Help Center/ Elastic Cloud Server/ API Reference/ APIs/ NIC Management/ Updating NIC Attachment Information of an ECS
Updated on 2025-12-10 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.

Debugging

You can debug this API in API Explorer.

Authorization

Each account has all of the permissions required to call all APIs, but IAM users must have the required permissions specifically assigned.
  • If you are using role/policy-based authorization, see the required permissions in Permissions and Supported Actions.
  • If you are using identity policy-based authorization, the permissions listed below are required.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

ecs:cloudServers:updateServerInterface

write

instance *

-

ecs:cloudServerNics:update

-

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.