• MapReduce Service

mrs
  1. Help Center
  2. MapReduce Service
  3. API Reference
  4. APIs
  5. Job Object APIs
  6. Updating a Job Object

Updating a Job Object

Function

This API is used to update a job object. This API is compatible with Sahara.

URI

  • Format:

    PATCH /v1.1/{project_id}/jobs/{job_id}

  • 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.

    job_id

    Yes

    Job object ID

Request

  • Example:
    {    
        "name": "my-mapreduce-job-update",         
        "mains": [ ],         
        "libs": [                 
        "2628d0e4-6109-4a09-a338-c4ee1b0963ed"        
        ],         
        "is_protected": false,         
        "interface": [ ],         
        "is_public": false,         
        "type": "MapReduce",         
        "description": "This is the Map Reduce job template"    
    }
  • Parameter description
    Table 2 Request parameter description

    Parameter

    Mandatory or Not

    Type

    Description

    name

    No

    String

    Job object name

    Contains 1 to 80 characters and consists of letters, digits, hyphens (-), and underscores (_) only.

    mains

    No

    Array

    Executable program set of a job object

    The current version does not support update of the executable program set.

    libs

    No

    Array

    Dependency package set of a job object

    The current version does not support update of the dependency package set.

    interface

    No

    Array

    User-defined interface set

    The current version does not support this function.

    is_protected

    No

    Bool

    Whether a job object is protected

    • true
    • false

    The current version does not support this function.

    is_public

    No

    Bool

    Whether a job object is public

    • true
    • false

    The current version does not support this function.

    type

    No

    String

    Job object type

    • MapReduce
    • Spark
    • Hive
    • hql (not supported currently)
    • DistCp
    • SparkScript
    • SparkSql (not supported in this API currently)

    description

    Yes

    String

    Job object description

    Contains a maximum of 65535 characters.

Response

  • Example:
    {
        "job": {
            "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 3 Response 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

    updated_at

    Yes

    String

    Job object update time

    mains

    Yes

    Array

    Executable program set of a job object

    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 4 describes the status code of this API.

Table 4 Status code

Status code

Description

202

The job object is successfully updated.

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