Creating a Job

Function

Create a job for the selected video analysis service.

URI

  • URI format:
    POST /v2/{project_id}/services/{service_name}/tasks
  • Parameters

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID corresponding to the region where the service is located. For details about how to obtain the project ID, see Obtaining the Project ID.

    service_name

    Yes

    String

    Name of the selected video analysis service.

Request Parameters

  • Example request
    POST /v2/6204a5bd270343b5885144cf9c8c158d/services/video-analyze/tasks
    {  
        "name": "task-est",
        "description": "description",
        "input": {  
               "type": "obs",
               "data": [
                      {  
                       "bucket": "obs-iva",
                       "path": "input/demo.mp4"
                      }  
               ]  
        },  
        "output": {
               "obs": {
                      "bucket": "obs-iva",
                      "path": "output/"
               }
        },
       "service_version":"1.0"  
    }
  • Request parameters

    Parameter

    Mandatory

    Type

    Description

    name

    Yes

    String

    Job name, which consists of 1 to 100 characters, including letters (A to Z and a to z), digits (0 to 9), hyphens (-), and underscores (_).

    description

    No

    String

    Job description, which consists of a maximum of 500 characters.

    input

    Yes

    Object

    List of input video data.

    For details, see task.input.

    service_version

    Yes

    String

    Version.

    output

    Yes

    Object

    List of output result data.

    For details, see task.output.

Response Parameters

  • Example response
    [  
      {      "id": "f18320e61e4c4dc685aa2dfc22a28dc5"   }
    ]
  • Job ID description

    Parameter

    Type

    Description

    id

    String

    Job ID

Status Codes

  • Normal

    201

  • Abnormal

    Status Code

    Description

    400 Bad Request

    Request error. For details about the returned error code, see Error Codes.

    401 Unauthorized

    Authentication failed.

    403 Forbidden

    No operation permission.

    404 Not Found

    The requested resource was not found.

    500 Internal Server Error

    Internal service error.

    503 Service Unavailable

    Service unavailable.