Help Center/ Cloud Service Engine/ API Reference/ ServiceComb API/ Microservice/ Deleting Static Information About Microservices in Batches
Updated on 2023-11-08 GMT+08:00

Deleting Static 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.

Restrictions

None

URI

DELETE /v4/{project_id}/registry/microservices

Table 1 Path parameter

Parameter

Mandatory

Type

Description

project_id

Yes

String

Fixed value: default.

Table 2 Query parameter

Parameter

Mandatory

Type

Description

force

No

Boolean

Whether to forcibly delete static information about microservices.

true: forcible deletion; false: non-forcible deletion.

If you choose forcible deletion, all service instances are automatically deregistered and related service dependencies are deleted. If this parameter is not transferred, the service cannot be deleted when it has an instance.

Default value: false.

Request

Table 3 Request header parameter

Parameter

Mandatory

Type

Description

Authorization

No

String

This parameter is mandatory if security authentication is enabled for an exclusive ServiceComb engine. Otherwise, this parameter is not required.

The token of an exclusive ServiceComb engine with security authentication enabled is in the following format:

Authorization:Bearer {Token}

For details about how to obtain the token, see Obtaining the User Token of an Exclusive ServiceComb Engine.

Table 4 Request body parameter

Parameter

Mandatory

Type

Description

serviceIds

Yes

Array of strings

Service ID list. See Querying Information About All Microservices.

Response

Status code: 200

Table 5 Response body parameter

Parameter

Type

Description

services

Array of DelServicesRspInfo objects

List of services to be deleted.

Table 6 DelServicesRspInfo

Parameter

Type

Description

serviceId

String

Microservice ID.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

errorCode

String

Error code.

errorMessage

String

Error message.

detail

String

Location details.

Status code: 500

Table 8 Response body parameters

Parameter

Type

Description

errorCode

String

Error code.

errorMessage

String

Error message.

detail

String

Location details.

Example Request

Delete the static information about the microservices whose IDs are id1 and id2.

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

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

Example Response

Status code: 200

Successfully deleted.

{
  "services" : [ {
    "serviceId" : "id1"
  },
 {
    "serviceId" : "id2"
  }
 ]
}

Status Code

Status Code

Description

200

OK

400

Bad Request

500

Internal Server Error

Error Code

See ServiceComb Error Codes.