Batch Deleting Training Jobs
Function
This API is used to delete multiple training jobs from ModelArts at a time.
This API applies to the following scenario: When you need to delete multiple completed or unnecessary training jobs, you can use this API to batch delete them instead of calling the deletion API to delete them one by one. Before using this API, ensure that the training jobs to be deleted exist, belong to the same workspace, and you have the permission to delete training jobs. After the deletion is complete, the training job is permanently removed from the platform, and related resources and configurations are cleared. If the number of jobs to be deleted exceeds 100, the jobs do not exist, the jobs do not belong to the same workspace, or you do not have the operation permission, the API will return an error message.
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, no identity policy-based permission required for calling this API.
URI
POST /v2/{project_id}/training-jobs/batch-delete
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition: Project ID. For details, see Obtaining a Project ID and Name. Constraints: N/A Range: The value can contain 1 to 64 characters. Only letters, digits, and hyphens (-) are allowed. Default Value: N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| jobs | Yes | Array of BatchDeleteJobItem objects | Definition: List of training jobs to be deleted. Constraints: The list can contain a maximum of 100 elements, and all jobs must belong to the same workspace. Range: N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| kind | Yes | String | Definition: Type of a training job. Range: |
| metadata | Yes | BatchDeleteJobMetadata object | Metadata of training jobs to be batch deleted. |
Response Parameters
Status code: 202
No Content
None
Example Requests
Delete two training jobs at a time.
POST https://{endpoint}/v2/{project_id}/training-jobs/batch-delete
{
"jobs" : [ {
"kind" : "job",
"metadata" : {
"id" : "3faf5c03-aaa1-4cbe-879d-24b05d997347"
}
}, {
"kind" : "job",
"metadata" : {
"id" : "4a0b6d14-bb22-5cf9-980e-35c16e00845f"
}
} ]
} Example Responses
Status code: 202
No Content
""
Status Codes
| Status Code | Description |
|---|---|
| 202 | No Content |
Error Codes
See Error Codes.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot