• MapReduce Service

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

Creating a Job Binary Object

Function

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

URI

  • Format:

    POST /v1.1/{project_id}/job-binaries

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

Request

  • Example:
    {
        "name": "my-job-binary", 
        "url": "/simple/mapreduce/input", 
        "is_protected": false, 
        "is_public": false, 
        "description": "this is the job binary for map reduce job"
    }
  • Parameter description
    Table 2 Request parameter description

    Parameter

    Mandatory or Not

    Type

    Description

    name

    Yes

    String

    Binary object name

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

    url

    Yes

    String

    Binary object URL

    Contains of 1 to 255 characters.

    is_protected

    No

    Bool

    Whether a binary object is protected

    • true
    • false

    The current version does not support this function.

    is_public

    No

    Bool

    Whether a binary object is public

    • true
    • false

    The current version does not support this function.

    description

    No

    String

    Binary object description

    Contains a maximum of 65535 characters.

Response

  • Example:
    {
        "job_binary": {
            "name": "my-job-binary",
            "url": "/simple/mapreduce/program",
            "description": "this is the job binary template",
            "created_at": "2017-06-22T09:04:53",
            "updated_at": null,
            "id": "da37b581-042f-4d7a-9378-f628f32bd9ae",
            "tenant_id": "5a3314075bfa49b9ae360f4ecd333695",
            "is_public": false,
            "is_protected": false
        }
    }
  • Parameter description
    Table 3 Response parameter description

    Parameter

    Mandatory or Not

    Type

    Description

    description

    No

    String

    Binary object description

    url

    Yes

    String

    Binary object URL

    tenant_id

    Yes

    String

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

    created_at

    Yes

    String

    Binary object creation time

    updated_at

    Yes

    String

    Binary object update time

    is_protected

    No

    Bool

    Whether a binary object is protected

    • true
    • false

    The current version does not support this function.

    is_public

    No

    Bool

    Whether a binary object is public

    • true
    • false

    The current version does not support this function.

    id

    Yes

    String

    Binary object ID

    name

    Yes

    String

    Binary object name

Status Code

Table 4 describes the status code of this API.

Table 4 Status code

Status Code

Description

202

The job binary object is successfully created.

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