百度智能云

All Product Document

          MapReduce

          Step Operation Interface

          Add Steps

          Interface Description

          Add custom step batches to the specified cluster.

          Privileges Description

          The request is initiated with legal AccessKeyID and SecretAccessKey, and see the Authentication for more information.

          Notes

          If the request contains no user verification information (i.e., anonymous access), the 403 Forbidden will be returned with the error message AccessDenied.

          Request Structure

          POST /v{version}/cluster/{clusterId}/step?clientToken={clientToken} HTTP/1.1
          accept-encoding: gzip, deflate
          x-bce-date: {utc-date-string}
          host: bmr.bj.baidubce.com
          connection: keep-alive
          accept: */*
          content-type: application/json
          authorization: {bce-authorization-string}
          {
              "steps": [
                  {
                      "actionOnFailure": "Continue",
                      "name": "my-mapreduce-streaming",
                      "properties": {
                          "arguments": "-D mapreduce.job.reduces=20",
                          "input": "bos://mybucket/inputs/txt-1m",
                          "mapper": "cat",
                          "output": "bos://mybucket/outputs/streaming",
                          "reducer": "cat"
                      },
                      "type": "Streaming"
                  },
                  {
                      "actionOnFailure": "Continue",
                      "name": "my-java-program",
                      "properties": {
                          "arguments": "bos://mybucket/inputs/java bos://mybucket/outputs/java",
                          "jar": "bos://mybucket/jars/my-java.jar",
                          "mainClass": "org.apache.hadoop.mapred.WordCount"
                      },
                      "type": "Java"
                  }
              ]
          }

          Request Header Field

          There are no other special header fields except the common header field.

          Request Parameter

          Parameter Name Parameter Type Required Parameter Position Parameter Description
          version String Yes URI parameter API version number, and the current number is 1
          clusterId String Yes URI parameter Cluster ID to specify, and add steps only to the cluster in the status of RUNNING or WAITING
          steps List<StepConfig> Yes RequestBody parameter Information on the step to add
          clientToken String No Query parameter Idempotent Token is an ASCII string with a length not exceeding 64 bits.

          Response Header Field

          There are no other special header fields except the common header field.

          Response Parameter

          Parameter Name Parameter Type Parameter Description
          stepIds List<String> Set of step IDs, and the step ID is the unique step identification generated by the system

          Request Examples

          POST /v1/cluster/0ce4f730-4af2-4f37-8fa2-b14f2f44e50e/step?clientToken=be31b98c-5e41-4838-9830-9be700de5a20 HTTP/1.1
          accept-encoding: gzip, deflate
          x-bce-date: 2015-03-24T13:02:00Z
          host: bmr.bj.baidubce.com
          connection: keep-alive
          accept: */*
          content-type: application/json
          authorization: bce-auth-v1/46bd9968a6194b4bbdf0341f2286ccce/2015-03-24T13:02:00Z/1800/host;x-bce-date/994014d96b0eb26578e039fa053a4f9003425da4bfedf33f4790882fb4c54903
          
          {
              "steps": [
                  {
                      "actionOnFailure": "Continue",
                      "name": "my-mapreduce-streaming",
                      "properties": {
                          "arguments": "-D mapreduce.job.reduces=20",
                          "input": "bos://mybucket/inputs/txt-1m",
                          "mapper": "cat",
                          "output": "bos://mybucket/outputs/streaming",
                          "reducer": "cat"
                      },
                      "type": "Streaming"
                  },
                  {
                      "actionOnFailure": "Continue",
                      "name": "my-java-program",
                      "properties": {
                          "arguments": "bos://mybucket/inputs/java bos://mybucket/outputs/java",
                          "jar": "bos://mybucket/jars/my-java.jar",
                          "mainClass": "org.apache.hadoop.mapred.WordCount"
                      },
                      "type": "Java"
                  }
              ]
          }

          Return Example

          HTTP/1.1 201 CREATED
          Transfer-Encoding: chunked
          x-bce-request-id: 73c4e74c-3101-4a00-bf44-fe246959c05e
          Cache-Control: no-cache
          Server: BWS
          Date: Tue, 24 Mar 2015 13:02:01 GMT
          Content-Type: application/json;charset=UTF-8
          
          {
              "stepIds": [
                  "31fd0974-452b-491f-a3fc-c28b3b9d7046",
                  "f99f669b-be45-48c9-8549-fd8dd473be0f"
              ]
          }

          Query Step Lists

          Interface Description

          Obtain the step list of the specified cluster, and the paging query is available.

          Privileges Description

          The request is initiated with legal AccessKeyID and SecretAccessKey, and see the Authentication for more information.

          Notes

          If the request contains no user verification information (i.e., anonymous access), the 403 Forbidden will be returned with the error message AccessDenied.

          Request Structure

          GET /v{version}/cluster/{clusterId}/step?marker={marker}&maxKeys={maxKeys} HTTP/1.1
          accept-encoding: gzip, deflate
          x-bce-date: {utc-date-string}
          host: bmr.bj.baidubce.com
          connection: keep-alive
          accept: */*
          content-type: application/json
          authorization: {bce-authorization-string}

          Request Header Field

          There are no other special header fields except the common header field.

          Request Parameter

          Parameter Name Parameter Type Required Parameter Position Parameter Description
          version String Yes URI parameter API version number, and the current number is 1
          clusterId String Yes URI parameter Specified cluster ID
          marker String No Query parameter Initial position of list query obtained in batch, which is a string generated by the system
          maxKeys Int No Query parameter The maximum number on every page is not more than 1000. The number of more than 1000 is modified as 1000. The default value is 1000

          Response Header Field

          There are no other special header fields except the common header field.

          Response Parameter

          Parameter Name Parameter Type Parameter Description
          marker String Mark the initial position of query
          isTruncated Boolean True means there is still data behind, and false means it is already the last page.
          nextMarker String Gets the marker value to pass on the next page. This field does not appear when isTruncated is false.
          Stepteps List<Step> Returned the step list

          Request Examples

          GET /v1/cluster/0ce4f730-4af2-4f37-8fa2-b14f2f44e50e/step?marker=9e0c8cf1-690c-444a-8727-04241f3beaa5&maxKeys=30 HTTP/1.1
          accept-encoding: gzip, deflate
          x-bce-date: 2015-03-24T13:02:00Z
          host: bmr.bj.baidubce.com
          connection: keep-alive
          accept: */*
          content-type: application/json
          authorization: bce-auth-v1/46bd9968a6194b4bbdf0341f2286ccce/2015-03-24T13:02:00Z/1800/host;x-bce-date/994014d96b0eb26578e039fa053a4f9003425da4bfedf33f4790882fb4c54903

          Return Example

          HTTP/1.1 200 OK
          Transfer-Encoding: chunked
          x-bce-request-id: 73c4e74c-3101-4a00-bf44-fe246959c05e
          Cache-Control: no-cache
          Server: BWS
          Date: Tue, 24 Mar 2015 13:02:01 GMT
          Content-Type: application/json;charset=UTF-8
          
          {
              "isTruncated": false,
              "marker": "9e0c8cf1-690c-444a-8727-04241f3beaa5",
              "steps": [
                  {
                      "actionOnFailure": "Continue",
                      "id": "6e0e826f-462c-4529-a5ef-b7d9d86e7741",
                      "name": "my-java-program",
                      "properties": {
                          "arguments": "bos://mybucket/inputs/java bos://mybucket/outputs/java",
                          "jar": "bos://mybucket/jars/my-java.jar",
                          "mainClass": "org.apache.hadoop.mapred.WordCount"
                      },
                      "status": {
                          "code": null,
                          "creationDateTime": "2014-08-06T11:00:30Z",
                          "endDateTime": null,
                          "message": null,
                          "startDateTime": "2014-08-06T11:02:55Z",
                          "state": "Running"
                      },
                      "type": "Java"
                  },
                  {
                      "actionOnFailure": "Continue",
                      "id": "f5540043-b1b1-4a52-95a7-6005cb0ebc64",
                      "name": "my-mapreduce-streaming",
                      "properties": {
                          "arguments": "-D mapreduce.job.reduces=20",
                          "input": "bos://mybucket/inputs/txt-1m",
                          "mapper": "cat",
                          "output": "bos://mybucket/outputs/streaming",
                          "reducer": "cat"
                      },
                      "status": {
                          "code": null,
                          "creationDateTime": "2014-08-06T11:00:05Z",
                          "endDateTime": "2014-08-06T11:02:37Z",
                          "message": null,
                          "startDateTime": "2014-08-06T11:00:33Z",
                          "state": "Completed"
                      },
                      "type": "Streaming"
                  }
              ]
          }

          Query Step Information

          Interface Description

          Query the information on a specified step in a specified cluster.

          Privileges Description

          The request is initiated with legal AccessKeyID and SecretAccessKey, and see the Authentication for more information.

          Notes

          If the request contains no user verification information (i.e., anonymous access), the 403 Forbidden will be returned with the error message AccessDenied.

          Request Structure

          GET /v{version}/cluster/{clusterId}/step/{stepId} HTTP/1.1
          accept-encoding: gzip, deflate
          x-bce-date: {utc-date-string}
          host: bmr.bj.baidubce.com
          connection: keep-alive
          accept: */*
          content-type: application/json
          authorization: {bce-authorization-string}

          Request Header Field

          There are no other special header fields except the common header field.

          Request Parameter

          Parameter Name Parameter Type Required Parameter Position Parameter Description
          version String Yes URI parameter API version number, and current number is 1
          clusterId String Yes URI parameter Specified cluster ID
          stepId String Yes URI parameter Step ID to query

          Response Header Field

          There are no other special header fields except the common header field.

          Response Parameter

          Parameter Name Parameter Type Parameter Description
          actionOnFailure String Step Failure Policy
          id String The step ID is a fixed-length string which only contains uppercase and lowercase letters, numbers, hyphens (-), and underlines (_)
          name String Step name
          properties Object Step Description, depending on the step type
          status [StepStatus](BMR/API Reference/Data Type.md#StepStatus) Information on step status
          type String Step Type

          Request Examples

          GET /v1/cluster/0ce4f730-4af2-4f37-8fa2-b14f2f44e50e/step/f5540043-b1b1-4a52-95a7-6005cb0ebc64 HTTP/1.1
          accept-encoding: gzip, deflate
          x-bce-date: 2015-03-24T13:02:00Z
          host: bmr.bj.baidubce.com
          connection: keep-alive
          accept: */*
          content-type: application/json
          authorization: bce-auth-v1/46bd9968a6194b4bbdf0341f2286ccce/2015-03-24T13:02:00Z/1800/host;x-bce-date/994014d96b0eb26578e039fa053a4f9003425da4bfedf33f4790882fb4c54903

          Return Example

          HTTP/1.1 200 OK
          Transfer-Encoding: chunked
          x-bce-request-id: 73c4e74c-3101-4a00-bf44-fe246959c05e
          Cache-Control: no-cache
          Server: BWS
          Date: Tue, 24 Mar 2015 13:02:01 GMT
          Content-Type: application/json;charset=UTF-8
          
          {
              "actionOnFailure": "Continue",
              "id": "f5540043-b1b1-4a52-95a7-6005cb0ebc64",
              "name": "my-mapreduce-streaming",
              "properties": {
                  "arguments": "-D mapreduce.job.reduces=20",
                  "input": "bos://mybucket/inputs/txt-1m",
                  "mapper": "cat",
                  "output": "bos://mybucket/outputs/streaming",
                  "reducer": "cat"
              },
              "status": {
                  "code": null,
                  "creationDateTime": "2014-08-06T11:00:05Z",
                  "endDateTime": "2014-08-06T11:02:37Z",
                  "message": null,
                  "startDateTime": "2014-08-06T11:00:33Z",
                  "state": "Completed"
              },
              "type": "Streaming"
          }
          Previous
          Instance Operation Interface
          Next
          Data Type