• Elastic Cloud Server

ecs
  1. Help Center
  2. Elastic Cloud Server
  3. API Reference
  4. Extension ECS APIs
  5. NIC Management
  6. Adding NICs to an ECS in Batches

Adding NICs to an ECS in Batches

Function

This interface is used to add one or multiple NICs to an ECS.

URI

POST /v1/{project_id}/cloudservers/{server_id}/nics

Table 1 describes the parameters in the URI.
Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

server_id

Yes

Specifies the ECS ID.

Request

Request parameters

Table 2 describes the request parameters.
Table 2 Request parameters

Parameter

Mandatory

Type

Description

nics

Yes

List data structure

Specifies the NICs to be added. For details, see Table 3.

Table 3 nics field description

Parameter

Mandatory

Type

Description

subnet_id

Yes

String

Specifies the subnet ID of the NIC to be added.

security_groups

No

List data structure

Specifies the security groups for NICs. For details, see Table 4.

ip_address

No

String

Specifies the IP address. If this parameter is unavailable, the IP address is automatically assigned.

Table 4 security_groups field description

Parameter

Mandatory

Type

Description

id

Yes

String

Specifies the ID of the security group.

Response

See Responses (Task).

Examples

  • Example request
    {
        "nics": [
            {
                "subnet_id": "d32019d3-bc6e-4319-9c1d-6722fc136a23", 
                "security_groups": [
                    {
                        "id": "f0ac4394-7e4a-4409-9701-ba8be283dbc3"
                    }
                ]
            }
        ]
    }

Returned Values

See General Request Returned Values.

Error Code

See Error Code Description.