Viewing Details of an Active/Standby Backend Server Group
Function
This API is used to view details of an active/standby backend server group.
Calling Method
For details, see Calling APIs.
URI
GET /v3/{project_id}/elb/master-slave-pools/{pool_id}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Specifies the project ID. |
pool_id |
Yes |
String |
Specifies the ID of the backend server group. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Specifies the token used for IAM authentication. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
request_id |
String |
Specifies the request ID. Note: The value is automatically generated. |
pool |
MasterSlavePool object |
Specifies the backend server group. |
Parameter |
Type |
Description |
---|---|---|
description |
String |
Specifies supplementary information about the backend server group. |
id |
String |
Specifies the ID of the backend server group. |
lb_algorithm |
String |
Specifies the load balancing algorithm used by the load balancer to route requests to backend servers in the associated backend server group. The value can be one of the following:
Notes and constraints:
|
listeners |
Array of ListenerRef objects |
Specifies the IDs of the listeners with which the backend server group is associated. |
loadbalancers |
Array of LoadBalancerRef objects |
Specifies the IDs of the load balancers with which the backend server group is associated. |
members |
Array of MasterSlaveMember objects |
Specifies the backend servers in the backend server group. |
name |
String |
Specifies the backend server group name. |
project_id |
String |
Specifies the project ID. |
protocol |
String |
Specifies the protocol used by the backend server group to receive requests. The value can be TCP, UDP, QUIC, or TLS. Notes and constraints:
|
session_persistence |
SessionPersistence object |
Specifies the sticky session. |
ip_version |
String |
Specifies the IP address version supported by the backend server group.
|
created_at |
String |
Specifies the time when a backend server group was created. The format is yyyy-MM-dd'T'HH:mm:ss'Z' (UTC time). This is a new field in this version, and it will not be returned for resources associated with existing dedicated load balancers and for resources associated with existing and new shared load balancers. |
updated_at |
String |
Specifies the time when when a backend server group was updated. The format is yyyy-MM-dd'T'HH:mm:ss'Z' (UTC time). This is a new field in this version, and it will not be returned for resources associated with existing dedicated load balancers and for resources associated with existing and new shared load balancers. |
vpc_id |
String |
Specifies the ID of the VPC where the backend server group works. |
type |
String |
Specifies the type of the backend server group. The value can be:
|
enterprise_project_id |
String |
Specifies the enterprise project ID of the backend server group. All created projects belong to the default enterprise project. |
healthmonitor |
MasterSlaveHealthMonitor object |
Specifies the health check configured for the backend server group. |
any_port_enable |
Boolean |
Specifies whether to enable any_port_enable for a backend server group. If this option is enabled, the listener routes the requests to the backend server over the same port as the frontend port. If this option is disabled, the listener routes the requests over the port specified by protocol_port. The value can be:
Notes and constraints: This option is available only for TCP, UDP, or QUIC backend server groups. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Specifies the backend server ID. |
name |
String |
Specifies the backend server name. |
admin_state_up |
Boolean |
Specifies the administrative status of the backend server. The value can be true or false. Although this parameter can be used in the APIs for creating and updating backend servers, its actual value depends on whether ECSs exist. If ECSs exist, the value is true. Otherwise, the value is false. |
subnet_cidr_id |
String |
Specifies the ID of the IPv4 or IPv6 subnet where the backend server resides. This parameter can be left blank, indicating that IP as a Backend has been enabled for the load balancer. In this case, IP addresses of these servers must be IPv4 addresses, and the protocol of the backend server group must be UDP, TCP, TLS, HTTP, HTTPS, QUIC, or GRPC. The IPv4 or IPv6 subnet must be in the same VPC as the subnet of the load balancer. |
protocol_port |
Integer |
Specifies the port used by the backend server to receive requests.
NOTE:
This parameter can be left blank because it does not take effect if any_port_enable is set to true for a backend server group. |
address |
String |
Specifies the private IP address bound to the backend server.
|
ip_version |
String |
Specifies the IP version supported by the backend server. The value can be v4 (IPv4) or v6 (IPv6), depending on the value of address returned by the system. |
device_owner |
String |
Specifies whether the backend server is associated with an ECS.
This parameter is unsupported. Please do not use it. |
device_id |
String |
Specifies the ID of the ECS with which the backend server is associated. If this parameter is left blank, the backend server is not associated with an ECS. This parameter is unsupported. Please do not use it. |
operating_status |
String |
Specifies the health status of the backend server if listener_id under status is not specified. The value can be one of the following:
|
member_type |
String |
Specifies the type of the backend server. The value can be:
|
instance_id |
String |
Specifies the ID of the ECS used as the backend server. If this parameter is left blank, the backend server is not an ECS. For example, it may be an IP address. |
role |
String |
Specifies the type of the backend server. |
status |
Array of ListenerMemberInfo objects |
Specifies the health status of the backend server if listener_id is specified. |
Parameter |
Type |
Description |
---|---|---|
listener_id |
String |
Specifies the ID of the listener associated with the backend server. |
operating_status |
String |
Specifies the health status of the backend server if listener_id under status is not specified. The value can be one of the following:
|
Parameter |
Type |
Description |
---|---|---|
cookie_name |
String |
Specifies the cookie name. Notes and constraints:
Value ranges:
|
type |
String |
Specifies the sticky session type. The value can be SOURCE_IP, HTTP_COOKIE, or APP_COOKIE. Notes and constraints:
|
persistence_timeout |
Integer |
Specifies the stickiness duration, in minutes. This parameter will not take effect when type is set to APP_COOKIE. Value ranges:
|
Parameter |
Type |
Description |
---|---|---|
admin_state_up |
Boolean |
Specifies the administrative status of the health check. The value can be:
|
delay |
Integer |
Specifies the interval between health checks, in seconds. The value ranges from 1 to 50. |
domain_name |
String |
Specifies the domain name that HTTP requests are sent to during the health check. The value can contain only digits, letters, hyphens (-), and periods (.) and must start with a digit or letter. The value is left blank by default, indicating that the virtual IP address of the load balancer is used as the destination address of HTTP requests. This parameter is available only when type is set to HTTP or HTTPS. |
expected_codes |
String |
Specifies the expected HTTP status code. The value options are as follows:
If type is set to gRPC, the default value is 0. If type is set to other protocols, the default value is 200. This parameter will take effect only when type is set to HTTP, HTTPS or gRPC. |
http_method |
String |
Specifies the HTTP method. The value can be GET, HEAD, or POST. The default value is GET. This parameter is available when type is set to HTTP or HTTPS. This parameter is unsupported. Please do not use it. |
id |
String |
Specifies the health check ID. |
max_retries |
Integer |
Specifies the number of consecutive health checks when the health check result of a backend server changes from OFFLINE to ONLINE. The value ranges from 1 to 10. |
max_retries_down |
Integer |
Specifies the number of consecutive health checks when the health check result of a backend server changes from ONLINE to OFFLINE. The value ranges from 1 to 10, and the default value is 3. |
monitor_port |
Integer |
Specifies the port used for the health check. If this parameter is left blank, a port of the backend server will be used by default. The port number ranges from 1 to 65535. |
name |
String |
Specifies the health check name. |
timeout |
Integer |
Specifies the maximum time required for waiting for a response from the health check, in seconds. It is recommended that you set the value less than that of parameter delay. |
type |
String |
Specifies the health check protocol. The value can be TCP, UDP_CONNECT, HTTP, or HTTPS. Note:
|
url_path |
String |
Specifies the HTTP request path for the health check. The value must start with a slash (/), and the default value is /. The value can contain letters, digits, hyphens (-), slashes (/), periods (.), percentage signs (%), question marks (?), pound signs (#), ampersand signs (&), and the extended character set _;~!()*[]@$^:',+. Note: This parameter is available only when type is set to HTTP or HTTPS. |
Example Requests
GET https://{ELB_Endpoint}/v3/99a3fff0d03c428eac3678da6a7d0f24/elb/master-slave-pools/36ce7086-a496-4666-9064-5ba0e6840c75
Example Responses
Status code: 200
Successful request.
{ "pool" : { "lb_algorithm" : "LEAST_CONNECTIONS", "type" : "ip", "vpc_id" : "3sae7086-a416-4666-9064-5b340e6840125", "protocol" : "TCP", "description" : "", "loadbalancers" : [ { "id" : "098b2f68-af1c-41a9-8efd-69958722af62" } ], "project_id" : "99a3fff0d03c428eac3678da6a7d0f24", "session_persistence" : null, "healthmonitor" : { "monitor_port" : null, "id" : "36ce7086-a496-4666-9064-5ba0e6840c75", "domain_name" : "", "name" : "My Healthmonitor", "max_retries" : 3, "max_retries_down" : 3, "admin_state_up" : true, "type" : "HTTP", "timeout" : 30, "delay" : 1, "http_method" : "get", "url_path" : "/", "expected_codes" : "200" }, "listeners" : [ { "id" : "0b11747a-b139-492f-9692-2df0b1c87193" } ], "members" : [ { "admin_state_up" : true, "address" : "172.16.0.210", "protocol_port" : 80, "id" : "2e7b36d2-66c8-4825-bcd2-211d99978680", "operating_status" : "OFFLINE", "status" : [ ], "instance_id" : "", "device_id" : "", "device_owner" : "", "member_type" : "ip", "role" : "master", "ip_version" : "v4", "name" : "cx-test-master", "subnet_cidr_id" : "" }, { "admin_state_up" : true, "address" : "172.16.0.211", "protocol_port" : 81, "id" : "2e7b36d2-66c8-4823-bsd2-21sa199978681", "operating_status" : "OFFLINE", "status" : [ ], "instance_id" : "", "device_id" : "", "device_owner" : "", "member_type" : "ip", "role" : "slave", "ip_version" : "v4", "name" : "cx-test-slave", "subnet_cidr_id" : "" } ], "id" : "36ce7086-a496-4666-9064-5ba0e6840c75", "name" : "My pool", "ip_version" : "dualstack", "created_at" : "2021-03-26T01:33:12Z", "updated_at" : "2021-03-26T01:33:12Z" }, "request_id" : "c1a60da2-1ec7-4a1c-b4cc-73e1a57b368e" }
SDK Sample Code
The SDK sample code is as follows.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.elb.v3.region.ElbRegion; import com.huaweicloud.sdk.elb.v3.*; import com.huaweicloud.sdk.elb.v3.model.*; public class ShowMasterSlavePoolSolution { public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); String projectId = "{project_id}"; ICredential auth = new BasicCredentials() .withProjectId(projectId) .withAk(ak) .withSk(sk); ElbClient client = ElbClient.newBuilder() .withCredential(auth) .withRegion(ElbRegion.valueOf("<YOUR REGION>")) .build(); ShowMasterSlavePoolRequest request = new ShowMasterSlavePoolRequest(); request.withPoolId("{pool_id}"); try { ShowMasterSlavePoolResponse response = client.showMasterSlavePool(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# coding: utf-8 import os from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkelb.v3.region.elb_region import ElbRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkelb.v3 import * if __name__ == "__main__": # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak = os.environ["CLOUD_SDK_AK"] sk = os.environ["CLOUD_SDK_SK"] projectId = "{project_id}" credentials = BasicCredentials(ak, sk, projectId) client = ElbClient.new_builder() \ .with_credentials(credentials) \ .with_region(ElbRegion.value_of("<YOUR REGION>")) \ .build() try: request = ShowMasterSlavePoolRequest() request.pool_id = "{pool_id}" response = client.show_master_slave_pool(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" elb "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/elb/v3" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/elb/v3/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/elb/v3/region" ) func main() { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak := os.Getenv("CLOUD_SDK_AK") sk := os.Getenv("CLOUD_SDK_SK") projectId := "{project_id}" auth := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). WithProjectId(projectId). Build() client := elb.NewElbClient( elb.ElbClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). Build()) request := &model.ShowMasterSlavePoolRequest{} request.PoolId = "{pool_id}" response, err := client.ShowMasterSlavePool(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } } |
For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.
Status Codes
Status Code |
Description |
---|---|
200 |
Successful request. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot