Creating a Visualization Job

Function

This API is used to create a visualization job.

Calling this API is an asynchronous operation. The job status can be obtained by calling the APIs described in Querying the List of Visualization Jobs and Querying the Details About a Visualization Job.

URI

POST /v1/{project_id}/visualization-jobs

Table 1 describes the required parameters.
Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

Request Body

Table 2 describes the request parameters.

Table 2 Parameter description

Parameter

Mandatory

Type

Description

job_name

Yes

String

Name of a visualization job. The value is a string of 1 to 20 characters consisting of only digits, letters, underscores (_), and hyphens (-).

job_desc

No

String

Description of a visualization job. The value is a string of 0 to 256 characters. By default, this parameter is left blank.

train_url

Yes

String

OBS path

Response Body

Table 3 describes the response parameters.

Table 3 Parameter description

Parameter

Type

Description

is_success

Boolean

Whether the request is successful

error_msg

String

Error message of a failed API call.

This parameter is not included when the API call succeeds.

error_code

String

Error code of a failed API call. For details, see Error Code.

This parameter is not included when the API call succeeds.

job_id

Long

ID of a visualization job

job_name

String

Name of a visualization job

status

Byte

Status of a visualization job. For details about the job statuses, see Job Statuses.

create_time

Long

Time when a visualization job is created, in timestamp format

Samples

The following shows how to create a visualization job whose name is visualization-job, description is this is a visualization job, and OBS path is /obs/name/.

  • Sample request
    POST  https://endpoint/v1/{project_id}/visualization-jobs
    {
        "job_name": "visualization-job",
        "job_desc": "this is a visualization job",
        "train_url": "/obs/name/"
    }
  • Successful sample response
    {
        "is_success": true,
        "job_id": "10",
        "job_name": "visualization-job",
        "status": "1",
        "create_time": "1524189990635"
    }
  • Failed sample response
    {
        "is_success": false,
        "error_msg": "error message",
        "error_code": "ModelArts.0103"
    }

Status Code

For details about the status code, see Table 1.