Deleting BMSs

Function

This API is used to delete specified BMSs in a batch or one by one.

Constraints

  • This API can only be used to delete pay-per-use BMSs.

URI

POST /v1/{project_id}/baremetalservers/delete

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.

Request Parameters

Parameter

Mandatory

Type

Description

servers

Yes

Array of objects

Specifies the BMSs to be deleted. For details, see Table 2.

delete_publicip

Yes

Boolean

Specifies whether to delete the EIP bound to the BMS when the BMS is deleted. If you choose not to delete the EIP, the system only unbinds the EIP from the BMS and reserves the EIP.

The value can be true or false. The default value is false.

  • true: The EIP bound to the BMS is deleted when the BMS is deleted.

  • false: The EIP is unbound from the BMS when the BMS is deleted, but not deleted.

delete_volume

No

Boolean

Specifies whether to delete a data disk attached to the BMS when the BMS is deleted. If you choose not to delete the data disk, the system only detaches the disk from the BMS and reserves the disk.

The value can be true or false. The default value is false.

  • true: The data disk attached to the BMS is deleted when the BMS is deleted.

  • false: The data disk is detached from the BMS when the BMS is deleted, but not deleted.

Table 2 servers data structure

Parameter

Mandatory

Type

Description

id

Yes

String

Specifies the ID of the BMS to be deleted.

Example Request

Deleting a BMS (ID: 616fb98f-46ca-475e-917e-2563e5a8cd19) without deleting its EIPs and data disks

{
    "servers": [
        {
            "id": "616fb98f-46ca-475e-917e-2563e5a8cd19"
        }
    ],
    "delete_publicip": false,
    "delete_volume": false
}

Response

See Task ID Response.

Returned Values

Normal values

Returned Value

Description

200

The request has been successfully processed.

For details about other returned values, see Status Codes.

Error Codes

See Error Codes.