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

Request parameters

Parameter Type Required Example Description
Action String Yes AttachResourceToVpcEndpointService

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

RegionId String Yes cn-hangzhou

The ID of the region where the endpoint service is created.

You can call the DescribeRegions operation to query the most recent region list.

ResourceType String Yes slb

The type of the service resource.

Set the value to slb, which specifies that the service resource is a Classic Load Balancer (CLB) instance that supports PrivateLink. In addition, the CLB instance is deployed in a virtual private cloud (VPC).

ResourceId String Yes lb-hp32z1wp5peaoox2q****

The ID of the service resource.

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 precheck this request. Valid values:

  • true: prechecks the request without performing the operation. The system checks whether your AccessKey pair is valid, whether the Resource Access Management (RAM) user is authorized, and whether required parameters are set. If the request fails to pass the precheck, an error code is returned. If the request passes the precheck, the DryRunOperation error code is returned.
  • false (default): sends the API request. If the request passes the precheck, a 2xx HTTP status code is returned and the operation is performed.
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 the value, but you must make sure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 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=cn-hangzhou
&ResourceId=lb-hp32z1wp5peaoox2q****
&ResourceType=slb
&ServiceId=epsrv-hp3vpx8yqxblby3i****
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<AttachResourceToVpcEndpointServiceResponse>
    <RequestId>0ED8D006-F706-4D23-88ED-E11ED28DCAC0</RequestId>
</AttachResourceToVpcEndpointServiceResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "0ED8D006-F706-4D23-88ED-E11ED28DCAC0"
}

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 CLB instance does not exist.
400 LoadBalancerNotSupportPrivateLink The specified SLB does not support PrivateLink. The error message returned because the specified CLB instance does not support PrivateLink.
400 AlbNotFound The specified Alb does not exist. The error message returned because the specified Application Load Balancer (ALB) 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.
400 QuotaMisMatched The resource you applied for has exceeded the quota. The error message returned because the requested amount of resources has reached the upper limit.
400 VSwitchNotFound The specified VSwitch does not exist. The error message returned because the specified vSwitch is not found.
400 ResourceNotFound.NatGateway The specified resource %s is not found. The error message returned because the specified resource %s does not exist.
400 Mismatch.ResourceType The %s is mismatched for %s and %s. The error message returned because %s does not correspond to %s and %s.
400 EndpointServiceNotSupportedZone The specified endpoint service does not support the zone. The error message returned because the endpoint service is not supported in the zone.

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