Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GCP API for getting list of load balancer

From GCP portal perspective Load balancer is a service and related services comes under it like backendServers, health Check etc.

However APIs are only available for services like backendService, address, healthcheck etc.

Using UI we could find direct relationship between service like backendServers and LoadBalancer but backend service API doesn't have respective field.

While on UI we have: enter image description here

Where as supported fields from backend service: affinityCookieTtlSec,backends,cdnPolicy,connectionDraining,creationTimestamp,description,enableCDN,fingerprint,healthChecks,iap,id,kind,loadBalancingScheme,name,port,portName,protocol,region,selfLink,sessionAffinity,timeoutSec

Wanted to know if there is direct / indirect way to get List of Load Balancers

like image 253
Vikrant Pawar Avatar asked Jun 12 '18 09:06

Vikrant Pawar


People also ask

How many load balancers are there in GCP?

Traffic enters Cloud Load Balancing through 80+ distinct global load balancing locations, maximizing the distance traveled on Google's fast private network backbone.

How do I list instances in Gcloud?

To list all instances in a project in table form, run: $ gcloud compute instances list. To list the URIs of all instances in a project, run: $ gcloud compute instances list --uri.

What is the difference between GCP load balancer and GCP API?

From GCP portal perspective Load balancer is a service and related services comes under it like backendServers, health Check etc. However APIs are only available for services like backendService, address, healthcheck etc.

What is listloadbalancers API?

A list of administrative states which once set can override health probe so that Load Balancer will always forward new connections to backend, or deny new connections and reset existing connections. Response for ListLoadBalancers API service call. The URL to get the next set of results. A list of load balancers in a resource group.

How to attach NEG to HTTP (S) load balancer?

Now we will need to attach the NEG to HTTP(S) load balancer. Navigate to Networking Services under ‘NETWORK’ section, click on the ‘Load Balancing’. Step # 1 Create a backend service named api-gateway-backend.

What is Azure load balancer REST API?

Load Balancer REST API. Load balancer allows fine-grained configuration of how incoming traffic is distributed across VM instances hosted in Microsoft Azure. A load balancer has two main parts: a frontend and a backend configuration. The frontend configuration describes the exposed IP address of the load balancer.


1 Answers

At the API level, there is no Load Balancer, only the components that make it up. Your best bet to get a view similar to the UI is to list forwarding rules (global and regional). You can use gcloud compute forwarding-rules list which will show you all the forwarding rules in use (similar to the UI view), along with the IPs of each and the target (which may be a backend service or a target pool).

like image 177
Patrick W Avatar answered Sep 23 '22 01:09

Patrick W