Help Center/ Elastic Cloud Server/ API Reference/ APIs/ NIC Management/ Updating NIC Attachment Information of an ECS
Updated on 2026-03-19 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

Definition

Specifies the project ID.

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

Constraints

N/A

Range

N/A

Default Value

N/A

server_id

Yes

Definition

Specifies the ECS ID.

Constraints

N/A

Range

N/A

Default Value

N/A

port_id

Yes

Definition

Specifies the NIC ID.

Constraints

N/A

Range

N/A

Default Value

N/A

Request

Table 2 describes the request parameters.
Table 2 Request parameters

Parameter

Mandatory

Type

Description

interface_attachment

Yes

Object

Definition

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

Constraints

N/A

Range

N/A

Default Value

N/A

Table 3 interface_attachment data structure

Parameter

Mandatory

Type

Description

delete_on_termination

Yes

Boolean

Definition

Specifies whether to delete a NIC when detaching it.

Constraints

N/A

Range

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

Default Value

N/A

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.