Help Center> ServiceStage> API Reference> CSE API> Microservice> Deleting Definitions and Related Information About Microservices in Batches

Deleting Definitions and Related Information About Microservices in Batches

Function

This API is used to delete the definitions and related information about microservices in batches, and deregister all instances of the microservices.

Constraints

None

URI

DELETE /v4/{project_id}/registry/microservices

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Unique ID of a tenant sub-project. Length: 1–64 characters.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

x-domain-name

Yes

String

Tenant account name.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

serviceIds

No

Array of strings

Microservice ID list.

force

No

Boolean

Whether forcible deletion is allowed. false: Forcible deletion is prohibited. true: Forcible deletion is allowed. Default value: false. If the value is true, all service instances are automatically deregistered and related service dependencies are deleted. If the value is not specified and microservice A depends on microservice B (for example, microservice B serves as a provider) or microservice B has instances, microservice B cannot be deleted.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

services

Array of DelServicesRspInfo objects

List of services to be deleted.

Table 5 DelServicesRspInfo

Parameter

Type

Description

serviceId

String

Microservice ID.

errMessage

String

Error information. In case of a success response, the value is empty. Otherwise, error information is returned.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

errorCode

String

Error code.

errorMessage

String

Error information.

detail

String

Location details.

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

errorCode

String

Error code.

errorMessage

String

Error information.

detail

String

Location details.

Example Requests

DELETE https://{endpoint}/v4/{project_id}/registry/microservices

{
  "serviceIds" : [ {
    "id" : "id1"
  }, {
    "id" : "id2"
  } ]
}

Example Responses

Status code: 200

OK

"{\n  \"services\": [\n    {\n      \"serviceId\": \"string\",\n      \"errMessage\": \"string\"\n    }\n  ]\n}"

Status Codes

Status Code

Description

200

OK

400

Bad Request

500

Internal Server Error

Error Codes

See Error Codes.