Help Center/ ModelArts/ API Reference/ Lite Server/ Detaching a NIC from a Lite Server
Updated on 2026-11-12 GMT+08:00

Detaching a NIC from a Lite Server

Function

This API is used to remove a specified NIC from a server. This API is designed for scenarios such as hardware maintenance, resource reclamation, or network configuration adjustments, allowing you to detach NIC devices that are no longer in use. To use this API, the target NIC must be correctly installed and operable, and you must have system administrator permissions. Once the detachment is complete, the NIC will be removed from the server configuration, and associated drivers and network parameters will be cleared. If the target NIC does not exist, you have insufficient permissions, or the server is in a state that prevents detachment, the API will return a corresponding error message.

Constraints

Only supernode-related resources are supported.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    modelarts:devserver:detachPort

    Write

    devserver *

    -

    -

    -

URI

DELETE /v1/{project_id}/dev-servers/{id}/detach-ports/{port_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition: Project ID. For details, see Obtaining a Project ID and Name.

Constraints: N/A

Range: 1 to 64 characters. Only letters, digits, and hyphens (-) are allowed.

Default Value: N/A

id

Yes

String

Definition: Lite Server instance ID.

Constraints: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$.

Range: 1 to 64 characters.

Default Value: N/A.

port_id

Yes

String

Definition: ID of the NIC to be detached.

Constraints: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[.89ab][0-9a-f]{3}-[0-9a-f]{12}$.

Range: 1 to 64 characters

Default Value: N/A.

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

port_id

String

Definition: ID of the NIC to be detached.

Range: ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$.

Example Requests

DELETE https://{endpoint}/v1/{project_id}/dev-servers/{id}/detach-ports/{port_id}

Example Responses

Status code: 200

{
  "port_id" : "38cf274a-98f9-4f6f-b622-5ed0e4a3db54"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.