• MapReduce Service

mrs
  1. Help Center
  2. MapReduce Service
  3. API Reference
  4. APIs
  5. Job Object APIs
  6. Querying the Job Object List

Querying the Job Object List

Function

This API is used to query the job object list. This API is compatible with Sahara.

URI

  • Format:

    GET /v1.1/{project_id}/jobs

  • Parameter description
    Table 1 URI parameter description

    Parameter

    Mandatory or Not

    Description

    project_id

    Yes

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

    limit

    No

    Maximum number of objects in response data

    Value range: 1 to 1073741822

    marker

    No

    Job object ID

    Query the job object list, and select one job object ID as the marker. The ID is the ID of the last element in the list that will not be returned.

    sort_by

    No

    Sort field

    • sort_by=name indicates to sort by name in ascending order.
    • sort_by=-name indicates to sort by name in descending order.

Request

  • Example:

    GET /v1.1/{project_id}/jobs?limit=2&sort_by=name&marker=4f59aa66-bf38-402c-9b6f-320e77219b9b

  • Parameter description

    None.

Response

  • Example:
    {
        "markers": {
            "prev": "62a287e9-76c3-458d-a2f8-56e2d824a9ee",
            "next": null
        },
        "jobs": [
            {
                "name": "my-mapreduce-job",
                "type": "MapReduce",
                "description": "This is the Map Reduce job template",
                "mains": [],
                "libs": [
                    {
                        "name": "my-job-binary-666",
                        "url": "/simple/mapreduce/program",
                        "description": "this is the job binary template",
                        "id": "2628d0e4-6109-4a09-a338-c4ee1b0963ed",
                        "tenant_id": "5a3314075bfa49b9ae360f4ecd333695",
                        "is_public": false,
                        "is_protected": null,
                        "extra": null
                    }
                ],
                "created_at": "2017-06-22T09:39:13",
                "updated_at": "2017-06-22T09:39:13",
                "id": "38a04cba-c113-4868-b11f-f50e8b1bf252",
                "tenant_id": "5a3314075bfa49b9ae360f4ecd333695",
                "is_public": false,
                "is_protected": false,
                "interface": []
            },
            {
                "name": "my-mapreduce-job-update",
                "type": "MapReduce",
                "description": "This is the Map Reduce job template",
                "mains": [],
                "libs": [
                    {
                        "name": "my-job-binary-666",
                        "url": "/simple/mapreduce/program",
                        "description": "this is the job binary template",
                        "id": "2628d0e4-6109-4a09-a338-c4ee1b0963ed",
                        "tenant_id": "5a3314075bfa49b9ae360f4ecd333695",
                        "is_public": false,
                        "is_protected": null,
                        "extra": null
                    }
                ],
                "created_at": "2017-06-22T12:05:58",
                "updated_at": "2017-06-22T12:05:58",
                "id": "b8ea4daa-0042-45e0-a522-e8b714e74760",
                "tenant_id": "5a3314075bfa49b9ae360f4ecd333695",
                "is_public": false,
                "is_protected": false,
                "interface": []
            }
        ]
    }
  • Parameter description
    Table 2 Response parameter description

    Parameter

    Mandatory or Not

    Type

    Description

    markers

    No

    Object

    Marker object

    For details, see Table 3.

    jobs

    Yes

    Array

    Job object list

    For details, see Table 4.

Table 3 markers parameter description

Parameter

Mandatory or Not

Type

Description

prev

No

String

Marker on the previous page

next

No

String

Marker on the next page

Table 4 jobs parameter description

Parameter

Mandatory or Not

Type

Description

description

Yes

String

Job object description

tenant_id

Yes

String

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

created_at

Yes

String

Job object creation time

mains

Yes

Array

Executable program set of a job object

updated_at

Yes

String

Job object update time

libs

Yes

Array

Dependency package set of a job object

is_protected

No

Bool

Whether a job object is protected

  • true
  • false

The current version does not support this function.

interface

Yes

Array

User-defined interface set

is_public

No

Bool

Whether a job object is public

  • true
  • false

The current version does not support this function.

type

Yes

String

Job object type

id

Yes

String

Job object ID

name

Yes

String

Job object name

Status Code

Table 5 describes the status code of this API.

Table 5 Status code

Status code

Description

200

The job object list is queried successfully.

For the description about error status codes, see section Status Codes.