Help Center/ Elastic Cloud Server/ API Reference/ APIs/ NIC Management/ Updating NIC Attachment Information of an ECS
Updated on 2025-06-27 GMT+08:00

Updating NIC Attachment Information of an ECS

Function

This API is used to update the NIC attachment information of an ECS. Currently, only delete_on_determination can be updated.

URI

PUT /v1/{project_id}/cloudservers/{server_id}/os-interface/{port_id}

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

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

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

server_id

Yes

Specifies the ECS ID.

port_id

Yes

Specifies the NIC ID.

Request

Table 2 describes the request parameters.
Table 2 Request parameters

Parameter

Mandatory

Type

Description

interface_attachment

Yes

Object

Specifies the structure of the ECS NIC information to be updated. For details, see Table 3.

Table 3 interface_attachment data structure

Parameter

Mandatory

Type

Description

delete_on_termination

Yes

Boolean

Specifies whether to delete a NIC when detaching it.

  • true: Delete the NIC.
  • false: Do not delete the NIC.

Response

None

Example Request

PUT  https://{endpoint}/v1/{project_id}/cloudservers/{server_id}/os-interface/{port_id}

{
    "interface_attachment":
    {
         "delete_on_termination": true
    }
}

Example Response

None

Returned Values

For details, see Returned Values for General Requests.

Error Codes

For details, see Error Codes.