调用CreateVpcEndpointService接口,创建终端节点服务。
接口说明
-
创建终端节点服务之前,请确保您已创建支持私网连接的负载均衡资源。具体操作,请参见创建负载均衡实例。
-
CreateVpcEndpointService 接口属于异步接口,即系统会返回一个实例 ID,但该终端节点服务尚未创建完成,系统后台任务仍在进行中。您可以调用 GetVpcEndpointServiceAttribute 查询终端节点服务的创建状态:
-
当终端节点服务处于 Creating 状态时,表示终端节点服务正在创建。
-
当终端节点服务处于 Active 状态时,表示终端节点服务创建完成。
-
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
privatelink:CreateVpcEndpointService |
create |
*VpcEndpointService
LoadBalancer
LoadBalancer
NatGateway
LoadBalancer
|
无 | 无 |
请求参数
名称 |
类型 |
必填 |
描述 |
示例值 |
RegionId |
string |
是 |
终端节点服务所在的地域 ID。 您可以通过调用 DescribeRegions 接口获取地域 ID。 |
cn-huhehaote |
ClientToken |
string |
否 |
客户端 Token,用于保证请求的幂等性。 从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符。 |
0c593ea1-3bea-11e9-b96b-88e9fe637760 |
DryRun |
boolean |
否 |
是否只预检此次请求,取值:
|
false |
ServiceDescription |
string |
否 |
终端节点服务的描述信息。 |
This is my EndpointService. |
AutoAcceptEnabled |
boolean |
否 |
是否自动接受终端节点连接,取值:
|
false |
Payer |
string |
否 |
付费方,取值:
|
Endpoint |
ZoneAffinityEnabled |
boolean |
否 |
是否支持连接服务的终端节点域名就近解析,取值:
|
false |
ServiceResourceType |
string |
否 |
服务资源类型。取值:
说明
不支持访问 NLB 的 TCPSSL 类型监听。 |
slb |
Resource |
array<object> |
否 |
终端节点服务资源合集。创建时最多支持 10 个资源。创建后可通过为终端节点添加服务资源继续添加。 |
|
object |
否 |
终端节点服务资源合集。 |
||
ResourceType |
string |
否 |
添加到终端节点服务中的服务资源的类型,一个终端节点服务最多支持添加 20 个服务资源。取值:
说明
在支持私网连接功能的地域内,专有网络类型的传统型负载均衡 CLB 实例均支持作为终端节点服务的服务资源。 |
slb |
ResourceId |
string |
否 |
添加到终端节点服务中的服务资源 ID。 |
lb-hp32z1wp5peaoox2q**** |
ZoneId |
string |
否 |
可用区 ID。 |
cn-huhehaote-a |
RegionId |
string |
是 |
终端节点服务所在的地域 ID。 您可以通过调用 DescribeRegions 接口获取地域 ID。 |
cn-huhehaote |
ServiceSupportIPv6
deprecated
|
boolean |
否 |
终端节点服务是否支持 IPv6 功能。取值:
|
false |
ResourceGroupId |
string |
否 |
资源组 ID。 |
rg-acfmy***** |
Tag |
array<object> |
否 |
标签列表。 |
|
object |
否 |
标签列表。 |
||
Key |
string |
否 |
实例的标签键。最多支持 20 个标签键。一旦传入该值,则不允许为空字符串。 最多支持 64 个字符,不能以 |
env |
Value |
string |
否 |
实例的标签值。最多支持 20 个标签值。一旦传入该值,可以为空字符串。 最多支持 128 个字符,不能以 |
prod |
AddressIpVersion |
string |
否 |
协议版本。取值:
说明
目前仅后端资源类型为 nlb、gwlb 的终端节点服务支持指定 IP 地址协议为 DualStack。终端节点服务支持双栈,要求其后端资源也需支持双栈。 枚举值:
|
IPv4 |
返回参数
名称 |
类型 |
描述 |
示例值 |
object |
|||
ServiceBusinessStatus |
string |
终端节点服务的业务状态。取值:
|
Normal |
RequestId |
string |
请求 ID。 |
8D8992C1-6712-423C-BAC5-E5E817484C6B |
ServiceName |
string |
终端节点服务的名称。 |
com.aliyuncs.privatelink.cn-huhehaote.epsrv-hp3vpx8yqxblby3i**** |
ServiceStatus |
string |
终端节点服务的状态。取值:
|
Active |
ServiceDescription |
string |
终端节点服务的描述信息。 |
This is my EndpointService. |
CreateTime |
string |
终端节点服务的创建时间。 |
2022-01-02T19:11:12Z |
ServiceDomain |
string |
终端节点服务的服务域名。 |
epsrv-hp3vpx8yqxblby3i****.cn-huhehaote.privatelink.aliyuncs.com |
ZoneAffinityEnabled |
boolean |
是否支持连接服务的终端节点域名就近解析。取值:
|
false |
AutoAcceptEnabled |
boolean |
是否自动接受终端节点连接。取值:
|
false |
ServiceId |
string |
终端节点服务的 ID。 |
epsrv-hp3vpx8yqxblby3i**** |
ServiceSupportIPv6
deprecated
|
boolean |
终端节点服务是否支持 IPv6 功能。取值:
|
false |
ResourceGroupId |
string |
资源组 ID。 |
rg-acfmy***** |
AddressIpVersion |
string |
协议版本。取值:
|
IPv4 |
示例
正常返回示例
JSON
格式
{
"ServiceBusinessStatus": "Normal",
"RequestId": "8D8992C1-6712-423C-BAC5-E5E817484C6B",
"ServiceName": "com.aliyuncs.privatelink.cn-huhehaote.epsrv-hp3vpx8yqxblby3i****",
"ServiceStatus": "Active",
"ServiceDescription": "This is my EndpointService.",
"CreateTime": "2022-01-02T19:11:12Z",
"ServiceDomain": "epsrv-hp3vpx8yqxblby3i****.cn-huhehaote.privatelink.aliyuncs.com",
"ZoneAffinityEnabled": false,
"AutoAcceptEnabled": false,
"ServiceId": "epsrv-hp3vpx8yqxblby3i****",
"ServiceSupportIPv6": false,
"ResourceGroupId": "rg-acfmy*****",
"AddressIpVersion": "IPv4"
}
错误码
HTTP status code |
错误码 |
错误信息 |
描述 |
---|---|---|---|
400 | EndpointServiceExist | The specified Endpoint Service already exists. | 当前终端节点服务已经存在。 |
400 | AlbNotFound | The specified Alb does not exist. | ALI负载均衡不存在。 |
400 | LoadBalancerNotFound | The specified load balancer does not exist. | 负载均衡不存在。 |
400 | LoadBalancerNotSupportPrivateLink | The specified SLB does not support PrivateLink. | 当前负载均衡不支持Privatelink。 |
400 | GenerateResourceIdFailed | Failed to generate ResourceId. | 生成资源ID失败。 |
400 | QuotaMisMatched | The resource you applied for has exceeded the quota. | 申请的资源超过配额 |
400 | VSwitchNotFound | The specified VSwitch does not exist. | |
400 | EndpointServicePayerForbidden | The parameter EndpointServicePayer is forbidden. The user is not in the whitelist. | 终端节点服务的付费类型, 不在白名单中 |
400 | NeedOpenProduct | The product is not activated. | 产品未开通 |
400 | EndpointServiceNotSupportedZone | The specified endpoint service does not support the zone. | 终端节点服务不支持当前可用区。 |
400 | IllegalParamFormat.%s | The param format of %s is illegal. | 指定的%s格式无效。请检查参数约束,并在修改后重试。 |
400 | MissingParam.%s | The param of %s is missing. | 参数%s缺失。 |
400 | ResourceNotFound.NatGateway | The specified resource %s is not found. | |
400 | Mismatch.ResourceType | The %s is mismatched for %s and %s. | %s在%s和%s中不匹配。 |
400 | EndpointServiceNotSupportIpv6 | The param supportIpv6 of EndpointService is forbidden , resource is not support ipv6. | 终端节点服务不支持IPv6 |
400 | OperationDenied.PrivateDomainNotSupport | The operation is not allowed because of PrivateDomainNotSupport. | 由于%s,操作不支持 |
400 | Conflict.ServiceName | The ServiceName %s is conflict. | 服务名称%s冲突 |
400 | InvalidParam.PrivateDnsName | The parameter of PrivateDnsName is illegal, which needs to end with aliyun.com, aliyun-inc.com, or aliyuncs.com. | |
400 | OperationDenied.ZoneAffinityNotSupport | The operation is not allowed because of zone affinity not support. | 不允许操作,因为不支持域名就近解析。 |
400 | OperationDenied.RamPolicyNotSupport | The operation is not allowed because of RamPolicyNotSupport. | 不允许操作,因为不支持ram策略。 |
400 | OperationDenied.ResourceTypeNotSupportDualStack | The specified resource type does not support dualstack. | 服务后端资源类型不支持双栈。 |
400 | OperationDenied.ServiceResourceIpVersionMismatch | The endpoint service and service resource AddressIpVersion do not match. | 终端节点服务与后端资源AddressIpVersion不匹配 |
400 | IllegalParam.AddressIpVersion | The specified parameter AddressIpVersion is invalid. | 指定的参数AddressIpVersion 不符合要求。 |
400 | SpecifiedAlbNotSupport | The specified alb %s is not supported. | 指定的alb实例不支持。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。