Attach ENIC to CVM Server
Last Updated:2021-12-16
Description
Attach the ENIC onto the specified CVM server.
- You can bind a CVM server to multiple ENICs but only bind to one primary ENIC.
- An ENIC can only be bound to one CVM server.
- Only the running or disabled CVM server can be bound to an ENIC.
- The ENIC and the bound CVM server must be in the same private network and in the same available zone of the subnet where both of them reside.
Request Structure
PUT /v{version}/eni/{eniId}?{action}?clientToken={clientToken} HTTP/1.1
Host: bcc.bj.baidubce.com
Authorization: authorization string
{
"instanceId":{instanceId}
}
Request Header Field
No other special header fields are available except for the public header field.
Request Parameters
Parameter name | Type | Required? | Parameter Position | Description |
---|---|---|---|---|
version | String | Yes | URL parameter | API version number |
eniId | String | Yes | URL parameter | ENIC Id |
action | String | Yes | Query parameter | This interface value is "attach". |
instanceId | String | Yes | RequestBody parameter | The bound CVM server Id. |
clientToken | String | No | Query parameters | Idempotence Token, which is an ASCII string with a length of not more than 64 bits. |
Return Header Field
No other special header fields are available except for the public header field.
Return Parameter
No special return parameters.
Request Example
PUT /v1/eni/eni-w2d4kgc3x0y1?attach&clientToken=ds-hng79d HTTP/1.1
Host: bcc.bj.baidubce.com
authorization: bce-auth-v1/c3119080364d11e8912505e5e0ae9978/2018-04-02T08:14:25Z/3600/host;x-bce-account;x-bce-client-ip;x-bce-date;x-bce-request-id;x-bce-security-token/6b93bfd5ca2328fcb5560fa57f56253d80a629f6aac9c9cb74adf9a055fceb53
{
"instanceId":"i-syGfPUYO"
}
Return Example
HTTP/1.1 200 OK
x-bce-request-id: 7e789a40-adac-414a-8bd4-916d6be61112
Date: Mon, 02 Apr 2019 08:14:25 GMT
Content-Type: application/json;charset=UTF-8
Server: BWS