Updated on 2025-11-27 GMT+08:00

Deleting a Training Job

Function

This API is used to delete a training job from ModelArts.

This API applies to the following scenarios: When you need to delete completed or unnecessary training jobs, you can use this API to delete a specified training job. Before using this API, ensure that the training job exists and you have the permission to delete it. After the deletion is complete, the training job is permanently removed from the platform, and related resources and configurations are cleared. If the training job ID does not exist 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. Obtain its CLI example hcloud ModelArts DeleteTrainingJob.

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:trainJob:delete

    Write

    trainJob *

    g:ResourceTag/<tag-key>

    -

    -

    -

    • modelarts:poolType

    • modelarts:poolId

URI

DELETE /v2/{project_id}/training-jobs/{training_job_id}

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: The value can contain 1 to 64 characters. Letters, digits, and hyphens (-) are allowed.

Range: N/A

Default Value: N/A

training_job_id

Yes

String

Definition: Training job ID. For details, see Obtaining Training Jobs.

Constraints: N/A

Range: N/A

Default Value: N/A

Request Parameters

None

Response Parameters

Status code: 202

No Content

None

Example Requests

The following shows how to delete a training job whose UUID is 3faf5c03-aaa1-4cbe-879d-24b05d997347.

DELETE https://endpoint/v2/{project_id}/training-jobs/3faf5c03-aaa1-4cbe-879d-24b05d997347

Example Responses

Status code: 202

No Content

""

Status Codes

Status Code

Description

202

No Content

Error Codes

See Error Codes.