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

Deleting a Pod

Function

This API is used to delete a specified pod. It is applicable to scenarios where pod resources 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 pod ID. After the pod is deleted, the pod is completely removed and does not take effect for any service request. If the provided pod ID is invalid, the pod 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:deleteDeploymentPod

    Read

    service *

    -

    -

    -

URI

DELETE /v2/{project_id}/services/{id}/deployments/{deployment_name}/instances/{instance_name}/pods/{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, which can be obtained from the response body during deployment creation. You can also obtain the deployments owned by the current user by obtaining service deployments. The name field indicates the deployment name.

Constraints

N/A

Range

N/A

Default Value

N/A

instance_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

name

Yes

String

Definition

Service instance pod 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

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

pod_name

String

Definition

Pod 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 a specified pod.

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

Example Responses

Status code: 200

Response indicating successful deletion.

{
  "pod_name" : "infer-689e24bb-4489-499b-becb-9ec539ebac93-cfvs4-role-0-68cj4gd"
}

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.