Updated on 2024-11-06 GMT+08:00

Configuring Job Tags

Function

This API is used to configure job tags.

URI

  • URI format

    POST /v2/{project_id}/factory/jobs/{job_name}/tags

  • Parameter description
    Table 1 URI parameters

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID. For details about how to obtain a project ID, see Project ID and Account ID.

    job_name

    Yes

    String

    Job name

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

workspace

No

String

Workspace ID

  • If this parameter is not set, data in the default workspace is queried by default.
  • To query data in other workspaces, this header must be carried.

X-Auth-Token

Yes

String

IAM Token

Minimum length: 0

Maximum length: 4096

Content-Type

No

String

This parameter is mandatory if the body is available. If the body is unavailable, you do not need to set and verify this parameter.

Example: Content-Type: application/json;charset=UTF-8

Table 3 Body parameters

Parameter

Mandatory

Type

Description

tag_names

No

List<String>

Tag list. If the list is empty, all tags of the job will be deleted.

Example: ["tag1", "tag2"]

Response Parameters

None

Example Request

Add tag1 to job myJob.
POST /v2/b384b9e9ab9b4ee8994c8633aabc9505/factory/jobs/myJob/tags
{
    "tag_names": ["tag1"]
}
Delete all the tags of job myJob.
POST /v2/b384b9e9ab9b4ee8994c8633aabc9505/factory/jobs/myJob/tags
{
     "tag_names": []
}

Example Response

  • Success response

    HTTP status code 204

  • Failure response

    HTTP status code 400

    {
        "error_code":"DLF.100",
        "error_msg":"The job does not exists."
    }