Application Load Balancer (ALB) Enhanced Edition supports the Model Context Protocol (MCP) proxy feature. This feature lets you quickly integrate existing MCP servers, REST APIs, or Function Compute functions. It converts them into a unified tool interface in MCP format for AI agents to call. This simplifies the integration between agents and enterprise systems.
MCP service management of the ALB Extensible Edition is a whitelist feature. To use it, contact your business manager.
Solution architecture
An ALB Enhanced Edition instance receives MCP requests and routes them to an MCP server group based on forwarding rules. The MCP server group acts as a unified proxy for backend MCP servers, REST APIs, and Function Compute services. It converts their responses into the MCP format before returning them. The MCP proxy component also has a built-in semantic search feature. This allows an agent to retrieve matching tools as needed without loading the entire tool list, which reduces token consumption.
-
ALB Enhanced Edition instance: Provides load balancing and traffic forwarding.
-
HTTPS listener: Accepts client requests.
-
Forwarding rule: Matches MCP requests based on the request path and forwards them to the MCP server group.
-
Service extension: Uses the MCP proxy component to perform MCP protocol conversion and semantic search.
-
MCP server group: Acts as a unified proxy for three types of backend services: MCP servers, REST APIs, and Function Compute.
Applicability
-
You have obtained public preview access for ALB Enhanced Edition.
-
You have created a virtual private cloud (VPC) in the China (Ulanqab) region. You have also created a vSwitch in Ulanqab Zone A and another in Ulanqab Zone B. The vSwitches are configured with public SNAT to allow ALB to access public MCP services.
-
You have registered a custom domain name. Because the ALB instance in this topic is deployed in the China (Ulanqab) region, the domain name requires an ICP filing.
-
You have a server certificate that matches your custom domain name. If the certificate was not purchased from Alibaba Cloud, you must upload it to Alibaba Cloud Certificate Service.
Procedure
1. Create an ALB Enhanced Edition instance
-
Log on to the ALB console. Select the China (Ulanqab) region and click Create ALB.
-
On the purchase page, complete the following settings and click Create Now.
-
Region: China (Ulanqab) is selected by default.
-
Network Type: Select Public Network.
-
VPC and Zone: Select the target VPC. Select Ulanqab Zone A and Ulanqab Zone B, then select the corresponding vSwitches and Automatically Assign Public IP.
-
IP Version: Select IPv4.
-
Edition (Instance Fee): Select Enhanced Edition.
-
-
On the Confirm Order page, confirm the instance configuration details, and click Activate Now.
2. Create server groups
Create an empty server group
Create an empty server group. This group will be the forwarding target for the default rule when you create the listener later. In this topic, all MCP requests are precisely matched by forwarding rules and will not be processed by the default rule. Therefore, you do not need to add backend servers to this server group.
-
In the Server Group console, click Create Server Group.
-
Server Group Type: Select Server.
-
Server Group Name: Enter an easy-to-identify name. This topic uses
sgp-default. -
VPC: Select the VPC where the ALB instance is located.
-
-
At the bottom of the dialog box, select the For Extensible instances checkbox and click Create.
Create an MCP server group
-
In the Server Group console, click Create Server Group. Set Server Group Type to MCP Service and give it an easy-to-identify name. This topic uses
sgp-mcp. -
Click Create. In the The server group is created dialog box, click Add Backend Server.
After you create the server group, add MCP services by following the instructions on the tab that corresponds to your backend service type.
MCP server
This example integrates a self-built temperature conversion MCP service.
Click Add MCP Service, complete the following settings, and click OK.
-
Service Name: Enter a name that is easy for the large language model (LLM) to understand. This topic uses
temperature-converter, which represents a temperature conversion service. -
Service Type: Select MCP Server.
-
MCP Service Endpoint: Enter the domain name endpoint of the MCP service, such as
http://mcp-backend.example.com:8000/mcp. The MCP Service Endpoint does not support direct IP addresses. You must use a domain name. When an ALB Enhanced Edition instance accesses an MCP service endpoint, it uses only public authoritative DNS resolution. To access a service within a VPC, you must resolve the domain name to the corresponding private IP address on the public DNS. -
Access Method: Select Streamable HTTP.
The following is sample code for an MCP server that provides temperature conversion. You can deploy it on an ECS instance in the same VPC as the ALB instance. This ECS instance must have network connectivity with the ALB instance. The security group rules must allow ALB to access the MCP service port, which is 8000 in this topic. This topic uses the Alibaba Cloud Linux 3.2104 operating system as an example.
-
Log on to the ECS instance, install Python 3.11 and pip, and then install the MCP dependencies:
# Install Python 3.11 (requires 3.10 or later) sudo yum install -y python3.11 python3.11-pip # Install MCP dependencies sudo pip3.11 install "mcp>=1.0.0" -
Create a project directory and the server-side code:
mkdir mcp-server && cd mcp-serverCreate the server-side code file
server.py:from mcp.server.fastmcp import FastMCP server = FastMCP("temperature-converter", host="0.0.0.0") @server.tool() def celsius_to_fahrenheit(celsius: float) -> str: """ Convert temperature from Celsius to Fahrenheit. Args: celsius: Temperature in degrees Celsius Returns: Temperature in Fahrenheit (e.g., "77.0") """ fahrenheit = celsius * 9 / 5 + 32 return str(fahrenheit) @server.tool() def fahrenheit_to_celsius(fahrenheit: float) -> str: """ Convert temperature from Fahrenheit to Celsius. Args: fahrenheit: Temperature in degrees Fahrenheit Returns: Temperature in Celsius (e.g., "25.0") """ celsius = (fahrenheit - 32) * 5 / 9 return str(celsius) if __name__ == "__main__": server.run(transport="streamable-http") -
Start the MCP server:
nohup python3.11 server.py > server.log 2>&1 &View the log to confirm a successful startup:
cat server.logOutput similar to the following indicates a successful startup:
INFO: Started server process [12345] INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit) -
Verify that the service is running correctly. Execute the following command:
curl -X POST http://127.0.0.1:8000/mcp \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'A JSON response containing the
serverInfofield indicates that the MCP server is running correctly.
REST API
This example integrates Alibaba Cloud OpenAPI to query and manage ALB resources. Alibaba Cloud OpenAPI requires AccessKey authentication. You must first create credentials.
-
In the navigation pane on the left of the ALB console, choose Credential Management and click Create Credential. Set Credential Type to AccessKey. Enter the AccessKey ID and AccessKey Secret of the Alibaba Cloud account that you want to manage, and click Create. This AccessKey must have the permissions to call the corresponding API.
The AccessKey credential type is a whitelist feature. To use it, contact your account manager to request access.
-
Return to the MCP server group, click Add MCP Service, complete the following settings, and click OK.
-
Service Name: Enter a name that is easy for the LLM to understand. This topic uses
alb-operator, which represents an ALB management service. -
Service Type: Select REST API.
-
OpenAPI Configuration: Visit the Alibaba Cloud OpenAPI Portal. In the navigation pane on the left, click Get Metadata to download the OpenAPI configuration file. Edit the file to retain only the required APIs, and then paste or import it. This topic uses an example that retains only query-related APIs. The region specified by the endpoints in the example is China (Ulanqab). You can modify it as needed.
Example OpenAPI configuration file (retains only query-related APIs)
{ "version": "1.0", "info": { "style": "RPC", "product": "Alb", "version": "2020-06-16" }, "components": { "schemas": {} }, "apis": { "DescribeRegions": { "summary": "Queries the available regions for ALB.", "methods": [ "get", "post" ], "schemes": [ "http", "https" ], "security": [ { "AK": [] } ], "operationType": "read", "deprecated": false, "systemTags": { "operationType": "get", "abilityTreeCode": "203", "abilityTreeNodes": [ "FEATUREslbRXTOWD" ], "tenantRelevance": "publicInformation" }, "parameters": [ { "name": "AcceptLanguage", "in": "query", "schema": { "title": "Language", "description": "The supported language. Valid values:\n\n- **zh-CN** (Default): Chinese\n\n- **en-US**: English\n\n- **ja**: Japanese", "type": "string", "required": false, "example": "zh-CN", "default": "zh-CN" } } ], "responses": { "200": { "schema": { "title": "Schema of Response", "description": "The structure of the returned data.", "type": "object", "properties": { "Regions": { "title": "List of regions", "description": "A list of regions.", "type": "array", "items": { "description": "The structure of region information.", "type": "object", "properties": { "LocalName": { "title": "Name", "description": "The name of the region.", "type": "string", "example": "China (Hangzhou)" }, "RegionEndpoint": { "title": "Endpoint", "description": "The endpoint of the service in the region.", "type": "string", "example": "alb.cn-hangzhou.aliyuncs.com" }, "RegionId": { "title": "Region ID", "description": "The ID of the region.", "type": "string", "example": "cn-hangzhou" } } } }, "RequestId": { "title": "Id of the request", "description": "The request ID.", "type": "string", "example": "593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3" } } } } }, "responseDemo": "[{\"type\":\"json\",\"example\":\"{\\n \\\"Regions\\\": [\\n {\\n \\\"LocalName\\\": \\\"China (Hangzhou)\\\",\\n \\\"RegionEndpoint\\\": \\\"alb.cn-hangzhou.aliyuncs.com\\\",\\n \\\"RegionId\\\": \\\"cn-hangzhou\\\"\\n }\\n ],\\n \\\"RequestId\\\": \\\"593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3\\\"\\n}\",\"errorExample\":\"\"},{\"type\":\"xml\",\"example\":\"<DescribeRegionsResponse>\\n <Regions>\\n <LocalName>China (Hangzhou)</LocalName>\\n <RegionEndpoint>alb.cn-hangzhou.aliyuncs.com</RegionEndpoint>\\n <RegionId>cn-hangzhou</RegionId>\\n </Regions>\\n <RequestId>593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3</RequestId>\\n</DescribeRegionsResponse>\",\"errorExample\":\"\"}]", "title": "Query regions" }, "DescribeZones": { "summary": "Queries the list of zones in a region for ALB.", "methods": [ "get", "post" ], "schemes": [ "http", "https" ], "security": [ { "AK": [] } ], "operationType": "read", "deprecated": false, "systemTags": { "operationType": "get", "abilityTreeCode": "204", "abilityTreeNodes": [ "FEATUREslbRXTOWD" ], "tenantRelevance": "publicInformation" }, "parameters": [ { "name": "AcceptLanguage", "in": "query", "schema": { "description": "The supported language. Valid values:\n\n- **zh-CN** (Default): Chinese\n\n- **en-US**: English\n\n- **ja**: Japanese", "type": "string", "required": false, "example": "zh-CN", "default": "zh-CN" } } ], "responses": { "200": { "schema": { "title": "Schema of Response", "description": "The structure of the returned data.", "type": "object", "properties": { "RequestId": { "title": "Id of the request", "description": "The request ID.", "type": "string", "example": "593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3" }, "Zones": { "title": "List of zones", "description": "A list of zones.", "type": "array", "items": { "description": "The structure of zone information.", "type": "object", "properties": { "LocalName": { "title": "Zone name", "description": "The name of the zone.", "type": "string", "example": "Hangzhou Zone G" }, "ZoneId": { "title": "Zone ID", "description": "The ID of the zone.", "type": "string", "example": "cn-hangzhou-g" } } } } } } } }, "responseDemo": "[{\"type\":\"json\",\"example\":\"{\\n \\\"RequestId\\\": \\\"593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3\\\",\\n \\\"Zones\\\": [\\n {\\n \\\"LocalName\\\": \\\"Hangzhou Zone G\\\",\\n \\\"ZoneId\\\": \\\"cn-hangzhou-g\\\"\\n }\\n ]\\n}\",\"errorExample\":\"\"},{\"type\":\"xml\",\"example\":\"<DescribeZonesResponse>\\n <RequestId>593B0448-D13E-4C56-AC0D-FDF0FDE0E9A3</RequestId>\\n <Zones>\\n <LocalName>China (Hangzhou) Zone G</LocalName>\\n <ZoneId>cn-hangzhou-g</ZoneId>\\n </Zones>\\n</DescribeZonesResponse>\",\"errorExample\":\"\"}]", "title": "Query zones" }, "GetLoadBalancerAttribute": { "summary": "Queries the details of a specified SLB instance.", "methods": [ "get", "post" ], "schemes": [ "http", "https" ], "security": [ { "AK": [] } ], "operationType": "read", "deprecated": false, "systemTags": { "operationType": "get", "abilityTreeCode": "200", "abilityTreeNodes": [ "FEATUREslbM7ALO6", "FEATUREslbK3ZR0L", "FEATUREslbN5IE4S" ] }, "parameters": [ { "name": "LoadBalancerId", "in": "query", "schema": { "title": "Instance identity", "description": "The ID of the Application Load Balancer instance.", "type": "string", "required": true, "example": "alb-o9ulmq5hgn68jk****" } } ], "responses": { "200": { "schema": { "title": "Schema of Response", "description": "The detailed configuration of the Application Load Balancer instance.", "type": "object", "properties": { "AccessLogConfig": { "title": "Access log properties", "description": "The access log configuration.", "type": "object", "properties": { "LogProject": { "title": "The log project to which access logs are delivered", "description": "The log project.", "type": "string", "example": "sls-setter" }, "LogStore": { "title": "Deletion protection enabling time", "description": "The log store.\n\n", "type": "string", "example": "test" } } }, "AddressAllocatedMode": { "title": "Address allocation method", "description": "The address mode. Valid values:\n\n- **Fixed**: A fixed IP address is used.\n\n- **Dynamic**: An IP address is dynamically allocated in each zone.", "type": "string", "example": "Dynamic" }, "AddressType": { "title": "Address type", "description": "The network address type of the Application Load Balancer instance. Valid values:\n\n- **Internet**: The SLB instance has a public IP address. The DNS domain name is resolved to the public IP address, so the instance can be accessed over the Internet.\n\n- **Intranet**: The SLB instance has only a private IP address. The DNS domain name is resolved to the private IP address, so the instance can only be accessed from the internal network of the VPC where it is located.\n\n", "type": "string", "example": "Intranet" }, "BandwidthPackageId": { "title": "Bandwidth plan ID", "description": "The ID of the shared bandwidth plan associated with the public-facing instance.", "type": "string", "example": "cbwp-bp1vevu8h3ieh****" }, "CreateTime": { "title": "Resource creation time", "description": "The time the resource was created, in UTC. The format is `yyyy-MM-ddTHH:mm:ssZ`.", "type": "string", "example": "2022-07-02T02:49:05Z" }, "DNSName": { "title": "DNS name", "description": "The DNS domain name.", "type": "string", "example": "alb-95qnr2itwu9orb****.cn-hangzhou.alb.aliyuncs.com" }, "DeletionProtectionConfig": { "title": "Load balancer deletion protection information", "description": "The deletion protection configuration.", "type": "object", "properties": { "Enabled": { "title": "Deletion protection status", "description": "The deletion protection status. Valid values:\n\n- **true**: Enabled.\n\n- **false**: Disabled.", "type": "boolean", "example": "true" }, "EnabledTime": { "title": "Deletion protection enabling time", "description": "The time when deletion protection was enabled, in UTC. The format is `yyyy-MM-ddTHH:mm:ssZ`.", "type": "string", "example": "2022-08-02T02:49:05Z" } } }, "LoadBalancerBillingConfig": { "title": "Billing-related properties", "description": "The billing configuration of the Application Load Balancer instance.", "type": "object", "properties": { "PayType": { "title": "The billing method of the instance", "description": "The billing method.\n\n**PostPay** indicates pay-as-you-go.", "type": "string", "example": "PostPay", "default": "PostPay" } } }, "LoadBalancerBussinessStatus": { "title": "Instance business status", "description": "The business status of the Application Load Balancer. Valid values:\n\n- **Abnormal**: Abnormal.\n\n- **Normal**: Normal.", "type": "string", "example": "Normal" }, "LoadBalancerEdition": { "title": "Load balancer edition", "description": "The edition of the Application Load Balancer. Different editions have different feature limits and billing policies. Valid values:\n\n- **Basic**: Basic Edition.\n\n- **Standard**: Standard Edition.\n\n- **StandardWithWaf**: WAF-enabled Edition.", "type": "string", "example": "Standard" }, "LoadBalancerId": { "title": "Load balancer identity", "description": "The ID of the Application Load Balancer instance.", "type": "string", "example": "alb-o9ulmq5hgn68jk****" }, "LoadBalancerName": { "title": "Instance name", "description": "The instance name.\n\nThe length is 2 to 128 English or Chinese characters. It must start with a letter or a Chinese character and can contain numbers, periods (.), underscores (_), and hyphens (-).", "type": "string", "example": "alb1" }, "LoadBalancerOperationLocks": { "title": "Lock reason", "description": "The operation lock configuration of the Application Load Balancer.", "type": "array", "items": { "description": "The operation lock configuration of the Application Load Balancer.", "type": "object", "properties": { "LockReason": { "title": "Lock reason", "description": "The reason for the lock. This is valid when **LoadBalancerBussinessStatus** is **Abnormal**.", "type": "string", "example": "Overdue Payment" }, "LockType": { "title": "Lock type", "description": "The type of lock. Valid values:\n\n- **SecurityLocked**: Security lock.\n\n- **RelatedResourceLocked**: Related resource lock.\n\n- **FinancialLocked**: Financial lock.\n\n- **ResidualLocked**: Residual lock.", "type": "string", "example": "FinancialLocked" } } } }, "LoadBalancerStatus": { "title": "Instance status", "description": "The status of the Application Load Balancer instance. Valid values:\n\n- **Inactive**: Stopped. The instance listener will no longer forward traffic.\n\n- **Active**: Running.\n\n- **Provisioning**: Creating.\n\n- **Configuring**: Modifying.\n\n- **CreateFailed**: Creation failed. No fees are incurred at this time, and the instance can only be deleted.", "type": "string", "example": "Active" }, "ModificationProtectionConfig": { "title": "Load balancer modification protection information", "description": "The modification protection configuration.", "type": "object", "properties": { "Reason": { "title": "The reason for setting the modification protection status", "description": "The reason for enabling modification protection.\n\nThe length is 2 to 128 English or Chinese characters. It must start with an uppercase or lowercase letter or a Chinese character and can contain numbers, periods (.), underscores (_), and hyphens (-).\n\nThis is returned only when **Status** is **ConsoleProtection**.", "type": "string", "example": "Managed Instance" }, "Status": { "title": "Load balancer modification protection status", "description": "The modification protection status of the Application Load Balancer instance. Valid values:\n\n- **NonProtection**: Modification protection is not enabled. If **Reason** is configured, **Reason** will be forcibly cleared.\n\n- **ConsoleProtection**: Console modification protection is enabled. If **Reason** is configured, **Reason** can take effect.\n\n> When the value is **ConsoleProtection**, meaning modification protection is enabled, users cannot modify the instance configuration through the SLB console, but can modify it by calling the API.", "type": "string", "example": "ConsoleProtection" } } }, "RegionId": { "title": "Region", "description": "The region ID of the Application Load Balancer instance.", "type": "string", "example": "cn-hangzhou" }, "RequestId": { "title": "Id of the request", "description": "The request ID.", "type": "string", "example": "365F4154-92F6-4AE4-92F8-7FF34B540710" }, "ResourceGroupId": { "title": "Enterprise resource group ID", "description": "The enterprise resource group ID.", "type": "string", "example": "rg-atstuj3rtop****" }, "Tags": { "title": "List of tags", "description": "The tags.", "type": "array", "items": { "description": "The tags.", "type": "object", "properties": { "Key": { "title": "The tag key of the instance", "description": "The tag key of the instance.\n\nIt can be up to 128 characters long and cannot start with `aliyun` or `acs:`. It cannot contain `http://` or `https://`.", "type": "string", "example": "FinanceDept" }, "Value": { "title": "The tag value of the instance", "description": "The tag value of the instance.\n\nIt can be up to 128 characters long and cannot start with `aliyun` or `acs:`. It cannot contain `http://` or `https://`.", "type": "string", "example": "FinanceJoshua" } } } }, "VpcId": { "title": "VPC network ID", "description": "The VPC ID of the instance.", "type": "string", "example": "vpc-bp1b49rqrybk45nio****" }, "ZoneMappings": { "title": "Zone resources of the load balancer", "description": "A list of zone and vSwitch mappings. A maximum of 10 zones can be returned. If the current region supports 2 or more zones, at least 2 zones are returned.", "type": "array", "items": { "description": "A list of zone and vSwitch mappings. A maximum of 10 zones can be returned. If the current region supports 2 or more zones, at least 2 zones are returned.", "type": "object", "properties": { "LoadBalancerAddresses": { "title": "In fixed VIP mode, the list of addresses for the load balancer in this zone", "description": "The instance addresses.", "type": "array", "items": { "description": "The instance addresses.", "type": "object", "properties": { "Address": { "title": "IP address", "description": "Identifies an IPv4 address.\n\nThis is effective when **AddressIPVersion** is **IPv4** or **DualStack**. The public or private IP address is determined by **AddressType**.", "type": "string", "example": "10.1.0.61" }, "Ipv6Address": { "title": "IPv6 address", "description": "Identifies an IPv6 address.\n\nThis is valid only when **AddressIPVersion** is **DualStack**. The public or private IP address is determined by **Ipv6AddressType**.", "type": "string", "example": "2408:xxxx:249:dd01:6f4:750f:xxxx:bcd9" }, "IntranetAddress": { "title": "Private endpoint", "description": "The IPv4 private IP address.", "type": "string", "example": "10.1.0.61" }, "AllocationId": { "description": "The ID of the Elastic IP Address.", "type": "string", "example": "eip-uf6wm****1zj9" }, "EipType": { "description": "The type of the public EIP. Valid values:\n\n- **Common**: An Elastic IP Address (EIP).\n- **Anycast**: An Anycast EIP.\n\n> For regions where ALB supports binding Anycast EIPs, see [Limits](~~460727~~).", "type": "string", "example": "Common" }, "IntranetAddressHcStatus": { "description": "The health check status of the private IPv4 address of the Application Load Balancer instance.\n\nThis is returned only when the zone status is Active. Valid values:\n\n- **Healthy**: Healthy.\n- **Unhealthy**: Abnormal.", "type": "string", "example": "Healthy" }, "Ipv6AddressHcStatus": { "description": "The health check status of the IPv6 address of the Application Load Balancer instance.\n\nThis is returned only when the zone status is Active. Valid values:\n\n- **Healthy**: Healthy.\n- **Unhealthy**: Abnormal.", "type": "string", "example": "Healthy" }, "Ipv4LocalAddresses": { "description": "A list of IPv4 local addresses. This is the list of addresses used for interaction between ALB and backend services.", "type": "array", "items": { "description": "An IPv4 local address.", "type": "string", "example": "10.1.0.62" } }, "Ipv6LocalAddresses": { "description": "A list of IPv6 local addresses. This is the list of addresses used for interaction between ALB and backend services.", "type": "array", "items": { "description": " An IPv6 local address.", "type": "string", "example": "2408:xxxx:249:dd01:6f4:750f:xxxx:bcda" } } } } }, "VSwitchId": { "title": "vSwitch identity", "description": "The vSwitch corresponding to the zone. Each zone can use only one vSwitch and one subnet.", "type": "string", "example": "vsw-bp12mw1f8k3jgy****" }, "ZoneId": { "title": "Zone identity", "description": "The zone ID of the Application Load Balancer instance.\n\nYou can get information about the zone corresponding to the zone ID by calling the [DescribeZones](~~189196~~) API.", "type": "string", "example": "cn-hangzhou-a" }, "Status": { "description": "The zone status. Valid values:\n\n- **Active**: Running.\n- **Stopped**: Stopped.\n- **Shifted**: Removed.\n- **Starting**: Starting.\n- **Stopping**: Stopping.", "type": "string", "example": "Active" } } } }, "AddressIpVersion": { "title": "Protocol version", "description": "The protocol version. Valid values:\n\n- **IPv4**: IPv4\n- **DualStack**: Dual-stack", "type": "string", "example": "DualStack" }, "Ipv6AddressType": { "title": "IPv6 address type", "description": "The network address type of the IPv6 address of the Application Load Balancer. Valid values:\n\n- **Internet**: Public network. The SLB instance has a public IP address. The DNS domain name is resolved to the public IP address, so it can be accessed over the Internet.\n- **Intranet**: Private network. The SLB instance has only a private IP address. The DNS domain name is resolved to the private IP address, so it can only be accessed from the internal network of the VPC where it is located.", "type": "string", "example": "Intranet" }, "SecurityGroupIds": { "description": "A set of security group IDs bound to the Application Load Balancer instance.", "type": "array", "items": { "description": "The ID of a security group bound to the Application Load Balancer instance.", "type": "string", "example": "sg-uf63j385dzwlm6cy****" } } } } } }, "errorCodes": { "400": [ { "errorCode": "Forbidden.LoadBalancer", "errorMessage": "Authentication has failed for LoadBalancer." } ], "404": [ { "errorCode": "ResourceNotFound.LoadBalancer", "errorMessage": "The specified resource %s is not found." } ] }, "responseDemo": "[{\"type\":\"json\",\"example\":\"{\\n \\\"AccessLogConfig\\\": {\\n \\\"LogProject\\\": \\\"sls-setter\\\",\\n \\\"LogStore\\\": \\\"test\\\"\\n },\\n \\\"AddressAllocatedMode\\\": \\\"Dynamic\\\",\\n \\\"AddressType\\\": \\\"Intranet\\\",\\n \\\"BandwidthPackageId\\\": \\\"cbwp-bp1vevu8h3ieh****\\\",\\n \\\"CreateTime\\\": \\\"2022-07-02T02:49:05Z\\\",\\n \\\"DNSName\\\": \\\"alb-95qnr2itwu9orb****.cn-hangzhou.alb.aliyuncs.com\\\",\\n \\\"DeletionProtectionConfig\\\": {\\n \\\"Enabled\\\": true,\\n \\\"EnabledTime\\\": \\\"2022-08-02T02:49:05Z\\\"\\n },\\n \\\"LoadBalancerBillingConfig\\\": {\\n \\\"PayType\\\": \\\"PostPay\\\"\\n },\\n \\\"LoadBalancerBussinessStatus\\\": \\\"Normal\\\",\\n \\\"LoadBalancerEdition\\\": \\\"Standard\\\",\\n \\\"LoadBalancerId\\\": \\\"alb-o9ulmq5hgn68jk****\\\",\\n \\\"LoadBalancerName\\\": \\\"alb1\\\",\\n \\\"LoadBalancerOperationLocks\\\": [\\n {\\n \\\"LockReason\\\": \\\"Overdue Payment\\\",\\n \\\"LockType\\\": \\\"FinancialLocked\\\"\\n }\\n ],\\n \\\"LoadBalancerStatus\\\": \\\"Active\\\",\\n \\\"ModificationProtectionConfig\\\": {\\n \\\"Reason\\\": \\\"Managed Instance\\\",\\n \\\"Status\\\": \\\"ConsoleProtection\\\"\\n },\\n \\\"RegionId\\\": \\\"cn-hangzhou\\\",\\n \\\"RequestId\\\": \\\"365F4154-92F6-4AE4-92F8-7FF34B540710\\\",\\n \\\"ResourceGroupId\\\": \\\"rg-atstuj3rtop****\\\",\\n \\\"Tags\\\": [\\n {\\n \\\"Key\\\": \\\"FinanceDept\\\",\\n \\\"Value\\\": \\\"FinanceJoshua\\\"\\n }\\n ],\\n \\\"VpcId\\\": \\\"vpc-bp1b49rqrybk45nio****\\\",\\n \\\"ZoneMappings\\\": [\\n {\\n \\\"LoadBalancerAddresses\\\": [\\n {\\n \\\"Address\\\": \\\"10.1.0.61\\\",\\n \\\"Ipv6Address\\\": \\\"2408:xxxx:249:dd01:6f4:750f:xxxx:bcd9\\\",\\n \\\"IntranetAddress\\\": \\\"10.1.0.61\\\",\\n \\\"AllocationId\\\": \\\"eip-uf6wm****1zj9\\\",\\n \\\"EipType\\\": \\\"Common\\\",\\n \\\"IntranetAddressHcStatus\\\": \\\"Healthy\\\",\\n \\\"Ipv6AddressHcStatus\\\": \\\"Healthy\\\",\\n \\\"Ipv4LocalAddresses\\\": [\\n \\\"10.1.0.62\\\"\\n ],\\n \\\"Ipv6LocalAddresses\\\": [\\n \\\"2408:xxxx:249:dd01:6f4:750f:xxxx:bcda\\\"\\n ]\\n }\\n ],\\n \\\"VSwitchId\\\": \\\"vsw-bp12mw1f8k3jgy****\\\",\\n \\\"ZoneId\\\": \\\"cn-hangzhou-a\\\",\\n \\\"Status\\\": \\\"Active\\\"\\n }\\n ],\\n \\\"AddressIpVersion\\\": \\\"DualStack\\\",\\n \\\"Ipv6AddressType\\\": \\\"Intranet\\\",\\n \\\"SecurityGroupIds\\\": [\\n \\\"sg-uf63j385dzwlm6cy****\\\"\\n ]\\n}\",\"errorExample\":\"\"},{\"type\":\"xml\",\"example\":\"<GetLoadBalancerAttributeResponse>\\n <AccessLogConfig>\\n <LogProject>sls-setter</LogProject>\\n <LogStore>test</LogStore>\\n </AccessLogConfig>\\n <AddressAllocatedMode>Dynamic</AddressAllocatedMode>\\n <AddressType>Intranet</AddressType>\\n <BandwidthPackageId>cbwp-bp1vevu8h3ieh****</BandwidthPackageId>\\n <CreateTime>2022-07-02T02:49:05Z</CreateTime>\\n <DNSName>alb-95qnr2itwu9orb****.cn-hangzhou.alb.aliyuncs.com</DNSName>\\n <DeletionProtectionConfig>\\n <Enabled>true</Enabled>\\n <EnabledTime>2022-08-02T02:49:05Z</EnabledTime>\\n </DeletionProtectionConfig>\\n <LoadBalancerBillingConfig>\\n <PayType>PostPay</PayType>\\n </LoadBalancerBillingConfig>\\n <LoadBalancerBussinessStatus>Normal</LoadBalancerBussinessStatus>\\n <LoadBalancerEdition>Standard</LoadBalancerEdition>\\n <LoadBalancerId>alb-o9ulmq5hgn68jk****</LoadBalancerId>\\n <LoadBalancerName>alb1</LoadBalancerName>\\n <LoadBalancerOperationLocks>\\n <LockReason>Overdue Payment</LockReason>\\n <LockType>FinancialLocked</LockType>\\n </LoadBalancerOperationLocks>\\n <LoadBalancerStatus>Active</LoadBalancerStatus>\\n <ModificationProtectionConfig>\\n <Reason>Managed Instance</Reason>\\n <Status>ConsoleProtection</Status>\\n </ModificationProtectionConfig>\\n <RegionId>cn-hangzhou</RegionId>\\n <RequestId>365F4154-92F6-4AE4-92F8-7FF34B540710</RequestId>\\n <ResourceGroupId>rg-atstuj3rtop****</ResourceGroupId>\\n <Tags>\\n <Key>FinanceDept</Key>\\n <Value>FinanceJoshua</Value>\\n </Tags>\\n <VpcId>vpc-bp1b49rqrybk45nio****</VpcId>\\n <ZoneMappings>\\n <LoadBalancerAddresses>\\n <Address>192.168.10.1</Address>\\n <Ipv6Address>2408:XXXX:39d:eb00::/56</Ipv6Address>\\n </LoadBalancerAddresses>\\n <VSwitchId>vsw-bp12mw1f8k3jgy****</VSwitchId>\\n <ZoneId>cn-hangzhou-a</ZoneId>\\n </ZoneMappings>\\n <AddressIpVersion>DualStack</AddressIpVersion>\\n <Ipv6AddressType>Intranet</Ipv6AddressType>\\n</GetLoadBalancerAttributeResponse>\",\"errorExample\":\"\"}]", "title": "Query the details of a load balancer instance" }, "ListLoadBalancers": { "summary": "Queries instance configurations.", "methods": [ "get", "post" ], "schemes": [ "http", "https" ], "security": [ { "AK": [] } ], "operationType": "read", "deprecated": false, "systemTags": { "operationType": "get", "riskType": "none", "chargeType": "free", "abilityTreeNodes": [ "FEATUREslb6TP8T4" ] }, "parameters": [ { "name": "NextToken", "in": "query", "schema": { "title": "Marks the current starting position for reading. Leave it empty to start from the beginning.", "description": "The token for the next query. Valid values:\n- If this is your first query or there are no more queries, you do not need to fill this in.\n- If there is a next query, set it to the value of **NextToken** from the previous API call.", "type": "string", "required": false, "example": "FFmyTO70tTpLG6I3FmYAXGKPd****" } }, { "name": "MaxResults", "in": "query", "schema": { "title": "The maximum number of data records to read this time. This parameter is optional. The value is 1-100. If the user does not pass a value, the default is 20.", "description": "The number of entries to display per page for paged queries. The value range is **1** to **100**. The default value is **20**.\n\n", "type": "integer", "format": "int32", "required": false, "example": "20" } }, { "name": "ZoneId", "in": "query", "schema": { "title": "Zone ID", "description": "The zone ID where the Application Load Balancer instance is located.\n\nYou can get information about the zone corresponding to the zone ID by calling the [DescribeZones](~~189196~~) API.", "type": "string", "required": false, "example": "cn-hangzhou-a" } }, { "name": "LoadBalancerStatus", "in": "query", "schema": { "title": "Instance status", "description": "The status of the Application Load Balancer instance. Valid values:\n\n- **Inactive**: Stopped. The listener no longer forwards traffic.\n\n- **Active**: Running.\n\n- **Provisioning**: Creating.\n\n- **Configuring**: Modifying.\n\n- **CreateFailed**: Creation failed. No fees are incurred at this time, and the instance can only be deleted. The system automatically cleans up instances that failed to be created in the last day.", "type": "string", "required": false, "example": "Active" } }, { "name": "LoadBalancerBussinessStatus", "in": "query", "schema": { "title": "Instance business status", "description": "The business status of the Application Load Balancer. Valid values:\n\n- **Abnormal**: Abnormal.\n\n- **Normal**: Normal.", "type": "string", "required": false, "example": "Normal" } }, { "name": "LoadBalancerIds", "in": "query", "style": "flat", "schema": { "title": "List of instance IDs, N supports a maximum of 20", "description": "A list of instance IDs. A maximum of 20 Application Load Balancer instance IDs are supported.", "type": "array", "items": { "description": "The ID of the instance.", "type": "string", "required": false, "example": "alb-o9ulmq5hgn68jk****" }, "required": false, "maxItems": 21, "minItems": 1 } }, { "name": "LoadBalancerNames", "in": "query", "style": "flat", "schema": { "title": "List of instance names, N supports a maximum of 10", "description": "A list of instance names. A maximum of 10 instance names are supported.", "type": "array", "items": { "description": "The instance name.\n\nThe length is 2 to 128 English or Chinese characters. It must start with an uppercase or lowercase English letter or a Chinese character and can contain numbers, periods (.), underscores (_), and hyphens (-).", "type": "string", "required": false, "example": "alb-instance-test" }, "required": false, "maxItems": 11, "minItems": 1 } }, { "name": "VpcIds", "in": "query", "style": "flat", "schema": { "title": "List of VPC IDs", "description": "The VPC ID to which the Application Load Balancer instance belongs. A maximum of 10 VPC IDs are supported.", "type": "array", "items": { "description": "The VPC ID to which the Application Load Balancer instance belongs.", "type": "string", "required": false, "example": "vpc-bp1b49rqrybk45nio****" }, "required": false, "maxItems": 11, "minItems": 1 } }, { "name": "Tag", "in": "query", "style": "flat", "schema": { "title": "List of tags", "description": "The instance tags.", "type": "array", "items": { "description": "The structure of instance tags.", "type": "object", "properties": { "Key": { "title": "The tag key of the instance", "description": "The tag key of the instance. A maximum of 20 tag keys can be entered. Once this value is entered, it cannot be an empty string.\n\nIt can be up to 64 characters long and cannot start with `aliyun` or `acs:`. It cannot contain `http://` or `https://`.", "type": "string", "required": false, "example": "KeyTest" }, "Value": { "title": "The tag value of the instance", "description": "The tag value of the instance. A maximum of 20 tag values can be entered. Once this value is entered, it can be an empty string.\n\nIt can be up to 128 characters long and cannot start with `aliyun` or `acs:`. It cannot contain `http://` or `https://`.", "type": "string", "required": false, "example": "alueTest" } }, "required": false }, "required": false, "maxItems": 21, "minItems": 1 } }, { "name": "AddressType", "in": "query", "schema": { "title": "The address type of the load balancer", "description": "The instance address type. Valid values:\n\n- **Internet**: The SLB instance has a public IP address. The DNS domain name is resolved to the public IP address, so it can be accessed over the Internet.\n\n- **Intranet**: The SLB instance has only a private IP address. The DNS domain name is resolved to the private IP address, so it can only be accessed from the internal network of the VPC where it is located.", "type": "string", "required": false, "example": "Intranet" } }, { "name": "PayType", "in": "query", "schema": { "title": "Billing method", "description": "The billing method of the instance. Valid values:\n\n**PostPay** (default): Pay-as-you-go.", "type": "string", "required": false, "example": "PostPay" } }, { "name": "ResourceGroupId", "in": "query", "schema": { "title": "Resource group ID", "description": "The enterprise resource group ID.", "type": "string", "required": false, "example": "rg-acfmxazb4ph****" } }, { "name": "AddressIpVersion", "in": "query", "schema": { "title": "The protocol version to filter", "description": "The protocol version. Valid values:\n\n- **IPv4**: IPv4.\n- **DualStack**: Dual-stack.", "type": "string", "required": false, "example": "IPv4" } }, { "name": "Ipv6AddressType", "in": "query", "schema": { "title": "The network type of the IPv6 address", "description": "The IPv6 address type of the Application Load Balancer. Valid values:\n\n- **Internet**: The SLB instance has a public IP address. The DNS domain name is resolved to the public IP address, so it can be accessed over the Internet.\n\n- **Intranet**: The SLB instance has only a private IP address. The DNS domain name is resolved to the private IP address, so it can only be accessed from the internal network of the VPC where it is located.", "type": "string", "required": false, "example": "Intranet" } }, { "name": "DNSName", "in": "query", "schema": { "description": "The DNS domain name.", "type": "string", "required": false, "example": "alb-95qnr2itwu9orb****.cn-hangzhou.alb.aliyuncs.com" } } ], "responses": { "200": { "schema": { "title": "Schema of Response", "description": "The configuration information of the Application Load Balancer instance.", "type": "object", "properties": { "LoadBalancers": { "title": "List of instances", "description": "A list of Application Load Balancer instances.", "type": "array", "items": { "description": "The structure of an Application Load Balancer instance.", "type": "object", "properties": { "AccessLogConfig": { "title": "Access log properties", "description": "The structure of the access log configuration.", "type": "object", "properties": { "LogProject": { "title": "The log project to which access logs are delivered", "description": "The log project.", "type": "string", "example": "sls-setter" }, "LogStore": { "title": "Deletion protection enabling time", "description": "The log store.", "type": "string", "example": "test" } } }, "AddressAllocatedMode": { "title": "Address mode", "description": "The address mode. Valid values:\n\n- **Fixed**: Fixed IP mode, which uses a fixed IP address.\n\n- **Dynamic**: Dynamic IP mode, where an IP address is dynamically allocated for each zone.", "type": "string", "example": "Fixed" }, "AddressType": { "title": "Address type", "description": "The address type of the load balancer. Valid values:\n\n- **Internet**: The SLB instance has a public IP address. The DNS domain name is resolved to the public IP address, so it can be accessed over the Internet.\n\n- **Intranet**: The SLB instance has only a private IP address. The DNS domain name is resolved to the private IP address, so it can only be accessed from the internal network of the VPC where it is located.", "type": "string", "example": "Intranet" }, "BandwidthPackageId": { "title": "Bandwidth plan ID", "description": "The ID of the shared bandwidth plan associated with the public-facing instance.", "type": "string", "example": "cbwp-bp1vevu8h3ieh****" }, "CreateTime": { "title": "Resource creation time", "description": "The time the resource was created.", "type": "string", "example": "2022-07-02T02:49:05Z" }, "DNSName": { "title": "DNS name", "description": "The DNS domain name.", "type": "string", "example": "alb-95qnr2itwu9orb****.cn-hangzhou.alb.aliyuncs.com" }, "DeletionProtectionConfig": { "title": "Load balancer deletion protection information", "description": "The deletion protection configuration.", "type": "object", "properties": { "Enabled": { "title": "Deletion protection status", "description": "The deletion protection status. Valid values:\n\n- **true**: Enabled.\n\n- **false**: Disabled.", "type": "boolean", "example": "true" }, "EnabledTime": { "title": "Deletion protection enabling time", "description": "The time when deletion protection was enabled.", "type": "string", "example": "2022-08-02T02:49:05Z" } } }, "LoadBalancerBillingConfig": { "title": "Billing-related properties", "description": "The billing configuration of the SLB instance.", "type": "object", "properties": { "PayType": { "title": "The billing method of the instance", "description": "The billing method. Valid values:\n\n**PostPay**: Pay-as-you-go.", "type": "string", "example": "PostPay", "default": "PostPay" } } }, "LoadBalancerBussinessStatus": { "title": "Instance business status", "description": "The business status of the load balancer. Valid values:\n\n- **Abnormal**: Abnormal.\n\n- **Normal**: Normal.", "type": "string", "example": "Normal" }, "LoadBalancerEdition": { "title": "Load balancer edition", "description": "The edition of the load balancer. Different editions have different feature limits and billing policies. Valid values:\n\n- **Basic**: Basic Edition.\n\n- **Standard**: Standard Edition.\n\n- **StandardWithWaf**: WAF-enabled Edition.\n\n", "type": "string", "example": "Standard" }, "LoadBalancerId": { "title": "Load balancer identity", "description": "The ID of the Application Load Balancer instance.", "type": "string", "example": "alb-o9ulmq5hgn68jk****" }, "LoadBalancerName": { "title": "Instance name", "description": "The name of the SLB instance.", "type": "string", "example": "alb-instance-test" }, "LoadBalancerOperationLocks": { "title": "Reason for lock", "description": "The operation lock configuration of the load balancer.", "type": "array", "items": { "description": "The structure of the load balancer operation lock.", "type": "object", "properties": { "LockReason": { "title": "Reason for lock", "description": "The reason for the lock. This is valid when **LoadBalancerBussinessStatus** is **Abnormal**.", "type": "string" }, "LockType": { "title": "Type of lock", "description": "The type of lock. Valid values:\n\n- **SecurityLocked**: Security lock.\n\n- **RelatedResourceLocked**: Related resource lock.\n\n- **FinancialLocked**: Financial lock.\n\n- **ResidualLocked**: Residual lock.", "type": "string", "example": "FinancialLocked" } } } }, "LoadBalancerStatus": { "title": "Instance status", "description": "The status of the Application Load Balancer instance. Valid values:\n\n- **Inactive**: Stopped. The instance listener will no longer forward traffic.\n\n- **Active**: Running.\n\n- **Provisioning**: Creating.\n\n- **Configuring**: Modifying.\n\n- **CreateFailed**: Creation failed.", "type": "string", "example": "Active" }, "ModificationProtectionConfig": { "title": "Load balancer modification protection information", "description": "The modification protection configuration.", "type": "object", "properties": { "Reason": { "title": "The reason for setting the modification protection status", "description": "The reason for enabling modification protection.\n\nThe length is 2 to 128 English or Chinese characters. It must start with an uppercase or lowercase English letter or a Chinese character and can contain numbers, periods (.), underscores (_), and hyphens (-).\n\nThis is returned only when **Status** is **ConsoleProtection**.", "type": "string", "example": "Managed Instance" }, "Status": { "title": "Load balancer modification protection status", "description": "The modification protection status of the Application Load Balancer instance. Valid values:\n\n- **NonProtection**: Modification protection is not enabled. If **Reason** is configured, **Reason** will be forcibly cleared.\n\n- **ConsoleProtection**: Console modification protection is enabled. If **Reason** is configured, **Reason** can take effect.\n\n> When the value is **ConsoleProtection**, meaning modification protection is enabled, users cannot modify the instance configuration through the SLB console, but can modify it by calling the API.", "type": "string", "example": "ConsoleProtection" } } }, "ResourceGroupId": { "title": "Enterprise resource group ID", "description": "The enterprise resource group ID.", "type": "string", "example": "rg-atstuj3rtop****" }, "Tags": { "title": "List of tags", "description": "A list of tags.", "type": "array", "items": { "description": "The structure of a tag.", "type": "object", "properties": { "Key": { "title": "The tag key of the instance", "description": "The tag key of the instance.", "type": "string", "example": "KeyTest" }, "Value": { "title": "The tag value of the instance", "description": "The tag value of the instance.", "type": "string", "example": "alueTest" } } } }, "VpcId": { "title": "VPC network ID", "description": "The VPC ID of the Application Load Balancer instance.", "type": "string", "example": "vpc-bp1b49rqryhk45nio****" }, "AddressIpVersion": { "title": "Protocol version", "description": "The protocol version. Valid values:\n\n- **IPv4**: IPv4.\n\n- **DualStack**: Dual-stack.", "type": "string", "example": "DualStack" }, "Ipv6AddressType": { "title": "IPv6 address type", "description": "The network address type of the IPv6 address of the Application Load Balancer. Valid values:\n\n- **Internet**: Public network. The SLB instance has a public IP address. The DNS domain name is resolved to the public IP address, so it can be accessed over the Internet.\n\n- **Intranet**: Private network. The SLB instance has only a private IP address. The DNS domain name is resolved to the private IP address, so it can only be accessed from the internal network of the VPC where it is located.", "type": "string", "example": "Intranet" }, "SecurityGroupIds": { "description": "The security groups to which the Application Load Balancer instance is added.", "type": "array", "items": { "description": "The security groups to which the Application Load Balancer instance is added.", "type": "string", "example": "sg-2zejdtxxpu8c9tny****" } } } } }, "MaxResults": { "title": "The maximum number of records returned for this request.", "description": "The number of entries displayed per page for paged queries.\n\n", "type": "integer", "format": "int32", "example": "20" }, "NextToken": { "title": "Indicates the position where the current call returns to read. Empty means the data has been read.", "description": "The token for the next query. Valid values:\n- If **NextToken** is empty, there are no more queries.\n- If **NextToken** has a return value, this value indicates the token to start the next query.", "type": "string", "example": "FFmyTO70tTpLG6I3FmYAXGKPd****" }, "RequestId": { "title": "Id of the request", "description": "The request ID.", "type": "string", "example": "365F4154-92F6-4AE4-92F8-7FF34B540710" }, "TotalCount": { "title": "The total amount of data under the conditions of this request.", "description": "The number of list entries.", "type": "integer", "format": "int32", "example": "100" } } } } }, "responseDemo": "[{\"type\":\"json\",\"example\":\"{\\n \\\"LoadBalancers\\\": [\\n {\\n \\\"AccessLogConfig\\\": {\\n \\\"LogProject\\\": \\\"sls-setter\\\",\\n \\\"LogStore\\\": \\\"test\\\"\\n },\\n \\\"AddressAllocatedMode\\\": \\\"Fixed\\\",\\n \\\"AddressType\\\": \\\"Intranet\\\",\\n \\\"BandwidthPackageId\\\": \\\"cbwp-bp1vevu8h3ieh****\\\",\\n \\\"CreateTime\\\": \\\"2022-07-02T02:49:05Z\\\",\\n \\\"DNSName\\\": \\\"alb-95qnr2itwu9orb****.cn-hangzhou.alb.aliyuncs.com\\\",\\n \\\"DeletionProtectionConfig\\\": {\\n \\\"Enabled\\\": true,\\n \\\"EnabledTime\\\": \\\"2022-08-02T02:49:05Z\\\"\\n },\\n \\\"LoadBalancerBillingConfig\\\": {\\n \\\"PayType\\\": \\\"PostPay\\\"\\n },\\n \\\"LoadBalancerBussinessStatus\\\": \\\"Normal\\\",\\n \\\"LoadBalancerEdition\\\": \\\"Standard\\\",\\n \\\"LoadBalancerId\\\": \\\"alb-o9ulmq5hgn68jk****\\\",\\n \\\"LoadBalancerName\\\": \\\"alb-instance-test\\\",\\n \\\"LoadBalancerOperationLocks\\\": [\\n {\\n \\\"LockReason\\\": \\\"\\\",\\n \\\"LockType\\\": \\\"FinancialLocked\\\"\\n }\\n ],\\n \\\"LoadBalancerStatus\\\": \\\"Active\\\",\\n \\\"ModificationProtectionConfig\\\": {\\n \\\"Reason\\\": \\\"Managed Instance\\\",\\n \\\"Status\\\": \\\"ConsoleProtection\\\"\\n },\\n \\\"ResourceGroupId\\\": \\\"rg-atstuj3rtop****\\\",\\n \\\"Tags\\\": [\\n {\\n \\\"Key\\\": \\\"KeyTest\\\",\\n \\\"Value\\\": \\\"alueTest\\\"\\n }\\n ],\\n \\\"VpcId\\\": \\\"vpc-bp1b49rqryhk45nio****\\\",\\n \\\"AddressIpVersion\\\": \\\"DualStack\\\",\\n \\\"Ipv6AddressType\\\": \\\"Intranet\\\",\\n \\\"SecurityGroupIds\\\": [\\n \\\"sg-2zejdtxxpu8c9tny****\\\"\\n ]\\n }\\n ],\\n \\\"MaxResults\\\": 20,\\n \\\"NextToken\\\": \\\"FFmyTO70tTpLG6I3FmYAXGKPd****\\\",\\n \\\"RequestId\\\": \\\"365F4154-92F6-4AE4-92F8-7FF34B540710\\\",\\n \\\"TotalCount\\\": 100\\n}\",\"errorExample\":\"\"},{\"type\":\"xml\",\"example\":\"<ListLoadBalancersResponse>\\n <LoadBalancers>\\n <AccessLogConfig>\\n <LogProject>sls-setter</LogProject>\\n <LogStore>test</LogStore>\\n </AccessLogConfig>\\n <AddressAllocatedMode>Fixed</AddressAllocatedMode>\\n <AddressType>Intranet</AddressType>\\n <BandwidthPackageId>cbwp-bp1vevu8h3ieh****</BandwidthPackageId>\\n <CreateTime>2022-07-02T02:49:05Z</CreateTime>\\n <DNSName>alb-95qnr2itwu9orb****.cn-hangzhou.alb.aliyuncs.com</DNSName>\\n <DeletionProtectionConfig>\\n <Enabled>true</Enabled>\\n <EnabledTime>2022-08-02T02:49:05Z</EnabledTime>\\n </DeletionProtectionConfig>\\n <LoadBalancerBillingConfig>\\n <PayType>PostPay</PayType>\\n </LoadBalancerBillingConfig>\\n <LoadBalancerBussinessStatus>Normal</LoadBalancerBussinessStatus>\\n <LoadBalancerEdition>Standard</LoadBalancerEdition>\\n <LoadBalancerId>alb-o9ulmq5hgn68jk****</LoadBalancerId>\\n <LoadBalancerName>alb-instance-test</LoadBalancerName>\\n <LoadBalancerOperationLocks>\\n <LockReason>Overdue Payment</LockReason>\\n <LockType>FinancialLocked</LockType>\\n </LoadBalancerOperationLocks>\\n <LoadBalancerStatus>Active</LoadBalancerStatus>\\n <ModificationProtectionConfig>\\n <Reason>Managed Instance</Reason>\\n <Status>ConsoleProtection</Status>\\n </ModificationProtectionConfig>\\n <ResourceGroupId>rg-atstuj3rtop****</ResourceGroupId>\\n <Tags>\\n <Key>KeyTest</Key>\\n <Value>alueTest</Value>\\n </Tags>\\n <VpcId>vpc-bp1b49rqrybk45nio****</VpcId>\\n <AddressIpVersion>DualStack</AddressIpVersion>\\n <Ipv6AddressType>Intranet</Ipv6AddressType>\\n </LoadBalancers>\\n <MaxResults>20</MaxResults>\\n <NextToken>FFmyTO70tTpLG6I3FmYAXGKPd****</NextToken>\\n <RequestId>365F4154-92F6-4AE4-92F8-7FF34B540710</RequestId>\\n <TotalCount>100</TotalCount>\\n</ListLoadBalancersResponse>\",\"errorExample\":\"\"}]", "title": "Query load balancers" }, "ListListeners": { "summary": "Queries listeners in a specified region.", "methods": [ "get", "post" ], "schemes": [ "http", "https" ], "security": [ { "AK": [] } ], "operationType": "read", "deprecated": false, "systemTags": { "operationType": "get", "abilityTreeCode": "190", "abilityTreeNodes": [ "FEATUREslbM7ALO6", "FEATUREslbK3ZR0L", "FEATUREslbN5IE4S" ] }, "parameters": [ { "name": "NextToken", "in": "query", "schema": { "title": "Marks the current starting position for reading. Leave it empty to start from the beginning.", "description": "The token for the next query. Valid values:\n- If this is your first query or there are no more queries, you do not need to fill this in.\n- If there is a next query, set it to the value of **NextToken** from the previous API call.", "type": "string", "required": false, "example": "FFmyTO70tTpLG6I4FmYAXGKPd****" } }, { "name": "MaxResults", "in": "query", "schema": { "title": "The maximum number of data records to read this time. This parameter is optional. The value is 1-100. If the user does not pass a value, the default is 20.", "description": "The maximum number of data records to read this time. This parameter is optional. The value range is **1 to 100**. If the parameter is empty, the default value is **20**.", "type": "integer", "format": "int32", "required": false, "example": "50" } }, { "name": "ListenerIds", "in": "query", "style": "flat", "schema": { "title": "List of listener IDs, N supports a maximum of 20", "description": "A list of listener instance IDs. A maximum of 20 listener IDs are supported.", "type": "array", "items": { "description": "The listener instance ID.", "type": "string", "required": false, "example": "lsn-o4u54y73wq7b******" }, "required": false, "maxItems": 20, "minItems": 1 } }, { "name": "LoadBalancerIds", "in": "query", "style": "flat", "schema": { "title": "List of instance IDs, N supports a maximum of 20", "description": "The ID of the Application Load Balancer instance. A maximum of 20 instance IDs are supported.", "type": "array", "items": { "description": "The ID of the Application Load Balancer instance.", "type": "string", "required": false, "example": "alb-bd6oylbckp6k9x****" }, "required": false, "maxItems": 21, "minItems": 1 } }, { "name": "ListenerProtocol", "in": "query", "schema": { "title": "Listener protocol", "description": "The listener protocol to filter. Valid values:\n\n- **HTTP**: The protocol type is HTTP.\n- **HTTPS**: The protocol type is HTTPS.\n- **QUIC**: The protocol type is QUIC.", "type": "string", "required": false, "example": "HTTP" } }, { "name": "Tag", "in": "query", "style": "flat", "schema": { "description": "The tags.", "type": "array", "items": { "description": "The structure of a tag.", "type": "object", "properties": { "Key": { "description": "The tag key. It can be up to 128 characters long and cannot start with aliyun or acs:. It cannot contain http:// or https://.", "type": "string", "required": false, "example": "env" }, "Value": { "description": "The tag value. It can be up to 128 characters long and cannot start with aliyun or acs:. It cannot contain http:// or https://.", "type": "string", "required": false, "example": "product" } }, "required": false }, "required": false } } ], "responses": { "200": { "schema": { "title": "Schema of Response", "description": "The information of the Application Load Balancer listener.", "type": "object", "properties": { "Listeners": { "title": "List of listeners", "description": "A list of Application Load Balancer listeners.", "type": "array", "items": { "description": "The structure of an Application Load Balancer listener.", "type": "object", "properties": { "DefaultActions": { "title": "Default actions", "description": "A list of default rule actions.", "type": "array", "items": { "description": "The structure of a default rule action.", "type": "object", "properties": { "ForwardGroupConfig": { "title": "Forward to server group", "description": "The configuration corresponding to the forwarding rule action. This is valid when the action type is **ForwardGroup**.", "type": "object", "properties": { "ServerGroupTuples": { "title": "List of server groups", "description": "The destination server group for forwarding.", "type": "array", "items": { "description": "The destination server group for forwarding.", "type": "object", "properties": { "ServerGroupId": { "title": "Server group ID", "description": "The ID of the destination server group to forward to.", "type": "string", "example": "sgp-i5qt20******" } } } } } }, "Type": { "title": "Type", "description": "The action type. The value is **ForwardGroup**, which means forwarding to multiple server groups.", "type": "string", "example": "ForwardGroup" } } } }, "GzipEnabled": { "title": "Whether to enable Gzip compression", "description": "Whether to enable Gzip compression for specific file types. Valid values:\n\n- **true**: Yes.\n- **false**: No.\n\n", "type": "boolean", "example": "false" }, "Http2Enabled": { "title": "Whether to enable the HTTP/2 feature", "description": "Whether to enable the HTTP/2 feature. Valid values:\n\n- **true**: Yes.\n- **false**: No.\n\n> This parameter is only supported by HTTPS listeners.", "type": "boolean", "example": "false" }, "IdleTimeout": { "title": "Connection idle timeout", "description": "Specifies the connection idle timeout. Unit: seconds. The value range is **1 to 60**.\n\nIf there are no access requests within the timeout period, the load balancer will temporarily break the current connection until a new connection is established upon receiving the next request.", "type": "integer", "format": "int32", "example": "3" }, "ListenerDescription": { "title": "Listener description", "description": "The custom listener name.", "type": "string", "example": "HTTP_80" }, "ListenerId": { "title": "Listener identity", "description": "The listener ID.", "type": "string", "example": "lsn-o4u34y73wq7b******" }, "ListenerPort": { "title": "Listening port", "description": "The frontend port used by the Application Load Balancer instance. The value is **1 to 65535**.", "type": "integer", "format": "int32", "example": "80" }, "ListenerProtocol": { "title": "Listener protocol", "description": "The listener protocol. Valid values:\n\n- **HTTP**: The protocol type is HTTP.\n- **HTTPS**: The protocol type is HTTPS.\n- **QUIC**: The protocol type is QUIC.", "type": "string", "example": "HTTP" }, "ListenerStatus": { "title": "Listener status", "description": "The current status of the listener. Valid values:\n\n- **Provisioning**: Creating.\n\n- **Running**: Running.\n\n- **Configuring**: Configuring.\n\n- **Stopped**: Stopped.", "type": "string", "example": "Running" }, "LoadBalancerId": { "title": "Load balancer identity", "description": "The ID of the Application Load Balancer instance.", "type": "string", "example": "alb-bd6oylbckp6k9x****" }, "LogConfig": { "title": "Listener access log related configuration", "description": "The log configuration.", "type": "object", "properties": { "AccessLogRecordCustomizedHeadersEnabled": { "title": "Whether the access log carries custom headers", "description": "Whether the access log carries custom headers. Valid values:\n\n- **true**: Yes.\n- **false**: No.\n", "type": "boolean", "example": "true" }, "AccessLogTracingConfig": { "title": "Access log Xtrace related configuration", "description": "The access log Xtrace related configuration information.", "type": "object", "properties": { "TracingEnabled": { "title": "Xtrace feature status", "description": "Whether to enable the Xtrace feature. Valid values:\n\n- **true**: Yes.\n- **false**: No.\n\n> This parameter can only be set to **true** when the instance access log switch **AccessLogEnabled** is on.", "type": "boolean", "example": "true" }, "TracingSample": { "title": "Xtrace feature status", "description": "The sampling rate of Xtrace. The value is **1 to 10000**.\n\n> This value is valid when **TracingEnabled** is **true**.", "type": "integer", "format": "int32", "example": "100" }, "TracingType": { "title": "Xtrace type", "description": "The Xtrace type. The legal value is **Zipkin**.\n\n> This value is valid when **TracingEnabled** is **true**.", "type": "string", "example": "Zipkin" } } } } }, "QuicConfig": { "title": "Related properties when HTTPS enables QUIC", "description": "The configuration information when an associated QUIC listener is enabled.", "type": "object", "properties": { "QuicListenerId": { "title": "The ID of the QUIC listener to be associated. This is valid for HTTPS listeners and is required when QuicUpgradeEnabled is true.", "description": "The ID of the QUIC listener to be associated. This is required when **QuicUpgradeEnabled** is **true**. This is valid for HTTPS listeners.\n\n> The original listener and the associated QUIC listener must belong to the same ALB instance, and this QUIC listener must not have been associated before.", "type": "string", "example": "lsn-o4u54y73wq7b******" }, "QuicUpgradeEnabled": { "title": "Whether to enable QUIC upgrade. This is valid for HTTPS listeners.", "description": "Whether to enable QUIC upgrade. Valid values:\n\n- **true**: Yes.\n- **false**: No.\n\n> This is valid only for HTTPS listeners.", "type": "boolean", "example": "true" } } }, "RequestTimeout": { "title": "Request timeout", "description": "Specifies the request timeout. Unit: seconds. The value is **1 to 180**.\n\nIf the backend server does not respond within the timeout period, the load balancer will give up waiting and return an `HTTP 504` error code to the client.", "type": "integer", "format": "int32", "example": "34" }, "SecurityPolicyId": { "title": "Security policy", "description": "The security policy.\n\n> This parameter is only supported by HTTPS listeners.", "type": "string", "example": "tls_cipher_policy_1_1" }, "XForwardedForConfig": { "title": "Configuration related to XForwarded fields", "description": "The `XForward` header field configuration information.", "type": "object", "properties": { "XForwardedForClientCertClientVerifyAlias": { "title": "The custom header name. This value is effective only when the value of XForwardedForClientCertClientVerifyEnabled is true; otherwise, this value is not effective. This is valid for HTTPS listeners.", "description": "The custom header field name. This value is effective only when the value of **XForwardedForClientCertClientVerifyEnabled** is **true**; otherwise, this value is not effective.\n\nThe length is 1 to 40 characters. It supports letters a-z, numbers, hyphens (-), and underscores (_).\n\n> This parameter is only supported by HTTPS listeners.", "type": "string", "example": "test_client-verify-alias_123456" }, "XForwardedForClientCertClientVerifyEnabled": { "title": "Whether to obtain the verification result of the client certificate accessing the SLB instance through the X-Forwarded-Clientcert-clientverify header field. This is valid for HTTPS listeners.", "description": "Whether to obtain the verification result of the client certificate accessing the SLB instance through the `X-Forwarded-Clientcert-clientverify` header field. Valid values:\n\n- **true**: Yes.\n- **false**: No.\n\n> This parameter is only supported by HTTPS listeners.", "type": "boolean", "example": "true" }, "XForwardedForClientCertFingerprintAlias": { "title": "The custom header name. This value is effective only when the value of XForwardedForClientCertFingerprintEnabled is true; otherwise, this value is not effective. This is valid for HTTPS listeners.", "description": "The custom header name. This is effective only when the value of **XForwardedForClientCertFingerprintEnabled** is **true**.\n\nThe length is 1 to 40 characters. It supports letters a-z, numbers, hyphens (-), and underscores (_).\n\n> This parameter is only supported by HTTPS listeners.", "type": "string", "example": "test_finger-print-alias_123456" }, "XForwardedForClientCertFingerprintEnabled": { "title": "Whether to obtain the fingerprint value of the client certificate accessing the SLB instance through the X-Forwarded-Clientcert-fingerprint header field. This is valid for HTTPS listeners.", "description": "Whether to obtain the fingerprint value of the client certificate accessing the SLB instance through the `X-Forwarded-Clientcert-fingerprint` header field. Valid values:\n\n- **true**: Yes.\n- **false**: No.\n\n> This parameter is only supported by HTTPS listeners.", "type": "boolean", "example": "true" }, "XForwardedForClientCertIssuerDNAlias": { "title": "The custom header name. This value is effective only when the value of XForwardedForClientCertIssuerDNEnabled is 'On'; otherwise, this value is not effective. This is valid for HTTPS listeners.", "description": "The custom header name. This value is effective only when the value of **XForwardedForClientCertIssuerDNEnabled** is **true**.\n\nThe length is 1 to 40 characters. It supports letters a-z, numbers, hyphens (-), and underscores (_).\n\n> This parameter is only supported by HTTPS listeners.", "type": "string", "example": "test_issue-dn-alias_123456" }, "XForwardedForClientCertIssuerDNEnabled": { "title": "Whether to obtain the issuer information of the client certificate accessing the SLB instance through the X-Forwarded-Clientcert-issuerdn header field. This is valid for HTTPS listeners.", "description": "Whether to obtain the issuer information of the client certificate accessing the SLB instance through the `X-Forwarded-Clientcert-issuerdn` header field. Valid values:\n\n- **true**: Yes.\n- **false**: No.\n\n> This parameter is only supported by HTTPS listeners.", "type": "boolean", "example": "true" }, "XForwardedForClientCertSubjectDNAlias": { "title": "The custom header name. This value is effective only when the value of XForwardedForClientCertSubjectDNEnabled is true; otherwise, this value is not effective. This is valid for HTTPS listeners.", "description": "The custom header name. This value is effective only when the value of **XForwardedForClientCertSubjectDNEnabled** is **true**.\n\nThe length is 1 to 40 characters. It supports letters a-z, numbers, hyphens (-), and underscores (_).\n\n> This parameter is only supported by HTTPS listeners.", "type": "string", "example": "test_subject-dn-alias_123456" }, "XForwardedForClientCertSubjectDNEnabled": { "title": "Whether to obtain the owner information of the client certificate accessing the SLB instance through the X-Forwarded-Clientcert-subjectdn header field. This is valid for HTTPS listeners.", "description": "Whether to obtain the owner information of the client certificate accessing the SLB instance through the `X-Forwarded-Clientcert-subjectdn` header field. Valid values:\n\n- **true**: Yes.\n- **false**: No.\n\n> This parameter is only supported by HTTPS listeners.", "type": "boolean", "example": "true" }, "XForwardedForClientSrcPortEnabled": { "title": "Whether to obtain the port of the client accessing the SLB instance through the X-Forwarded-Client-Port header field. This is valid for HTTPS listeners.", "description": "Whether to obtain the port of the client accessing the SLB instance through the `X-Forwarded-Client-Port` header field. Valid values:\n\n- **true**: Yes.\n- **false**: No.\n\n> This parameter is supported by HTTP and HTTPS listeners.", "type": "boolean", "example": "true" }, "XForwardedForEnabled": { "title": "Whether to enable obtaining the real IP of the visitor through the X-Forwarded-For header field", "description": "Whether to obtain the real IP of the visitor through the `X-Forwarded-For` header field. Valid values:\n- **true** (default): Yes.\n- **false**: No.\n\n> 1. If you configure **true**, the default value of **XForwardedForProcessingMode** is **append**, which can be changed to **remove**.\n> 2. If you configure **false**, the `X-Forwarded-For` header field is retained without additional processing before the request is sent to the backend service.\n> 3. This parameter is supported by HTTP and HTTPS listeners.", "type": "boolean", "example": "true" }, "XForwardedForProcessingMode": { "description": "The mode for processing the `X-Forwarded-For` header field. This value is effective only when **XForwardedForEnabled** is **true**. Valid values:\n- **append** (default): Appends.\n- **remove**: Deletes.\n\n> 1. If you configure **append**, the last hop IP is added to the `X-Forwarded-For` header field before the request is sent to the backend service.\n> 2. If you configure **remove**, the `X-Forwarded-For` header is deleted before the request is sent to the backend service, regardless of whether the request carries the `X-Forwarded-For` header field.\n> 3. This parameter is supported by HTTP and HTTPS listeners.", "type": "string", "example": "append" }, "XForwardedForProtoEnabled": { "title": "Whether to obtain the listener protocol of the SLB instance through the X-Forwarded-Proto header field.", "description": "Whether to obtain the listener protocol of the SLB instance through the `X-Forwarded-Proto` header field. Valid values:\n\n- **true**: Yes.\n- **false**: No.\n\n> This parameter is supported by HTTP, HTTPS, and QUIC listeners.", "type": "boolean", "example": "true" }, "XForwardedForSLBIdEnabled": { "title": "Whether to obtain the SLB instance ID through the SLB-ID header field.", "description": "Whether to obtain the SLB instance ID through the `SLB-ID` header field. Valid values:\n\n- **true**: Yes.\n- **false**: No.\n\n> This parameter is supported by HTTP, HTTPS, and QUIC listeners.", "type": "boolean", "example": "true" }, "XForwardedForSLBPortEnabled": { "title": "Whether to obtain the listener port of the SLB instance through the X-Forwarded-Port header field. This is valid for HTTPS listeners.", "description": "Whether to obtain the listener port of the SLB instance through the `X-Forwarded-Port` header field. Valid values:\n\n- **true**: Yes.\n- **false**: No.\n\n> This parameter is supported by HTTP, HTTPS, and QUIC listeners.", "type": "boolean", "example": "true" }, "XForwardedForClientSourceIpsEnabled": { "description": "Whether to allow ALB to find the real client IP from the X-Forwarded-For header field. Valid values:\n\n- **true**: Yes.\n\n- **false**: No.\n\n> This parameter is supported by HTTP and HTTPS listeners.", "type": "boolean", "example": "false" }, "XForwardedForClientSourceIpsTrusted": { "description": "Specifies the trusted proxy IP.\n\nApplication Load Balancer (ALB) traverses `X-Forwarded-For` from back to front, selecting the first IP not in the trusted IP list as the real client IP. This IP is used for source IP rate limiting.", "type": "string", "example": "10.1.1.0/24" }, "XForwardedForHostEnabled": { "description": "Whether to enable obtaining the domain name of the client accessing the SLB instance through the `X-Forwarded-Host` header field. Valid values:\n- **true**: Yes.\n- **false** (default): No.\n\n> This parameter is supported by HTTP, HTTPS, and QUIC listeners.", "type": "boolean", "example": "false" } } }, "Tags": { "description": "The tags.", "type": "array", "items": { "description": "The structure of a tag.", "type": "object", "properties": { "Key": { "description": "The tag key. It can be up to 128 characters long and cannot start with aliyun or acs:. It cannot contain http:// or https://.", "type": "string", "example": "env" }, "Value": { "description": "The tag value. It can be up to 128 characters long and cannot start with aliyun or acs:. It cannot contain http:// or https://.", "type": "string", "example": "product" } } } } } } }, "MaxResults": { "title": "The maximum number of records returned for this request.", "description": "The maximum number of records returned for this request.", "type": "integer", "format": "int32", "example": "50" }, "NextToken": { "title": "Indicates the position where the current call returns to read. Empty means the data has been read.", "description": "The position where the current call returns to read. Setting it to empty means the data has been read.", "type": "string", "example": "FFmyTO70tTpLG6I3FmYAXGKPd****" }, "RequestId": { "title": "Id of the request", "description": "The request ID.", "type": "string", "example": "365F4154-92F6-4AE4-92F8-7FF3******" }, "TotalCount": { "title": "The total amount of data under the conditions of this request.", "description": "The total amount of data under the conditions of this request.", "type": "integer", "format": "int32", "example": "1000" } } } } }, "errorCodes": { "403": [ { "errorCode": "Forbidden.LoadBalancer", "errorMessage": "Authentication is failed for %s." } ] }, "responseDemo": "[{\"type\":\"json\",\"example\":\"{\\n \\\"Listeners\\\": [\\n {\\n \\\"DefaultActions\\\": [\\n {\\n \\\"ForwardGroupConfig\\\": {\\n \\\"ServerGroupTuples\\\": [\\n {\\n \\\"ServerGroupId\\\": \\\"sgp-i5qt20******\\\"\\n }\\n ]\\n },\\n \\\"Type\\\": \\\"ForwardGroup\\\"\\n }\\n ],\\n \\\"GzipEnabled\\\": false,\\n \\\"Http2Enabled\\\": false,\\n \\\"IdleTimeout\\\": 3,\\n \\\"ListenerDescription\\\": \\\"HTTP_80\\\",\\n \\\"ListenerId\\\": \\\"lsn-o4u34y73wq7b******\\\",\\n \\\"ListenerPort\\\": 80,\\n \\\"ListenerProtocol\\\": \\\"HTTP\\\",\\n \\\"ListenerStatus\\\": \\\"Running\\\",\\n \\\"LoadBalancerId\\\": \\\"alb-bd6oylbckp6k9x****\\\",\\n \\\"LogConfig\\\": {\\n \\\"AccessLogRecordCustomizedHeadersEnabled\\\": true,\\n \\\"AccessLogTracingConfig\\\": {\\n \\\"TracingEnabled\\\": true,\\n \\\"TracingSample\\\": 100,\\n \\\"TracingType\\\": \\\"Zipkin\\\"\\n }\\n },\\n \\\"QuicConfig\\\": {\\n \\\"QuicListenerId\\\": \\\"lsn-o4u54y73wq7b******\\\",\\n \\\"QuicUpgradeEnabled\\\": true\\n },\\n \\\"RequestTimeout\\\": 34,\\n \\\"SecurityPolicyId\\\": \\\"tls_cipher_policy_1_1\\\",\\n \\\"XForwardedForConfig\\\": {\\n \\\"XForwardedForClientCertClientVerifyAlias\\\": \\\"test_client-verify-alias_123456\\\",\\n \\\"XForwardedForClientCertClientVerifyEnabled\\\": true,\\n \\\"XForwardedForClientCertFingerprintAlias\\\": \\\"test_finger-print-alias_123456\\\",\\n \\\"XForwardedForClientCertFingerprintEnabled\\\": true,\\n \\\"XForwardedForClientCertIssuerDNAlias\\\": \\\"test_issue-dn-alias_123456\\\",\\n \\\"XForwardedForClientCertIssuerDNEnabled\\\": true,\\n \\\"XForwardedForClientCertSubjectDNAlias\\\": \\\"test_subject-dn-alias_123456\\\",\\n \\\"XForwardedForClientCertSubjectDNEnabled\\\": true,\\n \\\"XForwardedForClientSrcPortEnabled\\\": true,\\n \\\"XForwardedForEnabled\\\": true,\\n \\\"XForwardedForProcessingMode\\\": \\\"append\\\",\\n \\\"XForwardedForProtoEnabled\\\": true,\\n \\\"XForwardedForSLBIdEnabled\\\": true,\\n \\\"XForwardedForSLBPortEnabled\\\": true,\\n \\\"XForwardedForClientSourceIpsEnabled\\\": false,\\n \\\"XForwardedForClientSourceIpsTrusted\\\": \\\"10.1.1.0/24\\\",\\n \\\"XForwardedForHostEnabled\\\": false\\n },\\n \\\"Tags\\\": [\\n {\\n \\\"Key\\\": \\\"env\\\",\\n \\\"Value\\\": \\\"product\\\"\\n }\\n ]\\n }\\n ],\\n \\\"MaxResults\\\": 50,\\n \\\"NextToken\\\": \\\"FFmyTO70tTpLG6I3FmYAXGKPd****\\\",\\n \\\"RequestId\\\": \\\"365F4154-92F6-4AE4-92F8-7FF3******\\\",\\n \\\"TotalCount\\\": 1000\\n}\",\"errorExample\":\"\"},{\"type\":\"xml\",\"example\":\"<ListListenersResponse>\\n <Listeners>\\n <DefaultActions>\\n <ForwardGroupConfig>\\n <ServerGroupTuples>\\n <ServerGroupId>rsp-cige6j****</ServerGroupId>\\n </ServerGroupTuples>\\n </ForwardGroupConfig>\\n <Type>ForwardGroup</Type>\\n </DefaultActions>\\n <GzipEnabled>false</GzipEnabled>\\n <Http2Enabled>false</Http2Enabled>\\n <IdleTimeout>3</IdleTimeout>\\n <ListenerDescription>HTTP_80</ListenerDescription>\\n <ListenerId>lsr-bp1bpn0kn908w4nbw****</ListenerId>\\n <ListenerPort>80</ListenerPort>\\n <ListenerProtocol>HTTP</ListenerProtocol>\\n <ListenerStatus>Running</ListenerStatus>\\n <LoadBalancerId>alb-bd6oylbckp6k9x****</LoadBalancerId>\\n <LogConfig>\\n <AccessLogRecordCustomizedHeadersEnabled>true</AccessLogRecordCustomizedHeadersEnabled>\\n <AccessLogTracingConfig>\\n <TracingEnabled>true</TracingEnabled>\\n <TracingSample>100</TracingSample>\\n <TracingType>Zipkin</TracingType>\\n </AccessLogTracingConfig>\\n </LogConfig>\\n <QuicConfig>\\n <QuicListenerId>lsr-bp1bpn908w4nbw****</QuicListenerId>\\n <QuicUpgradeEnabled>true</QuicUpgradeEnabled>\\n </QuicConfig>\\n <RequestTimeout>34</RequestTimeout>\\n <SecurityPolicyId>tls_cipher_policy_1_1</SecurityPolicyId>\\n <XForwardedForConfig>\\n <XForwardedForClientCertClientVerifyAlias>test_client-verify-alias_123456</XForwardedForClientCertClientVerifyAlias>\\n <XForwardedForClientCertClientVerifyEnabled>true</XForwardedForClientCertClientVerifyEnabled>\\n <XForwardedForClientCertFingerprintAlias>test_finger-print-alias_123456</XForwardedForClientCertFingerprintAlias>\\n <XForwardedForClientCertFingerprintEnabled>true</XForwardedForClientCertFingerprintEnabled>\\n <XForwardedForClientCertIssuerDNAlias>test_issue-dn-alias_123456</XForwardedForClientCertIssuerDNAlias>\\n <XForwardedForClientCertIssuerDNEnabled>true</XForwardedForClientCertIssuerDNEnabled>\\n <XForwardedForClientCertSubjectDNAlias>test_subject-dn-alias_123456</XForwardedForClientCertSubjectDNAlias>\\n <XForwardedForClientCertSubjectDNEnabled>true</XForwardedForClientCertSubjectDNEnabled>\\n <XForwardedForClientSrcPortEnabled>true</XForwardedForClientSrcPortEnabled>\\n <XForwardedForEnabled>true</XForwardedForEnabled>\\n <XForwardedForProtoEnabled>true</XForwardedForProtoEnabled>\\n <XForwardedForSLBIdEnabled>true</XForwardedForSLBIdEnabled>\\n <XForwardedForSLBPortEnabled>true</XForwardedForSLBPortEnabled>\\n <XForwardedForClientSourceIpsEnabled>false</XForwardedForClientSourceIpsEnabled>\\n <XForwardedForClientSourceIpsTrusted>10.1.1.0/24</XForwardedForClientSourceIpsTrusted>\\n </XForwardedForConfig>\\n </Listeners>\\n <MaxResults>50</MaxResults>\\n <NextToken>FFmyTO70tTpLG6I3FmYAXGKPd****</NextToken>\\n <RequestId>365F4154-92F6-4AE4-92F8-7FF34B540710</RequestId>\\n <TotalCount>1000</TotalCount>\\n</ListListenersResponse>\",\"errorExample\":\"\"}]", "title": "Query listeners" }, "ListServerGroups": { "summary": "Queries a list of server groups.", "methods": [ "get", "post" ], "schemes": [ "http", "https" ], "security": [ { "AK": [] } ], "operationType": "read", "deprecated": false, "systemTags": { "operationType": "get", "abilityTreeCode": "166", "abilityTreeNodes": [ "FEATUREslbVRSQEA" ] }, "parameters": [ { "name": "ServerGroupIds", "in": "query", "style": "flat", "schema": { "title": "List of server group IDs", "description": "A list of server group IDs.", "type": "array", "items": { "description": "The server group ID. A maximum of 20 server group IDs can be queried at a time.", "type": "string", "required": false, "example": "sgp-atstuj3rtop****" }, "required": false, "maxItems": 20 } }, { "name": "ServerGroupNames", "in": "query", "style": "flat", "schema": { "title": "Server group name", "description": "A list of server group names, up to 10.", "type": "array", "items": { "description": "The server group name. A maximum of 10 server group names can be queried at a time.", "type": "string", "required": false, "example": "Group3" }, "required": false, "maxItems": 10 } }, { "name": "ResourceGroupId", "in": "query", "schema": { "title": "Resource group ID", "description": "The resource group ID.", "type": "string", "required": false, "example": "rg-atstuj3rtop****" } }, { "name": "NextToken", "in": "query", "schema": { "title": "Paged query identifier", "description": "The token for the next query. Valid values:\n- If this is your first query or there are no more queries, you do not need to fill this in.\n- If there is a next query, set it to the value of **NextToken** from the previous API call.", "type": "string", "required": false, "example": "FFmyTO70tTpLG6I3FmYAXG****" } }, { "name": "MaxResults", "in": "query", "schema": { "title": "Query quantity", "description": "The number of entries to display per page for paged queries. The value range is **1** to **100**. The default value is **20**.", "type": "integer", "format": "int32", "required": false, "maximum": "100", "minimum": "1", "example": "20", "default": "20" } }, { "name": "VpcId", "in": "query", "schema": { "title": "VpcId", "description": "The VPC instance ID.", "type": "string", "required": false, "example": "vpc-bp15zckdt37pq72zv****" } }, { "name": "ServerGroupType", "in": "query", "schema": { "title": "Server group type", "description": "The server group type. Valid values:\n\n- **Instance**: Server type, including ECS, ENI, and ECI instances.\n\n- **Ip**: IP address type.\n\n- **Fc**: Function Compute type.\n\n- If not filled, all types are queried.", "type": "string", "required": false, "example": "Instance" } }, { "name": "Tag", "in": "query", "style": "flat", "schema": { "title": "List of tags", "description": "A list of tags bound to the server group. A maximum of 10 tags are supported in the list of bound tags in a single request.", "type": "array", "items": { "description": "The tags bound to the server group. A single request supports passing in 10 tags.", "type": "object", "properties": { "Key": { "title": "Tag key", "description": "The tag key. A maximum of 10 tag keys are supported.\n\nIt can be up to 64 characters long and cannot start with `aliyun` or `acs:`. It cannot contain `http://` or `https://`.", "type": "string", "required": false, "example": "Test" }, "Value": { "title": "Tag value", "description": "The tag value. A maximum of 10 tag values are supported.\n\nIt can be up to 128 characters long and cannot start with `aliyun` or `acs:`. It cannot contain `http://` or `https://`.\n\n", "type": "string", "required": false, "example": "Test" } }, "required": false }, "required": false, "example": "Instance" } } ], "responses": { "200": { "schema": { "title": "Schema of Response", "description": " The returned data structure.", "type": "object", "properties": { "MaxResults": { "title": "Number of records returned by this query", "description": "The number of entries displayed per page for paged queries.", "type": "integer", "format": "int32", "example": "50" }, "NextToken": { "title": "Paged query identifier", "description": "The token for the next query. Valid values:\n- If **NextToken** is empty, there are no more queries.\n- If **NextToken** has a return value, this value indicates the token to start the next query.", "type": "string", "example": "caeba0bbb2be03f8****" }, "RequestId": { "title": "Id of the request", "description": "The request ID.", "type": "string", "example": "CEF72CEB-54B6-4AE8-B225-F876******" }, "ServerGroups": { "title": "Server group", "description": "A list of backend server groups.", "type": "array", "items": { "description": "A list of backend server groups.", "type": "object", "properties": { "HealthCheckConfig": { "title": "Health check configuration", "description": "The health check configuration.", "type": "object", "properties": { "HealthCheckConnectPort": { "title": "Port", "description": "The port of the backend server for health checks. The value range is **0** to **65535**.\n\nA return value of **0** means the port of the backend server is used for health checks.", "type": "integer", "format": "int32", "example": "80" }, "HealthCheckEnabled": { "title": "Whether to enable health checks", "description": "Whether to enable health checks. Valid values:\n- **true**: Enabled.\n- **false**: Disabled.", "type": "boolean", "example": "true" }, "HealthCheckHost": { "title": "Domain name", "description": "The health check domain name.\n\n- **Use the internal IP of the backend server** (default): The internal IP address of the backend server is used as the health check domain name.\n\n- **Specify a specific domain name**: Enter a domain name.\n\n - The length is 1 to 80 characters.\n\n - It can contain lowercase letters, numbers, hyphens (-), and periods (.).\n\n - It must contain at least one period (.), and the period (.) cannot appear at the beginning or end.\n\n - The rightmost domain label can only contain letters and cannot contain numbers or hyphens (-).\n\n - Hyphens (-) cannot appear at the beginning or end.\n\n> \n> This parameter is effective only when HealthCheckProtocol is set to HTTP, HTTPS, or gRPC.", "type": "string", "example": "www.example.com" }, "HealthCheckCodes": { "title": "Status code", "description": "A list of normal status codes for health checks.", "type": "array", "items": { "description": "The normal status code for a health check.\n\n- When **HealthCheckProtocol** is **HTTP** or **HTTPS**, **HealthCheckCodes** can be **http\\_2xx**, **http\\_3xx**, **http\\_4xx**, or **http\\_5xx**. Multiple status codes are separated by commas (,).\n\n- When **HealthCheckProtocol** is **gRPC**, the **HealthCheckCodes** status code range is **0 to 99**. Range input is supported, with a maximum of 20 range values, separated by commas (,).\n\n> This parameter is effective when **HealthCheckProtocol** is **HTTP**, **HTTPS**, or **gRPC**.", "type": "string", "example": "http_2xx" } }, "HealthCheckHttpVersion": { "title": "Version", "description": "The health check HTTP protocol version.\n\nValid values: **HTTP1.0** or **HTTP1.1**.\n\n> This parameter is effective only when **HealthCheckProtocol** is set to **HTTP** or **HTTPS**.", "type": "string", "example": "HTTP1.1" }, "HealthCheckInterval": { "title": "Interval time", "description": "The time interval for health checks. Unit: seconds. The value range is **1** to **50**.", "type": "integer", "format": "int32", "example": "5" }, "HealthCheckMethod": { "title": "Method", "description": "The health check method. Valid values:\n\n- **GET**: If the response message length exceeds 8K, it will be truncated, but it will not affect the determination of the health check result.\n\n- **POST**: gRPC listener health checks use the POST method by default.\n\n- **HEAD**: HTTP and HTTPS listener health checks use the HEAD method by default.\n\n\n> This parameter is effective only when **HealthCheckProtocol** is set to **HTTP**, **HTTPS**, or **gRPC**.", "type": "string", "example": "HEAD" }, "HealthCheckPath": { "title": "URI", "description": "The forwarding rule path for health checks.\n\n> This parameter is effective only when **HealthCheckProtocol** is set to **HTTP** or **HTTPS**.", "type": "string", "example": "/test/index.html" }, "HealthCheckProtocol": { "title": "Protocol", "description": "The health check protocol. Valid values:\n\n- **HTTP**: Checks if the server application is healthy by sending HEAD or GET requests to simulate browser access.\n\n- **HTTPS**: Checks if the server application is healthy by sending HEAD or GET requests to simulate browser access. (Data is encrypted, which is more secure than HTTP.)\n\n- **TCP**: Detects if the server port is alive by sending SYN handshake messages.\n\n- **gRPC**: Checks if the server application is healthy by sending POST or GET requests.", "type": "string", "example": "HTTP" }, "HealthCheckTimeout": { "title": "Timeout", "description": "The time to wait for a response from a health check. If the backend server does not respond correctly within the specified time, the health check is considered to have failed. Unit: seconds.\n\n", "type": "integer", "format": "int32", "example": "3" }, "HealthyThreshold": { "title": "Healthy Threshold", "description": "The number of consecutive successful health checks required to change the health check status of a backend server from **failed** to **successful**.", "type": "integer", "format": "int32", "example": "4" }, "UnhealthyThreshold": { "title": "Unhealthy Threshold", "description": "The number of consecutive failed health checks required to change the health check status of a backend server from **successful** to **failed**.", "type": "integer", "format": "int32", "example": "4" } } }, "Protocol": { "title": "Server group protocol", "description": "The backend protocol type. Valid values:\n\n- **HTTP**: Supports association with HTTPS, HTTP, and QUIC listeners.\n- **HTTPS**: Supports association with HTTPS listeners.\n\n- **GRPC**: Associates with HTTPS and QUIC listeners.\n", "type": "string", "example": "HTTP" }, "RelatedLoadBalancerIds": { "title": "Associated instance ID", "description": "Associated instance ID", "type": "array", "items": { "description": "Associated load balancer instance ID", "type": "string", "example": "alb-n5qw04uq8savfe****" } }, "ResourceGroupId": { "title": "Resource group ID", "description": "The resource group ID.", "type": "string", "example": "rg-atstuj3rtop****" }, "Scheduler": { "title": "Scheduling policy", "description": "The scheduling algorithm. Valid values:\n\n- **Wrr**: Weighted round-robin. Backend servers with higher weights are more likely to be polled.\n- **Wlc**: Weighted least connections. In addition to polling based on the weight set for each backend server, the actual load (number of connections) of the backend server is also considered. When the weights are the same, the backend server with the smaller current number of connections is more likely to be polled.\n- **Sch**: Consistent hashing. Requests with the same hash factor calculation result will be scheduled to the same backend server. When the UchConfig parameter is not configured, the default hash factor is the source IP, and requests from the same source IP address will be distributed to the same backend server. When the UchConfig parameter is configured, the hash factor is the URL parameter, and requests with the same URL parameter will be distributed to the same backend server.", "type": "string", "example": "Wrr" }, "ServerGroupId": { "title": "Server group ID", "description": "The server group ID.", "type": "string", "example": "sgp-cige6j****" }, "ServerGroupName": { "title": "Server group name", "description": "The server group name.", "type": "string", "example": "Group3" }, "ServerGroupStatus": { "title": "Server group status", "description": "The server group status. Valid values:\n- **Creating**: Creating.\n\n- **Available**: Available.\n\n- **Configuring**: Modifying.", "type": "string", "example": "Available" }, "ServerGroupType": { "title": "Server group type", "description": "The server group type. Valid values:\n\n- **Instance**: Server type, including ECS, ENI, and ECI instances.\n\n- **Ip**: IP type.\n\n- **Fc**: Function Compute type.", "type": "string", "example": "Instance" }, "StickySessionConfig": { "title": "Session persistence configuration", "description": "The structure of the session persistence configuration.", "type": "object", "properties": { "Cookie": { "title": "Cookie", "description": "The cookie configured on the server.", "type": "string", "example": "B490B5EBF6F3CD402E515D22BCDA****" }, "CookieTimeout": { "title": "Cookie timeout", "description": "The cookie timeout. Unit: seconds. The value range is **1** to **86400**.\n\n> This parameter is effective when **StickySessionEnabled** is **true** and **StickySessionType** is **Insert**.\n\n\n\n", "type": "integer", "format": "int32", "example": "1000" }, "StickySessionEnabled": { "title": "Whether to enable session persistence", "description": "Whether to enable session persistence. Valid values:\n\n- **true**: Enabled.\n- **false**: Disabled.\n", "type": "boolean", "example": "false" }, "StickySessionType": { "title": "Session persistence type", "description": "The cookie handling method. Valid values:\n\n- **Insert**: Insert cookie.\nWhen a client visits for the first time, the load balancer inserts a cookie (that is, inserts SERVERID into the HTTP or HTTPS response message). The next time the client visits with this cookie, the SLB service will forward the request to the previously recorded backend server.\n- **Server**: Rewrite cookie.\nWhen the load balancer finds that the user has customized a cookie, it will rewrite the original cookie. The next time the client visits with the new cookie, the SLB service will forward the request to the previously recorded backend server.", "type": "string", "example": "Insert" } } }, "VpcId": { "title": "VPC ID where the server group is located", "description": "The VPC instance ID.", "type": "string", "example": "vpc-bp15zckdt37pq72zv****" }, "Tags": { "title": "List of tags", "description": "A list of tags bound to the server group.", "type": "array", "items": { "description": "A list of tags bound to the server group.", "type": "object", "properties": { "Key": { "title": "Tag key", "description": "The tag key.", "type": "string", "example": "Test" }, "Value": { "title": "Tag value", "description": "The tag value.", "type": "string", "example": "Test" } } } }, "ConfigManagedEnabled": { "title": "Whether to enable configuration management", "description": "Whether to enable configuration management. Valid values:\n- **true**: Enabled.\n- **false**: Disabled.", "type": "boolean", "example": "false" }, "UpstreamKeepaliveEnabled": { "title": "Whether to enable backend persistent connections", "description": "Whether to enable backend persistent connections. Valid values:\n- **true**: Enabled.\n- **false**: Disabled.", "type": "boolean", "example": "false" }, "Ipv6Enabled": { "title": "Whether to support IPv6", "description": "Whether to support IPv6. Valid values:\n- **true**: Supported.\n- **false**: Not supported.", "type": "boolean", "example": "false" }, "ServerCount": { "title": "Number of servers in the server group", "description": "The number of servers in the server group.", "type": "integer", "format": "int32", "example": "1" }, "ServiceName": { "title": "Server name", "description": "The service name.", "type": "string", "example": "test" }, "UchConfig": { "title": "URL consistent hash parameter configuration", "description": "The URL consistent hash parameter configuration.", "type": "object", "properties": { "Type": { "title": "Parameter type", "description": "The parameter type. Can only be QueryString.", "type": "string", "example": "QueryString" }, "Value": { "title": "Consistent hash parameter value", "description": "The consistent hash parameter value.", "type": "string", "example": "abc" } } }, "CreateTime": { "description": "The time the resource was created.", "type": "string", "example": "2022-07-02T02:49:05Z" }, "ConnectionDrainConfig": { "description": "Configuration related to connection draining.\n\nAfter enabling connection draining, when a backend server is removed or a health check fails, the load balancer allows existing connections to transmit normally for a certain period of time.\n>\n> - Basic Edition instances do not support enabling connection draining. Only Standard Edition and WAF-enabled Edition instances support it.\n> - Server type and IP type server groups support connection draining. Function Compute type does not.\n", "type": "object", "properties": { "ConnectionDrainEnabled": { "description": "Whether to enable connection draining.\n\n- **true**: Enabled\n- **false**: Disabled", "type": "boolean", "example": "false" }, "ConnectionDrainTimeout": { "description": "The connection draining timeout.", "type": "integer", "format": "int32", "example": "300" } } }, "SlowStartConfig": { "title": "Slow start configuration", "description": "Configuration related to slow start.\n\nAfter enabling slow start, newly added backend servers to the backend server group will be warmed up for a set period of time, and the number of requests forwarded to that server will increase linearly.\n>\n> - Basic Edition instances do not support enabling slow start. Only Standard Edition and WAF-enabled Edition instances support it.\n> - Server type and IP type server groups support configuring slow start. Function Compute type does not.\n> - Slow start can only be enabled when the backend scheduling algorithm is weighted round-robin.", "type": "object", "properties": { "SlowStartEnabled": { "description": "Whether to enable slow start.\n\n- **true**: Enabled\n- **false**: Disabled", "type": "boolean", "example": "false" }, "SlowStartDuration": { "description": "The duration of the slow start.", "type": "integer", "format": "int32", "example": "30" } } }, "CrossZoneEnabled": { "description": "Whether the server group enables cross-zone load balancing. Valid values:\n\n- **true**: Enabled (default)\n\n- **false**: Disabled", "type": "boolean", "example": "true" } } } }, "TotalCount": { "title": "Total records", "description": "The number of list entries.", "type": "integer", "format": "int32", "example": "1000" } } } } }, "eventInfo": { "enable": false, "eventNames": [] }, "responseDemo": "[{\"type\":\"json\",\"example\":\"{\\n \\\"MaxResults\\\": 50,\\n \\\"NextToken\\\": \\\"caeba0bbb2be03f8****\\\",\\n \\\"RequestId\\\": \\\"CEF72CEB-54B6-4AE8-B225-F876******\\\",\\n \\\"ServerGroups\\\": [\\n {\\n \\\"HealthCheckConfig\\\": {\\n \\\"HealthCheckConnectPort\\\": 80,\\n \\\"HealthCheckEnabled\\\": true,\\n \\\"HealthCheckHost\\\": \\\"www.example.com\\\",\\n \\\"HealthCheckCodes\\\": [\\n \\\"http_2xx\\\"\\n ],\\n \\\"HealthCheckHttpVersion\\\": \\\"HTTP1.1\\\",\\n \\\"HealthCheckInterval\\\": 5,\\n \\\"HealthCheckMethod\\\": \\\"HEAD\\\",\\n \\\"HealthCheckPath\\\": \\\"/test/index.html\\\",\\n \\\"HealthCheckProtocol\\\": \\\"HTTP\\\",\\n \\\"HealthCheckTimeout\\\": 3,\\n \\\"HealthyThreshold\\\": 4,\\n \\\"UnhealthyThreshold\\\": 4\\n },\\n \\\"Protocol\\\": \\\"HTTP\\\",\\n \\\"RelatedLoadBalancerIds\\\": [\\n \\\"alb-n5qw04uq8savfe****\\\"\\n ],\\n \\\"ResourceGroupId\\\": \\\"rg-atstuj3rtop****\\\",\\n \\\"Scheduler\\\": \\\"Wrr\\\",\\n \\\"ServerGroupId\\\": \\\"sgp-cige6j****\\\",\\n \\\"ServerGroupName\\\": \\\"Group3\\\",\\n \\\"ServerGroupStatus\\\": \\\"Available\\\",\\n \\\"ServerGroupType\\\": \\\"Instance\\\",\\n \\\"StickySessionConfig\\\": {\\n \\\"Cookie\\\": \\\"B490B5EBF6F3CD402E515D22BCDA****\\\",\\n \\\"CookieTimeout\\\": 1000,\\n \\\"StickySessionEnabled\\\": false,\\n \\\"StickySessionType\\\": \\\"Insert\\\"\\n },\\n \\\"VpcId\\\": \\\"vpc-bp15zckdt37pq72zv****\\\",\\n \\\"Tags\\\": [\\n {\\n \\\"Key\\\": \\\"Test\\\",\\n \\\"Value\\\": \\\"Test\\\"\\n }\\n ],\\n \\\"ConfigManagedEnabled\\\": false,\\n \\\"UpstreamKeepaliveEnabled\\\": false,\\n \\\"Ipv6Enabled\\\": false,\\n \\\"ServerCount\\\": 1,\\n \\\"ServiceName\\\": \\\"test\\\",\\n \\\"UchConfig\\\": {\\n \\\"Type\\\": \\\"QueryString\\\",\\n \\\"Value\\\": \\\"abc\\\"\\n },\\n \\\"CreateTime\\\": \\\"2022-07-02T02:49:05Z\\\",\\n \\\"ConnectionDrainConfig\\\": {\\n \\\"ConnectionDrainEnabled\\\": false,\\n \\\"ConnectionDrainTimeout\\\": 300\\n },\\n \\\"SlowStartConfig\\\": {\\n \\\"SlowStartEnabled\\\": false,\\n \\\"SlowStartDuration\\\": 30\\n },\\n \\\"CrossZoneEnabled\\\": true\\n }\\n ],\\n \\\"TotalCount\\\": 1000\\n}\",\"errorExample\":\"\"},{\"type\":\"xml\",\"example\":\"<ListServerGroupsResponse>\\n <MaxResults>50</MaxResults>\\n <NextToken>caeba0bbb2be03f8****</NextToken>\\n <RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BA984</RequestId>\\n <ServerGroups>\\n <HealthCheckConfig>\\n <HealthCheckConnectPort>80</HealthCheckConnectPort>\\n <HealthCheckEnabled>true</HealthCheckEnabled>\\n <HealthCheckHost>www.example.com</HealthCheckHost>\\n <HealthCheckCodes>http_2xx</HealthCheckCodes>\\n <HealthCheckHttpVersion>HTTP1.1</HealthCheckHttpVersion>\\n <HealthCheckInterval>5</HealthCheckInterval>\\n <HealthCheckMethod>HEAD</HealthCheckMethod>\\n <HealthCheckPath>/test/index.html</HealthCheckPath>\\n <HealthCheckProtocol>HTTP</HealthCheckProtocol>\\n <HealthCheckTimeout>3</HealthCheckTimeout>\\n <HealthyThreshold>4</HealthyThreshold>\\n <UnhealthyThreshold>4</UnhealthyThreshold>\\n </HealthCheckConfig>\\n <Protocol>HTTP</Protocol>\\n <ResourceGroupId>rg-atstuj3rtop****</ResourceGroupId>\\n <Scheduler>Wrr</Scheduler>\\n <ServerGroupId>sgp-cige6j****</ServerGroupId>\\n <ServerGroupName>Group3</ServerGroupName>\\n <ServerGroupStatus>Available</ServerGroupStatus>\\n <ServerGroupType>Instance</ServerGroupType>\\n <StickySessionConfig>\\n <Cookie>B490B5EBF6F3CD402E515D22BCDA****</Cookie>\\n <CookieTimeout>1000</CookieTimeout>\\n <StickySessionEnabled>false</StickySessionEnabled>\\n <StickySessionType>Insert</StickySessionType>\\n </StickySessionConfig>\\n <VpcId>vpc-bp15zckdt37pq72zv****</VpcId>\\n <Tags>\\n <Key>Test</Key>\\n <Value>Test</Value>\\n </Tags>\\n <ConfigManagedEnabled>false</ConfigManagedEnabled>\\n <UpstreamKeepaliveEnabled>false</UpstreamKeepaliveEnabled>\\n <Ipv6Enabled>false</Ipv6Enabled>\\n <ServerCount>1</ServerCount>\\n <ServiceName>test</ServiceName>\\n <CreateTime>2023-03-21T07:43:10Z</CreateTime>\\n </ServerGroups>\\n <TotalCount>1000</TotalCount>\\n</ListServerGroupsResponse>\",\"errorExample\":\"\"}]", "title": "Query server groups" }, "ListServerGroupServers": { "summary": "Queries the servers in a server group.", "methods": [ "get", "post" ], "schemes": [ "http", "https" ], "security": [ { "AK": [] } ], "operationType": "read", "deprecated": false, "systemTags": { "operationType": "get", "riskType": "none", "chargeType": "free", "abilityTreeCode": "167", "abilityTreeNodes": [ "FEATUREslbULKWF1" ] }, "parameters": [ { "name": "NextToken", "in": "query", "schema": { "title": "Paged query identifier", "description": "The token for the next query. Valid values:\n- If this is your first query or there are no more queries, you do not need to fill this in.\n- If there is a next query, set it to the value of **NextToken** from the previous API call.", "type": "string", "required": false, "example": "FFmyTO70tTpLG6I3FmYAXG****" } }, { "name": "MaxResults", "in": "query", "schema": { "title": "Query quantity", "description": "The maximum number of data records to read this time. The value range is **1** to **100**. If the parameter is empty, the default value is **20**.", "type": "integer", "format": "int32", "required": false, "maximum": "1000", "minimum": "1", "example": "50", "default": "20" } }, { "name": "ServerGroupId", "in": "query", "schema": { "title": "Server group ID", "description": "The server group ID.", "type": "string", "required": false, "example": "sgp-cb25e2i2vr******" } }, { "name": "ServerIds", "in": "query", "style": "flat", "schema": { "title": "List of server IDs", "description": "A list of server IDs.", "type": "array", "items": { "title": "Server ID", "description": "The server ID. A single call can display up to 40 servers.\n\n- When the server group is of type **Instance**, this parameter is the resource ID of ECS, ENI, or ECI.\n- When the server group is of type **Ip**, this parameter is the IP address.\n- When the server group is of type **Fc**, this parameter is the ARN identifier of Function Compute.\n\n", "type": "string", "required": false, "example": "i-bp1e0u8f10by57wl****" }, "required": false, "maxItems": 20, "minItems": 1 } }, { "name": "Tag", "in": "query", "style": "flat", "schema": { "title": "List of tags bound to the server group", "description": "A list of tags bound to the server group. A maximum of 10 tags are supported in the list of bound tags in a single request.", "type": "array", "items": { "title": "Tags bound to the server group", "description": "A list of tags bound to the server group. A maximum of 10 tags are supported in the list of bound tags in a single request.", "type": "object", "properties": { "Key": { "title": "Tag key", "description": "The tag key. A maximum of 10 tag keys are supported.\n\nIt can be up to 64 characters long and cannot start with `aliyun` or `acs:`. It cannot contain `http://` or `https://`.", "type": "string", "required": false, "example": "Test" }, "Value": { "title": "Tag value", "description": "The tag value. A maximum of 10 tag values are supported.\n\nIt can be up to 128 characters long and cannot start with `aliyun` or `acs:`. It cannot contain `http://` or `https://`.", "type": "string", "required": false, "example": "Test" } }, "required": false }, "required": false } } ], "responses": { "200": { "schema": { "title": "Schema of Response", "description": "The returned data structure.", "type": "object", "properties": { "MaxResults": { "title": "Number of records returned by this query", "description": "The maximum number of records returned for this request.", "type": "integer", "format": "int32", "example": "50" }, "NextToken": { "title": "Paged query identifier", "description": "The token for the next query. Valid values:\n- If **NextToken** is empty, there are no more queries.\n- If **NextToken** has a return value, this value indicates the token to start the next query.", "type": "string", "example": "caeba0bbb2be03f8****" }, "RequestId": { "title": "Id of the request", "description": "The request ID.", "type": "string", "example": "CEF72CEB-54B6-4AE8-B225-F876FF*****" }, "Servers": { "title": "List of backend servers", "description": "A list of servers.", "type": "array", "items": { "title": "Backend server", "description": "The structure of the backend server description.", "type": "object", "properties": { "Description": { "title": "Description information", "description": "The backend server description.", "type": "string", "example": "test" }, "Port": { "title": "Port", "description": "The port used by the backend server. The value range is **1** to **65535**.", "type": "integer", "format": "int32", "example": "80" }, "ServerId": { "title": "Server ID", "description": "The backend server ID.\n\n>When **ServerType** is **Fc**, **ServerId** is the ARN identifier of Function Compute.", "type": "string", "example": "i-bp1f9kdprbgy9uiu****" }, "ServerIp": { "title": "Server IP", "description": "The specified IP address.", "type": "string", "example": "192.168.XX.XX" }, "ServerType": { "title": "Backend server type", "description": "The backend server type.", "type": "string", "example": "Ecs" }, "Status": { "title": "Status", "description": "The added status of the backend server. Valid values:\n\n- **Adding**: Adding.\n- **Available**: Normal available state.\n- **Configuring**: Configuring.\n- **Removing**: Removing.", "type": "string", "example": "Available" }, "Weight": { "title": "Weight", "description": "The weight of the backend server. A server with a higher weight will be allocated more access requests.", "type": "integer", "format": "int32", "example": "100" }, "ServerGroupId": { "title": "Server group ID", "description": "The server group ID.", "type": "string", "example": "sgp-qy042e1jabmprh****" }, "RemoteIpEnabled": { "title": "Whether it is a remote IP", "description": "Whether to enable remote IP. Valid values:\n \n- **true**: Yes.\n- **false**: No.", "type": "boolean", "example": "true" } } } }, "TotalCount": { "title": "Total records", "description": "The total amount of data under the conditions of this request.", "type": "integer", "format": "int32", "example": "3" } } } } }, "errorCodes": { "403": [ { "errorCode": "Forbidden.ServerGroup", "errorMessage": "Authentication has failed for ServerGroup." } ] }, "responseDemo": "[{\"type\":\"json\",\"example\":\"{\\n \\\"MaxResults\\\": 50,\\n \\\"NextToken\\\": \\\"caeba0bbb2be03f8****\\\",\\n \\\"RequestId\\\": \\\"CEF72CEB-54B6-4AE8-B225-F876FF*****\\\",\\n \\\"Servers\\\": [\\n {\\n \\\"Description\\\": \\\"test\\\",\\n \\\"Port\\\": 80,\\n \\\"ServerId\\\": \\\"i-bp1f9kdprbgy9uiu****\\\",\\n \\\"ServerIp\\\": \\\"192.168.XX.XX\\\",\\n \\\"ServerType\\\": \\\"Ecs\\\",\\n \\\"Status\\\": \\\"Available\\\",\\n \\\"Weight\\\": 100,\\n \\\"ServerGroupId\\\": \\\"sgp-qy042e1jabmprh****\\\",\\n \\\"RemoteIpEnabled\\\": true\\n }\\n ],\\n \\\"TotalCount\\\": 3\\n}\",\"errorExample\":\"\"},{\"type\":\"xml\",\"example\":\"<ListServerGroupServersResponse>\\n <MaxResults>50</MaxResults>\\n <NextToken>caeba0bbb2be03f8****</NextToken>\\n <RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BA984</RequestId>\\n <Servers>\\n <Description>test</Description>\\n <Port>80</Port>\\n <ServerId>i-bp1f9kdprbgy9uiu****</ServerId>\\n <ServerIp>192.168.XX.XX</ServerIp>\\n <ServerType>Ecs</ServerType>\\n <Status>Available</Status>\\n <Weight>100</Weight>\\n <ServerGroupId>sgp-qy042e1jabmprh****</ServerGroupId>\\n <RemoteIpEnabled>true</RemoteIpEnabled>\\n </Servers>\\n <TotalCount>3</TotalCount>\\n</ListServerGroupServersResponse>\",\"errorExample\":\"\"}]", "title": "Query servers" }, "ListRules": { "summary": "Queries forwarding rules in a specified region.", "methods": [ "get", "post" ], "schemes": [ "http", "https" ], "security": [ { "AK": [] } ], "operationType": "read", "deprecated": false, "systemTags": { "operationType": "get", "riskType": "none", "chargeType": "free", "abilityTreeNodes": [ "FEATUREslbM7ALO6" ] }, "parameters": [ { "name": "NextToken", "in": "query", "schema": { "title": "Marks the current starting position for reading. Leave it empty to start from the beginning.", "description": "The token for the next query. Valid values:\n\n- If this is your first query or there are no more queries, you do not need to fill this in.\n\n- If there is a next query, set it to the value of **NextToken** from the previous API call.", "type": "string", "required": false, "example": "FFmyTO70tTpLG6I3FmYAXGKPd****" } }, { "name": "MaxResults", "in": "query", "schema": { "title": "The maximum number of data records to read this time. This parameter is optional. The value is 1-100. If the user does not pass a value, the default is 20.", "description": "The maximum number of data records to read.\n\nThe value is **1 to 100**.\n\nThe default value is **20**, which means the user did not pass in data.\n\n> This parameter is optional.", "type": "integer", "format": "int32", "required": false, "example": "20" } }, { "name": "RuleIds", "in": "query", "style": "flat", "schema": { "title": "List of forwarding rule IDs, N supports a maximum of 20", "description": "A list of forwarding rules. A maximum of 20 forwarding rules can be queried at a time.", "type": "array", "items": { "description": "The forwarding rule ID.", "type": "string", "required": false, "example": "rule-sada******" }, "required": false, "maxItems": 20, "minItems": 1 } }, { "name": "ListenerIds", "in": "query", "style": "flat", "schema": { "title": "List of listener IDs", "description": "A list of listener IDs. A maximum of 20 listeners can be queried at a time.", "type": "array", "items": { "description": "The listener ID.", "type": "string", "required": false, "example": "lsn-i35udpz3pxsmnf****" }, "required": false, "maxItems": 20 } }, { "name": "LoadBalancerIds", "in": "query", "style": "flat", "schema": { "title": "List of instance IDs", "description": "A list of load balancer instance IDs. A maximum of 20 instances can be queried at a time.", "type": "array", "items": { "description": "The load balancer instance ID.", "type": "string", "required": false, "example": "alb-x30o38azsuj0sx****" }, "required": false, "maxItems": 20 } }, { "name": "Direction", "in": "query", "schema": { "title": "Forwarding rule direction", "description": "The direction of the forwarding rule. Valid values:\n\n- **Request** (default): Request type. It matches conditions on messages sent from the client to ALB and performs corresponding actions.\n\n- **Response**: Response type. It matches conditions on messages returned from the backend server group to ALB and performs corresponding actions.\n\n>Basic Edition ALB instances do not support the Response type.", "type": "string", "required": false, "example": "Request" } }, { "name": "Tag", "in": "query", "style": "flat", "schema": { "description": "The tags.", "type": "array", "items": { "description": "The structure of a tag.", "type": "object", "properties": { "Key": { "description": "The tag key. It can be up to 128 characters long and cannot start with aliyun or acs:. It cannot contain http:// or https://.", "type": "string", "required": false, "example": "env" }, "Value": { "description": "The tag value. It can be up to 128 characters long and cannot start with aliyun or acs:. It cannot contain http:// or https://.", "type": "string", "required": false, "example": "product" } }, "required": false }, "required": false, "maxItems": 20 } } ], "responses": { "200": { "schema": { "title": "Schema of Response", "description": "The forwarding rule.", "type": "object", "properties": { "MaxResults": { "title": "The maximum number of records returned for this request.", "description": "The maximum number of records returned for this request.", "type": "integer", "format": "int32", "example": "50" }, "NextToken": { "title": "Indicates the position where the current call returns to read. Empty means the data has been read.", "description": "The token for the next query. Valid values:\n- If **NextToken** is empty, there are no more queries.\n- If **NextToken** has a return value, this value indicates the token to start the next query.", "type": "string", "example": "FFmyTO70tTpLG6I3FmYAXGKPd****" }, "RequestId": { "title": "Id of the request", "description": "The request ID.", "type": "string", "example": "CEF72CEB-54B6-4AE8-B225-F876F******" }, "Rules": { "title": "List of forwarding rules", "description": "A list of forwarding rules.", "type": "array", "items": { "description": "The structure of a forwarding rule.", "type": "object", "properties": { "ListenerId": { "title": "Listener ID", "description": "The ID of the listener to which the forwarding rule belongs.", "type": "string", "example": "lsn-i35udpz3pxsmnf****" }, "LoadBalancerId": { "title": "Instance ID", "description": "The ID of the load balancer instance to which the forwarding rule belongs.", "type": "string", "example": "alb-x30o38azsuj0sx****" }, "Priority": { "title": "Forwarding rule priority", "description": "The priority of the rule. The value is **1 to 10000**. A smaller value indicates a higher priority.\n\n> The rule priority must be unique within the same listener.", "type": "integer", "format": "int32", "example": "1" }, "RuleActions": { "title": "Forwarding rule actions", "description": "A list of forwarding rule actions.", "type": "array", "items": { "description": "The structure of a forwarding rule action.", "type": "object", "properties": { "FixedResponseConfig": { "title": "Fixed content response action configuration", "description": "The fixed response content configuration.", "type": "object", "properties": { "Content": { "title": "Content", "description": "The fixed content to return. A maximum of 1 KB bytes, supporting only ASCII characters.", "type": "string", "example": "dssacav" }, "ContentType": { "title": "Content type", "description": "The format of the returned fixed content.\n\nValid values: **text/plain**, **text/css**, **text/html**, **application/javascript**, or **application/json**.", "type": "string", "example": "text/plain" }, "HttpCode": { "title": "HTTP response code", "description": "The HTTP response code to return. Only supports **HTTP_2xx**, **HTTP_4xx**, and **HTTP_5xx** numeric strings, where **x** is any digit.", "type": "string", "example": "HTTP_2xx" } } }, "ForwardGroupConfig": { "title": "Forwarding group action configuration", "description": "The forwarding group configuration.", "type": "object", "properties": { "ServerGroupTuples": { "title": "List of destination server groups to forward to", "description": "A list of destination server groups to forward to.", "type": "array", "items": { "description": "A list of destination server groups to forward to.", "type": "object", "properties": { "ServerGroupId": { "title": "Server group identity", "description": "The ID of the destination server group to forward to.", "type": "string", "example": "sgp-atstuj3rtoptyui****" }, "Weight": { "title": "When the number of ServerGroupTuple.N is greater than 1, the weight of each server group can be configured", "description": "The weight. The value range is **0** to **100**.", "type": "integer", "format": "int32", "example": "2" } } } }, "ServerGroupStickySession": { "title": "Session persistence configuration between server groups", "description": "Session persistence configuration between server groups", "type": "object", "properties": { "Enabled": { "title": "When the number of ServerGroupTuple.N is greater than 1, it is optional whether to enable session persistence between server groups", "description": "When the number of ServerGroupTuple.N is greater than 1, it is optional whether to enable session persistence between server groups", "type": "boolean" }, "Timeout": { "title": "When Enabled=True, the session persistence timeout can be configured", "description": "When Enabled=True, the session persistence timeout can be configured", "type": "integer", "format": "int32", "example": "100" } } } } }, "InsertHeaderConfig": { "title": "Insert header action configuration", "description": "The write header field configuration.", "type": "object", "properties": { "Key": { "title": "HTTP header", "description": "The name of the header field to insert. The length is 1 to 40 characters, supporting uppercase and lowercase letters a-z, numbers, underscores (_), and hyphens (-). The header field name cannot be used repeatedly in `InsertHeader`.\n\n> Users are not allowed to use **Cookie** and **Host** in the header field name.", "type": "string", "example": "key" }, "Value": { "title": "HTTP header content", "description": "The content of the header field to insert.\n\n- When **ValueType** is **SystemDefined**, the values are as follows:\n - **ClientSrcPort**: Client port.\n - **ClientSrcIp**: Client IP address.\n - **Protocol**: Client request protocol (HTTP or HTTPS).\n - **SLBId**: Application Load Balancer instance ID.\n - **SLBPort**: Application Load Balancer instance listener port.\n- When **ValueType** is **UserDefined**: You can customize the header field content. The length is limited to 1 to 128 characters, supporting wildcards asterisk (*) and question mark (?), and printable characters within the ASCII value range `ch >= 32 && ch < 127`. The beginning and end cannot be spaces.\n- When **ValueType** is **ReferenceHeader**: You can reference a field in the request header. The length is limited to 1 to 128 characters, supporting lowercase letters a-z, numbers, hyphens (-), and underscores (_).", "type": "string", "example": "ClientSrcPort" }, "ValueType": { "title": "Value type", "description": "The header field content type. Valid values:\n\n- **UserDefined**: User-specified.\n\n- **ReferenceHeader**: References a field in the user request header.\n\n- **SystemDefined**: System-defined.", "type": "string", "example": "SystemDefined" } } }, "Order": { "title": "Priority", "description": "The execution order of the forwarding rule actions. The value is **1 to 50000**. Actions are executed in ascending order of value. The value cannot be empty and cannot be repeated.", "type": "integer", "format": "int32", "example": "1" }, "RedirectConfig": { "title": "Redirection action configuration", "description": "The redirection configuration.", "type": "object", "properties": { "Host": { "title": "The host address to jump to", "description": "The host address to jump to. Valid values:\n- **${host}** (default): This value cannot be used in conjunction with other characters.\n- Other values, with the following character set and format restrictions:\n - The hostname length is 3 to 128 characters, supporting lowercase letters a-z, numbers, hyphens (-), periods (.), and wildcards asterisk (*) and question mark (?).\n - The hostname must contain at least one period (.), and the period (.) cannot appear at the beginning or end.\n - The rightmost domain label can only contain letters and wildcards, and cannot contain numbers or hyphens (-).\n - Hyphens (-) cannot appear at the beginning or end of other domain labels.\n - Wildcards asterisk (*) and question mark (?) can appear anywhere in the domain label.", "type": "string", "example": "www.example.com" }, "HttpCode": { "title": "Jump method", "description": "The jump method. The value is **301**, **302**, **303**, **307**, or **308**.", "type": "string", "example": "301" }, "Path": { "title": "The path to jump to", "description": "The path to jump to. Valid values:\n- **${path}** (default): Can reference **${host}**, **${protocol}**, and **${port}**, consisting of **${host}**, **${protocol}**, and **${port}**. Each variable can appear at most once. These variables can be used simultaneously or concatenated with strings within the allowed value range listed below.\n- Other values, with the following character set and format restrictions:\n - The length is 1 to 128 characters.\n - It must start with a forward slash (/), and supports letters, numbers, and special characters `$-_.+/&~@:`. It does not support `“%#;!()[]^,”`. It also supports wildcards asterisk (*) and question mark (?).", "type": "string", "example": "/test" }, "Port": { "title": "The port to jump to", "description": "The port to jump to. Valid values:\n- **${port}** (default): This value cannot be used with other characters at the same time.\n- Other values: **1 to 63335**.", "type": "string", "example": "10" }, "Protocol": { "title": "The protocol to jump to", "description": "The protocol to jump to. Valid values:\n- **${protocol}** (default): This value cannot be used in conjunction with other characters.\n- **HTTP** or **HTTPS**.\n\n \n> HTTPS listeners only support jumping to the HTTPS protocol.", "type": "string", "example": "HTTP" }, "Query": { "title": "The query string to jump to", "description": "The query string to jump to. The length is 1 to 128 characters, supporting lowercase letters and visible characters. It does not support `#[]{}\\|<>&`.\n", "type": "string", "example": "quert" } } }, "RemoveHeaderConfig": { "title": "Remove HTTP header", "description": "The remove HTTP header configuration.", "type": "object", "properties": { "Key": { "title": "HTTP header", "description": "The name of the header field to remove. The length is 1 to 40 characters, supporting uppercase and lowercase letters a-z, numbers, underscores (_), and hyphens (-). The header field name cannot be used repeatedly in RemoveHeader.\n\n* Request direction (Direction is Request): The header name cannot be set to the following fields (case-insensitive): `slb-id`, `slb-ip`, `x-forwarded-for`, `x-forwarded-proto`, `x-forwarded-eip`, `x-forwarded-port`, `x-forwarded-client-srcport`, `connection`, `upgrade`, `content-length`, `transfer-encoding`, `keep-alive`, `te`, `host`, `cookie`, `remoteip`, `authority`.\n* Response direction (Direction is Response): The header name cannot be set to the following fields (case-insensitive): `connection`, `upgrade`, `content-length`, `transfer-encoding`.", "type": "string", "example": "key" } } }, "RewriteConfig": { "title": "Internal redirection action configuration", "description": "The rewrite configuration.", "type": "object", "properties": { "Host": { "title": "Hostname", "description": "The host address to jump to. Valid values:\n- **${host}** (default): This value cannot be used in conjunction with other characters.\n- Other values, with the following character set and format restrictions:\n - The hostname length is 3 to 128 characters, supporting lowercase letters a-z, numbers, hyphens (-), periods (.), and wildcards asterisk (*) and question mark (?).\n - The hostname must contain at least one period (.), and the period (.) cannot appear at the beginning or end.\n - The rightmost domain label can only contain letters and wildcards, and cannot contain numbers or hyphens (-).\n - Hyphens (-) cannot appear at the beginning or end of other domain labels.\n - Wildcards asterisk (*) and question mark (?) can appear anywhere in the domain label.", "type": "string", "example": "www.example.com" }, "Path": { "title": "Path", "description": "The destination path for internal jumps. The length is 1 to 128 characters, starting with a forward slash (/), and supports letters, numbers, asterisk (*), question mark (?), and `$-_.+/&~@:`. It does not support `“%#;!()[]^,”`.", "type": "string", "example": "/tsdf" }, "Query": { "title": "Query", "description": "The query string for internal jumps. The length is 1 to 128 characters, supporting lowercase letters and visible characters. It does not support `#[]{}\\|<>&`.\n\n", "type": "string", "example": "quedsa" } } }, "TrafficMirrorConfig": { "title": "The configuration corresponding to the TrafficMirror action, which is required and valid when type is TrafficMirror", "description": "Traffic mirroring.", "type": "object", "properties": { "TargetType": { "title": "The destination of traffic mirroring, which can be a server group", "description": "The destination of traffic mirroring, which can be a server group", "type": "string", "example": "ForwardGroupMirror" }, "MirrorGroupConfig": { "title": "Required when TargetType is a server group, the target server group", "description": "Traffic mirroring to a server group.", "type": "object", "properties": { "ServerGroupTuples": { "description": "Traffic mirroring to a server group.", "type": "array", "items": { "type": "object", "properties": { "ServerGroupId": { "description": "The server group ID.", "type": "string", "example": "sgp-00mkgijak0w4qgz9****" }, "Weight": { "description": "The weight. The value range is **0** to **100**.", "type": "integer", "format": "int32", "example": "2" } } } } } } } }, "TrafficLimitConfig": { "description": "Traffic rate limiting.", "type": "object", "properties": { "QPS": { "description": "The number of requests per second. The value range is **1** to **100000**.", "type": "integer", "format": "int32", "example": "4" }, "PerIpQps": { "description": "The number of requests per second per IP. The value range is **1 to 100000**.\n\n> If the **QPS** parameter is also configured, the value of the **PerIpQps** parameter must be less than the value of the **QPS** parameter.", "type": "integer", "format": "int32", "example": "80" } } }, "Type": { "title": "Forwarding rule action type", "description": "The action type. Valid values:\n\n- **ForwardGroup**: Forwards to multiple virtual server groups.\n\n- **Redirect**: Redirects.\n\n- **FixedResponse**: Returns fixed content.\n\n- **Rewrite**: Rewrites.\n\n- **InsertHeader**: Writes a header field.\n\n- **RemoveHeaderConfig**: Deletes a header field.\n\n- **TrafficLimitConfig**: Traffic rate limiting.\n\n- **TrafficMirrorConfig**: Traffic mirroring.\n\n- **CorsConfig**: Cross-domain.", "type": "string", "example": "ForwardGroup" }, "CorsConfig": { "title": "Cross-domain", "description": "Cross-domain.", "type": "object", "properties": { "AllowOrigin": { "title": "Allowed access sources", "description": "The allowed access sources.", "type": "array", "items": { "description": "The allowed access sources. It can be configured as `*` or as one or more value values. The value of value cannot be `*`.\n\n- A single value must start with `http://` or `https://`, followed by a correct domain name or a first-level wildcard domain name (for example, `*.test.abc.example.com`).\n- A single value can be without a port, or a port can be specified. The port range is **1** to **65535**.", "type": "string", "example": "http://test.com" } }, "AllowMethods": { "title": "Select the allowed HTTP methods for cross-domain access", "description": "Select the allowed HTTP methods for cross-domain access.", "type": "array", "items": { "description": "Select the allowed HTTP methods for cross-domain access. Valid values:\n- **GET**.\n- **POST**.\n- **PUT**.\n- **DELETE**.\n- **HEAD**.\n- **OPTIONS**.\n- **PATCH**.", "type": "string", "example": "GET" } }, "AllowHeaders": { "title": "List of allowed cross-domain headers", "description": "A list of allowed cross-domain headers.", "type": "array", "items": { "description": "A list of allowed cross-domain headers. It can be configured as `*` or as one or more value values, separated by commas (,). A single value can only contain uppercase and lowercase letters, numbers, and underscores (_) and hyphens (-) that are not at the beginning or end. The maximum length is 32 characters.", "type": "string", "example": "test_123" } }, "ExposeHeaders": { "title": "List of allowed exposed headers", "description": "A list of allowed exposed headers.", "type": "array", "items": { "description": "A list of allowed cross-domain headers. It can be configured as `*` or as one or more value values, separated by commas (,). A single value can only contain uppercase and lowercase letters, numbers, and underscores (_) and hyphens (-) that are not at the beginning or end. The maximum length is 32 characters.", "type": "string", "example": "test_123" } }, "AllowCredentials": { "title": "Whether to allow carrying credential information", "description": "Whether to allow carrying credential information. Valid values:\n\n- **on**: Yes.\n- **off**: No.", "type": "string", "example": "on" }, "MaxAge": { "title": "The maximum cache time of the preflight request in the browser", "description": "The maximum cache time of the preflight request in the browser, in seconds.\n\nThe value range is **-1** to **172800**.", "type": "integer", "format": "int64", "example": "1000" } } } } } }, "RuleConditions": { "title": "Forwarding rule conditions", "description": "A list of forwarding rule conditions.", "type": "array", "items": { "description": "The structure of a forwarding rule condition.", "type": "object", "properties": { "CookieConfig": { "title": "Cookie condition configuration", "description": "The cookie configuration.", "type": "object", "properties": { "Values": { "title": "List of cookie key-value pairs", "description": "The cookie value.", "type": "array", "items": { "description": "The cookie value.", "type": "object", "properties": { "Key": { "title": "Cookie condition key", "description": "The cookie key. The length is 1 to 100 characters, supporting lowercase letters, visible characters, asterisk (*), and question mark (?). It does not support spaces and `#[]{}\\|<>&`.", "type": "string", "example": "test" }, "Value": { "title": "Cookie condition value", "description": "The cookie value. The length is 1 to 128 characters, supporting lowercase letters, visible characters, asterisk (*), and question mark (?). It does not support spaces and `#[]{}\\|<>&`.", "type": "string", "example": "test" } } } } } }, "HeaderConfig": { "title": "HTTP header condition configuration", "description": "The header field configuration.", "type": "object", "properties": { "Key": { "title": "HTTP header key", "description": "The header field key. The length is 1 to 40 characters. It supports letters a-z, numbers, hyphens (-), and underscores (_). It does not support Cookie and Host.", "type": "string", "example": "Port" }, "Values": { "title": "List of HTTP header values", "description": "The header field value.", "type": "array", "items": { "description": "The header field value. The length is 1 to 128 characters. It supports printable characters within the ASCII value range `ch >= 32 && ch < 127`, lowercase letters, asterisk (*), and question mark (?). The beginning and end cannot be spaces.", "type": "string", "example": "5006" } } } }, "HostConfig": { "title": "Hostname condition configuration", "description": "The host configuration.", "type": "object", "properties": { "Values": { "title": "List of hostnames", "description": "The hostname.", "type": "array", "items": { "description": "The hostname. Naming rules:\n\n- The domain name length is 3 to 128 characters, supporting lowercase letters a-z, numbers, hyphens (-), periods (.), asterisk (*), and question mark (?).\n\n- The domain name must contain at least one period (.), and the period (.) cannot appear at the beginning or end.\n\n- The rightmost domain label can only contain letters, asterisk (*), and question mark (?), and cannot contain numbers or hyphens (-).\n\n- Hyphens (-) cannot appear at the beginning or end of other domain labels. Asterisk (*) and question mark (?) can appear anywhere in the domain label.", "type": "string", "example": "www.example.com" } } } }, "MethodConfig": { "title": "HTTP request method condition configuration", "description": "The request method configuration.", "type": "object", "properties": { "Values": { "title": "List of HTTP request methods", "description": "The request method.", "type": "array", "items": { "description": "The request method.\n\nValid values: **HEAD**, **GET**, **POST**, **OPTIONS**, **PUT**, **PATCH**, or **DELETE**.", "type": "string", "example": "PUT" } } } }, "PathConfig": { "title": "Path condition configuration", "description": "The forwarding path configuration.", "type": "object", "properties": { "Values": { "title": "List of path conditions", "description": "The forwarding path.", "type": "array", "items": { "description": "The forwarding path. The length is 1 to 128 characters, starting with a forward slash (/), and supports letters, numbers, asterisk (*), question mark (?), and `$-_.+/&~@:`. It does not support `“%#;!()[]^,”`.", "type": "string", "example": "/test" } } } }, "QueryStringConfig": { "title": "Query string condition configuration", "description": "The query string configuration.", "type": "object", "properties": { "Values": { "title": "List of query string condition key-value pairs", "description": "The query string.", "type": "array", "items": { "description": "The query string.", "type": "object", "properties": { "Key": { "title": "Query string condition key", "description": "The query string key. The length is 1 to 100 characters, supporting lowercase letters, visible characters, asterisk (*), and question mark (?). It does not support spaces and `#[]{}\\|<>&`.", "type": "string", "example": "test" }, "Value": { "title": "Query string condition value", "description": "The query string value. The length is 1 to 128 characters, supporting lowercase letters, visible characters, asterisk (*), and question mark (?). It does not support spaces and `#[]{}\\|<>&`.", "type": "string", "example": "test" } } } } } }, "SourceIpConfig": { "title": "Source IP service traffic matching", "description": "Matching based on source IP service traffic.", "type": "object", "properties": { "Values": { "title": "List of source IPs to match", "description": "A list of source IPs to match.", "type": "array", "items": { "description": "Add one or more IP addresses or IP address ranges.\n\nA single forwarding rule supports adding up to 5 source IPs.", "type": "string", "example": "192.168.XX.XX/32" } } } }, "ResponseStatusCodeConfig": { "title": "Return status code condition", "description": "The response status code configuration.", "type": "object", "properties": { "Values": { "title": "List of return status code conditions", "description": "A list of response status codes.", "type": "array", "items": { "description": "The response status code.", "type": "string", "example": "200" } } } }, "ResponseHeaderConfig": { "title": "Return HTTP header", "description": "The response HTTP header configuration.", "type": "object", "properties": { "Key": { "title": "Return HTTP header key", "description": "The response HTTP header key. The length is 1 to 40 characters. It supports letters a-z, numbers, hyphens (-), and underscores (_). It does not support Cookie and Host.", "type": "string", "example": "key" }, "Values": { "title": "Return HTTP header value", "description": "A list of response HTTP header values.", "type": "array", "items": { "description": "The response HTTP header value. The length is 1 to 128 characters.", "type": "string", "example": "value" } } } }, "Type": { "title": "Condition type", "description": "The forwarding rule type. Valid values:\n\n- **Host**: Host.\n\n- **Path**: Path.\n\n- **Header**: HTTP header field.\n\n- **QueryString**: Query string.\n\n- **Method**: Request method.\n\n- **Cookie**: Cookie.\n\n- **SourceIp**: Source IP.", "type": "string", "example": "Host" } }, "required": true } }, "RuleId": { "title": "Forwarding rule identity", "description": "The forwarding rule ID.", "type": "string", "example": "rule-bpn0kn908w4nbw****" }, "RuleName": { "title": "Forwarding rule name", "description": "The forwarding rule name. The length is 2 to 128 English or Chinese characters. It must start with an uppercase or lowercase letter or a Chinese character and can contain numbers, periods (.), underscores (_), and hyphens (-).", "type": "string", "example": "rule-instance-test" }, "RuleStatus": { "title": "Forwarding rule status", "description": "The forwarding rule status. Valid values:\n\n- **Provisioning**: Creating.\n\n- **Configuring**: Modifying.\n\n- **Available**: Running.", "type": "string", "example": "Available" }, "Direction": { "title": "Forwarding rule direction", "description": "The direction of the forwarding rule. Valid values:\n\n* Request (default): Request type. It matches conditions on messages sent from the client to ALB and performs corresponding actions.\n\n* Response: Response type. It matches conditions on messages returned from the backend server group to ALB and performs corresponding actions.\n\n> Basic Edition ALB instances do not support the Response type.", "type": "string", "example": "Request" }, "Tags": { "description": "The tags.", "type": "array", "items": { "description": "The structure of a tag.", "type": "object", "properties": { "Key": { "description": "The tag key. It can be up to 128 characters long and cannot start with aliyun or acs:. It cannot contain http:// or https://.", "type": "string", "example": "env" }, "Value": { "description": "The tag value. It can be up to 128 characters long and cannot start with aliyun or acs:. It cannot contain http:// or https://.", "type": "string", "example": "product" } } } } } } }, "TotalCount": { "title": "The total amount of data under the conditions of this request.", "description": "The total number of data records returned under the conditions of this request.", "type": "integer", "format": "int32", "example": "1000" } } } } }, "errorCodes": { "403": [ { "errorCode": "Forbidden.LoadBalancer", "errorMessage": "Authentication is failed for %s." } ] }, "responseDemo": "[{\"type\":\"json\",\"example\":\"{\\n \\\"MaxResults\\\": 50,\\n \\\"NextToken\\\": \\\"FFmyTO70tTpLG6I3FmYAXGKPd****\\\",\\n \\\"RequestId\\\": \\\"CEF72CEB-54B6-4AE8-B225-F876F******\\\",\\n \\\"Rules\\\": [\\n {\\n \\\"Listener\\\": \\\"lsn-i35udpz3pxsmnf****\\\",\\n \\\"LoadBalancerId\\\": \\\"alb-x30o38azsuj0sx****\\\",\\n \\\"Priority\\\": 1,\\n \\\"RuleActions\\\": [\\n {\\n \\\"FixedResponseConfig\\\": {\\n \\\"Content\\\": \\\"dssacav\\\",\\n \\\"ContentType\\\": \\\"text/plain\\\",\\n \\\"HttpCode\\\": \\\"HTTP_2xx\\\"\\n },\\n \\\"ForwardGroupConfig\\\": {\\n \\\"ServerGroupTuples\\\": [\\n {\\n \\\"ServerGroupId\\\": \\\"sgp-atstuj3rtoptyui****\\\",\\n \\\"Weight\\\": 2\\n }\\n ],\\n \\\"ServerGroupStickySession\\\": {\\n \\\"Enabled\\\": true,\\n \\\"Timeout\\\": 100\\n }\\n },\\n \\\"InsertHeaderConfig\\\": {\\n \\\"Key\\\": \\\"key\\\",\\n \\\"Value\\\": \\\"ClientSrcPort\\\",\\n \\\"ValueType\\\": \\\"SystemDefined\\\"\\n },\\n \\\"Order\\\": 1,\\n \\\"RedirectConfig\\\": {\\n \\\"Host\\\": \\\"www.example.com\\\",\\n \\\"HttpCode\\\": \\\"301\\\",\\n \\\"Path\\\": \\\"/test\\\",\\n \\\"Port\\\": \\\"10\\\",\\n \\\"Protocol\\\": \\\"HTTP\\\",\\n \\\"Query\\\": \\\"quert\\\"\\n },\\n \\\"RemoveHeaderConfig\\\": {\\n \\\"Key\\\": \\\"key\\\"\\n },\\n \\\"RewriteConfig\\\": {\\n \\\"Host\\\": \\\"www.example.com\\\",\\n \\\"Path\\\": \\\"/tsdf\\\",\\n \\\"Query\\\": \\\"quedsa\\\"\\n },\\n \\\"TrafficMirrorConfig\\\": {\\n \\\"TargetType\\\": \\\"ForwardGroupMirror\\\",\\n \\\"MirrorGroupConfig\\\": {\\n \\\"ServerGroupTuples\\\": [\\n {\\n \\\"ServerGroupId\\\": \\\"sgp-00mkgijak0w4qgz9****\\\",\\n \\\"Weight\\\": 2\\n }\\n ]\\n }\\n },\\n \\\"TrafficLimitConfig\\\": {\\n \\\"QPS\\\": 4,\\n \\\"PerIpQps\\\": 80\\n },\\n \\\"Type\\\": \\\"ForwardGroup\\\",\\n \\\"CorsConfig\\\": {\\n \\\"AllowOrigin\\\": [\\n \\\"http://test.com\\\"\\n ],\\n \\\"AllowMethods\\\": [\\n \\\"GET\\\"\\n ],\\n \\\"AllowHeaders\\\": [\\n \\\"test_123\\\"\\n ],\\n \\\"ExposeHeaders\\\": [\\n \\\"test_123\\\"\\n ],\\n \\\"AllowCredentials\\\": \\\"on\\\",\\n \\\"MaxAge\\\": 1000\\n }\\n }\\n ],\\n \\\"RuleConditions\\\": [\\n {\\n \\\"CookieConfig\\\": {\\n \\\"Values\\\": [\\n {\\n \\\"Key\\\": \\\"test\\\",\\n \\\"Value\\\": \\\"test\\\"\\n }\\n ]\\n },\\n \\\"HeaderConfig\\\": {\\n \\\"Key\\\": \\\"Port\\\",\\n \\\"Values\\\": [\\n \\\"5006\\\"\\n ]\\n },\\n \\\"HostConfig\\\": {\\n \\\"Values\\\": [\\n \\\"www.example.com\\\"\\n ]\\n },\\n \\\"MethodConfig\\\": {\\n \\\"Values\\\": [\\n \\\"PUT\\\"\\n ]\\n },\\n \\\"PathConfig\\\": {\\n \\\"Values\\\": [\\n \\\"/test\\\"\\n ]\\n },\\n \\\"QueryStringConfig\\\": {\\n \\\"Values\\\": [\\n {\\n \\\"Key\\\": \\\"test\\\",\\n \\\"Value\\\": \\\"test\\\"\\n }\\n ]\\n },\\n \\\"SourceIpConfig\\\": {\\n \\\"Values\\\": [\\n \\\"192.168.XX.XX/32\\\"\\n ]\\n },\\n \\\"ResponseStatusCodeConfig\\\": {\\n \\\"Values\\\": [\\n \\\"200\\\"\\n ]\\n },\\n \\\"ResponseHeaderConfig\\\": {\\n \\\"Key\\\": \\\"key\\\",\\n \\\"Values\\\": [\\n \\\"value\\\"\\n ]\\n },\\n \\\"Type\\\": \\\"Host\\\"\\n }\\n ],\\n \\\"RuleId\\\": \\\"rule-bpn0kn908w4nbw****\\\",\\n \\\"RuleName\\\": \\\"rule-instance-test\\\",\\n \\\"RuleStatus\\\": \\\"Available\\\",\\n \\\"Direction\\\": \\\"Request\\\",\\n \\\"Tags\\\": [\\n {\\n \\\"Key\\\": \\\"env\\\",\\n \\\"Value\\\": \\\"product\\\"\\n }\\n ]\\n }\\n ],\\n \\\"TotalCount\\\": 1000\\n}\",\"errorExample\":\"\"},{\"type\":\"xml\",\"example\":\"<ListRulesResponse>\\n <MaxResults>50</MaxResults>\\n <NextToken>FFmyTO70tTpLG6I3FmYAXGKPd****</NextToken>\\n <RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BA984</RequestId>\\n <Rules>\\n <ListenerId>lsn-i35udpz3pxsmnf****</ListenerId>\\n <LoadBalancerId>alb-x30o38azsuj0sx****</LoadBalancerId>\\n <Priority>1</Priority>\\n <RuleActions>\\n <FixedResponseConfig>\\n <Content>dssacav</Content>\\n <ContentType>text/plain</ContentType>\\n <HttpCode>HTTP_2xx</HttpCode>\\n </FixedResponseConfig>\\n <ForwardGroupConfig>\\n <ServerGroupTuples>\\n <ServerGroupId>sg-atstuj3rtoptyui****</ServerGroupId>\\n <Weight>2</Weight>\\n </ServerGroupTuples>\\n </ForwardGroupConfig>\\n <InsertHeaderConfig>\\n <Key>key</Key>\\n <Value>ClientSrcPort</Value>\\n <ValueType>SystemDefined</ValueType>\\n </InsertHeaderConfig>\\n <Order>1</Order>\\n <RedirectConfig>\\n <Host>www.example.com</Host>\\n <HttpCode>301</HttpCode>\\n <Path>/test</Path>\\n <Port>10</Port>\\n <Protocol>HTTP</Protocol>\\n <Query>quert</Query>\\n </RedirectConfig>\\n <RewriteConfig>\\n <Host>www.example.com</Host>\\n <Path>/tsdf</Path>\\n <Query>quedsa</Query>\\n </RewriteConfig>\\n <TrafficMirrorConfig>\\n <MirrorGroupConfig>\\n <ServerGroupTuples>\\n <ServerGroupId>srg-00mkgijak0w4qgz9****</ServerGroupId>\\n <Weight>2</Weight>\\n </ServerGroupTuples>\\n </MirrorGroupConfig>\\n </TrafficMirrorConfig>\\n <TrafficLimitConfig>\\n <QPS>4</QPS>\\n <PerIpQps>80</PerIpQps>\\n </TrafficLimitConfig>\\n <Type>ForwardGroup</Type>\\n <CorsConfig>\\n <AllowOrigin>http://test.com</AllowOrigin>\\n <AllowMethods>GET</AllowMethods>\\n <AllowHeaders>test_123</AllowHeaders>\\n <ExposeHeaders>test_123</ExposeHeaders>\\n <AllowCredentials>on</AllowCredentials>\\n <MaxAge>1000</MaxAge>\\n </CorsConfig>\\n </RuleActions>\\n <RuleConditions>\\n <CookieConfig>\\n <Values>\\n <Key>test</Key>\\n <Value>test</Value>\\n </Values>\\n </CookieConfig>\\n <HeaderConfig>\\n <Key>Port</Key>\\n <Values>5006</Values>\\n </HeaderConfig>\\n <HostConfig>\\n <Values>www.example.com</Values>\\n </HostConfig>\\n <MethodConfig>\\n <Values>PUT</Values>\\n </MethodConfig>\\n <PathConfig>\\n <Values>/test</Values>\\n </PathConfig>\\n <QueryStringConfig>\\n <Values>\\n <Key>test</Key>\\n <Value>test</Value>\\n </Values>\\n </QueryStringConfig>\\n <SourceIpConfig>\\n <Values>192.168.XX.XX/32</Values>\\n </SourceIpConfig>\\n <Type>Host</Type>\\n </RuleConditions>\\n <RuleId>rule-bpn0kn908w4nbw****</RuleId>\\n <RuleName>rule-instance-test</RuleName>\\n <RuleStatus>Available</RuleStatus>\\n </Rules>\\n <TotalCount>1000</TotalCount>\\n</ListRulesResponse>\",\"errorExample\":\"\"}]", "title": "Query forwarding rules" } }, "endpoints": [ { "regionId": "cn-wulanchabu", "endpoint": "alb.cn-wulanchabu.aliyuncs.com" } ] } -
Outbound Authentication: Select the AccessKey credential created in the previous step.
-
Function Compute
This example integrates a math calculation web function.
Before you add a Function Compute service, you must create and deploy a web function in the Function Compute console:
-
Click Create Function. For **Function Type**, select Web Function. Enter a Function Name. For **Runtime Environment**, select Custom Runtime > Python > Python 3.10 (Debian 11). For Code Upload Method, select Use Sample Code. For Startup Command, select Command Mode and enter
python app.py. Click Create. -
In the WebIDE, replace the sample code with the following math calculation service code. Change the filename to
app.py, save it, and then click Deploy. -
On the right side of the interface, click Copy ARN. You will need this when you add the service later.
Sample code for a web function that provides math calculations
from http.server import HTTPServer, BaseHTTPRequestHandler
import urllib
import json
class MathHandler(BaseHTTPRequestHandler):
def do_GET(self):
"""Handle GET request: /?a=10&b=5&op=add"""
params = urllib.parse.parse_qs(urllib.parse.urlparse(self.path).query)
try:
a = float(params.get('a', [0])[0])
b = float(params.get('b', [0])[0])
op = params.get('op', ['add'])[0]
# Perform calculation
if op == 'add':
result = a + b
elif op == 'sub':
result = a - b
elif op == 'mul':
result = a * b
elif op == 'div':
result = a / b
else:
raise ValueError(f"Unsupported operation: {op}")
response = {'result': result, 'message': f'{a} {op} {b} = {result}'}
self.send_response(200)
except (ValueError, ZeroDivisionError) as e:
response = {'error': str(e)}
self.send_response(400)
self.send_header('Content-type', 'application/json')
self.end_headers()
self.wfile.write(json.dumps(response).encode())
if __name__ == "__main__":
server = HTTPServer(('0.0.0.0', 9000), MathHandler)
print("Server running on http://localhost:9000")
server.serve_forever()After you complete the preparations, return to the MCP server group, click Add MCP Service, complete the following settings, and click OK.
-
Service Name: Enter a name that is easy for the LLM to understand. This topic uses
math-calculator, which represents a math calculation service. -
Service Type: Select Function Compute.
-
Function Compute ARN: Enter the copied function ARN.
-
OpenAPI Configuration: Paste or import the following OpenAPI configuration file.
-
Outbound Authentication: Select RAM Role.
OpenAPI configuration for the above function
{
"openapi": "3.1.0",
"info": {
"title": "Math Calculator API",
"version": "1.0.0",
"description": "Math calculator supporting addition, subtraction, multiplication, and division"
},
"paths": {
"/": {
"get": {
"summary": "Math calculation",
"description": "Perform basic mathematical operations (addition, subtraction, multiplication, division)",
"operationId": "calculate",
"parameters": [
{
"name": "op",
"in": "query",
"required": true,
"description": "Operation type: add=addition, sub=subtraction, mul=multiplication, div=division",
"schema": {
"type": "string",
"enum": ["add", "sub", "mul", "div"]
}
},
{
"name": "a",
"in": "query",
"required": true,
"description": "First operand",
"schema": {
"type": "number"
}
},
{
"name": "b",
"in": "query",
"required": true,
"description": "Second operand",
"schema": {
"type": "number"
}
}
],
"responses": {
"200": {
"description": "Calculation successful",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"result": {
"type": "number",
"description": "Calculation result"
},
"message": {
"type": "string",
"description": "Calculation description"
}
}
}
}
}
}
}
}
}
}
}3. Create a listener
-
In the ALB console, click the target instance ID to open the Instance Details page. On the Listener tab, click Create Listener.
-
In the Configure Listener step, set Listener Protocol to HTTPS and Listener Port to
443. Then click Next. -
In the Configure SSL Certificate step, select the server certificate that matches your custom domain name and click Next.
-
In the Select Server Group step, select Server and the server group
sgp-default. Then click Next.The server group selected here is used for the listener's default rule, which handles requests that do not match any other forwarding rules. In this topic, all MCP requests are precisely matched by forwarding rules and will not be processed by this rule.
-
In the Configuration Review step, confirm the settings and click Submit.
4. Configure forwarding rules
Requests are matched against forwarding rules in ascending order of priority. When a request matches a rule, its forwarding action is executed, and no further rules are matched. Create a forwarding rule with the condition set to Path to route MCP-related requests to the MCP server group.
-
On the Listener tab of the instance, click the target listener ID. On the Listener Details page, click the Forwarding Rules tab.
-
Click Add New Rule, complete the following settings, and click OK.
-
Add Condition: Select Path, set the matching method to Exact Match, and enter
/mcp. -
Service Extension (Optional): Select Create from Template, select MCP Authentication Proxy, and click Create. Enter a Extension name, select Enable Semantic Search, and click Create. This template automatically adds an API Key Authentication component and generates credentials.
-
Action: Set Forward To the
sgp-mcpserver group.
-
-
In the forwarding rule list, click the ID of the newly created service extension to open its details page. At the bottom of the page, expand the API Key Authentication component. In the Credential field, retrieve the API key. You will need it for verification testing later.
5. Set up domain name resolution
Point your custom domain name to the DNS name of the ALB instance using a CNAME record. Clients will then access ALB through your custom domain name.
This topic uses Alibaba Cloud DNS as an example. For domain names not registered with Alibaba Cloud, you must first add the domain name to the Cloud DNS console.
-
In the ALB console, copy the Domain Name of the target instance.
-
Log on to the Domain Name Resolution console. In the Actions column for the target domain, click Settings. On the Settings page, click Add Record.
-
Add a CNAME record with the following information and click OK.
-
Record Type: Select CNAME.
-
Hostname: Enter a domain prefix such as
mcp. If your root domain isexample.com, the domain for accessing ALB will bemcp.example.com. -
Query Source and TTL: Keep the default values.
-
Record Value: Enter the DNS name of the ALB instance.
-
-
In the Change Resource Record Confirmation dialog box, confirm the resolution information and click OK.
6. Verification and testing
After you complete the preceding configurations, you can verify that the MCP service is running correctly using one of the following methods.
MCP Inspector debugging
-
Install the Node.js environment and run the following command to start MCP Inspector:
npx @modelcontextprotocol/inspector -
Switch Transport Type to Streamable HTTP. In the URL field, enter the MCP service endpoint of ALB, such as
https://mcp.example.com/mcp. Expand Authentication and add a header in Custom Headers. Set the name toAuthorizationand the value toBearer <API Key credential>(the credential that you retrieved in Step 4). Enable the switch for the header. Click Connect. A Connected status indicates a successful connection. -
Click List Tools to retrieve a list of all currently mounted tools. Verify each service type separately:
-
MCP Server Type: You can select the
temperature-converter::celsius_to_fahrenheittool. Enter22forcelsiusand click Run Tool. The result is 71.6 degrees Fahrenheit. -
Function Compute type: Select the math calculation tool
math-calculator::calculate. Selectopasadd,aas10, andbas5. Click Run Tool to obtain the calculation result of 15. -
REST API Type: Select the ALB management tool
alb-operator::ListLoadBalancersand click Run Tool to retrieve the list of ALB instances in the destination account. -
Semantic Search: Select the
x-aliyun-alb-searchtool to use the built-in semantic search capability of the MCP proxy component to search for matching tools. For example, enterqueryasquery load balancer informationandtopkas2. This returns the two best-matching tools, which avoids the need to load the full tool list and saves LLM token consumption.
-
Agent testing
The following example builds an agent based on LangChain. It dynamically retrieves and calls tools using the semantic search capability of the MCP proxy component.
-
Install Python (version 3.10 or later) and the dependencies:
pip install "langchain>=1.2.4" "langchain-community>=0.4.1" "langchain-mcp-adapters>=0.2.1" "langchain-openai>=1.0.1" "langgraph>=1.0.1" -
Save the following code as
agent.py:# -*- coding: utf-8 -*- import asyncio import os import httpx from langchain.agents import create_agent from langchain_openai import ChatOpenAI from mcp import ClientSession from mcp.client.streamable_http import streamable_http_client from mcp.types import Tool from langchain_mcp_adapters.tools import convert_mcp_tool_to_langchain_tool async def search_alb_tools(session: ClientSession, query: str, topk: int = 3) -> list: """Search for relevant tools via MCP protocol.""" result = await session.call_tool( "x-aliyun-alb-search", {"query": query, "topk": topk} ) payload = result.structuredContent or {} allowed_fields = {"name", "title", "description", "inputSchema"} mcp_tools = [ Tool(**{k: v for k, v in t.items() if k in allowed_fields and v}) for t in payload.get("tools", []) ] return [convert_mcp_tool_to_langchain_tool(session, t) for t in mcp_tools] class AlbChatAgent: def __init__(self, session: ClientSession, llm: ChatOpenAI): self.session = session self.llm = llm async def chat(self, user_query: str) -> None: print(f"\nUser: {user_query}") tools = await search_alb_tools(self.session, user_query) system_prompt = ( "You are an expert assistant. Only use the provided ALB tools to answer questions. " "If the tools are insufficient, clearly inform the user. Be concise and professional." ) agent = create_agent( model=self.llm, tools=tools, system_prompt=system_prompt ) try: response = await agent.ainvoke( {"messages": [{"role": "user", "content": user_query}]}, ) print(f"Assistant: {response['messages'][-1].content}") except Exception as e: print(f"Error: {type(e).__name__}: {str(e)}") async def main(): mcp_url = os.getenv("MCP_URL") mcp_api_key = os.getenv("MCP_API_KEY") qwen_api_key = os.getenv("QWEN_API_KEY") if not mcp_url: raise EnvironmentError("Environment variable not set: MCP_URL") if not mcp_api_key: raise EnvironmentError("Environment variable not set: MCP_API_KEY") if not qwen_api_key: raise EnvironmentError("Environment variable not set: QWEN_API_KEY") async with httpx.AsyncClient( headers={"Authorization": f"Bearer {mcp_api_key}"}, timeout=httpx.Timeout(60, read=300), ) as http_client: async with streamable_http_client( mcp_url, http_client=http_client, ) as (reader, writer, _): async with ClientSession(reader, writer) as session: await session.initialize() llm = ChatOpenAI( model="qwen-plus", api_key=qwen_api_key, base_url="https://dashscope.aliyuncs.com/compatible-mode/v1" ) agent = AlbChatAgent(session, llm) while True: try: query = input("\n>>> ").strip() if query: await agent.chat(query) except (KeyboardInterrupt, EOFError): break if __name__ == "__main__": asyncio.run(main()) -
Set the following environment variables and run the script:
-
MCP_URL: The MCP service endpoint of the ALB instance. In this topic, it ishttps://mcp.example.com/mcp. -
MCP_API_KEY: The API Key credential generated in Step 4. -
QWEN_API_KEY: After you activate Alibaba Cloud Model Studio, retrieve the API key from the Model Studio console.
Linux/macOS
export MCP_URL=https://mcp.example.com/mcp export MCP_API_KEY=your_api_key export QWEN_API_KEY=sk-xxx python agent.pyWindows
$env:MCP_URL="https://mcp.example.com/mcp" $env:MCP_API_KEY="your_api_key" $env:QWEN_API_KEY="sk-xxx" python agent.py -
-
After the script runs, input questions in natural language. The agent will retrieve and call matching tools using
x-aliyun-alb-search.>>> Help me convert 22 degrees Celsius to Fahrenheit User: Help me convert 22 degrees Celsius to Fahrenheit Assistant: 22 degrees Celsius is equal to 71.6 degrees Fahrenheit. >>> Help me calculate 22 * 33 User: Help me calculate 22 * 33 Assistant: 22 × 33 = 726 >>> Help me list the current ALB instances User: Help me list the current ALB instances Assistant: There are currently 2 ALB instances. The details are as follows: | Instance ID | Name | Address Type | Status | |--------|------|----------|------| | alb-xxxx1 | my-alb-1 | Internet | Active | | alb-xxxx2 | my-alb-2 | Intranet | Active |
More information
Billing
-
ALB Enhanced Edition is currently in public preview and is free to use.
-
Domain name and DNS resolution fees: In addition to the domain name fees from your provider, configuring DNS resolution on Alibaba Cloud incurs public authoritative resolution fees.
-
Certificate fees: Purchasing a certificate from Alibaba Cloud or uploading a certificate to Alibaba Cloud incurs server certificate fees.
-
Function Compute fees: Fees are billed by Function Compute.
-
Model Studio model fees: Calling the Model Studio API incurs model fees.
Regions that support ALB Enhanced Edition
|
Area |
Region |
Zone |
|
China |
China (Ulanqab) |
Zone A, Zone B, and Zone C |
|
China (Hangzhou) |
Zone J and Zone K |
|
|
China (Beijing) |
Zone I, Zone K, and Zone L |
|
|
China (Shanghai) |
Zone B and Zone F |
|
|
China (Hong Kong) |
Zone B, Zone C, and Zone D |
|
|
Asia-Pacific |
Singapore |
Zone A, Zone B, and Zone C |
|
Japan (Tokyo) |
Zone B, Zone C, and Zone E |
|
|
Malaysia (Kuala Lumpur) |
Zone A, Zone B, and Zone C |
|
|
Europe and Americas |
Germany (Frankfurt) |
Zone A and Zone B |
|
US (Silicon Valley) |
Zone A and Zone B |
|
|
Middle East |
UAE (Dubai) |
Zone A and Zone B |
Suggestions
-
Tool list retrieval strategy: If you have a small number of tools, you can call
tools/listdirectly to retrieve the complete list. If you have many tools, we recommend that you usex-aliyun-alb-searchfor semantic search to find relevant tools and reduce token consumption. -
Tool description optimization: The tool descriptions in the OpenAPI configuration directly affect the matching accuracy of semantic search. We recommend that you accurately describe the purpose of each tool in natural language. If necessary, you can use a large language model (LLM) to optimize the description text.
-
Internal network domain name resolution: ALB Enhanced Edition resolves MCP server addresses through public DNS. If the MCP server is deployed in a VPC, you must resolve the domain name to the corresponding private IP address in the public DNS and ensure that the ALB instance can access the server.
-
Security: Avoid hard coding API keys in client code. We recommend that you manage them using environment variables or a key management service.
FAQ
MCP server connection times out, reporting "upstream connect error" or "connection timeout"
-
Ensure that the network between the ALB instance and the MCP server is reachable.
-
If the MCP service is deployed in a VPC: Ensure that the ALB instance can access the MCP service through the private network. Connectivity is established by default within the same VPC. For cross-VPC or cross-region scenarios, you must connect the private networks using products such as Cloud Enterprise Network. Also, ensure that the security group rules allow the ALB instance to access the MCP service port.
-
If the MCP service is deployed on the public network: Ensure that the vSwitch to which the ALB instance belongs is correctly configured for public SNAT.
-
-
Confirm that the domain name resolution is correctly configured in the public DNS.
-
Confirm that the MCP server process has started and is listening on the expected port.
Semantic search does not return the expected tools
-
Check whether the tool descriptions are sufficiently accurate. Semantic search relies on the semantic similarity between the description and the query.
-
Increase the value of the
topkparameter to return more candidate tools.
Function Compute type service cannot be called after being added
-
Confirm that the OpenAPI configuration file format is correct and that the API path and parameters are consistent with the actual behavior of the function.
-
Confirm that the code has been successfully deployed to the Function Compute service.