Updated on 2024-10-22 GMT+08:00

Binding NICs to a BMS

Function

This API is used to bind one or more NICs to a BMS.

URI

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

Table 1 lists the parameters.

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

For details about how to obtain the project ID, see Obtaining a Project ID.

server_id

Yes

Specifies the BMS ID.

You can obtain the BMS ID from the BMS console or by calling the Querying BMSs (Discarded).

Request Parameters

Parameter

Mandatory

Type

Description

nics

Yes

Array of objects

Specifies the NICs to be bound. For details, see Table 2.

Constraints:

Currently, you can concurrently bind a maximum of 10 NICs to a BMS. If more than 10 NICs are bound concurrently, the binding may fail.

Table 2 nics field data structure description

Parameter

Mandatory

Type

Description

subnet_id

Yes

String

Specifies the subnet ID of the NIC.

You can obtain the subnet ID (in UUID format) from the console or by referring to Querying Subnets in Virtual Private Cloud API Reference.

Constraints:

  • If subnet_id is specified, the value of quota:min_rate will be used as the minimum NIC bandwidth by default.
  • If subnet_id is specified, the value of quota:vif_multiqueue_num will be used as the number of queues for a NIC by default.
  • For details about quota:min_rate and quota:vif_multiqueue_num, see Querying Details About extra_specs Parameters of a BMS Flavor (Discarded).

security_groups

No

Array of objects

Specifies the security groups for the NIC. For details, see Table 3.

Constraints:

This parameter is valid only when subnet_id is specified. It is mandatory when subnet_id is used to bind NICs across tenants.

ip_address

No

String

Specifies the IP address of the NIC. If this parameter is left blank, the IP address is automatically assigned.

Constraints:

This parameter is valid only if subnet_id is specified.

Table 3 security_groups field data structure description

Parameter

Mandatory

Type

Description

id

Yes

String

Specifies the security group ID.

Example Request

Binding a NIC (subnet ID: d32019d3-bc6e-4319-9c1d-6722fc136a23; security group ID: f0ac4394-7e4a-4409-9701-ba8be283dbc3) to a BMS
{
    "nics": [
        {
            "subnet_id": "d32019d3-bc6e-4319-9c1d-6722fc136a23",
            "security_groups": [
                {
                    "id": "f0ac4394-7e4a-4409-9701-ba8be283dbc3"
                }
            ]
        }
    ]
}

Response Parameters

Table 4 Normal response

Parameter

Type

Description

job_id

String

Specifies the task ID returned after a task command is issued. The task ID can be used to query the execution status of the task.

For details about how to query the task execution status based on job_id, see Querying Task Statuses.

Table 5 Abnormal response

Parameter

Type

Description

error

Dictionary data structure

Specifies the error returned when a task submission encounters an exception. For details, see Table 6.

Table 6 error data structure

Parameter

Type

Description

message

String

Specifies the error message.

code

String

Specifies the error code.

Example Response

  • Normal response
    1
    2
    3
    { 
        "job_id": "70a599e0-31e7-49b7-b260-868f441e862b" 
    } 
    

Returned Values

Normal values

Returned Values

Description

200

The request has been successfully processed.

For details about other returned values, see Status Codes.

Error Codes

See Error Codes.