Adds service resources to an endpoint service.

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 a sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Required AttachResourceToVpcEndpointService

The operation that you want to perform. Set the value to AttachResourceToVpcEndpointService.

RegionId String Required eu-west-1

The ID of the region where the endpoint service is created. You can call the DescribeRegions operation to query region IDs.

ResourceId String Yes lb-hp32z1wp5peaoox2q****

The ID of the service resource.

ResourceType String Yes slb

The type of the service resource. Set the value to slb (SLB instances that support PrivateLink and are deployed in a VPC).

ServiceId String Yes epsrv-hp3vpx8yqxblby3i****

The endpoint service to which you want to add the service resource.

DryRun Boolean No false

Specifies whether to only check the API request. Valid values:

true: only checks the API request. If you select this option, the service resource is not added to the endpoint service after the request passes the check. Check items include whether the AccessKey pair is valid, whether the RAM user is authorized, and whether the required parameters are specified. If the request fails to meet the requirements in the check items, an error message is returned. If the request meets the requirements in the check items, the DryRunOperation error code is returned.

false (default): checks the API request. After the request passes the check, the 2XX HTTP status code is returned, and the service resource is automatically added to the endpoint service.

ClientToken String No 0c593ea1-3bea-11e9-b96b-88e9fe637760

The client token that is used to ensure the idempotence of the request. You can use the client to generate a value that is unique among different requests. ClientToken can contain only ASCII characters. It must be 1 to 64 characters in length.

Response parameters

Parameter Type Example Description
RequestId String 0ED8D006-F706-4D23-88ED-E11ED28DCAC0

The ID of the request.

Examples

Sample requests

https://[Endpoint]/?Action=AttachResourceToVpcEndpointService
&RegionId=eu-west-1
&ResourceId=lb-hp32z1wp5peaoox2q****
&ResourceType=slb
&ServiceId=epsrv-hp3vpx8yqxblby3i****
&<Common request parameters>

Sample success responses

XML format

<AttachResourceToVpcEndpointServiceResponse>  
         <RequestId>3109D437-5D6D-4A28-B5F5-EF936DExxxx</RequestId>
</AttachResourceToVpcEndpointServiceResponse>

JSON format

{
    "RequestId": "3109D437-5D6D-4A28-B5F5-EF936DExxxx"
}

Error codes

HttpCode Error code Error message Description
400 EndpointServiceNotFound The specified Service does not exist. The error message returned because the specified endpoint service does not exist.
400 EndpointServiceOperationDenied The specified operation of endpoint service is not allowed. The error message returned because the operation is not allowed when the endpoint service is being processed.
400 EndpointServiceResourceExist The specified resource already exists. The error message returned because the specified resource is already added to the endpoint service.
400 LoadBalancerNotFound The specified load balancer does not exist. The error message returned because the specified Server Load Balancer (SLB) instance does not exist.
400 LoadBalancerNotSupportPrivateLink The specified SLB does not support PrivateLink. The error message returned because the specified SLB instance does not support PrivateLink.
400 AlbNotFound The specified Alb does not exist. The error message returned because the specified Alibaba Cloud internal SLB instance does not exist.
400 EndpointServiceResourceTypeNotSupport The specified resource type is not supported. The error message returned because the specified resource type is not supported.

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