Giter Site home page Giter Site logo

Comments (6)

github-anurag avatar github-anurag commented on June 16, 2024

Hi @jbcintra
Thanks for bringing this up. We will ask the Load Balancer team if they have an alternative API to do this otherwise we can raise an issue with them.

from oci-dotnet-sdk.

jbcintra avatar jbcintra commented on June 16, 2024

Hi @github-anurag , I've got code working for it, loading ListLoadBalancers, then enumerating them and their Listener properties, just it stood out as a possible gap whilst working through the child elements.

from oci-dotnet-sdk.

github-anurag avatar github-anurag commented on June 16, 2024

@jbcintra
You can perhaps first use GetLoadBalancer with the Load Balancer OCID and then use the response object to get the Listener by its name from the dictionary of its Listeners. An example would be:-

using System;
using System.Threading.Tasks;
using Oci.LoadbalancerService;
using Oci.LoadbalancerService.Models;
using Oci.Common;
using Oci.Common.Auth;

namespace Oci.Sdk.DotNet.Example.Loadbalancer
{
    public class GetLoadBalancerExample
    {
        public static async Task Main()
        {
            // Create a request and dependent object(s).
            var getLoadBalancerRequest = new Oci.LoadbalancerService.Requests.GetLoadBalancerRequest
            {
                LoadBalancerId = "ocid1.test.oc1..<unique_ID>EXAMPLE-loadBalancerId-Value",
            };

            // Create a default authentication provider that uses the DEFAULT
            // profile in the configuration file.
            // Refer to <see href="https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File>the public documentation</see> on how to prepare a configuration file.
            var provider = new ConfigFileAuthenticationDetailsProvider("DEFAULT");
            try
            {
                // Create a service client and send the request.
                using (var client = new LoadBalancerClient(provider, new ClientConfiguration()))
                {
                    var response = await client.GetLoadBalancer(getLoadBalancerRequest);
                    // Retrieve value from the response.
                    Listener listener = response.LoadBalancer.Listeners["listener_name"];
                }
            }
            catch (Exception e)
            {
                Console.WriteLine($"GetLoadBalancer Failed with {e.Message}");
                throw e;
            }
        }

    }
}

from oci-dotnet-sdk.

jbcintra avatar jbcintra commented on June 16, 2024

Hi @github-anurag , I'm doing exactly that, but it stood out as a gap having I've implemented the following...

ListLoadBalancers(string compartmentId)
ListCertificates(string loadBalancerId)
ListBackendSets(string loadBalancerId)
ListBackends(string loadBalancerId, string backendSetName)
ListHostnames(string loadBalancerId)
ListListenerRules(string loadBalancerId, string listenerName) <-- nothing to load listeners here, other than from LB properties
ListListeners(string loadBalancerId)
ListLoadBalancerHealths(string compartmentId)
ListPathRouteSets(string loadBalancerId)
ListPolicies(string compartmentId)
ListProtocols(string compartmentId)
ListRoutingPolicies(string loadBalancerId)
ListRuleSets(string loadBalancerId)
ListShapes()
ListSSLCipherSuites(string loadBalancerId)

from oci-dotnet-sdk.

KartikShrikantHegde avatar KartikShrikantHegde commented on June 16, 2024

Hi @jbcintra , I wanted to provide an update on this ticket. Load Balancer eng does not have plans or a roadmap for creating a list Listeners method for now. Their suggestion is to follow the current method you are using i.e to query the listener objects with getLoadBalancer method. I will keep the ticket open though.

from oci-dotnet-sdk.

jbcintra avatar jbcintra commented on June 16, 2024

Hi @KartikShrikantHegde , thanks for that. It just stood out when working through all the APIs to audit. Happy for it to be closed.

from oci-dotnet-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.