Binds a Server Load Balancer (SLB) instance to an application that is deployed in a Container Service for Kubernetes (ACK) cluster.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request headers

This operation uses only the common request header. For more information, see Common request parameters.

Request syntax

POST /pop/v5/k8s/acs/k8s_slb_binding HTTPS|HTTP

Request parameters

Parameter Type Position Required Example Description
AppId String Query Yes 5a166fbd-****-****-a286-781659d9f54c

The ID of the application.

ClusterId String Query Yes 712082c3-f554-****-****-a947b5cde6ee

The ID of the cluster.

Type String Query Yes internet

The type of the SLB instance. Valid values: internet and intranet.

Port String Query No 80

The frontend port. Valid values: 1 to 65535.

SlbProtocol String Query No TCP

The protocol used by the SLB instance. Valid values: TCP, HTTP, and HTTPS.

TargetPort String Query No 8080

The backend port, which is also the service port of the application. Valid values: 1 to 65535.

SlbId String Query No lb-2ze1quax9t****iz82bjt

The ID of the SLB instance. If you leave this parameter empty, Enterprise Distributed Application Service (EDAS) automatically purchases an SLB instance.

ServicePortInfos String Query No [{"targetPort":8080,"port":82,"loadBalancerProtocol":"TCP"},{"port":81,"certId":"136246975637380916c185d6fa21914500329_-988as","targetPort":8181,"lo adBalancerProtocol":"HTTPS"}]

This parameter is required if you want to configure multi-port mappings or use a protocol other than TCP.

Set the value in the JSONArray format. Example:

{"targetPort":8080,"port":82,"loadBalancerProtocol":"TCP"},{"port":81,"certId":"1362469756373809_16c185d6fa2_1914500329_-xxxxxxx","targetPort":8181,"lo adBalancerProtocol":"HTTPS"}

  • port: the frontend port. Valid values: 1 to 65535. This parameter is required. Each port must be unique.
  • targetPort: the backend port. Valid values: 1 to 65535. This parameter is required.
  • loadBalancerProtocol: This parameter is required. Valid values: TCP and HTTPS. If the HTTP protocol is used, set the value to TCP.
  • certId: the ID of the certificate. This parameter is required if the HTTPS protocol is used. You can purchase an SLB instance in the SLB console.
    Note This parameter is used to enable multi-port mappings. If you specify ServicePortInfos, you must also specify AppId, ClusterId, Type, and SlbId.

Response parameters

Parameter Type Example Description
ChangeOrderId String b4b37bde-a125-****-****-741f7f4a9ae3

The ID of the change process.

Code Integer 200

The HTTP status code.

Message String success

The response message.

RequestId String 4823-bhjf-23u4-eiufh

The ID of the request. Each request has a unique ID.

Examples

Sample requests

POST /pop/v5/k8s/acs/k8s_slb_binding HTTP/1.1
Common request parameters
{
  "AppId": "5a166fbd-****-****-a286-781659d9f54c"
  "ClusterId": "712082c3-f554-****-****-a947b5cde6ee"
  "Port": "80"
  "SlbProtocol": "TCP"
  "TargetPort": "8080"
  "Type": "internet"
}

Sample success responses

XML format

<Message>success</Message>
<ChangeOrderId>b4b37bde-a125-43fc-9f8e-741f7f4a9ae3</ChangeOrderId>
<Code>200</Code>

JSON format

{
	"Message": "success",
	"ChangeOrderId": "b4b37bde-a125-43fc-9f8e-741f7f4a9ae3",
	"Code": 200
}

Error codes

For a list of error codes, visit the API Error Center.