You need to enable JavaScript to run this app.
文档中心
私有网络

私有网络

复制全文
下载 pdf
网卡
AssignPrivateIpAddresses - 分配辅助私网IP地址
复制全文
下载 pdf
AssignPrivateIpAddresses - 分配辅助私网IP地址
调用 AssignPrivateIpAddresses 接口,为网卡(主网卡/辅助网卡)分配辅助私网IPv4地址。​
使用说明​
  • 仅状态为Available或InUse状态下的辅助网卡,可分配辅助私网IPv4地址。​
  • 为主网卡分配辅助私网IPv4时,主网卡所属的实例状态必须为RUNNING或STOPPED状态。​
  • 辅助网卡处于Available状态,最多可以分配49个辅助私网IPv4地址;辅助网卡处于InUse状态,可分配的辅助私网IPv4地址数量受挂载实例的规格限制。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action String 必选 示例值:AssignPrivateIpAddresses​
接口名称。当前 API 的名称为AssignPrivateIpAddresses。​
​
Version String 必选 示例值:2020-04-01​
接口版本。当前 API 的版本为 2020-04-01。​
​
NetworkInterfaceId String 必选 示例值:eni-bp67acfmxazb4p****​
网卡的ID。​
您可以调用 DescribeNetworkInterfaces 接口,查询网卡的ID。​
​
PrivateIpAddress.N String 可选 示例值:192.168.XX.10​
为网卡指定私网IP地址的IP和数量。​
  • 参数 - N:表示私网IPv4地址的序号,取值范围由网卡状态决定。​
  • 当网卡处于未挂载(Available)状态时,取值范围为1~49。​
  • 当网卡处于已挂载(InUse)状态时,N的取值范围受到实例规格限制,更多详情请参见实例规格介绍。​
  • 多个私网IPv4地址之间用&分隔。​
  • 指定的私网IPv4地址必须为网卡所属子网中的空闲私网IPv4地址。​
说明​
PrivateIpAddress.N和SecondaryPrivateIpAddressCount二者必须传入且只能传入一个。​
​
SecondaryPrivateIpAddressCount Integer 可选 示例值:1​
为网卡分配辅助私网IPv4地址数量。系统会自动从网卡所属子网中,分配相应数量的空闲IP地址作为网卡的辅助私网IPv4地址。​
说明​
参数PrivateIpAddress.N和SecondaryPrivateIpAddressCount二者必须传入且只能传入一个。​
​
ClientToken String 可选 示例值:123e4567-e89b-12d3-a456-42665544****​
客户端Token,用于保证请求幂等性。​
  • 由客户端自动生成一个参数值,确保不同请求间该参数值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。​
  • 仅支持ASCII字符,且不能超过64个字符。​
  • 若不传入ClientToken,则此次API调用不进行幂等校验。​
​
Ipv4Prefix.N String 可选 示例值:["192.168.1.32/28"]​
为网卡分配/28的IPv4地址段。​
说明​
本参数不能和以下任一参数同时指定​
  • Ipv4PrefixCount​
  • PrivateIpAddress.N​
  • SecondaryPrivateIpAddressCount​
  • 本参数正在邀测中,如需试用,请联系客户经理。​
​
Ipv4PrefixCount Integer 可选 示例值:["2001:db8:1234:XX::/80"]​
指定系统自动分配/28的IPv4网段的数量。​
说明​
本参数不能和以下任一参数同时指定​
  • Ipv4Prefix.N​
  • PrivateIpAddress.N​
  • SecondaryPrivateIpAddressCount​
  • 本参数正在邀测中,如需试用,请联系客户经理。​
