Updated on 2025-11-21 GMT+08:00

Deleting Service Groups in Batches

Function

This API is used to delete service groups in batches.

URI

POST /v1/{project_id}/service-sets/batch-delete

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID, which is used to specify the project that an asset belongs to. You can query the assets of a project by project ID. You can obtain the project ID from the API or console. For details, see Obtaining a Project ID.

Constraints

N/A

Range

32-bit UUID.

Default Value

N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

object_id

Yes

String

Definition

Protected object ID, which is used to distinguish between Internet border protection and VPC border protection after a cloud firewall is created. You can obtain the ID by calling the API for querying firewall instances. In the return value, find the ID in data.records.protect_objects.object_id (The period [.] is used to separate different levels of objects). If the value of type is 0, the protected object ID belongs to the Internet border. If the value of type is 1, the protected object ID belongs to the VPC border.

Constraints

N/A

Range

32-bit UUID.

Default Value

N/A

set_ids

Yes

Array of strings

Definition

Service group ID. It can be obtained by calling the API for [obtaining the service group list]. The value is obtained from data.records.set_id in the return value.

Constraints

N/A

Range

32-bit UUID.

Default Value

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

data

Array of data objects

Definition

Service group information.

Range

N/A

Table 4 data

Parameter

Type

Description

name

String

Definition

Service group name.

Range

N/A

id

String

Definition

Service group ID.

Range

N/A

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Definition

Error code.

Range

N/A

error_msg

String

Definition

Error message.

Range

N/A

Example Requests

Delete service groups in batches. The project ID is eefb11b22d5944f2aa067954516df1cf, the object ID is be6a36cf-3f3a-4e49-b437-0ec2ae6b3135, the service group ID is 6d09fd06-cfb6-4c08-94b1-a7cfe3ef9413, and 9fb75958-aab1-48b6-a281-d029345cc9a4.

https://{Endpoint}/v1/eefb11b22d5944f2aa067954516df1cf/service-sets/batch-delete

{
  "object_id" : "be6a36cf-3f3a-4e49-b437-0ec2ae6b3135",
  "set_ids" : [ "6d09fd06-cfb6-4c08-94b1-a7cfe3ef9413", "9fb75958-aab1-48b6-a281-d029345cc9a4" ]
}

Example Responses

Status code: 200

OK

{
  "data" : [ {
    "name" : "test",
    "id" : "6d09fd06-cfb6-4c08-94b1-a7cfe3ef9413"
  }, {
    "name" : "test2",
    "id" : "9fb75958-aab1-48b6-a281-d029345cc9a4"
  } ]
}

Status code: 400

Bad Request

{
  "error_code" : "CFW.00200003",
  "error_msg" : "Parameter error."
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

Error Codes

See Error Codes.