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
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Unique ID of a tenant sub-project. Length: 1–64 characters. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| x-domain-name | Yes | String | Tenant account name. |
| 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
| Parameter | Type | Description |
|---|---|---|
| services | Array of DelServicesRspInfo objects | List of services to be deleted. |
| 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
| Parameter | Type | Description |
|---|---|---|
| errorCode | String | Error code. |
| errorMessage | String | Error information. |
| detail | String | Location details. |
Status code: 500
| 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.
Last Article: Creating Static Information for a Microservice
Next Article: Modifying Extended Attribute Information About a Microservice
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.