​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
RequestId String 示例值:473469C7-AA6F-4DC5-B3DB-A3DC0DE3****​
请求ID。​
​
NetworkInterfaceId String 示例值:eni-bp125p95hhdhn3ot****​
网卡ID。​
​
PrivateIpSet String[] 示例值:192.168.XX.10​
网卡辅助私网IPv4地址集合。​
​
​
​
请求示例​
​
GET /?Action=AssignPrivateIpAddresses&Version=2020-04-01&NetworkInterfaceId=eni-bp67acfmxazb4p****&PrivateIpAddress.1=192.168.XX.10&PrivateIpAddress.2=192.168.XX.12 HTTP/1.1​
Host: vpc.cn-beijing.volcengineapi.com​
X-Date: 20251121T094038Z​
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20251121/cn-beijing/vpc/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "20230604110420****100232280022D31",​
"Action": "AssignPrivateIpAddresses",​
"Version": "2020-04-01",​
"Service": "vpc",​
"Region": "cn-beijing"​
},​
"Result": {​
"NetworkInterfaceId": "eni-bp125p95hhdhn3ot****",​
"PrivateIpSet": [​
""​
],​
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"​
}​
}​
​
错误码​
​
状态码​
错误码​
错误信息​
说明​
400​
DryRunOperation​
Exception raised to indicate a successfully authorized action when the DryRun flag is set to true.​
该请求设置为DryRun操作,操作授权已获得许可,但未被实际执行。​
400​
IdempotentParameterMismatch​
Arguments on this idempotent request are inconsistent with arguments used in previous request(s).​
此幂等请求的参数与前一个请求中使用的参数不一致。​
400​
InsufficientIpInSubnet​
The specified subnet does not contain enough free private IP addresses to fulfill your request.​
指定子网下可用IP不足。​
400​
InvalidEni.IPv4Disabled​
IPv4 has been disabled for the specified ENI.​
指定网卡已经禁用IPv4。​
400​
InvalidEni.InvalidStatus​
The specified elastic network interface is not in the correct status for the request.​
指定的弹性网卡所处的状态无法响应该请求。​
400​
InvalidEni.InvalidType​
The type of specified elastic network interface is illegal for the request.​
指定类型的弹性网卡无法响应该请求。​
400​
InvalidEniIp.Malformed​
The specified elastic network interface ip is malformed. If you are specifying an IP of an elastic network interface, ensure it must fall into the range of the CIDR block of the subnet to which the elastic network interface belongs to.​
指定的弹性网卡IP不合法。请确保网卡IP必须从属于所在子网的网段。​
400​
InvalidEniIpPrefix.Malformed​
The specified elastic network interface IP prefix is malformed. ensure it must fall into the range of the CIDR block of the subnet.​
指定的弹性网卡IP前缀不合法。请确保网卡IP前缀必须从属于所在子网的网段。​
400​
InvalidInstance.InvalidStatus​
The specified instance is not in the correct status for the request.​
指定的ECS实例所处的状态无法响应该请求。​
400​
InvalidIp.Malformed​
The specified ip is malformed.​
指定的IP不合法。​
400​
InvalidIpPrefix.Malformed​
The specified ipv4 prefix is malformed.​
指定的IPv4前缀不合法。​
400​
InvalidIpv6.Malformed​
The specified IPv6 address is malformed.​
指定的IPv6地址不合法。​
400​
InvalidParameter.ClientTokenMalformed​
The specified parameter ClientToken is malformed.​
指定的参数ClientToken格式不合法,长度不能超过64个ASCII字符。​
400​
InvalidPrivateIp.Malformed​
The specified private ip is malformed.​
指定的私网IP不合法。​
400​
LimitExceeded.Ipv6AddressesPerEni​
You've reached the limit on the number of IPv6 addresses per ENI that you can assign.​
已达到网卡可分配的IPv6地址的数量上限。​
400​
LimitExceeded.PrivateIpsPerEni​
You've reached the limit on the number of private IPs per ENI that you can assign.​
已达到网卡可分配的辅助IP的数量上限。​
400​
QuotaExceeded.SecurityGroupIp​
The number of IP addresses bound to the security group exceeded quota.​
已达到安全组可绑定IP地址的数量上限。​
403​
Forbidden.IpPrefix​
You are not authorized to allocate ip prefix.​
您无权限分配网卡前缀。​
403​
Forbidden​
You are not authorized to perform operations on the specified elastic network interface. The owner of the specified elastic network interface is not in sharing.​
无权限对指定弹性网卡进行操作。指定的弹性网卡归属用户不在共享中。​
403​
Forbidden​
You are not authorized to perform operations on the specified elastic network interface. The specified elastic network interface is a service-managed elastic network interface.​
无权限对指定弹性网卡进行操作。指定的弹性网卡为云产品托管的弹性网卡。​
404​
InvalidEniId.NotFound​
The specified elastic network interface does not exist.​
指定的弹性网卡不存在。​
404​
InvalidVpc.NotFound​
The specified VPC does not exist.​
指定的VPC不存在。​
409​
InvalidIPv4Prefix.Conflict​
The specified IPv4 prefix is in use.​
指定的IPv4前缀已被占用。​
409​
InvalidIPv6Prefix.Conflict​
The specified IPv6 prefix is in use.​
指定的IPv6前缀已被占用。​
409​
InvalidIpAddress.InUse​
The specified IP address is in use.​
指定的IP地址已被占用。​
409​
InvalidIpPrefix.Conflict​
The parameters for IP prefix number and IP prefixes cannot be specified at the same time.​
该请求不允许同时传入IP前缀数量以及IP前缀。​
409​
InvalidParameter.ParameterConflict​
The parameters for IP address number and IP addresses cannot be specified at the same time.​
该请求不允许同时传入IP地址数量以及IP地址。​
412​
IdempotentProcessing​
The request uses the same client token as a previous one that is still in process.​
幂等请求处理中。​
​
​
最近更新时间:2026.09.23 11:14:51
这个页面对您有帮助吗?
有用
有用
无用
无用