全部文档
当前文档

暂无内容

如果没有找到您期望的内容,请尝试其他搜索词

文档中心

实例添加弹性网卡

请求参数

以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见公共请求参数
参数名称
类型
必填
描述
Action String
公共参数,本接口取值:AttachNetworkInterface。
Version String
公共参数,本接口取值:2016-03-04。
InstanceId String

实例ID

示例值:98284100-f6d1-4bbf-886a-1b0765024738
NetworkInterfaceId String

弹性网卡ID(保留已经上线的参数,该参数与已经上线参数不可同时指定)

示例值:2f93aaba-6368-4cec-b50f-9f199138023f
SubnetId String
SecurityGroupId.N String

安全组id

PrivateIpAddress String
VpcIpv6 String

指定子网下的ipv6地址

MacAddress String

返回参数

参数名称
类型
描述
RequestId String

请求ID

示例值:35ebced8-26dc-4f4c-bb2a-f1884efb5dc0
Return Boolean

返回状态

示例值:true(成功)/false(失败)

请求示例

curl -X GET|POST
'http://kec.api.ksyun.com/?Action=AttachNetworkInterface&Version=2016-03-04'
-H 'authorization: xxx, SignedHeaders=content-type;host;x-amz-date, Signature=xxx'
-H 'cache-control: no-cache'
-H 'content-type: application/x-www-form-urlencoded'
-H 'host: kec.api.ksyun.com'
-H 'x-amz-date: 20170720T022802Z'
-d 'InstanceId=xxx&NetworkInterfaceId=xxx&SubnetId=xxx&SecurityGroupId.N=xxx&PrivateIpAddress=xxx&VpcIpv6=xxx&MacAddress=xxx'

返回示例

JSON格式

{
"RequestId":"6b9a2975-a032-4dfc-a959-c8be1c03d569009",
"Return":"true"
}

错误码

以下仅列出了接口业务逻辑相关的错误码,其他错误码详见公共错误码

错误码
错误信息
Http状态码
描述
NetworkInterfaceNotFoundThe specified network interface is not exist400找不到指定的网卡ID
NetworkInterfaceHasAttachedThe network interface has been attached to instance.400指定的网卡已经被绑定到实例
NetworkInterfaceAZIsNotSameWithVMThe network interface must be in the same availability zone with attached instance [{0}]400网卡和待绑定的实例必须处于同一个可用区
SubnetIsNotNormalSubnet type must Normal400选择的子网的类型必须是普通子网
PrivateIPNotMatchDhcpPrivateIpAddress is exceed Subnet's DHCP Range400PrivateIpAddress超过子网设置的DHCP范围
VifIdInvalidNetwork interface ID is invalid400网卡ID无效
AvailableIpNumberNotEnoughForAttachNetworkInterfaceThe available IP number {1} is insufficient to attach networkInterface under the subnet {0}.400子网{0}下可用IP数量只有{1}个,无法进行挂载网卡操作.
NetworkInterfaceConflictingParameterOnly One of NetworkInterfaceId or SubnetId parameters should be supplied400暂无
SecurityGroupIdRequiredSecurityGroupId is required400SecurityGroupId必传
NetworkInterfaceOrSubnetIdRequiredEither the NetworkInterfaceId or the SubnetId should be specified400“NetworkInterfaceId“和“SubnetId“参数两者必须且只能指定其中一个
SubnetAndSecurityGroupNotMatchSub network[{0}] and security groups[{1}] must belong to the same VPC400子网[{0}]和安全组[{1}]必须属于同一个VPC.
SubnetAndPrivateIpAddressNotMatchPrivate ip address is not in the sub network IP range or has been used400私网IP不在子网的IP范围内或者已经被占用
NetworkInterfaceLimitExceededEach instance has reached the limit of the number of extension network interface400主机绑定网卡数已超出限制
InstanceNotSupportIPv6NetworkInterfaceThe instance does not enable ipv6, can not specify IPv6 network interface400因主机不支持IPv6,不能绑定指定IPv6地址的网卡
SecurityGroupIdInvalidSecurity group id is invalid400安全组ID无效
InstanceIdRequiredInstanceId is required400InstanceId必传
PrivateIpAddressInvalidParameterValueAn invalid or out-of-range value was supplied for the "PrivateIpAddress" parameter.400“私有IP地址”参数的取值无效或者超出有效范围
Ipv6 is not valid暂无400暂无
CheckMacAddressThe Mac address format of the input is incorrect.400输入的主网卡mac地址内容格式不正确
纯净模式常规模式

纯净模式

点击可全屏预览文档内容