Updated on 2026-07-24 GMT+08:00

Deleting Service Deployment Instances

Function

This API is used to delete a specified deployment instance. It is applicable to scenarios where deployment instances are no longer used and need to be cleared or released. Before calling this API, ensure that you have the deletion permission and provide a valid service instance ID and deployment ID. After the deployment instance is deleted, it is permanently removed and does not take effect for any request. If the provided service instance ID and deployment ID are invalid, the service instance has been deleted, or the permission is insufficient, an exception message is returned, prompting you to check the validity and permission of the input data.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    modelarts:service:deleteDeploymentInstance

    Read

    service *

    -

    -

    -

URI

DELETE /v2/{project_id}/services/{id}/deployments/{deployment_name}/instances/{name}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID. For details, see Obtaining a Project ID and Name.

Constraints

N/A

Range

Project ID.

Default Value

N/A

id

Yes

String

Definition

Service ID, which can be obtained from the response body during service creation or by obtaining services owned by the current user. The service_id field is the service ID.

Constraints

N/A

Range

Service ID.

Default Value

N/A

deployment_name

Yes

String

Definition

Deployment name.

name

Yes

String

Definition

Service instance name. The value can be all. In this case, all service instances are displayed.

Constraints

N/A

Range

Service instance name.

Default Value

N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

force

No

Boolean

Definition

Specifies whether to enable forcible deletion.

Constraints

N/A

Range

  • true: Enable forcible deletion.

  • false: Disable forcible deletion.

Default Value

false

operation

No

String

Definition

Deletion operation type.

Constraints

Enumerated value.

Range

  • DELETE: Resources are directly deleted and released.

  • RECREATE: Resources are recreated after being deleted.

Default Value

RECREATE

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. For details about how to obtain the token, see Obtaining a User Token Through Password Authentication.

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

instance_name

String

Definition

Service instance name.

Range

N/A

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

  • Definition: ModelArts error code.

Range: N/A.

error_msg

String

Definition: Error message.

Range: N/A.

Status code: 401

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

  • Definition: ModelArts error code.

Range: N/A.

error_msg

String

Definition: Error message.

Range: N/A.

Status code: 403

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

  • Definition: ModelArts error code.

Range: N/A.

error_msg

String

Definition: Error message.

Range: N/A.

Status code: 404

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

  • Definition: ModelArts error code.

Range: N/A.

error_msg

String

Definition: Error message.

Range: N/A.

Example Requests

Forcibly delete specified service instances.

DELETE https://{endpoint}/v2/{project_id}/services/{service_id}/deployments/{deployment_id}/instances/{name}?force=true

Example Responses

Status code: 200

Response indicating successful deletion.

{
  "instance_name" : "infer-689e24bb-3cf7-48c3-9ab5-67c0ade4dba7-fp74f"
}

Status Codes

Status Code

Description

200

Response indicating successful deletion.

400

Invalid request parameter.

401

Authentication failed.

403

Insufficient permissions.

404

Resource not found.

Error Codes

See Error Codes.