diff --git a/docs/mrs/api-ref/ALL_META.TXT.json b/docs/mrs/api-ref/ALL_META.TXT.json new file mode 100644 index 000000000..f639205ab --- /dev/null +++ b/docs/mrs/api-ref/ALL_META.TXT.json @@ -0,0 +1,932 @@ +[ + { + "uri":"en-us_topic_0037324628.html", + "product_code":"mrs", + "code":"1", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Before You Start", + "title":"Before You Start", + "githuburl":"" + }, + { + "uri":"mrs_02_0001.html", + "product_code":"mrs", + "code":"2", + "des":"Welcome to MapReduce Service API Reference. MapReduce Service (MRS) provides enterprise-level big data clusters on the cloud. Tenants can fully control the clusters and e", + "doc_type":"api", + "kw":"Overview,Before You Start,API Reference", + "title":"Overview", + "githuburl":"" + }, + { + "uri":"mrs_02_0017.html", + "product_code":"mrs", + "code":"3", + "des":"MRS support Representational State Transfer (REST) APIs, allowing you to call APIs using HTTPS. For details about API calling, see Calling APIs.", + "doc_type":"api", + "kw":"API Calling,Before You Start,API Reference", + "title":"API Calling", + "githuburl":"" + }, + { + "uri":"mrs_02_0003.html", + "product_code":"mrs", + "code":"4", + "des":"An endpoint is the request address for calling an API. Endpoints vary depending on services and regions. For the endpoints of all services, see Regions and Endpoints..", + "doc_type":"api", + "kw":"Endpoints,Before You Start,API Reference", + "title":"Endpoints", + "githuburl":"" + }, + { + "uri":"mrs_02_0004.html", + "product_code":"mrs", + "code":"5", + "des":"For more constraints, see API description.", + "doc_type":"api", + "kw":"Constraints,Before You Start,API Reference", + "title":"Constraints", + "githuburl":"" + }, + { + "uri":"mrs_02_0005.html", + "product_code":"mrs", + "code":"6", + "des":"DomainA domain is created upon successful registration with the cloud platform. The domain has full access permissions for all of its cloud services and resources. It can", + "doc_type":"api", + "kw":"Concepts,Before You Start,API Reference", + "title":"Concepts", + "githuburl":"" + }, + { + "uri":"mrs_02_0006.html", + "product_code":"mrs", + "code":"7", + "des":"Currently, MRS provides two types (V1 and V2) of APIs for cloud services with customized specifications. Only part of V2 APIs is available and mainly used for submitting ", + "doc_type":"api", + "kw":"Selecting an API Type,Before You Start,API Reference", + "title":"Selecting an API Type", + "githuburl":"" + }, + { + "uri":"mrs_02_0007.html", + "product_code":"mrs", + "code":"8", + "des":"Table 1 describes MRS APIs that meet RESTful API design standards.Table 2 lists MRS Manager APIs provided by MRS.", + "doc_type":"api", + "kw":"API Overview,API Reference", + "title":"API Overview", + "githuburl":"" + }, + { + "uri":"mrs_02_0002.html", + "product_code":"mrs", + "code":"9", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Calling APIs", + "title":"Calling APIs", + "githuburl":"" + }, + { + "uri":"mrs_02_0008.html", + "product_code":"mrs", + "code":"10", + "des":"This section describes the structure of a REST API, and uses the IAM API for obtaining request authentication as an example to demonstrate how to call an API. The obtaine", + "doc_type":"api", + "kw":"Making an API Request,Calling APIs,API Reference", + "title":"Making an API Request", + "githuburl":"" + }, + { + "uri":"mrs_02_0009.html", + "product_code":"mrs", + "code":"11", + "des":"Requests for calling an API can be authenticated using either of the following methods:Token-based authentication: Requests are authenticated using a token.AK/SK-based au", + "doc_type":"api", + "kw":"Authentication,Calling APIs,API Reference", + "title":"Authentication", + "githuburl":"" + }, + { + "uri":"mrs_02_0010.html", + "product_code":"mrs", + "code":"12", + "des":"After sending a request, you will receive a response, including a status code, response header, and response body.A status code is a group of digits, ranging from 1xx to ", + "doc_type":"api", + "kw":"Response,Calling APIs,API Reference", + "title":"Response", + "githuburl":"" + }, + { + "uri":"mrs_02_0020.html", + "product_code":"mrs", + "code":"13", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"APIs", + "title":"APIs", + "githuburl":"" + }, + { + "uri":"mrs_02_0021.html", + "product_code":"mrs", + "code":"14", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Data Source APIs", + "title":"Data Source APIs", + "githuburl":"" + }, + { + "uri":"mrs_02_0022.html", + "product_code":"mrs", + "code":"15", + "des":"This API is used to create a data source. This API is compatible with Sahara.FormatPOST /v1.1/{project_id}/data-sourcesPOST /v1.1/{project_id}/data-sourcesParameter descr", + "doc_type":"api", + "kw":"Creating a Data Source,Data Source APIs,API Reference", + "title":"Creating a Data Source", + "githuburl":"" + }, + { + "uri":"mrs_02_0023.html", + "product_code":"mrs", + "code":"16", + "des":"This API is used to update a data source. If the data source does not exist, the system reports an error. This API is compatible with Sahara.FormatPUT /v1.1/{project_id}/", + "doc_type":"api", + "kw":"Updating a Data Source,Data Source APIs,API Reference", + "title":"Updating a Data Source", + "githuburl":"" + }, + { + "uri":"mrs_02_0024.html", + "product_code":"mrs", + "code":"17", + "des":"This API is used to query the data source list. This API is compatible with Sahara.FormatGET /v1.1/{project_id}/data-sourcesGET /v1.1/{project_id}/data-sourcesParameter d", + "doc_type":"api", + "kw":"Querying the Data Source List,Data Source APIs,API Reference", + "title":"Querying the Data Source List", + "githuburl":"" + }, + { + "uri":"mrs_02_0025.html", + "product_code":"mrs", + "code":"18", + "des":"This API is used to query detailed information about a data source. This API is compatible with Sahara.FormatGET /v1.1/{project_id}/data-sources/{data_source_id}GET /v1.1", + "doc_type":"api", + "kw":"Querying the Data Source Details,Data Source APIs,API Reference", + "title":"Querying the Data Source Details", + "githuburl":"" + }, + { + "uri":"mrs_02_0026.html", + "product_code":"mrs", + "code":"19", + "des":"This API is used to delete a data source. This API is compatible with Sahara.FormatDELETE /v1.1/{project_id}/data-sources/{data_source_id}DELETE /v1.1/{project_id}/data-s", + "doc_type":"api", + "kw":"Deleting a Data Source,Data Source APIs,API Reference", + "title":"Deleting a Data Source", + "githuburl":"" + }, + { + "uri":"mrs_02_0100.html", + "product_code":"mrs", + "code":"20", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Cluster management APIs (V2)", + "title":"Cluster management APIs (V2)", + "githuburl":"" + }, + { + "uri":"mrs_02_0101.html", + "product_code":"mrs", + "code":"21", + "des":"This API is used to create an MRS cluster.Before using the API, you need to obtain the resources listed in Table 1.URI formatPOST /v2/{project_id}/clustersPOST /v2/{proje", + "doc_type":"api", + "kw":"Creating Clusters,Cluster management APIs (V2),API Reference", + "title":"Creating Clusters", + "githuburl":"" + }, + { + "uri":"mrs_02_0027.html", + "product_code":"mrs", + "code":"22", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Cluster management APIs (V1)", + "title":"Cluster management APIs (V1)", + "githuburl":"" + }, + { + "uri":"mrs_02_0028.html", + "product_code":"mrs", + "code":"23", + "des":"This API is used to create an MRS cluster and submit a job in the cluster. This API is incompatible with Sahara.A maximum of 10 clusters can be concurrently created.Befor", + "doc_type":"api", + "kw":"Creating a Cluster and Running a Job,Cluster management APIs (V1),API Reference", + "title":"Creating a Cluster and Running a Job", + "githuburl":"" + }, + { + "uri":"mrs_02_0029.html", + "product_code":"mrs", + "code":"24", + "des":"This API is used to manually scale out or scale in Core or Task nodes in a cluster that has been created. After an MRS cluster is created, the number of Master nodes cann", + "doc_type":"api", + "kw":"Resizing a Cluster,Cluster management APIs (V1),API Reference", + "title":"Resizing a Cluster", + "githuburl":"" + }, + { + "uri":"mrs_02_0030.html", + "product_code":"mrs", + "code":"25", + "des":"This API is used to query a list of clusters created by a user. This API is incompatible with Sahara.FormatGET /v1.1/{project_id}/cluster_infos?pageSize={page_size}&curre", + "doc_type":"api", + "kw":"Querying a Cluster List,Cluster management APIs (V1),API Reference", + "title":"Querying a Cluster List", + "githuburl":"" + }, + { + "uri":"mrs_02_0031.html", + "product_code":"mrs", + "code":"26", + "des":"This API is used to query details about a specified cluster. This API is incompatible with Sahara.FormatGET /v1.1/{project_id}/cluster_infos/{cluster_id}GET /v1.1/{projec", + "doc_type":"api", + "kw":"Querying Cluster Details,Cluster management APIs (V1),API Reference", + "title":"Querying Cluster Details", + "githuburl":"" + }, + { + "uri":"mrs_02_0032.html", + "product_code":"mrs", + "code":"27", + "des":"This API is used to delete a cluster after data processing and analysis are completed or the cluster is abnormal. This API is compatible with Sahara.Clusters in any of th", + "doc_type":"api", + "kw":"Deleting a Cluster,Cluster management APIs (V1),API Reference", + "title":"Deleting a Cluster", + "githuburl":"" + }, + { + "uri":"mrs_02_0057.html", + "product_code":"mrs", + "code":"28", + "des":"This API is used to query a host list of a specified cluster.FormatGET /v1.1/{project_id}/clusters/{cluster_id}/hostsGET /v1.1/{project_id}/clusters/{cluster_id}/hostsPar", + "doc_type":"api", + "kw":"Querying a Host List,Cluster management APIs (V1),API Reference", + "title":"Querying a Host List", + "githuburl":"" + }, + { + "uri":"mrs_02_0033.html", + "product_code":"mrs", + "code":"29", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Job Binary Object APIs", + "title":"Job Binary Object APIs", + "githuburl":"" + }, + { + "uri":"mrs_02_0034.html", + "product_code":"mrs", + "code":"30", + "des":"This API is used to create a job binary object. This API is compatible with Sahara.FormatPOST /v1.1/{project_id}/job-binariesPOST /v1.1/{project_id}/job-binariesParameter", + "doc_type":"api", + "kw":"Creating a Job Binary Object,Job Binary Object APIs,API Reference", + "title":"Creating a Job Binary Object", + "githuburl":"" + }, + { + "uri":"mrs_02_0035.html", + "product_code":"mrs", + "code":"31", + "des":"This API is used to update a job binary object. This API is compatible with Sahara.FormatPUT /v1.1/{project_id}/job-binaries/{job_binary_id}PUT /v1.1/{project_id}/job-bin", + "doc_type":"api", + "kw":"Updating a Job Binary Object,Job Binary Object APIs,API Reference", + "title":"Updating a Job Binary Object", + "githuburl":"" + }, + { + "uri":"mrs_02_0036.html", + "product_code":"mrs", + "code":"32", + "des":"This API is used to query the binary object list. This API is compatible with Sahara.FormatGET /v1.1/{project_id}/job-binariesGET /v1.1/{project_id}/job-binariesParameter", + "doc_type":"api", + "kw":"Querying the Binary Object List,Job Binary Object APIs,API Reference", + "title":"Querying the Binary Object List", + "githuburl":"" + }, + { + "uri":"mrs_02_0037.html", + "product_code":"mrs", + "code":"33", + "des":"This API is used to query detailed information about a binary object. This API is compatible with Sahara.FormatGET /v1.1/{project_id}/job-binaries/{job_binary_id}GET /v1.", + "doc_type":"api", + "kw":"Querying the Binary Object Details,Job Binary Object APIs,API Reference", + "title":"Querying the Binary Object Details", + "githuburl":"" + }, + { + "uri":"mrs_02_0038.html", + "product_code":"mrs", + "code":"34", + "des":"This API is used to delete a binary object. This API is compatible with Sahara.FormatDELETE /v1.1/{project_id}/job-binaries/{job_binary_id}DELETE /v1.1/{project_id}/job-b", + "doc_type":"api", + "kw":"Deleting a Job Binary Object,Job Binary Object APIs,API Reference", + "title":"Deleting a Job Binary Object", + "githuburl":"" + }, + { + "uri":"mrs_02_0039.html", + "product_code":"mrs", + "code":"35", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Job Object APIs (V1, Not Recommended)", + "title":"Job Object APIs (V1, Not Recommended)", + "githuburl":"" + }, + { + "uri":"mrs_02_0040.html", + "product_code":"mrs", + "code":"36", + "des":"This API is used to add a job to an MRS cluster and execute the job. This API is incompatible with Sahara.FormatPOST /v1.1/{project_id}/jobs/submit-jobPOST /v1.1/{project", + "doc_type":"api", + "kw":"Adding a Job and Executing the Job,Job Object APIs (V1, Not Recommended),API Reference", + "title":"Adding a Job and Executing the Job", + "githuburl":"" + }, + { + "uri":"mrs_02_0041.html", + "product_code":"mrs", + "code":"37", + "des":"This API is used to create a job object. This API is compatible with Sahara.FormatPOST /v1.1/{project_id}/jobsPOST /v1.1/{project_id}/jobsParameter descriptionURI paramet", + "doc_type":"api", + "kw":"Creating a Job Object,Job Object APIs (V1, Not Recommended),API Reference", + "title":"Creating a Job Object", + "githuburl":"" + }, + { + "uri":"mrs_02_0042.html", + "product_code":"mrs", + "code":"38", + "des":"This API is used to update a job object. This API is compatible with Sahara.FormatPATCH /v1.1/{project_id}/jobs/{job_id}PATCH /v1.1/{project_id}/jobs/{job_id}Parameter de", + "doc_type":"api", + "kw":"Updating a Job Object,Job Object APIs (V1, Not Recommended),API Reference", + "title":"Updating a Job Object", + "githuburl":"" + }, + { + "uri":"mrs_02_0043.html", + "product_code":"mrs", + "code":"39", + "des":"This API is used to execute a created job object. This API is compatible with Sahara.FormatPOST /v1.1/{project_id}/jobs/{job_id}/executePOST /v1.1/{project_id}/jobs/{job_", + "doc_type":"api", + "kw":"Executing a Job Object,Job Object APIs (V1, Not Recommended),API Reference", + "title":"Executing a Job Object", + "githuburl":"" + }, + { + "uri":"mrs_02_0044.html", + "product_code":"mrs", + "code":"40", + "des":"This API is used to query the job object list. This API is compatible with Sahara.FormatGET /v1.1/{project_id}/jobsGET /v1.1/{project_id}/jobsParameter descriptionURI par", + "doc_type":"api", + "kw":"Querying the Job Object List,Job Object APIs (V1, Not Recommended),API Reference", + "title":"Querying the Job Object List", + "githuburl":"" + }, + { + "uri":"mrs_02_0045.html", + "product_code":"mrs", + "code":"41", + "des":"This API is used to query detailed information about a job object. This API is compatible with Sahara.FormatGET /v1.1/{project_id}/jobs/{job_id}GET /v1.1/{project_id}/job", + "doc_type":"api", + "kw":"Querying Job Object Details,Job Object APIs (V1, Not Recommended),API Reference", + "title":"Querying Job Object Details", + "githuburl":"" + }, + { + "uri":"mrs_02_0046.html", + "product_code":"mrs", + "code":"42", + "des":"This API is used to query the exe object list of all jobs. This API is incompatible with Sahara.FormatGET /v1.1/{project_id}/job-exesGET /v1.1/{project_id}/job-exesParame", + "doc_type":"api", + "kw":"Querying the exe Object List of Jobs,Job Object APIs (V1, Not Recommended),API Reference", + "title":"Querying the exe Object List of Jobs", + "githuburl":"" + }, + { + "uri":"mrs_02_0047.html", + "product_code":"mrs", + "code":"43", + "des":"This API is used to query detailed information about the exe object of a job. This API is incompatible with Sahara.FormatGET /v1.1/{project_id}/job-exes/{job_exe_id}GET /", + "doc_type":"api", + "kw":"Querying exe Object Details,Job Object APIs (V1, Not Recommended),API Reference", + "title":"Querying exe Object Details", + "githuburl":"" + }, + { + "uri":"mrs_02_0048.html", + "product_code":"mrs", + "code":"44", + "des":"This API is used to delete a job object. This API is compatible with Sahara.FormatDELETE /v1.1/{project_id}/jobs/{job_id}DELETE /v1.1/{project_id}/jobs/{job_id}Parameter ", + "doc_type":"api", + "kw":"Deleting a Job Object,Job Object APIs (V1, Not Recommended),API Reference", + "title":"Deleting a Job Object", + "githuburl":"" + }, + { + "uri":"mrs_02_0049.html", + "product_code":"mrs", + "code":"45", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Job Execution Object APIs (V1, Not Recommended)", + "title":"Job Execution Object APIs (V1, Not Recommended)", + "githuburl":"" + }, + { + "uri":"mrs_02_0050.html", + "product_code":"mrs", + "code":"46", + "des":"This API is used to query the job execution object list. This API is compatible with Sahara.FormatGET /v1.1/{project_id}/job-executionsGET /v1.1/{project_id}/job-executio", + "doc_type":"api", + "kw":"Querying the Job Execution Object List,Job Execution Object APIs (V1, Not Recommended),API Reference", + "title":"Querying the Job Execution Object List", + "githuburl":"" + }, + { + "uri":"mrs_02_0051.html", + "product_code":"mrs", + "code":"47", + "des":"This API is used to query detailed information about a job execution object. This API is compatible with Sahara.FormatGET /v1.1/{project_id}/job-executions/{job_execution", + "doc_type":"api", + "kw":"Querying Job Execution Object Details,Job Execution Object APIs (V1, Not Recommended),API Reference", + "title":"Querying Job Execution Object Details", + "githuburl":"" + }, + { + "uri":"mrs_02_0052.html", + "product_code":"mrs", + "code":"48", + "des":"This API is used to cancel a job object being executed. This API is compatible with Sahara.FormatGET /v1.1/{project_id}/job-executions/{job_execution_id}/cancelGET /v1.1/", + "doc_type":"api", + "kw":"Canceling Job Execution,Job Execution Object APIs (V1, Not Recommended),API Reference", + "title":"Canceling Job Execution", + "githuburl":"" + }, + { + "uri":"mrs_02_0053.html", + "product_code":"mrs", + "code":"49", + "des":"This API is used to delete a job execution object. This API is compatible with Sahara.FormatDELETE /v1.1/{project_id}/job-executions/{job_execution_id}DELETE /v1.1/{proje", + "doc_type":"api", + "kw":"Deleting a Job Execution Object,Job Execution Object APIs (V1, Not Recommended),API Reference", + "title":"Deleting a Job Execution Object", + "githuburl":"" + }, + { + "uri":"mrs_02_0084.html", + "product_code":"mrs", + "code":"50", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Job Object APIs (V2)", + "title":"Job Object APIs (V2)", + "githuburl":"" + }, + { + "uri":"mrs_02_0085.html", + "product_code":"mrs", + "code":"51", + "des":"This API is used to add and submit a job in an MRS cluster.If Kerberos authentication is enabled for a cluster, on the Dashboard tab page of the cluster details page, cli", + "doc_type":"api", + "kw":"Adding and Executing a Job,Job Object APIs (V2),API Reference", + "title":"Adding and Executing a Job", + "githuburl":"" + }, + { + "uri":"mrs_02_0086.html", + "product_code":"mrs", + "code":"52", + "des":"This API is used to query information about a specified job in an MRS cluster.FormatGET /v2/{project_id}/clusters/{cluster_id}/job-executions/{job_execution_id}GET /v2/{p", + "doc_type":"api", + "kw":"Querying Information About a Job,Job Object APIs (V2),API Reference", + "title":"Querying Information About a Job", + "githuburl":"" + }, + { + "uri":"mrs_02_0087.html", + "product_code":"mrs", + "code":"53", + "des":"This API is used to query the job list in an MRS cluster.FormatGET /v2/{project_id}/clusters/{cluster_id}/job-executionsGET /v2/{project_id}/clusters/{cluster_id}/job-exe", + "doc_type":"api", + "kw":"Querying a List of Jobs,Job Object APIs (V2),API Reference", + "title":"Querying a List of Jobs", + "githuburl":"" + }, + { + "uri":"mrs_02_0088.html", + "product_code":"mrs", + "code":"54", + "des":"This API is used to terminate a specified job in an MRS cluster.FormatPOST /v2/{project_id}/clusters/{cluster_id}/job-executions/{job_execution_id}/killPOST /v2/{project_", + "doc_type":"api", + "kw":"Terminating a Job,Job Object APIs (V2),API Reference", + "title":"Terminating a Job", + "githuburl":"" + }, + { + "uri":"mrs_02_0089.html", + "product_code":"mrs", + "code":"55", + "des":"This API is used to delete APIs in batches.FormatPOST /v2/{project_id}/clusters/{cluster_id}/job-executions/batch-deletePOST /v2/{project_id}/clusters/{cluster_id}/job-ex", + "doc_type":"api", + "kw":"Deleting Jobs in Batches,Job Object APIs (V2),API Reference", + "title":"Deleting Jobs in Batches", + "githuburl":"" + }, + { + "uri":"mrs_02_0090.html", + "product_code":"mrs", + "code":"56", + "des":"This API is used to obtain results returned after the SQL statements for querying SparkSQL and SparkScript jobs in an MRS cluster are executed.FormatGET /v2/{project_id}/", + "doc_type":"api", + "kw":"Obtain the SQL Result,Job Object APIs (V2),API Reference", + "title":"Obtain the SQL Result", + "githuburl":"" + }, + { + "uri":"mrs_02_0054.html", + "product_code":"mrs", + "code":"57", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Auto Scaling APIs", + "title":"Auto Scaling APIs", + "githuburl":"" + }, + { + "uri":"mrs_02_0056.html", + "product_code":"mrs", + "code":"58", + "des":"This API is used to configure an auto scaling rule.The API used for cluster creation and job execution can also be used to create an auto scaling rule.FormatPOST /v1.1/{p", + "doc_type":"api", + "kw":"Configuring an Auto Scaling Rule,Auto Scaling APIs,API Reference", + "title":"Configuring an Auto Scaling Rule", + "githuburl":"" + }, + { + "uri":"mrs_02_0070.html", + "product_code":"mrs", + "code":"59", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Tag Management APIs", + "title":"Tag Management APIs", + "githuburl":"" + }, + { + "uri":"mrs_02_0071.html", + "product_code":"mrs", + "code":"60", + "des":"This API is used to add a tag to a specified cluster.A cluster has a maximum of 10 tags. This API is idempotent. If a tag to be created has the same key as an existing ta", + "doc_type":"api", + "kw":"Adding a Tag to a Specified Cluster,Tag Management APIs,API Reference", + "title":"Adding a Tag to a Specified Cluster", + "githuburl":"" + }, + { + "uri":"mrs_02_0072.html", + "product_code":"mrs", + "code":"61", + "des":"This API is used to delete a tag of a specified cluster.FormatDELETE /v1.1/{project_id}/clusters/{cluster_id}/tags/{key}DELETE /v1.1/{project_id}/clusters/{cluster_id}/ta", + "doc_type":"api", + "kw":"Deleting a Tag of a Specified Cluster,Tag Management APIs,API Reference", + "title":"Deleting a Tag of a Specified Cluster", + "githuburl":"" + }, + { + "uri":"mrs_02_0073.html", + "product_code":"mrs", + "code":"62", + "des":"This API is used to query tags of a specified cluster.FormatGET /v1.1/{project_id}/clusters/{cluster_id}/tagsGET /v1.1/{project_id}/clusters/{cluster_id}/tagsParameter de", + "doc_type":"api", + "kw":"Querying Tags of a Specified Cluster,Tag Management APIs,API Reference", + "title":"Querying Tags of a Specified Cluster", + "githuburl":"" + }, + { + "uri":"mrs_02_0074.html", + "product_code":"mrs", + "code":"63", + "des":"This API is used to add or delete tags to or from a specified cluster in batches.You can add a maximum of 10 tags to a cluster.This API is idempotent.If a tag to be creat", + "doc_type":"api", + "kw":"Adding or Deleting Cluster Tags in Batches,Tag Management APIs,API Reference", + "title":"Adding or Deleting Cluster Tags in Batches", + "githuburl":"" + }, + { + "uri":"mrs_02_0075.html", + "product_code":"mrs", + "code":"64", + "des":"This API is used to query all tag sets of a specified region.FormatGET /v1.1/{project_id}/clusters/tagsGET /v1.1/{project_id}/clusters/tagsParameter descriptionURI parame", + "doc_type":"api", + "kw":"Querying All Tags,Tag Management APIs,API Reference", + "title":"Querying All Tags", + "githuburl":"" + }, + { + "uri":"mrs_02_0076.html", + "product_code":"mrs", + "code":"65", + "des":"This API is used to filter clusters by tag.By default, clusters and tags are sorted in descending order of creation time.FormatPOST /v1.1/{project_id}/clusters/resource_i", + "doc_type":"api", + "kw":"Querying a List of Clusters with Specified Tags,Tag Management APIs,API Reference", + "title":"Querying a List of Clusters with Specified Tags", + "githuburl":"" + }, + { + "uri":"mrs_02_1082.html", + "product_code":"mrs", + "code":"66", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"MRS Manager API", + "title":"MRS Manager API", + "githuburl":"" + }, + { + "uri":"mrs_02_1018.html", + "product_code":"mrs", + "code":"67", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"API Usage Guide", + "title":"API Usage Guide", + "githuburl":"" + }, + { + "uri":"mrs_02_1019.html", + "product_code":"mrs", + "code":"68", + "des":"MRS Manager APIs are provided for you to query basic information about MRS clusters and monitoring status, as well as start and stop services.MRS Manager APIs can be acce", + "doc_type":"api", + "kw":"Introduction to MRS Manager APIs,API Usage Guide,API Reference", + "title":"Introduction to MRS Manager APIs", + "githuburl":"" + }, + { + "uri":"mrs_02_1080.html", + "product_code":"mrs", + "code":"69", + "des":"The process for calling an MRS Manager API is as follows:Obtaining Request Authentication InformationBefore you call an API, obtain request authentication information, an", + "doc_type":"api", + "kw":"API Calling Process,API Usage Guide,API Reference", + "title":"API Calling Process", + "githuburl":"" + }, + { + "uri":"mrs_02_1081.html", + "product_code":"mrs", + "code":"70", + "des":"Invoke API demo code.This class is a running entry class for calling APIs. Before running this class, you need to set the following parameters:IP address of the cluster m", + "doc_type":"api", + "kw":"Examples,API Usage Guide,API Reference", + "title":"Examples", + "githuburl":"" + }, + { + "uri":"mrs_02_1083.html", + "product_code":"mrs", + "code":"71", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"MRS Manager CAS APIs", + "title":"MRS Manager CAS APIs", + "githuburl":"" + }, + { + "uri":"mrs_02_1084.html", + "product_code":"mrs", + "code":"72", + "des":"This API is used to submit a CAS login request. This API can be used only by security clusters that support Kerberos authentication.POST /cas/loginExample:Parameter descr", + "doc_type":"api", + "kw":"Logging In to the CAS,MRS Manager CAS APIs,API Reference", + "title":"Logging In to the CAS", + "githuburl":"" + }, + { + "uri":"mrs_02_1085.html", + "product_code":"mrs", + "code":"73", + "des":"This API is used to destruct the CAS single sign-on (SSO) session of a client. This API can be used only by security clusters that support Kerberos authentication.POST /c", + "doc_type":"api", + "kw":"Logging Out of the CAS,MRS Manager CAS APIs,API Reference", + "title":"Logging Out of the CAS", + "githuburl":"" + }, + { + "uri":"mrs_02_1086.html", + "product_code":"mrs", + "code":"74", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"MRS Manager Web APIs", + "title":"MRS Manager Web APIs", + "githuburl":"" + }, + { + "uri":"mrs_02_1087.html", + "product_code":"mrs", + "code":"75", + "des":"This API is used to check the login after a login request is submitted.GET /web/v1/access/login_checkExample:GET /web/v1/access/login_check HTTP/1.1\nHost: example.com\nCon", + "doc_type":"api", + "kw":"Checking the Login,MRS Manager Web APIs,API Reference", + "title":"Checking the Login", + "githuburl":"" + }, + { + "uri":"mrs_02_1088.html", + "product_code":"mrs", + "code":"76", + "des":"This API is used to change the password of the current login user. This API can be used only by security clusters that support Kerberos authentication.FormatPOST /web/v1/", + "doc_type":"api", + "kw":"Modifying the Password of the Current Login User,MRS Manager Web APIs,API Reference", + "title":"Modifying the Password of the Current Login User", + "githuburl":"" + }, + { + "uri":"mrs_02_1089.html", + "product_code":"mrs", + "code":"77", + "des":"This API is used to query the health status of a specified cluster. If any component is unavailable, the abnormal cluster health status is returned.FormatGET /web/v1/clus", + "doc_type":"api", + "kw":"Querying the Health Status of a Specified Cluster,MRS Manager Web APIs,API Reference", + "title":"Querying the Health Status of a Specified Cluster", + "githuburl":"" + }, + { + "uri":"mrs_02_1090.html", + "product_code":"mrs", + "code":"78", + "des":"This API is used to query basic information about a specified cluster.GET /web/v1/clustersExample:GET /web/v1/clusters HTTP/1.1\nHost: example.com\nContent-Type: applicatio", + "doc_type":"api", + "kw":"Querying Basic Information About a Specified Cluster,MRS Manager Web APIs,API Reference", + "title":"Querying Basic Information About a Specified Cluster", + "githuburl":"" + }, + { + "uri":"mrs_02_1091.html", + "product_code":"mrs", + "code":"79", + "des":"This API is used to query the command execution progress by command ID, including the total progress and the detailed progress of each step.FormatGET /web/v1/common/comma", + "doc_type":"api", + "kw":"Querying the Command Execution Progress,MRS Manager Web APIs,API Reference", + "title":"Querying the Command Execution Progress", + "githuburl":"" + }, + { + "uri":"mrs_02_1092.html", + "product_code":"mrs", + "code":"80", + "des":"This API is used to save configurations of services, roles, and instances. This API allows you to perform the following operations:Modify multiple configuration items at ", + "doc_type":"api", + "kw":"Saving Configurations,MRS Manager Web APIs,API Reference", + "title":"Saving Configurations", + "githuburl":"" + }, + { + "uri":"mrs_02_1093.html", + "product_code":"mrs", + "code":"81", + "des":"This API is used to return a temporary redirection, that is, a URL for logging out of the CAS, when you log out of the MapReduce Service system. This API can be used only", + "doc_type":"api", + "kw":"Logging Out Of a Session,MRS Manager Web APIs,API Reference", + "title":"Logging Out Of a Session", + "githuburl":"" + }, + { + "uri":"mrs_02_1094.html", + "product_code":"mrs", + "code":"82", + "des":"This API is used to start a specified service.FormatPOST /web/v1/maintain/cluster/{cluster_id}/service/{service_name}/startURI parameter descriptionExample:POST /web/v1/m", + "doc_type":"api", + "kw":"Starting a Service,MRS Manager Web APIs,API Reference", + "title":"Starting a Service", + "githuburl":"" + }, + { + "uri":"mrs_02_1095.html", + "product_code":"mrs", + "code":"83", + "des":"This API is used to stop a specified service.FormatPOST /web/v1/maintain/cluster/{cluster_id}/service/{service_name}/stopURI parameter descriptionExample:POST /web/v1/mai", + "doc_type":"api", + "kw":"Stopping a Service,MRS Manager Web APIs,API Reference", + "title":"Stopping a Service", + "githuburl":"" + }, + { + "uri":"mrs_02_1096.html", + "product_code":"mrs", + "code":"84", + "des":"This API is used to query performance monitoring items supported by a specified host.FormatGET /web/v1/monitor/metrics_infoParameter descriptionExample:GET /web/v1/monito", + "doc_type":"api", + "kw":"Querying Monitoring Data,MRS Manager Web APIs,API Reference", + "title":"Querying Monitoring Data", + "githuburl":"" + }, + { + "uri":"mrs_02_1097.html", + "product_code":"mrs", + "code":"85", + "des":"This API is used to query summary of a specified service in a cluster.FormatGET /web/v1/cluster/{cluster_id}/services/{service_name}URI parameter descriptionExample:GET /", + "doc_type":"api", + "kw":"Querying Summary of a Specified Service,MRS Manager Web APIs,API Reference", + "title":"Querying Summary of a Specified Service", + "githuburl":"" + }, + { + "uri":"mrs_01_9002.html", + "product_code":"mrs", + "code":"86", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Appendix", + "title":"Appendix", + "githuburl":"" + }, + { + "uri":"mrs_01_9005.html", + "product_code":"mrs", + "code":"87", + "des":"MRS uses ECSs of the following types in different application scenarios.General computing (S1)General computing (S3)General computing (C2)General computing-plus (C3)Gener", + "doc_type":"api", + "kw":"ECS Specifications Used by MRS,Appendix,API Reference", + "title":"ECS Specifications Used by MRS", + "githuburl":"" + }, + { + "uri":"mrs_02_0015.html", + "product_code":"mrs", + "code":"88", + "des":"Table 1 describes status codes.", + "doc_type":"api", + "kw":"Status Codes,Appendix,API Reference", + "title":"Status Codes", + "githuburl":"" + }, + { + "uri":"mrs_02_0011.html", + "product_code":"mrs", + "code":"89", + "des":"A project ID (project_id) is required for some URLs when an API is called. To obtain a project ID, perform the following operations:Log in to the management console.Click", + "doc_type":"api", + "kw":"Obtaining a Project ID,Appendix,API Reference", + "title":"Obtaining a Project ID", + "githuburl":"" + }, + { + "uri":"mrs_02_0016.html", + "product_code":"mrs", + "code":"90", + "des":"A domain ID (domain-id) is required for some URLs when an API is called. To obtain an account ID, perform the following operations:Log in to the management console.Click ", + "doc_type":"api", + "kw":"Obtaining Account ID,Appendix,API Reference", + "title":"Obtaining Account ID", + "githuburl":"" + }, + { + "uri":"mrs_02_0091.html", + "product_code":"mrs", + "code":"91", + "des":"A cluster ID (cluster_id) is required for some URLs when an API is called. To obtain a cluster ID, perform the following operations:Log in to the MRS management console.C", + "doc_type":"api", + "kw":"Obtain MRS Cluster Information,Appendix,API Reference", + "title":"Obtain MRS Cluster Information", + "githuburl":"" + }, + { + "uri":"mrs_02_0106.html", + "product_code":"mrs", + "code":"92", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Roles and components supported by MRS11,Appendix,API Reference", + "title":"Roles and components supported by MRS11", + "githuburl":"" + }, + { + "uri":"mrs_02_9003.html", + "product_code":"mrs", + "code":"93", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Change History,API Reference", + "title":"Change History", + "githuburl":"" + } +] \ No newline at end of file diff --git a/docs/mrs/api-ref/CLASS.TXT.json b/docs/mrs/api-ref/CLASS.TXT.json new file mode 100644 index 000000000..b121eae22 --- /dev/null +++ b/docs/mrs/api-ref/CLASS.TXT.json @@ -0,0 +1,839 @@ +[ + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"mrs", + "title":"Before You Start", + "uri":"en-us_topic_0037324628.html", + "doc_type":"api", + "p_code":"", + "code":"1" + }, + { + "desc":"Welcome to MapReduce Service API Reference. MapReduce Service (MRS) provides enterprise-level big data clusters on the cloud. Tenants can fully control the clusters and e", + "product_code":"mrs", + "title":"Overview", + "uri":"mrs_02_0001.html", + "doc_type":"api", + "p_code":"1", + "code":"2" + }, + { + "desc":"MRS support Representational State Transfer (REST) APIs, allowing you to call APIs using HTTPS. For details about API calling, see Calling APIs.", + "product_code":"mrs", + "title":"API Calling", + "uri":"mrs_02_0017.html", + "doc_type":"api", + "p_code":"1", + "code":"3" + }, + { + "desc":"An endpoint is the request address for calling an API. Endpoints vary depending on services and regions. For the endpoints of all services, see Regions and Endpoints..", + "product_code":"mrs", + "title":"Endpoints", + "uri":"mrs_02_0003.html", + "doc_type":"api", + "p_code":"1", + "code":"4" + }, + { + "desc":"For more constraints, see API description.", + "product_code":"mrs", + "title":"Constraints", + "uri":"mrs_02_0004.html", + "doc_type":"api", + "p_code":"1", + "code":"5" + }, + { + "desc":"DomainA domain is created upon successful registration with the cloud platform. The domain has full access permissions for all of its cloud services and resources. It can", + "product_code":"mrs", + "title":"Concepts", + "uri":"mrs_02_0005.html", + "doc_type":"api", + "p_code":"1", + "code":"6" + }, + { + "desc":"Currently, MRS provides two types (V1 and V2) of APIs for cloud services with customized specifications. Only part of V2 APIs is available and mainly used for submitting ", + "product_code":"mrs", + "title":"Selecting an API Type", + "uri":"mrs_02_0006.html", + "doc_type":"api", + "p_code":"1", + "code":"7" + }, + { + "desc":"Table 1 describes MRS APIs that meet RESTful API design standards.Table 2 lists MRS Manager APIs provided by MRS.", + "product_code":"mrs", + "title":"API Overview", + "uri":"mrs_02_0007.html", + "doc_type":"api", + "p_code":"", + "code":"8" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"mrs", + "title":"Calling APIs", + "uri":"mrs_02_0002.html", + "doc_type":"api", + "p_code":"", + "code":"9" + }, + { + "desc":"This section describes the structure of a REST API, and uses the IAM API for obtaining request authentication as an example to demonstrate how to call an API. The obtaine", + "product_code":"mrs", + "title":"Making an API Request", + "uri":"mrs_02_0008.html", + "doc_type":"api", + "p_code":"9", + "code":"10" + }, + { + "desc":"Requests for calling an API can be authenticated using either of the following methods:Token-based authentication: Requests are authenticated using a token.AK/SK-based au", + "product_code":"mrs", + "title":"Authentication", + "uri":"mrs_02_0009.html", + "doc_type":"api", + "p_code":"9", + "code":"11" + }, + { + "desc":"After sending a request, you will receive a response, including a status code, response header, and response body.A status code is a group of digits, ranging from 1xx to ", + "product_code":"mrs", + "title":"Response", + "uri":"mrs_02_0010.html", + "doc_type":"api", + "p_code":"9", + "code":"12" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"mrs", + "title":"APIs", + "uri":"mrs_02_0020.html", + "doc_type":"api", + "p_code":"", + "code":"13" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"mrs", + "title":"Data Source APIs", + "uri":"mrs_02_0021.html", + "doc_type":"api", + "p_code":"13", + "code":"14" + }, + { + "desc":"This API is used to create a data source. This API is compatible with Sahara.FormatPOST /v1.1/{project_id}/data-sourcesPOST /v1.1/{project_id}/data-sourcesParameter descr", + "product_code":"mrs", + "title":"Creating a Data Source", + "uri":"mrs_02_0022.html", + "doc_type":"api", + "p_code":"14", + "code":"15" + }, + { + "desc":"This API is used to update a data source. If the data source does not exist, the system reports an error. This API is compatible with Sahara.FormatPUT /v1.1/{project_id}/", + "product_code":"mrs", + "title":"Updating a Data Source", + "uri":"mrs_02_0023.html", + "doc_type":"api", + "p_code":"14", + "code":"16" + }, + { + "desc":"This API is used to query the data source list. This API is compatible with Sahara.FormatGET /v1.1/{project_id}/data-sourcesGET /v1.1/{project_id}/data-sourcesParameter d", + "product_code":"mrs", + "title":"Querying the Data Source List", + "uri":"mrs_02_0024.html", + "doc_type":"api", + "p_code":"14", + "code":"17" + }, + { + "desc":"This API is used to query detailed information about a data source. This API is compatible with Sahara.FormatGET /v1.1/{project_id}/data-sources/{data_source_id}GET /v1.1", + "product_code":"mrs", + "title":"Querying the Data Source Details", + "uri":"mrs_02_0025.html", + "doc_type":"api", + "p_code":"14", + "code":"18" + }, + { + "desc":"This API is used to delete a data source. This API is compatible with Sahara.FormatDELETE /v1.1/{project_id}/data-sources/{data_source_id}DELETE /v1.1/{project_id}/data-s", + "product_code":"mrs", + "title":"Deleting a Data Source", + "uri":"mrs_02_0026.html", + "doc_type":"api", + "p_code":"14", + "code":"19" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"mrs", + "title":"Cluster management APIs (V2)", + "uri":"mrs_02_0100.html", + "doc_type":"api", + "p_code":"13", + "code":"20" + }, + { + "desc":"This API is used to create an MRS cluster.Before using the API, you need to obtain the resources listed in Table 1.URI formatPOST /v2/{project_id}/clustersPOST /v2/{proje", + "product_code":"mrs", + "title":"Creating Clusters", + "uri":"mrs_02_0101.html", + "doc_type":"api", + "p_code":"20", + "code":"21" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"mrs", + "title":"Cluster management APIs (V1)", + "uri":"mrs_02_0027.html", + "doc_type":"api", + "p_code":"13", + "code":"22" + }, + { + "desc":"This API is used to create an MRS cluster and submit a job in the cluster. This API is incompatible with Sahara.A maximum of 10 clusters can be concurrently created.Befor", + "product_code":"mrs", + "title":"Creating a Cluster and Running a Job", + "uri":"mrs_02_0028.html", + "doc_type":"api", + "p_code":"22", + "code":"23" + }, + { + "desc":"This API is used to manually scale out or scale in Core or Task nodes in a cluster that has been created. After an MRS cluster is created, the number of Master nodes cann", + "product_code":"mrs", + "title":"Resizing a Cluster", + "uri":"mrs_02_0029.html", + "doc_type":"api", + "p_code":"22", + "code":"24" + }, + { + "desc":"This API is used to query a list of clusters created by a user. This API is incompatible with Sahara.FormatGET /v1.1/{project_id}/cluster_infos?pageSize={page_size}&curre", + "product_code":"mrs", + "title":"Querying a Cluster List", + "uri":"mrs_02_0030.html", + "doc_type":"api", + "p_code":"22", + "code":"25" + }, + { + "desc":"This API is used to query details about a specified cluster. This API is incompatible with Sahara.FormatGET /v1.1/{project_id}/cluster_infos/{cluster_id}GET /v1.1/{projec", + "product_code":"mrs", + "title":"Querying Cluster Details", + "uri":"mrs_02_0031.html", + "doc_type":"api", + "p_code":"22", + "code":"26" + }, + { + "desc":"This API is used to delete a cluster after data processing and analysis are completed or the cluster is abnormal. This API is compatible with Sahara.Clusters in any of th", + "product_code":"mrs", + "title":"Deleting a Cluster", + "uri":"mrs_02_0032.html", + "doc_type":"api", + "p_code":"22", + "code":"27" + }, + { + "desc":"This API is used to query a host list of a specified cluster.FormatGET /v1.1/{project_id}/clusters/{cluster_id}/hostsGET /v1.1/{project_id}/clusters/{cluster_id}/hostsPar", + "product_code":"mrs", + "title":"Querying a Host List", + "uri":"mrs_02_0057.html", + "doc_type":"api", + "p_code":"22", + "code":"28" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"mrs", + "title":"Job Binary Object APIs", + "uri":"mrs_02_0033.html", + "doc_type":"api", + "p_code":"13", + "code":"29" + }, + { + "desc":"This API is used to create a job binary object. This API is compatible with Sahara.FormatPOST /v1.1/{project_id}/job-binariesPOST /v1.1/{project_id}/job-binariesParameter", + "product_code":"mrs", + "title":"Creating a Job Binary Object", + "uri":"mrs_02_0034.html", + "doc_type":"api", + "p_code":"29", + "code":"30" + }, + { + "desc":"This API is used to update a job binary object. This API is compatible with Sahara.FormatPUT /v1.1/{project_id}/job-binaries/{job_binary_id}PUT /v1.1/{project_id}/job-bin", + "product_code":"mrs", + "title":"Updating a Job Binary Object", + "uri":"mrs_02_0035.html", + "doc_type":"api", + "p_code":"29", + "code":"31" + }, + { + "desc":"This API is used to query the binary object list. This API is compatible with Sahara.FormatGET /v1.1/{project_id}/job-binariesGET /v1.1/{project_id}/job-binariesParameter", + "product_code":"mrs", + "title":"Querying the Binary Object List", + "uri":"mrs_02_0036.html", + "doc_type":"api", + "p_code":"29", + "code":"32" + }, + { + "desc":"This API is used to query detailed information about a binary object. This API is compatible with Sahara.FormatGET /v1.1/{project_id}/job-binaries/{job_binary_id}GET /v1.", + "product_code":"mrs", + "title":"Querying the Binary Object Details", + "uri":"mrs_02_0037.html", + "doc_type":"api", + "p_code":"29", + "code":"33" + }, + { + "desc":"This API is used to delete a binary object. This API is compatible with Sahara.FormatDELETE /v1.1/{project_id}/job-binaries/{job_binary_id}DELETE /v1.1/{project_id}/job-b", + "product_code":"mrs", + "title":"Deleting a Job Binary Object", + "uri":"mrs_02_0038.html", + "doc_type":"api", + "p_code":"29", + "code":"34" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"mrs", + "title":"Job Object APIs (V1, Not Recommended)", + "uri":"mrs_02_0039.html", + "doc_type":"api", + "p_code":"13", + "code":"35" + }, + { + "desc":"This API is used to add a job to an MRS cluster and execute the job. This API is incompatible with Sahara.FormatPOST /v1.1/{project_id}/jobs/submit-jobPOST /v1.1/{project", + "product_code":"mrs", + "title":"Adding a Job and Executing the Job", + "uri":"mrs_02_0040.html", + "doc_type":"api", + "p_code":"35", + "code":"36" + }, + { + "desc":"This API is used to create a job object. This API is compatible with Sahara.FormatPOST /v1.1/{project_id}/jobsPOST /v1.1/{project_id}/jobsParameter descriptionURI paramet", + "product_code":"mrs", + "title":"Creating a Job Object", + "uri":"mrs_02_0041.html", + "doc_type":"api", + "p_code":"35", + "code":"37" + }, + { + "desc":"This API is used to update a job object. This API is compatible with Sahara.FormatPATCH /v1.1/{project_id}/jobs/{job_id}PATCH /v1.1/{project_id}/jobs/{job_id}Parameter de", + "product_code":"mrs", + "title":"Updating a Job Object", + "uri":"mrs_02_0042.html", + "doc_type":"api", + "p_code":"35", + "code":"38" + }, + { + "desc":"This API is used to execute a created job object. This API is compatible with Sahara.FormatPOST /v1.1/{project_id}/jobs/{job_id}/executePOST /v1.1/{project_id}/jobs/{job_", + "product_code":"mrs", + "title":"Executing a Job Object", + "uri":"mrs_02_0043.html", + "doc_type":"api", + "p_code":"35", + "code":"39" + }, + { + "desc":"This API is used to query the job object list. This API is compatible with Sahara.FormatGET /v1.1/{project_id}/jobsGET /v1.1/{project_id}/jobsParameter descriptionURI par", + "product_code":"mrs", + "title":"Querying the Job Object List", + "uri":"mrs_02_0044.html", + "doc_type":"api", + "p_code":"35", + "code":"40" + }, + { + "desc":"This API is used to query detailed information about a job object. This API is compatible with Sahara.FormatGET /v1.1/{project_id}/jobs/{job_id}GET /v1.1/{project_id}/job", + "product_code":"mrs", + "title":"Querying Job Object Details", + "uri":"mrs_02_0045.html", + "doc_type":"api", + "p_code":"35", + "code":"41" + }, + { + "desc":"This API is used to query the exe object list of all jobs. This API is incompatible with Sahara.FormatGET /v1.1/{project_id}/job-exesGET /v1.1/{project_id}/job-exesParame", + "product_code":"mrs", + "title":"Querying the exe Object List of Jobs", + "uri":"mrs_02_0046.html", + "doc_type":"api", + "p_code":"35", + "code":"42" + }, + { + "desc":"This API is used to query detailed information about the exe object of a job. This API is incompatible with Sahara.FormatGET /v1.1/{project_id}/job-exes/{job_exe_id}GET /", + "product_code":"mrs", + "title":"Querying exe Object Details", + "uri":"mrs_02_0047.html", + "doc_type":"api", + "p_code":"35", + "code":"43" + }, + { + "desc":"This API is used to delete a job object. This API is compatible with Sahara.FormatDELETE /v1.1/{project_id}/jobs/{job_id}DELETE /v1.1/{project_id}/jobs/{job_id}Parameter ", + "product_code":"mrs", + "title":"Deleting a Job Object", + "uri":"mrs_02_0048.html", + "doc_type":"api", + "p_code":"35", + "code":"44" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"mrs", + "title":"Job Execution Object APIs (V1, Not Recommended)", + "uri":"mrs_02_0049.html", + "doc_type":"api", + "p_code":"13", + "code":"45" + }, + { + "desc":"This API is used to query the job execution object list. This API is compatible with Sahara.FormatGET /v1.1/{project_id}/job-executionsGET /v1.1/{project_id}/job-executio", + "product_code":"mrs", + "title":"Querying the Job Execution Object List", + "uri":"mrs_02_0050.html", + "doc_type":"api", + "p_code":"45", + "code":"46" + }, + { + "desc":"This API is used to query detailed information about a job execution object. This API is compatible with Sahara.FormatGET /v1.1/{project_id}/job-executions/{job_execution", + "product_code":"mrs", + "title":"Querying Job Execution Object Details", + "uri":"mrs_02_0051.html", + "doc_type":"api", + "p_code":"45", + "code":"47" + }, + { + "desc":"This API is used to cancel a job object being executed. This API is compatible with Sahara.FormatGET /v1.1/{project_id}/job-executions/{job_execution_id}/cancelGET /v1.1/", + "product_code":"mrs", + "title":"Canceling Job Execution", + "uri":"mrs_02_0052.html", + "doc_type":"api", + "p_code":"45", + "code":"48" + }, + { + "desc":"This API is used to delete a job execution object. This API is compatible with Sahara.FormatDELETE /v1.1/{project_id}/job-executions/{job_execution_id}DELETE /v1.1/{proje", + "product_code":"mrs", + "title":"Deleting a Job Execution Object", + "uri":"mrs_02_0053.html", + "doc_type":"api", + "p_code":"45", + "code":"49" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"mrs", + "title":"Job Object APIs (V2)", + "uri":"mrs_02_0084.html", + "doc_type":"api", + "p_code":"13", + "code":"50" + }, + { + "desc":"This API is used to add and submit a job in an MRS cluster.If Kerberos authentication is enabled for a cluster, on the Dashboard tab page of the cluster details page, cli", + "product_code":"mrs", + "title":"Adding and Executing a Job", + "uri":"mrs_02_0085.html", + "doc_type":"api", + "p_code":"50", + "code":"51" + }, + { + "desc":"This API is used to query information about a specified job in an MRS cluster.FormatGET /v2/{project_id}/clusters/{cluster_id}/job-executions/{job_execution_id}GET /v2/{p", + "product_code":"mrs", + "title":"Querying Information About a Job", + "uri":"mrs_02_0086.html", + "doc_type":"api", + "p_code":"50", + "code":"52" + }, + { + "desc":"This API is used to query the job list in an MRS cluster.FormatGET /v2/{project_id}/clusters/{cluster_id}/job-executionsGET /v2/{project_id}/clusters/{cluster_id}/job-exe", + "product_code":"mrs", + "title":"Querying a List of Jobs", + "uri":"mrs_02_0087.html", + "doc_type":"api", + "p_code":"50", + "code":"53" + }, + { + "desc":"This API is used to terminate a specified job in an MRS cluster.FormatPOST /v2/{project_id}/clusters/{cluster_id}/job-executions/{job_execution_id}/killPOST /v2/{project_", + "product_code":"mrs", + "title":"Terminating a Job", + "uri":"mrs_02_0088.html", + "doc_type":"api", + "p_code":"50", + "code":"54" + }, + { + "desc":"This API is used to delete APIs in batches.FormatPOST /v2/{project_id}/clusters/{cluster_id}/job-executions/batch-deletePOST /v2/{project_id}/clusters/{cluster_id}/job-ex", + "product_code":"mrs", + "title":"Deleting Jobs in Batches", + "uri":"mrs_02_0089.html", + "doc_type":"api", + "p_code":"50", + "code":"55" + }, + { + "desc":"This API is used to obtain results returned after the SQL statements for querying SparkSQL and SparkScript jobs in an MRS cluster are executed.FormatGET /v2/{project_id}/", + "product_code":"mrs", + "title":"Obtain the SQL Result", + "uri":"mrs_02_0090.html", + "doc_type":"api", + "p_code":"50", + "code":"56" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"mrs", + "title":"Auto Scaling APIs", + "uri":"mrs_02_0054.html", + "doc_type":"api", + "p_code":"13", + "code":"57" + }, + { + "desc":"This API is used to configure an auto scaling rule.The API used for cluster creation and job execution can also be used to create an auto scaling rule.FormatPOST /v1.1/{p", + "product_code":"mrs", + "title":"Configuring an Auto Scaling Rule", + "uri":"mrs_02_0056.html", + "doc_type":"api", + "p_code":"57", + "code":"58" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"mrs", + "title":"Tag Management APIs", + "uri":"mrs_02_0070.html", + "doc_type":"api", + "p_code":"13", + "code":"59" + }, + { + "desc":"This API is used to add a tag to a specified cluster.A cluster has a maximum of 10 tags. This API is idempotent. If a tag to be created has the same key as an existing ta", + "product_code":"mrs", + "title":"Adding a Tag to a Specified Cluster", + "uri":"mrs_02_0071.html", + "doc_type":"api", + "p_code":"59", + "code":"60" + }, + { + "desc":"This API is used to delete a tag of a specified cluster.FormatDELETE /v1.1/{project_id}/clusters/{cluster_id}/tags/{key}DELETE /v1.1/{project_id}/clusters/{cluster_id}/ta", + "product_code":"mrs", + "title":"Deleting a Tag of a Specified Cluster", + "uri":"mrs_02_0072.html", + "doc_type":"api", + "p_code":"59", + "code":"61" + }, + { + "desc":"This API is used to query tags of a specified cluster.FormatGET /v1.1/{project_id}/clusters/{cluster_id}/tagsGET /v1.1/{project_id}/clusters/{cluster_id}/tagsParameter de", + "product_code":"mrs", + "title":"Querying Tags of a Specified Cluster", + "uri":"mrs_02_0073.html", + "doc_type":"api", + "p_code":"59", + "code":"62" + }, + { + "desc":"This API is used to add or delete tags to or from a specified cluster in batches.You can add a maximum of 10 tags to a cluster.This API is idempotent.If a tag to be creat", + "product_code":"mrs", + "title":"Adding or Deleting Cluster Tags in Batches", + "uri":"mrs_02_0074.html", + "doc_type":"api", + "p_code":"59", + "code":"63" + }, + { + "desc":"This API is used to query all tag sets of a specified region.FormatGET /v1.1/{project_id}/clusters/tagsGET /v1.1/{project_id}/clusters/tagsParameter descriptionURI parame", + "product_code":"mrs", + "title":"Querying All Tags", + "uri":"mrs_02_0075.html", + "doc_type":"api", + "p_code":"59", + "code":"64" + }, + { + "desc":"This API is used to filter clusters by tag.By default, clusters and tags are sorted in descending order of creation time.FormatPOST /v1.1/{project_id}/clusters/resource_i", + "product_code":"mrs", + "title":"Querying a List of Clusters with Specified Tags", + "uri":"mrs_02_0076.html", + "doc_type":"api", + "p_code":"59", + "code":"65" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"mrs", + "title":"MRS Manager API", + "uri":"mrs_02_1082.html", + "doc_type":"api", + "p_code":"", + "code":"66" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"mrs", + "title":"API Usage Guide", + "uri":"mrs_02_1018.html", + "doc_type":"api", + "p_code":"66", + "code":"67" + }, + { + "desc":"MRS Manager APIs are provided for you to query basic information about MRS clusters and monitoring status, as well as start and stop services.MRS Manager APIs can be acce", + "product_code":"mrs", + "title":"Introduction to MRS Manager APIs", + "uri":"mrs_02_1019.html", + "doc_type":"api", + "p_code":"67", + "code":"68" + }, + { + "desc":"The process for calling an MRS Manager API is as follows:Obtaining Request Authentication InformationBefore you call an API, obtain request authentication information, an", + "product_code":"mrs", + "title":"API Calling Process", + "uri":"mrs_02_1080.html", + "doc_type":"api", + "p_code":"67", + "code":"69" + }, + { + "desc":"Invoke API demo code.This class is a running entry class for calling APIs. Before running this class, you need to set the following parameters:IP address of the cluster m", + "product_code":"mrs", + "title":"Examples", + "uri":"mrs_02_1081.html", + "doc_type":"api", + "p_code":"67", + "code":"70" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"mrs", + "title":"MRS Manager CAS APIs", + "uri":"mrs_02_1083.html", + "doc_type":"api", + "p_code":"66", + "code":"71" + }, + { + "desc":"This API is used to submit a CAS login request. This API can be used only by security clusters that support Kerberos authentication.POST /cas/loginExample:Parameter descr", + "product_code":"mrs", + "title":"Logging In to the CAS", + "uri":"mrs_02_1084.html", + "doc_type":"api", + "p_code":"71", + "code":"72" + }, + { + "desc":"This API is used to destruct the CAS single sign-on (SSO) session of a client. This API can be used only by security clusters that support Kerberos authentication.POST /c", + "product_code":"mrs", + "title":"Logging Out of the CAS", + "uri":"mrs_02_1085.html", + "doc_type":"api", + "p_code":"71", + "code":"73" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"mrs", + "title":"MRS Manager Web APIs", + "uri":"mrs_02_1086.html", + "doc_type":"api", + "p_code":"66", + "code":"74" + }, + { + "desc":"This API is used to check the login after a login request is submitted.GET /web/v1/access/login_checkExample:GET /web/v1/access/login_check HTTP/1.1\nHost: example.com\nCon", + "product_code":"mrs", + "title":"Checking the Login", + "uri":"mrs_02_1087.html", + "doc_type":"api", + "p_code":"74", + "code":"75" + }, + { + "desc":"This API is used to change the password of the current login user. This API can be used only by security clusters that support Kerberos authentication.FormatPOST /web/v1/", + "product_code":"mrs", + "title":"Modifying the Password of the Current Login User", + "uri":"mrs_02_1088.html", + "doc_type":"api", + "p_code":"74", + "code":"76" + }, + { + "desc":"This API is used to query the health status of a specified cluster. If any component is unavailable, the abnormal cluster health status is returned.FormatGET /web/v1/clus", + "product_code":"mrs", + "title":"Querying the Health Status of a Specified Cluster", + "uri":"mrs_02_1089.html", + "doc_type":"api", + "p_code":"74", + "code":"77" + }, + { + "desc":"This API is used to query basic information about a specified cluster.GET /web/v1/clustersExample:GET /web/v1/clusters HTTP/1.1\nHost: example.com\nContent-Type: applicatio", + "product_code":"mrs", + "title":"Querying Basic Information About a Specified Cluster", + "uri":"mrs_02_1090.html", + "doc_type":"api", + "p_code":"74", + "code":"78" + }, + { + "desc":"This API is used to query the command execution progress by command ID, including the total progress and the detailed progress of each step.FormatGET /web/v1/common/comma", + "product_code":"mrs", + "title":"Querying the Command Execution Progress", + "uri":"mrs_02_1091.html", + "doc_type":"api", + "p_code":"74", + "code":"79" + }, + { + "desc":"This API is used to save configurations of services, roles, and instances. This API allows you to perform the following operations:Modify multiple configuration items at ", + "product_code":"mrs", + "title":"Saving Configurations", + "uri":"mrs_02_1092.html", + "doc_type":"api", + "p_code":"74", + "code":"80" + }, + { + "desc":"This API is used to return a temporary redirection, that is, a URL for logging out of the CAS, when you log out of the MapReduce Service system. This API can be used only", + "product_code":"mrs", + "title":"Logging Out Of a Session", + "uri":"mrs_02_1093.html", + "doc_type":"api", + "p_code":"74", + "code":"81" + }, + { + "desc":"This API is used to start a specified service.FormatPOST /web/v1/maintain/cluster/{cluster_id}/service/{service_name}/startURI parameter descriptionExample:POST /web/v1/m", + "product_code":"mrs", + "title":"Starting a Service", + "uri":"mrs_02_1094.html", + "doc_type":"api", + "p_code":"74", + "code":"82" + }, + { + "desc":"This API is used to stop a specified service.FormatPOST /web/v1/maintain/cluster/{cluster_id}/service/{service_name}/stopURI parameter descriptionExample:POST /web/v1/mai", + "product_code":"mrs", + "title":"Stopping a Service", + "uri":"mrs_02_1095.html", + "doc_type":"api", + "p_code":"74", + "code":"83" + }, + { + "desc":"This API is used to query performance monitoring items supported by a specified host.FormatGET /web/v1/monitor/metrics_infoParameter descriptionExample:GET /web/v1/monito", + "product_code":"mrs", + "title":"Querying Monitoring Data", + "uri":"mrs_02_1096.html", + "doc_type":"api", + "p_code":"74", + "code":"84" + }, + { + "desc":"This API is used to query summary of a specified service in a cluster.FormatGET /web/v1/cluster/{cluster_id}/services/{service_name}URI parameter descriptionExample:GET /", + "product_code":"mrs", + "title":"Querying Summary of a Specified Service", + "uri":"mrs_02_1097.html", + "doc_type":"api", + "p_code":"74", + "code":"85" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"mrs", + "title":"Appendix", + "uri":"mrs_01_9002.html", + "doc_type":"api", + "p_code":"", + "code":"86" + }, + { + "desc":"MRS uses ECSs of the following types in different application scenarios.General computing (S1)General computing (S3)General computing (C2)General computing-plus (C3)Gener", + "product_code":"mrs", + "title":"ECS Specifications Used by MRS", + "uri":"mrs_01_9005.html", + "doc_type":"api", + "p_code":"86", + "code":"87" + }, + { + "desc":"Table 1 describes status codes.", + "product_code":"mrs", + "title":"Status Codes", + "uri":"mrs_02_0015.html", + "doc_type":"api", + "p_code":"86", + "code":"88" + }, + { + "desc":"A project ID (project_id) is required for some URLs when an API is called. To obtain a project ID, perform the following operations:Log in to the management console.Click", + "product_code":"mrs", + "title":"Obtaining a Project ID", + "uri":"mrs_02_0011.html", + "doc_type":"api", + "p_code":"86", + "code":"89" + }, + { + "desc":"A domain ID (domain-id) is required for some URLs when an API is called. To obtain an account ID, perform the following operations:Log in to the management console.Click ", + "product_code":"mrs", + "title":"Obtaining Account ID", + "uri":"mrs_02_0016.html", + "doc_type":"api", + "p_code":"86", + "code":"90" + }, + { + "desc":"A cluster ID (cluster_id) is required for some URLs when an API is called. To obtain a cluster ID, perform the following operations:Log in to the MRS management console.C", + "product_code":"mrs", + "title":"Obtain MRS Cluster Information", + "uri":"mrs_02_0091.html", + "doc_type":"api", + "p_code":"86", + "code":"91" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"mrs", + "title":"Roles and components supported by MRS11", + "uri":"mrs_02_0106.html", + "doc_type":"api", + "p_code":"86", + "code":"92" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"mrs", + "title":"Change History", + "uri":"mrs_02_9003.html", + "doc_type":"api", + "p_code":"", + "code":"93" + } +] \ No newline at end of file diff --git a/docs/mrs/api-ref/PARAMETERS.txt b/docs/mrs/api-ref/PARAMETERS.txt new file mode 100644 index 000000000..6da8d5f07 --- /dev/null +++ b/docs/mrs/api-ref/PARAMETERS.txt @@ -0,0 +1,3 @@ +version="" +language="en-us" +type="" \ No newline at end of file diff --git a/docs/mrs/api-ref/en-us_image_0000001298246380.png b/docs/mrs/api-ref/en-us_image_0000001298246380.png new file mode 100644 index 000000000..68bfaf5ab Binary files /dev/null and b/docs/mrs/api-ref/en-us_image_0000001298246380.png differ diff --git a/docs/mrs/api-ref/en-us_image_0000001298566184.png b/docs/mrs/api-ref/en-us_image_0000001298566184.png new file mode 100644 index 000000000..94736e3a3 Binary files /dev/null and b/docs/mrs/api-ref/en-us_image_0000001298566184.png differ diff --git a/docs/mrs/api-ref/en-us_image_0000001298725832.png b/docs/mrs/api-ref/en-us_image_0000001298725832.png new file mode 100644 index 000000000..0adf514b3 Binary files /dev/null and b/docs/mrs/api-ref/en-us_image_0000001298725832.png differ diff --git a/docs/mrs/api-ref/en-us_image_0000001351245885.png b/docs/mrs/api-ref/en-us_image_0000001351245885.png new file mode 100644 index 000000000..508f4c13a Binary files /dev/null and b/docs/mrs/api-ref/en-us_image_0000001351245885.png differ diff --git a/docs/mrs/api-ref/en-us_image_0000001351245889.gif b/docs/mrs/api-ref/en-us_image_0000001351245889.gif new file mode 100644 index 000000000..cfbc91a43 Binary files /dev/null and b/docs/mrs/api-ref/en-us_image_0000001351245889.gif differ diff --git a/docs/mrs/api-ref/en-us_image_0000001351446161.png b/docs/mrs/api-ref/en-us_image_0000001351446161.png new file mode 100644 index 000000000..829989a93 Binary files /dev/null and b/docs/mrs/api-ref/en-us_image_0000001351446161.png differ diff --git a/docs/mrs/api-ref/en-us_topic_0037324628.html b/docs/mrs/api-ref/en-us_topic_0037324628.html new file mode 100644 index 000000000..9f02641ad --- /dev/null +++ b/docs/mrs/api-ref/en-us_topic_0037324628.html @@ -0,0 +1,21 @@ + + +
MRS uses ECSs of the following types in different application scenarios.
+AB.C.D
+Example: m3.8xlarge.8
+In the preceding flavor:
+Type + |
+vCPUs + |
+Memory (GB) + |
+Flavor + |
+Virtualization Type + |
+
|---|---|---|---|---|
S1 + + + |
+4 + |
+16 + |
+s1.xlarge.linux.mrs + |
+XEN + |
+
16 + |
+64 + |
+s1.4xlarge.linux.mrs + |
+XEN + |
+|
32 + |
+128 + |
+s1.8xlarge.linux.mrs + |
+XEN + |
+
Type + |
+vCPUs + |
+Memory (GB) + |
+Flavor + |
+Virtualization Type + |
+
|---|---|---|---|---|
S3 + |
+4 + |
+8 + |
+s3.xlarge.2.linux.mrs + |
+XEN + |
+
4 + |
+16 + |
+s3.xlarge.4.linux.mrs + |
+XEN + |
+|
8 + |
+16 + |
+s3.2xlarge.2.linux.mrs + |
+XEN + |
+|
8 + |
+32 + |
+s3.2xlarge.4.linux.mrs + |
+XEN + |
+|
16 + |
+32 + |
+s3.4xlarge.2.linux.mrs + |
+XEN + |
+
Type + |
+vCPUs + |
+Memory (GB) + |
+Flavor + |
+Virtualization Type + |
+
|---|---|---|---|---|
C2 + |
+8 + |
+16 + |
+c2.2xlarge.linux.mrs + |
+KVM + |
+
16 + |
+32 + |
+c2.4xlarge.linux.mrs + |
+KVM + |
+
Type + |
+vCPUs + |
+Memory (GB) + |
+Flavor + |
+Virtualization Type + |
+
|---|---|---|---|---|
C3 + |
+8 + |
+16 + |
+c3.2xlarge.2.linux.mrs + |
+KVM + |
+
4 + |
+16 + |
+c3.xlarge.4.linux.mrs + |
+KVM + |
+|
8 + |
+32 + |
+c3.2xlarge.4.linux.mrs + |
+KVM + |
+|
16 + |
+32 + |
+c3.4xlarge.2.linux.mrs + |
+KVM + |
+|
16 + |
+64 + |
+c3.4xlarge.4.linux.mrs + |
+KVM + |
+|
32 + |
+128 + |
+c3.8xlarge.4.linux.mrs + |
+KVM + |
+|
60 + |
+256 + |
+c3.15xlarge.4.linux.mrs + |
+KVM + |
+
Type + |
+vCPUs + |
+Memory (GB) + |
+Flavor + |
+Virtualization Type + |
+
|---|---|---|---|---|
C4 + |
+4 + |
+16 + |
+c4.xlarge.4.linux.mrs + |
+KVM + |
+
8 + |
+16 + |
+c4.2xlarge.2.linux.mrs + |
+KVM + |
+|
8 + |
+32 + |
+c4.2xlarge.4.linux.mrs + |
+KVM + |
+|
16 + |
+32 + |
+c4.4xlarge.2.linux.mrs + |
+KVM + |
+|
16 + |
+64 + |
+c4.4xlarge.4.linux.mrs + |
+KVM + |
+|
32 + |
+64 + |
+c4.8xlarge.2.linux.mrs + |
+KVM + |
+|
32 + |
+128 + |
+c4.8xlarge.4.linux.mrs + |
+KVM + |
+|
64 + |
+256 + |
+c4.16xlarge.4.linux.mrs + |
+KVM + |
+
Type + |
+vCPUs + |
+Memory (GB) + |
+Flavor + |
+Virtualization Type + |
+
|---|---|---|---|---|
c6 + |
+8 + |
+32 + |
+c6.2xlarge.4.linux.mrs + |
+KVM + |
+
16 + |
+64 + |
+c6.4xlarge.4.linux.mrs + |
+KVM + |
+|
32 + |
+64 + |
+c6.8xlarge.2.linux.mrs + |
+KVM + |
+|
32 + |
+128 + |
+c6.8xlarge.4.linux.mrs + |
+KVM + |
+|
64 + |
+128 + |
+c6.16xlarge.2.linux.mrs + |
+KVM + |
+|
64 + |
+256 + |
+c6.16xlarge.4.linux.mrs + |
+KVM + |
+
Type + |
+vCPUs + |
+Memory (GB) + |
+Flavor + |
+Virtualization Type + |
+Local Disk (GB) + |
+Hardware + |
+
|---|---|---|---|---|---|---|
D1 + + |
+44 + |
+3232 + |
+d1.xlarge.mrslinux.mrs + |
+KVM + |
+3×1800 + |
+CPU: Intel® Xeon® Gold 6151 Processor v5 +Memory: 20 × 32 GB + + |
+
88 + |
+6464 + |
+d1.2xlarge.mrslinux.mrs + |
+KVM + |
+6×1800 + |
+||
16 + |
+128 + |
+d1.4xlarge.linux.mrs + |
+KVM + |
+12×1800 + |
+||
36 + |
+256 + |
+d1.8xlarge.linux.mrs + |
+KVM + |
+24×1800 + |
+
Type + |
+vCPUs + |
+Memory (GB) + |
+Flavor + |
+Virtualization Type + |
+Local Disk (GB) + |
+Hardware + |
+
|---|---|---|---|---|---|---|
D2 + + + |
+4 + |
+32 + |
+d2.xlarge.8.linux.mrs + |
+KVM + |
+2×1800 + |
+CPU: Intel® Xeon® Gold 6151 Processor v5 +Memory: 20 × 32 GB + + + |
+
8 + |
+64 + |
+d2.2xlarge.8.linux.mrs + |
+KVM + |
+4×1800 + |
+||
16 + |
+128 + |
+d2.4xlarge.8.linux.mrs + |
+KVM + |
+8×1800 + |
+||
32 + |
+256 + |
+d2.8xlarge.8.linux.mrs + |
+KVM + |
+16×1800 + |
+
Type + |
+vCPUs + |
+Memory (GB) + |
+Flavor + |
+Virtualization Type + |
+
|---|---|---|---|---|
H1 + |
+8 + |
+32 + |
+h1.2xlarge.4.linux.mrs + |
+KVM + |
+
16 + |
+64 + |
+h1.4xlarge.4.linux.mrs + |
+KVM + |
+|
32 + |
+128 + |
+h1.8xlarge.4.linux.mrs + |
+KVM + |
+
Type + |
+vCPUs + |
+Memory (GB) + |
+Flavor + |
+Virtualization Type + |
+
|---|---|---|---|---|
M3 + + |
+8 + |
+64 + |
+m3.2xlarge.8.linux.mrs + |
+KVM + |
+
16 + |
+128 + |
+m3.4xlarge.8.linux.mrs + |
+KVM + |
+|
32 + |
+256 + |
+m3.8xlarge.8.linux.mrs + |
+KVM + |
+
Type + |
+vCPUs + |
+Memory (GB) + |
+Flavor + |
+Virtualization Type + |
+
|---|---|---|---|---|
M4 + + |
+8 + |
+64 + |
+m4.2xlarge.8.linux.mrs + |
+KVM + |
+
16 + |
+128 + |
+m4.4xlarge.8.linux.mrs + |
+KVM + |
+|
32 + |
+256 + |
+m4.8xlarge.8.linux.mrs + |
+KVM + |
+|
64 + |
+512 + |
+m4.16xlarge.8.linux.mrs + |
+KVM + |
+
Welcome to MapReduce Service API Reference. MapReduce Service (MRS) provides enterprise-level big data clusters on the cloud. Tenants can fully control the clusters and easily run big data components such as Hadoop, Spark, HBase, Kafka, and Storm in the clusters.
+This document describes how to use application programming interfaces (APIs) to perform operations on MRS, such as creating or deleting clusters, adjusting nodes, as well as creating and executing jobs. For details about all supported operations, see API Overview.
+If you plan to access MRS through an API, ensure that you are familiar with MRS concepts. For details, see Service Overview in the MapReduce Service User Guide.
+An endpoint is the request address for calling an API. Endpoints vary depending on services and regions. For the endpoints of all services, see Regions and Endpoints.
+.
+A domain is created upon successful registration with the cloud platform. The domain has full access permissions for all of its cloud services and resources. It can be used to reset user passwords and grant user permissions. The domain is a payment entity and should not be used directly to perform routine management. For security purposes, create users and grant them permissions for routine management.
+A user is created using a domain to use cloud services. Each user has its own identity credentials (password and access keys).
+The domain username, and password will be required for API authentication.
+Regions are geographic areas isolated from each other. Resources are region-specific and cannot be used across regions through internal network connections. For low network latency and quick resource access, select the nearest region.
+An AZ contains one or more physical data centers. Each AZ has independent cooling, fire extinguishing, moisture-proof, and electricity facilities. Within an AZ, computing, network, storage, and other resources are logically divided into multiple clusters. AZs within a region are interconnected using high-speed optical fibers to support cross-AZ high-availability systems.
+Projects group and isolate resources (including compute, storage, and network resources) across physical regions. A default project is provided for each region, and sub-projects can be created under each default project. Users can be granted permissions to access all resources in a specific project in your domain. For more refined access control, create sub-projects under a project and create resources in the sub-projects. Users can then be assigned permissions to access only specific resources in the sub-projects.
+
Checkpoint: When an application consumes data, the latest SN of the consumed data is recorded as a checkpoint. When the data is reconsumed, the consumption can be continued based on this checkpoint.
+Application: Multiple applications can access data in the same stream. Checkpoints generated for each application are used to record the consumed data in the stream by each application.
+Currently, MRS provides two types (V1 and V2) of APIs for cloud services with customized specifications. Only part of V2 APIs is available and mainly used for submitting jobs and SQL statements. If the API functions are the same, you are advised to use the V2 APIs first.
+All MRS versions support the V1 APIs. MRS 1.9.2 or later supports the V2 APIs.
+Based on the V1 APIs, the V2 APIs have the following enhancements:
+For details about the APIs and their functions, see API Overview.
+Table 1 describes MRS APIs that meet RESTful API design standards.
+Table 2 lists MRS Manager APIs provided by MRS.
+ +API + |
+Function + |
+API URI + |
+
|---|---|---|
Data source APIs + |
++ | +POST /v1.1/{project_id}/data-sources + |
+
| + | +PUT /v1.1/{project_id}/data-sources/{data_source_id} + |
+|
| + | +GET /v1.1/{project_id}/data-sources + |
+|
| + | +GET /v1.1/{project_id}/data-sources/{data_source_id} + |
+|
| + | +DELETE /v1.1/{project_id}/data-sources/{data_source_id} + |
+|
Cluster management APIs (V2) + |
++ | +POST /v2/{project_id}/clusters + |
+
Cluster management APIs (V1) + + |
++ | +POST /v1.1/{project_id}/run-job-flow + |
+
| + | +PUT /v1.1/{project_id}/cluster_infos/{cluster_id} + |
+|
| + | +GET /v1.1/{project_id}/cluster_infos + |
+|
| + | +GET /v1.1/{project_id}/cluster_infos/{cluster_id} + |
+|
| + | +DELETE /v1.1/{project_id}/clusters/{cluster_id} + |
+|
| + | +GET /v1.1/{project_id}/clusters/{cluster_id}/hosts + |
+|
Job binary object APIs + |
++ | +POST /v1.1/{project_id}/job-binaries + |
+
| + | +PUT /v1.1/{project_id}/job-binaries/{job_binary_id} + |
+|
| + | +GET /v1.1/{project_id}/job-binaries + |
+|
| + | +GET /v1.1/{project_id}/job-binaries/{job_binary_id} + |
+|
| + | +DELETE /v1.1/{project_id}/job-binaries/{job_binary_id} + |
+|
Job object APIs (V1) + |
++ | +POST /v1.1/{project_id}/jobs/submit-job + |
+
| + | +POST /v1.1/{project_id}/jobs + |
+|
| + | +PATCH /v1.1/{project_id}/jobs/{job_id} + |
+|
| + | +POST /v1.1/{project_id}/jobs/{job_id}/execute + |
+|
| + | +GET /v1.1/{project_id}/jobs + |
+|
| + | +GET /v1.1/{project_id}/jobs/{job_id} + |
+|
| + | +GET /v1.1/{project_id}/job-exes + |
+|
| + | +GET /v1.1/{project_id}/job-exes/{job_exe_id} + |
+|
| + | +DELETE /v1.1/{project_id}/jobs/{job_id} + |
+|
Job execution object APIs (V1) + |
++ | +GET /v1.1/{project_id}/job-executions + |
+
| + | +GET /v1.1/{project_id}/job-executions/{job_execution_id} + |
+|
| + | +GET /v1.1/{project_id}/job-executions/{job_execution_id}/cancel + |
+|
| + | +DELETE /v1.1/{project_id}/job-executions/{job_execution_id} + |
+|
Job object APIs (V2) + + |
++ | +POST /v2/{project_id}/clusters/{cluster_id}/job-executions + |
+
| + | +GET /v2/{project_id}/clusters/{cluster_id}/job-executions/{job_execution_id} + |
+|
| + | +GET /v2/{project_id}/clusters/{cluster_id}/job-executions + |
+|
| + | +POST /v2/{project_id}/clusters/{cluster_id}/job-executions/{job_execution_id}/kill + |
+|
| + | +POST /v2/{project_id}/clusters/{cluster_id}/job-executions/batch-delete + |
+|
| + | +GET /v2/{project_id}/clusters/{cluster_id}/job-executions/{job_execution_id}/sql-result + |
+|
Auto scaling APIs + |
++ | +POST /v1.1/{project_id}/autoscaling-policy/{cluster_id} + |
+
Tag Management APIs + + + + + + |
++ | +POST /v1.1/{project_id}/clusters/{cluster_id}/tags + |
+
| + | +DELETE /v1.1/{project_id}/clusters/{cluster_id}/tags/{key} + |
+|
| + | +GET /v1.1/{project_id}/clusters/{cluster_id}/tags + |
+|
| + | +POST /v1.1/{project_id}/clusters/{cluster_id}/tags/action + |
+|
| + | +GET /v1.1/{project_id}/clusters/tags + |
+|
| + | +POST /v1.1/{project_id}/clusters/resource_instances/action + |
+
API + |
+Function + |
+API URI + |
+
|---|---|---|
MRS Manager CAS API + |
++ | +POST /cas/login + |
+
| + | +POST /cas/logout + |
+|
MRS Manager WEB API + |
++ | +GET /web/v1/access/login_check + |
+
| + | +POST /web/v1/access/modify_self_password + |
+|
| + | +GET /web/v1/cluster/{cluster_id}/status + |
+|
| + | +GET /web/v1/clusters + |
+|
| + | +GET /web/v1/common/command/{command_id}/progress + |
+|
| + | +POST /web/v1/config/cluster/{cluster_id}/save + |
+|
| + | +GET /web/v1/logout_action + |
+|
| + | +POST /web/v1/maintain/cluster/{cluster_id}/service/{service_name}/start + |
+|
| + | +POST /web/v1/maintain/cluster/{cluster_id}/service/{service_name}/stop + |
+|
| + | +GET /web/v1/monitor/metrics_info + |
+|
| + | +GET /web/v1/cluster/{cluster_id}/services/{service_name} + |
+
This section describes the structure of a REST API, and uses the IAM API for obtaining request authentication as an example to demonstrate how to call an API. The obtained token is used to authenticate the calling of other APIs.
+A request URI is in the following format:
+{URI-scheme}://{Endpoint}/{resource-path}?{query-string}
+Although a request URI is included in the request header, most programming languages or frameworks require the request URI to be transmitted separately.
+ +Parameter + |
+Description + |
+
|---|---|
URI-scheme + |
+Protocol used to transmit requests. All APIs use HTTPS. + |
+
Endpoint + |
+Domain name or IP address of the server bearing the REST service. The endpoint varies between services in different regions. It can be obtained from Regions and Endpoints. + |
+
resource-path + |
+Access path of an API for performing a specified operation. Obtain the path from the URI of an API. For example, the resource-path of the API used to obtain request authentication is /v3/auth/tokens. + |
+
query-string + |
+Query parameter, which is optional. Ensure that a question mark (?) is included before each query parameter that is in the format of "Parameter name=Parameter value". For example, ? limit=10 indicates that a maximum of 10 data records will be displayed. + |
+
To simplify the URI display in this document, each API is provided only with a resource-path and a request method. The URI-scheme of all APIs is HTTPS, and the endpoints of all APIs in the same region are identical.
+Method + |
+Description + |
+
|---|---|
GET + |
+Requests the server to return specified resources. + |
+
PUT + |
+Requests the server to update specified resources. + |
+
POST + |
+Requests the server to add resources or perform special operations. + |
+
DELETE + |
+Requests the server to delete specified resources, for example, an object. + |
+
HEAD + |
+Same as GET except that the server must return only the response header. + |
+
PATCH + |
+Requests the server to update partial content of a specified resource. +If the resource does not exist, a new resource will be created. + |
+
In the URI of the API to obtain request authentication, you can see that the request method is POST. The request is as follows:
+POST https://{{endpoint}}/v3/auth/tokens
+You can also add additional header fields to a request, such as the fields required by a specified URI or HTTP method. For example, to request for the authentication information, add Content-Type, which specifies the request body type.
+Table 3 lists common request header fields.
+ +Field + |
+Description + |
+Mandatory + |
+Example + |
+
|---|---|---|---|
X-Sdk-Date + |
+Time when the request is sent. The time is in YYYYMMDD'T'HHMMSS'Z' format. +The value is the current Greenwich Mean Time (GMT) of the system. + |
+This field is mandatory for AK/SK-based authentication. + |
+20150907T101459Z + |
+
Host + |
+Server information of the resource being requested. The value can be obtained from the URL of a service API. The value is hostname[:port]. If the port number is not specified, the default port is used. The default port number for HTTPS is 443. + |
+This field is mandatory for AK/SK-based authentication. + |
+code.test.com +or +code.test.com:443 + |
+
Content-Type + |
+MIME type of the request body This field is mandatory and its default value is application/json. Other values of this field will be provided for specific APIs if any. + |
+Yes + |
+application/json + |
+
Content-Length + |
+Length of the request body. The unit is byte. + |
+This field is mandatory for POST and PUT requests, but must be left blank for GET requests. + |
+3495 + |
+
X-Project-Id + |
+Project ID. This field is used to obtain the token for each project. + |
+No + |
+e9993fc787d94b6c886cbaa340f9c0f4 + |
+
X-Auth-Token + |
+User token. +It is the response to the API used to obtain request authentication. This API is the only one that does not require authentication. +The token is the value of X-Subject-Token in the response header. + |
+No +This field is mandatory for token-based authentication. + |
+- + |
+
X-Language + |
+Request language. The options are as follows: +en-us: English + |
+No + |
+en-us + |
+
X-Domain-Id + |
+Domain ID + |
+No + |
+- + |
+
In addition to supporting token-based authentication, APIs also support authentication using access key ID/secret access key (AK/SK). During AK/SK-based authentication, an SDK is used to sign the request, and the Authorization (signature authentication) and X-Sdk-Date (time when the request is sent) header fields are automatically added to the request.
+For more information, see AK/SK-based Authentication in Authentication.
+The API used to obtain a user token does not require authentication. Therefore, only the Content-Type field needs to be added to requests for calling the API. An example of such requests is as follows:
+POST https://{{endpoint}}/v3/auth/tokens
+Content-Type: application/json
+This part is optional. The body of a request is often sent in a structured format (for example, JSON or XML) as specified in the Content-Type header field. The request body transfers content except the request header.
+The request body varies between APIs. Some APIs do not require the request body, such as the APIs requested using the GET and DELETE methods.
+In the case of the API used to obtain a user token, the request parameters and parameter description can be obtained from the API request. The following provides an example request with a body included. Replace username, domainname, ******** (login password), and xxxxxxxxxxxxxxxxxx (project ID) with the actual values. To learn how to obtain a project ID, see Obtaining a Project ID.
+
The scope parameter specifies where a token takes effect. You can set scope to an account or a project under an account. In the following example, the token takes effect only for the resources in a specified project. For more information about this API, see Obtaining a User Token of the IAM service.
+POST https://{{endpoint}}/v3/auth/tokens
+Content-Type: application/json
+
+{
+ "auth": {
+ "identity": {
+ "methods": [
+ "password"
+ ],
+ "password": {
+ "user": {
+ "name": "username",
+ "password": "********",
+ "domain": {
+ "name": "domainname"
+ }
+ }
+ }
+ },
+ "scope": {
+ "project": {
+ "id": "xxxxxxxxxxxxxxxxxx"
+ }
+ }
+ }
+}
+If all data required for the API request is available, you can send the request to call the API through curl, Postman, or coding. In the response to the API used to obtain a user token, x-subject-token is the desired user token. This token can then be used to authenticate the calling of other APIs.
+
The validity period of a token is 24 hours. When using a token for authentication, cache it to prevent frequently calling the IAM API used to obtain a user token.
+A token specifies temporary permissions in a computer system. During API authentication using a token, the token is added to requests to get permissions for calling the API.
+The token can be obtained by calling the API in Obtaining a User Token. A project-level token is required for calling this service API, that is, when calling the API for Obtaining a User Token, set the value of auth.scope in the request body to project.
+{
+ "auth": {
+ "identity": {
+ "methods": [
+ "password"
+ ],
+ "password": {
+ "user": {
+ "name": "username",
+ "password": "********",
+ "domain": {
+ "name": "domainname"
+ }
+ }
+ }
+ },
+ "scope": {
+ "project": {
+ "id": "xxxxxxxx"
+ }
+ }
+ }
+}
+After a token is obtained, the X-Auth-Token header field must be added to requests to specify the token when calling other APIs. For example, if the token is ABCDEFJ...., X-Auth-Token: ABCDEFJ.... can be added to a request as follows:
+Content-Type: application/json +X-Auth-Token: ABCDEFJ....+
An AK/SK is used to verify the identity of a request sender. In AK/SK-based authentication, a signature needs to be obtained and then added to requests.
+
AK: access key ID, which is a unique identifier used in conjunction with a secret access key to sign requests cryptographically.
+SK: secret access key used in conjunction with an AK to sign requests cryptographically. It identifies a request sender and prevents the request from being modified.
+The following uses a demo project to show how to sign a request and use an HTTP client to send an HTTPS request.
+Download the demo project at https://docs.otc.t-systems.com/en-us/api/apiug/apig-en-api-180328008.html.
+If you do not need the demo project, visit the following URL to download the API Gateway signing SDK:
+https://apig-demo.obs.eu-de.otc.t-systems.com/java/java-sdk-core.zip
+Decompress the downloaded package and reference the obtained JAR files as dependencies. See the following figure.
+
Keep the access key secure.
+


The request signing method is integrated in the JAR files imported in 3. The request needs to be signed before it is sent. The signature will then be added as part of the HTTP header to the request.
+The demo code is classified into the following classes to demonstrate signing and sending the HTTP request:
+As shown in the following code, if you use other methods such as POST, PUT, and DELETE, see the corresponding comment.
+Specify region, serviceName, ak/sk, and url as the actual values. In this demo, the URLs for accessing VPC resources are used.
+To obtain the project ID in the URLs, see Obtaining a Project ID.
+To obtain the endpoint, see Regions and Endpoints.
+//TODO: Replace region with the name of the region in which the service to be accessed is located.
+private static final String region = "";
+
+//TODO: Replace vpc with the name of the service you want to access. For example, ecs, vpc, iam, and elb.
+private static final String serviceName = "";
+
+public static void main(String[] args) throws UnsupportedEncodingException
+{
+//TODO: Replace the AK and SK with those obtained on the My Credential page.
+String ak = "ZIRRKMTWP******1WKNKB";
+String sk = "Us0mdMNHk******YrRCnW0ecfzl";
+
+//TODO: To specify a project ID (multi-project scenarios), add the X-Project-Id header.
+//TODO: To access a global service, such as IAM, DNS, CDN, and TMS, add the X-Domain-Id header to specify an account ID.
+//TODO: To add a header, find "Add special headers" in the AccessServiceImple.java file.
+
+//TODO: Test the API
+String url = "https://{Endpoint}/v1/{project_id}/vpcs";
+get(ak, sk, url);
+
+//TODO: When creating a VPC, replace {project_id} in postUrl with the actual value.
+//String postUrl = "https://serviceEndpoint/v1/{project_id}/cloudservers";
+//String postbody ="{\"vpc\": {\"name\": \"vpc\",\"cidr\": \"192.168.0.0/16\"}}";
+//post(ak, sk, postUrl, postbody);
+
+//TODO: When querying a VPC, replace {project_id} in url with the actual value.
+//String url = "https://serviceEndpoint/v1/{project_id}/vpcs/{vpc_id}";
+//get(ak, sk, url);
+
+//TODO: When updating a VPC, replace {project_id} and {vpc_id} in putUrl with the actual values.
+//String putUrl = "https://serviceEndpoint/v1/{project_id}/vpcs/{vpc_id}";
+//String putbody ="{\"vpc\":{\"name\": \"vpc1\",\"cidr\": \"192.168.0.0/16\"}}";
+//put(ak, sk, putUrl, putbody);
+
+//TODO: When deleting a VPC, replace {project_id} and {vpc_id} in deleteUrl with the actual values.
+//String deleteUrl = "https://serviceEndpoint/v1/{project_id}/vpcs/{vpc_id}";
+//delete(ak, sk, deleteUrl);
+}
+In the Package Explorer area on the left, right-click Demo.java, choose Run AS > Java Application from the shortcut menu to run the demo code.
+You can view the API call logs on the console.
+After sending a request, you will receive a response, including a status code, response header, and response body.
+A status code is a group of digits, ranging from 1xx to 5xx. It indicates the status of a request. For more information, see Status Codes.
+For the API to obtain request authentication, if the status code 201 is returned after the API is called, the request is successful.
+Similar to a request, a response also has a header, for example, Content-Type.
+Figure 1 shows the response header fields for the API used to obtain request authentication. The x-subject-token header field is the desired user token. This token can then be used to authenticate the calling of other APIs.
+ +This part is optional. The body of a response is often returned in structured format (for example, JSON or XML) as specified in the Content-Type header field. The response body transfers content except the response header.
+The following shows the response body for the API to obtain request authentication. For the sake of space, only part of the content is displayed here.
+{
+ "token": {
+ "expires_at": "2019-02-13T06:52:13.855000Z",
+ "methods": [
+ "password"
+ ],
+ "catalog": [
+ {
+ "endpoints": [
+ {
+ "region_id": "aaa"//The region ID "aaa" is used as an example.
+...
+If an error occurs during API calling, an error code and a message will be displayed. The following shows an error response body.
+{
+ "error_msg": "Invalid cluster name.",
+ "error_code": "12000002"
+}
+In the response body, error_code is an error code, and error_msg provides information about the error.
+A project ID (project_id) is required for some URLs when an API is called. To obtain a project ID, perform the following operations:
+On the My Credentials page, view project IDs in the project list.
+If there are multiple projects in one region, expand Region and view subproject IDs in the Project ID column.
+You can obtain the project ID by calling the IAM API used to query project information based on the specified criteria.
+The API used to obtain a project ID is GET https://{Endpoint}/v3/projects. {Endpoint} is the IAM endpoint and can be obtained from Regions and Endpoints. For details about API authentication, see Authentication.
+The following is an example response. The value of id under projects is the project ID of the region specified by name.
+{
+ "projects": [
+ {
+ "domain_id": "65382450e8f64ac0870cd180d14e684b",
+ "is_domain": false,
+ "parent_id": "65382450e8f64ac0870cd180d14e684b",
+ "name": "region_id",
+ "description": "",
+ "links": {
+ "next": null,
+ "previous": null,
+ "self": "https://www.example.com/v3/projects/a4a5d4098fb4474fa22cd05f897d6b99"
+ },
+ "id": "a4a5d4098fb4474fa22cd05f897d6b99",
+ "enabled": true
+ }
+ ],
+ "links": {
+ "next": null,
+ "previous": null,
+ "self": "https://www.example.com/v3/projects"
+ }
+}
+Table 1 describes status codes.
+ +Status Code + |
+Message + |
+Description + |
+
|---|---|---|
100 + |
+Continue + |
+The client should continue with its request. +This interim response is used to inform the client that the initial part of the request has been received and has not yet been rejected by the server. + |
+
101 + |
+Switching Protocols + |
+The protocol should be switched. The protocol can only be switched to a newer protocol. +For example, the current HTTPS protocol is switched to a later version. + |
+
200 + |
+OK + |
+The request has been fulfilled. + |
+
201 + |
+Created + |
+The request has been fulfilled and a new resource has been created. + |
+
202 + |
+Accepted + |
+The request has been accepted, but the processing has not been completed. + |
+
203 + |
+Non-Authoritative Information + |
+The server has successfully processed the request, but is returning information that may be from another source. + |
+
204 + |
+NoContent + |
+The request has been fulfilled, but the HTTPS response does not contain a response body. +The status code is returned in response to an HTTPS OPTIONS request. + |
+
205 + |
+Reset Content + |
+The server has fulfilled the request, but the requester is required to reset the content. + |
+
206 + |
+Partial Content + |
+The server has successfully processed the partial GET request. + |
+
300 + |
+Multiple Choices + |
+There are multiple options for the location of the requested resource. The response contains a list of resource characteristics and addresses from which a user terminal (such as a browser) can choose the most appropriate one. + |
+
301 + |
+Moved Permanently + |
+The requested resource has been assigned a new permanent URI, and the new URI is contained in the response. + |
+
302 + |
+Found + |
+The requested resource resides temporarily under a different URI. + |
+
303 + |
+See Other + |
+The response to the request can be found under a different URI. +It can be retrieved by using a GET or POST method. + |
+
304 + |
+Not Modified + |
+The requested resource has not been modified. When the server returns this status code, it does not return any resources. + |
+
305 + |
+Use Proxy + |
+The requested resource is available only through a proxy. + |
+
306 + |
+Unused + |
+The HTTPS status code is no longer used. + |
+
400 + |
+BadRequest + |
+The request is invalid. +The client should not repeat the request without modifications. + |
+
401 + |
+Unauthorized + |
+This status code is returned after the client provides the authentication information, indicating that the authentication information is incorrect or invalid. + |
+
402 + |
+Payment Required + |
+This status code is reserved for future use. + |
+
403 + |
+Forbidden + |
+The server understood the request, but is refusing to fulfill it. +The client should not repeat the request without modifications. + |
+
404 + |
+NotFound + |
+The requested resource cannot be found. +The client should not repeat the request without modifications. + |
+
405 + |
+MethodNotAllowed + |
+A request method is not supported for the requested resource. +The client should not repeat the request without modifications. + |
+
406 + |
+Not Acceptable + |
+The server cannot fulfill the request according to the content characteristics of the request. + |
+
407 + |
+Proxy Authentication Required + |
+This status code is similar to 401, but indicates that the client must first authenticate itself with the proxy. + |
+
408 + |
+Request Time-out + |
+The server has timed out waiting for the request. +The client may repeat the request without modifications at a later time. + |
+
409 + |
+Conflict + |
+The request could not be processed due to a conflict with the current state of the resource. +This status code indicates that the resource that the client is attempting to create already exists, or that the request has failed to be processed because of the update of the conflict request. + |
+
410 + |
+Gone + |
+The requested resource has been deleted permanently and is no longer available. ++ |
+
411 + |
+Length Required + |
+The server is refusing to process the request without a defined Content-Length. + |
+
412 + |
+Precondition Failed + |
+The server did not meet one of the preconditions that the requester put on the request. + |
+
413 + |
+Request Entity Too Large + |
+The server is refusing to process a request because the request entity is too large for the server to process. The server may close the connection to prevent the client from continuing the request. If the server is only temporarily unable to process the request, the response will contain a Retry-After header field. + |
+
414 + |
+Request-URI Too Large + |
+The Request-URI is too long for the server to process. + |
+
415 + |
+Unsupported Media Type + |
+The server is unable to process the media format in the request. + |
+
416 + |
+Requested range not satisfiable + |
+The requested range is invalid. + |
+
417 + |
+Expectation Failed + |
+The server has failed to meet the requirements of the Expect request-header field. + |
+
422 + |
+UnprocessableEntity + |
+The request is well-formed but is unable to be processed due to semantic errors. + |
+
429 + |
+TooManyRequests + |
+The client has sent excessive number of requests to the server within a given time (exceeding the limit on the access frequency of the client), or the server has received an excessive number of requests within a given time (beyond its processing capability). In this case, the client should resend the request after the time specified in the Retry-After header of the response has elapsed. + |
+
500 + |
+InternalServerError + |
+The server is able to receive the request but unable to understand it. + |
+
501 + |
+Not Implemented + |
+The server does not support the function required to fulfill the request. + |
+
502 + |
+Bad Gateway + |
+The server was acting as a gateway or proxy and received an invalid request from the remote server. + |
+
503 + |
+ServiceUnavailable + |
+The requested service is invalid. +The client should not repeat the request without modifications. + |
+
504 + |
+ServerTimeout + |
+The request cannot be fulfilled within a given time. This status code is returned to the client only if the Timeout parameter is specified in the request. + |
+
505 + |
+HTTPS Version not supported + |
+The server does not support the HTTPS protocol version used in the request. + |
+
A domain ID (domain-id) is required for some URLs when an API is called. To obtain an account ID, perform the following operations:
+View the account ID
+MRS support Representational State Transfer (REST) APIs, allowing you to call APIs using HTTPS. For details about API calling, see Calling APIs.
+This API is used to create a data source. This API is compatible with Sahara.
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
name + |
+Yes + |
+String + |
+Data source name +Contains 1 to 80 characters and consists of letters, digits, hyphens (-), and underscores (_) only. + |
+
url + |
+Yes + |
+String + |
+Data source URL +Contains 1 to 255 characters. +
|
+
credentials + |
+No + |
+Object + |
+Authentication information. The current version does not support this function. + |
+
is_protected + |
+No + |
+Bool + |
+Whether the data source is protected +
The current version does not support this function. + |
+
is_public + |
+No + |
+Bool + |
+Whether the data source is public +
The current version does not support this function. + |
+
type + |
+Yes + |
+String + |
+Data source type +
|
+
description + |
+No + |
+String + |
+Data source description +Contains a maximum of 65535 characters. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
description + |
+String + |
+Data source description + |
+
url + |
+String + |
+Data source URL + |
+
tenant_id + |
+String + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
created_at + |
+String + |
+Data source creation time + |
+
updated_at + |
+String + |
+Data source update time If the data source has not been updated, the value of this parameter is null. + |
+
is_protected + |
+Bool + |
+Whether the data source is protected + |
+
is_public + |
+Bool + |
+Whether the data source is public + |
+
type + |
+String + |
+Data source type + |
+
id + |
+String + |
+ID returned by the system after the data source is created + |
+
name + |
+String + |
+Data source name + |
+
{
+ "name": "my-data-source",
+ "url": "/simple/mapreduce/input",
+ "is_protected": false,
+ "is_public": false,
+ "type": "hdfs",
+ "description": "this is the data source template"
+}
+{
+ "data_source": {
+ "name": "my-data-source",
+ "type": "hdfs",
+ "url": "/simple/mapreduce/input",
+ "description": "this is the data source template",
+ "created_at": "2017-06-22T08:28:57",
+ "updated_at": null,
+ "id": "e275a927-fe72-4b8b-a634-e47a11dca181",
+ "tenant_id": "5a3314075bfa49b9ae360f4ecd333695",
+ "is_public": false,
+ "is_protected": false
+ }
+}
+Table 4 describes the status code of this API.
+ +Status Code + |
+Description + |
+
|---|---|
202 + |
+The data source has been successfully created. + |
+
For the description about error status codes, see Status Codes.
+This API is used to update a data source. If the data source does not exist, the system reports an error. This API is compatible with Sahara.
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
data_source_id + |
+Yes + |
+Data source ID + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
name + |
+No + |
+String + |
+Data source name +Contains 1 to 80 characters and consists of letters, digits, hyphens (-), and underscores (_) only. + |
+
type + |
+Yes + |
+String + |
+Data source type +
|
+
url + |
+No + |
+String + |
+Data source URL +Contains 1 to 255 characters. +
|
+
description + |
+No + |
+String + |
+Data source description +Contains a maximum of 65535 characters. + |
+
is_protected + |
+No + |
+Bool + |
+Whether the data source is protected +
The current version does not support this function. + |
+
is_public + |
+No + |
+Bool + |
+Whether the data source is public +
The current version does not support this function. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
description + |
+String + |
+Data source description + |
+
url + |
+String + |
+Data source URL + |
+
tenant_id + |
+String + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
created_at + |
+String + |
+Data source creation time + |
+
updated_at + |
+String + |
+Data source update time + |
+
is_protected + |
+Bool + |
+Whether the data source is protected +
The current version does not support this function. + |
+
is_public + |
+Bool + |
+Whether the data source is public +
The current version does not support this function. + |
+
type + |
+String + |
+Data source type + |
+
id + |
+String + |
+Data source ID + |
+
name + |
+String + |
+Data source name + |
+
{
+ "name": "my-data-source-update",
+ "url": "/simple/mapreduce/input",
+ "is_protected": false,
+ "is_public": false,
+ "type": "hdfs",
+ "description": "this is the data source template"
+}
+{
+ "data_source": {
+ "name": "my-data-source-update",
+ "type": "hdfs",
+ "url": "/simple/mapreduce/input",
+ "description": "this is the data source template",
+ "created_at": "2017-06-22T08:28:57",
+ "updated_at": "2017-06-22T08:30:08",
+ "id": "e275a927-fe72-4b8b-a634-e47a11dca181",
+ "tenant_id": "5a3314075bfa49b9ae360f4ecd333695",
+ "is_public": false,
+ "is_protected": false
+ }
+}
+Table 4 describes the status code of this API.
+ +Status Code + |
+Description + |
+
|---|---|
202 + |
+The data source has been successfully updated. + |
+
For the description about error status codes, see Status Codes.
+This API is used to query the data source list. This API is compatible with Sahara.
+Parameter + |
+Mandatory + |
+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 + |
+Data source ID +Query the data source list, and select one data source ID as the marker. The ID is the last element on the list that will not be returned. + |
+
sort_by + |
+No + |
+Sort field +A hyphen (-) before the sort field indicates to sort in descending order. Example: +
|
+
Request parameters
+None.
+Parameter + |
+Type + |
+Description + |
+
|---|---|---|
markers + |
+Object + |
+Marker object For more parameter description, see Table 3. + |
+
data_sources + |
+Array + |
+Data source list For more parameter description, see Table 4. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
prev + |
+String + |
+Marker on the previous page + |
+
next + |
+String + |
+Marker on the next page + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
name + |
+String + |
+Data source name + |
+
type + |
+String + |
+Data source type + |
+
url + |
+String + |
+Data source URL + |
+
description + |
+String + |
+Data source description + |
+
created_at + |
+String + |
+Data source creation time + |
+
updated_at + |
+String + |
+Data source update time + |
+
id + |
+String + |
+Data source ID + |
+
tenant_id + |
+String + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
is_public + |
+Bool + |
+Whether the data source is public +
The current version does not support this function. + |
+
is_protected + |
+Bool + |
+Whether the data source is protected +
The current version does not support this function. + |
+
GET /v1.1/{project_id}/data-sources?sort_by=name&limit=2&marker=81a2d48b-029a-4160-830b-2d0ac51fa3ba
+{
+ "markers": {
+ "prev": "948b92e5-8213-4f5d-975a-435a67c6b93d",
+ "next": null
+ },
+ "data_sources": [
+ {
+ "name": "my-data-source-update",
+ "type": "hdfs",
+ "url": "/simple/mapreduce/input",
+ "description": "this is the data source template",
+ "created_at": "2017-06-22T08:28:57",
+ "updated_at": "2017-06-22T08:30:08",
+ "id": "e275a927-fe72-4b8b-a634-e47a11dca181",
+ "tenant_id": "5a3314075bfa49b9ae360f4ecd333695",
+ "is_public": false,
+ "is_protected": false
+ },
+ {
+ "name": "my-datasource",
+ "type": "hdfs",
+ "url": "/simple/mapreduce/input",
+ "description": "this is the data source template",
+ "created_at": "2017-06-22T08:22:06",
+ "updated_at": null,
+ "id": "e68164d5-5897-41a7-a550-5de635fffe20",
+ "tenant_id": "5a3314075bfa49b9ae360f4ecd333695",
+ "is_public": false,
+ "is_protected": false
+ }
+ ]
+}
+Table 5 describes the status code of this API.
+ +Status Code + |
+Description + |
+
|---|---|
200 + |
+The data source list is queried successfully. + |
+
For the description about error status codes, see Status Codes.
+This API is used to query detailed information about a data source. This API is compatible with Sahara.
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
data_source_id + |
+Yes + |
+Data source ID + |
+
Request parameters
+None.
+Parameter + |
+Type + |
+Description + |
+
|---|---|---|
is_public + |
+Bool + |
+Whether the data source is public +
The current version does not support this function. + |
+
tenant_id + |
+String + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
is_protected + |
+Bool + |
+Whether the data source is protected +
The current version does not support this function. + |
+
created_at + |
+String + |
+Data source creation time + |
+
id + |
+String + |
+Data source ID + |
+
name + |
+String + |
+Data source name + |
+
updated_at + |
+String + |
+Data source update time + |
+
description + |
+String + |
+Data source description + |
+
url + |
+String + |
+Data source URL + |
+
type + |
+String + |
+Data source type + |
+
GET /v1.1/{project_id}/data-sources/{data_source_id}
+{
+ "data_source": {
+ "name": "my-data-source-update",
+ "type": "hdfs",
+ "url": "/simple/mapreduce/input",
+ "description": "this is the data source template",
+ "created_at": "2017-06-22T08:28:57",
+ "updated_at": "2017-06-22T08:30:08",
+ "id": "e275a927-fe72-4b8b-a634-e47a11dca181",
+ "tenant_id": "5a3314075bfa49b9ae360f4ecd333695",
+ "is_public": false,
+ "is_protected": false
+ }
+}
+Table 3 describes the status code of this API.
+ +Status Code + |
+Description + |
+
|---|---|
200 + |
+Data source details have been queried successfully. + |
+
For the description about error status codes, see Status Codes.
+This API is used to delete a data source. This API is compatible with Sahara.
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
data_source_id + |
+Yes + |
+Data source ID + |
+
Request parameters
+None.
+Response parameters
+None.
+Table 2 describes the status code of this API.
+ +Status Code + |
+Description + |
+
|---|---|
204 + |
+The data source is deleted successfully. + |
+
For the description about error status codes, see Status Codes.
+This API is used to create an MRS cluster and submit a job in the cluster. This API is incompatible with Sahara.
+A maximum of 10 clusters can be concurrently created.
+Before using the API, you need to obtain the resources listed in Table 1.
+ +Resource + |
+How to Obtain + |
+
|---|---|
VPC + |
+See operation instructions in VPC > Querying VPCs and VPC > Creating a VPC in the VPC API Reference. + |
+
Subnet + |
+See operation instructions in Subnet > Querying Subnets and Subnet > Creating a Subnet in the VPC API Reference. + |
+
Key Pair + |
+See operation instructions in ECS SSH Key Management > Querying SSH Key Pairs and ECS SSH Key Management > Creating and Importing an SSH Key Pair in the ECS API Reference. + |
+
Region + |
+Obtain the region and AZ information. For more information about regions and AZs, see Regions and Endpoints. + |
+
Version + |
+Currently, the following versions are supported: MRS 1.6.3, MRS 1.7.2, MRS 1.9.2, MRS 2.1.0, MRS 3.1.0-LTS.1 and MRS 3.1.2-LTS.3. + |
+
Component + |
+
|
+
Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
billing_type + |
+Yes + |
+Integer + |
+Cluster billing mode. Set this parameter to 12. + |
+
data_center + |
+Yes + |
+String + |
+Region of the cluster. For details, see Regions and Endpoints. + |
+
available_zone_id + |
+Yes + |
+String + |
+AZ ID. For details, see Regions and Endpoints. +
|
+
cluster_name + |
+Yes + |
+String + |
+Cluster name. It must be unique. +It contains only 1 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. + |
+
vpc + |
+Yes + |
+String + |
+Name of the VPC where the subnet locates +Perform the following operations to obtain the VPC name from the VPC management console: +
On the Virtual Private Cloud page, obtain the VPC name from the list. + |
+
vpc_id + |
+Yes + |
+String + |
+ID of the VPC where the subnet locates +Perform the following operations to obtain the VPC ID from the VPC management console: +
On the Virtual Private Cloud page, obtain the VPC ID from the list. + |
+
subnet_id + |
+Yes + |
+String + |
+Network ID +Perform the following operations to obtain the network ID of the VPC from the VPC management console: +
On the Virtual Private Cloud page, obtain the network ID of the VPC from the list. + |
+
subnet_name + |
+Yes + |
+String + |
+Subnet name +Perform the following operations to obtain the subnet name from the VPC management console: +
On the Virtual Private Cloud page, obtain the subnet name of the VPC from the list. + |
+
security_groups_id + |
+No + |
+String + |
+Security group ID of the cluster +
|
+
tags + |
+No + |
+Array + |
+Cluster tag +
|
+
cluster_version + |
+Yes + |
+String + |
+Cluster version +Possible values are as follows: +
|
+
cluster_type + |
+No + |
+Integer + |
+Cluster type +
The default value is 0. +Note: Currently, hybrid clusters cannot be created using APIs. + |
+
safe_mode + |
+Yes + |
+Integer + |
+Running mode of an MRS cluster +
NOTE:
+For MRS 1.7.2 or earlier, the request body contains the cluster_admin_secret field only when safe_mode is set to 1. + |
+
cluster_admin_secret + |
+Yes + |
+String + |
+Password of the MRS Manager administrator +
NOTE:
+For MRS 1.7.2 or earlier, this parameter is mandatory only when safe_mode is set to 1. + |
+
login_mode + |
+Yes + |
+Integer + |
+Cluster login mode +
The default value is 1. +
|
+
cluster_master_secret + |
+No + |
+String + |
+Password of user root for logging in to a cluster node +If login_mode is set to 0, the request body contains the cluster_master_secret field. +A password must meet the following requirements: +
|
+
node_public_cert_name + |
+No + |
+String + |
+Name of a key pair You can use a key pair to log in to the Master node in the cluster. +If login_mode is set to 1, the request body contains +the node_public_cert_name field. + |
+
log_collection + |
+No + |
+Integer + |
+Whether to collect logs when cluster creation fails +
The default value is 1, indicating that OBS buckets will be created and only used to collect logs that record MRS cluster creation failures. + |
+
node_groups + |
+No + |
+Array + |
+List of nodes. For more parameter description, see Table 4. + NOTE:
+You can select either this parameter or the parameter listed in Table 5. + |
+
component_list + |
+Yes + |
+Array + |
+List of service components to be installed. For more parameter description, see Table 7. + |
+
add_jobs + |
+No + |
+Array + |
+Jobs can be submitted when a cluster is created. Currently, only one job can be created. For details about job parameters, see Table 8. + |
+
bootstrap_scripts + |
+No + |
+Array + |
+Bootstrap action script information. For more parameter description, see Table 15. +MRS 1.7.2 or later supports this parameter. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
group_name + |
+Yes + |
+String + |
+Node group name. +
|
+
node_num + |
+Yes + |
+Integer + |
+Number of nodes. The value ranges from 0 to 500 and the default value is 0. The total number of Core and Task nodes cannot exceed 500. + |
+
node_size + |
+Yes + |
+String + |
+Instance specifications of a node. For details about the configuration method, see the remarks of master_node_size. + |
+
root_volume_size + |
+Yes + |
+String + |
+Data disk storage space of a node. + |
+
root_volume_type + |
+Yes + |
+String + |
+Data disk storage type of a node. Currently, SATA, SAS and SSD are supported. +
|
+
data_volume_type + |
+Yes + |
+String + |
+Data disk storage type of a node. Currently, SATA, SAS and SSD are supported. +
|
+
data_volume_count + |
+Yes + |
+Integer + |
+Number of data disks of a node. +Value range: 0 to 10 + |
+
data_volume_size + |
+Yes + |
+Integer + |
+Data disk storage space of a node. +Value range: 100 GB to 32,000 GB + |
+
auto_scaling_policy + |
+No + |
+AutoScalingPolicy + |
+Auto scaling rule information. This parameter is valid only when group_name is set to task_node_analysis_group or task_node_streaming_group. For details, see Table 5. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
master_node_num + |
+Yes + |
+Integer + |
+Number of Master nodes. If cluster HA is enabled, set this parameter to 2. If cluster HA is disabled, set this parameter to 1. + |
+
master_node_size + |
+Yes + |
+String + |
+Instance specifications of the Master node, for example, c6.4xlarge.4linux.mrs. MRS supports host specifications determined by CPU, memory, and disk space. For details about instance specifications, see ECS Specifications Used by MRS. + |
+
core_node_num + |
+Yes + |
+Integer + |
+Number of Core nodes +Value range: 1 to 500 +A maximum of 500 Core nodes are supported by default. If more than 500 Core nodes are required, contact technical support. + |
+
core_node_size + |
+Yes + |
+String + |
+Instance specifications of the Core node, for example, c6.4xlarge.4linux.mrs. + |
+
master_data_volume_type + |
+No + |
+String + |
+This parameter is a multi-disk parameter, indicating the data disk storage type of the Master node. Currently, SATA, SAS and SSD are supported. + |
+
master_data_volume_size + |
+No + |
+Integer + |
+This parameter is a multi-disk parameter, indicating the data disk storage space of the Master node. To increase data storage capacity, you can add disks at the same time when creating a cluster. +Value range: 100 GB to 32,000 GB + |
+
master_data_volume_count + |
+No + |
+Integer + |
+This parameter is a multi-disk parameter, indicating the number of data disks of the Master node. +The value can be set to 1 only. + |
+
core_data_volume_type + |
+No + |
+String + |
+This parameter is a multi-disk parameter, indicating the data disk storage type of the Core node. Currently, SATA, SAS and SSD are supported. + |
+
core_data_volume_size + |
+No + |
+Integer + |
+This parameter is a multi-disk parameter, indicating the data disk storage space of the Core node. To increase data storage capacity, you can add disks at the same time when creating a cluster. +Value range: 100 GB to 32,000 GB + |
+
core_data_volume_count + |
+No + |
+Integer + |
+This parameter is a multi-disk parameter, indicating the number of data disks of the Core node. +Value range: 1 to 10 + |
+
volume_type + |
+No + |
+String + |
+Data disk storage type of the Master and Core nodes. Currently, SATA, SAS and SSD are supported. Disk parameters can be represented by volume_type and volume_size, or multi-disk parameters. If the volume_type and volume_size parameters coexist with the multi-disk parameters, the system reads the volume_type and volume_size parameters first. You are advised to use the multi-disk parameters. +
|
+
volume_size + |
+No + |
+Integer + |
+Data disk storage space of the Master and Core nodes. To increase data storage capacity, you can add disks at the same time when creating a cluster. Select a proper disk storage space based on the following application scenarios: +
Value range: 100 GB to 32,000 GB +This parameter is not recommended. For details, see the description of the volume_type parameter. + |
+
task_node_groups + |
+No + |
+Array + |
+List of Task nodes For more parameter description, see Table 6. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
node_num + |
+Yes + |
+Integer + |
+Number of Task nodes. The value ranges from 0 to 500 and the total number of Core and Task nodes cannot exceed 500. + |
+
node_size + |
+Yes + |
+String + |
+Instance specifications of the Task node, for example, c6.4xlarge.4linux.mrs. For details about instance specifications, see ECS Specifications Used by MRS. + |
+
data_volume_type + |
+Yes + |
+String + |
+Data disk storage type of the Task node, supporting SATA, SAS, and SSD currently +
|
+
data_volume_count + |
+Yes + |
+Integer + |
+Number of data disks of a Task node +Value range: 0 to 10 + |
+
data_volume_size + |
+Yes + |
+Integer + |
+Data disk storage space of a Task node +Value range: 100 GB to 32,000 GB + |
+
auto_scaling_policy + |
+No + |
+AutoScalingPolicy + |
+Auto scaling policy. For details, see Table 9. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
component_name + |
+Yes + |
+String + |
+Component name + + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
job_type + |
+Yes + |
+Integer + |
+Job type code +
|
+
job_name + |
+Yes + |
+String + |
+Job name. It contains 1 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. + NOTE:
+Identical job names are allowed but not recommended. + |
+
jar_path + |
+No + |
+String + |
+Path of the JAR or SQL file for program execution. The parameter must meet the following requirements: +
|
+
arguments + |
+No + |
+String + |
+Key parameter for program execution. The parameter is specified by the function of the user's program. MRS is only responsible for loading the parameter. +The parameter contains a maximum of 2,047 characters, excluding special characters such as ;|&>'<$, and can be left blank. + |
+
input + |
+No + |
+String + |
+Address for inputting data. +Files can be stored in HDFS or OBS. The path varies depending on the file system.
+
The parameter contains a maximum of 1,023 characters, excluding special characters such as ;|&>'<$, and can be left blank. + |
+
output + |
+No + |
+String + |
+Address for outputting data. +Files can be stored in HDFS or OBS. The path varies depending on the file system.
+
If the specified path does not exist, the system will automatically create it. +The parameter contains a maximum of 1,023 characters, excluding special characters such as ;|&>'<$, and can be left blank. + |
+
job_log + |
+No + |
+String + |
+Path for storing job logs that record job running status. +Files can be stored in HDFS or OBS. The path varies depending on the file system.
+
The parameter contains a maximum of 1,023 characters, excluding special characters such as ;|&>'<$, and can be left blank. + |
+
shutdown_cluster + |
+No + |
+Bool + |
+Whether to delete the cluster after the job execution is complete +
|
+
file_action + |
+No + |
+String + |
+Data import and export +
|
+
submit_job_once_cluster_run + |
+Yes + |
+Bool + |
+
Set this parameter to true in this example. + |
+
hql + |
+No + |
+String + |
+HiveQL statement + |
+
hive_script_path + |
+Yes + |
+String + |
+SQL program path. This parameter is needed by Spark Script and Hive Script jobs only, and must meet the following requirements: +
|
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
auto_scaling_enable + |
+Yes + |
+Boolean + |
+Whether to enable the auto scaling rule. + |
+
min_capacity + |
+Yes + |
+Integer + |
+Minimum number of nodes left in the node group. +Value range: 0 to 500 + |
+
max_capacity + |
+Yes + |
+Integer + |
+Maximum number of nodes in the node group. +Value range: 0 to 500 + |
+
resources_plans + |
+No + |
+List + |
+Resource plan list. For details, see Table 10. If this parameter is left blank, the resource plan is disabled. +When auto scaling is enabled, either a resource plan or an auto scaling rule must be configured. +MRS 1.6.3 or later supports this parameter. + |
+
exec_scripts + |
+No + |
+List + |
+List of custom scaling automation scripts. For details, see Table 11. If this parameter is left blank, a hook script is disabled. +MRS 1.7.2 or later supports this parameter. + |
+
rules + |
+No + |
+List + |
+List of auto scaling rules. For details, see Table 12. +When auto scaling is enabled, either a resource plan or an auto scaling rule must be configured. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
period_type + |
+Yes + |
+String + |
+Cycle type of a resource plan. Currently, only the following cycle type is supported: +
|
+
start_time + |
+Yes + |
+String + |
+Start time of a resource plan. The value is in the format of hour:minute, indicating that the time ranges from 0:00 to 23:59. + |
+
end_time + |
+Yes + |
+String + |
+End time of a resource plan. The value is in the same format as that of start_time. The interval between end_time and start_time must be greater than or equal to 30 minutes. + |
+
min_capacity + |
+Yes + |
+Integer + |
+Minimum number of the preserved nodes in a node group in a resource plan. +Value range: 0 to 500 + |
+
max_capacity + |
+Yes + |
+Integer + |
+Maximum number of the preserved nodes in a node group in a resource plan. +Value range: 0 to 500 + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
name + |
+Yes + |
+String + |
+Name of a custom automation script. It must be unique in a same cluster. +The value can contain only digits, letters, spaces, hyphens (-), and underscores (_) and cannot start with a space. +The value can contain 1 to 64 characters. + |
+
uri + |
+Yes + |
+String + |
+Path of a custom automation script. Set this parameter to an OBS bucket path or a local VM path. +
|
+
parameters + |
+No + |
+String + |
+Parameters of a custom automation script. +
|
+
nodes + |
+Yes + |
+List<String> + |
+Type of a node where the custom automation script is executed. The node type can be Master, Core, or Task. + |
+
active_master + |
+No + |
+Boolean + |
+Whether the custom automation script runs only on the active Master node. +The default value is false, indicating that the custom automation script can run on all Master nodes. + |
+
action_stage + |
+Yes + |
+String + |
+Time when a script is executed. +The following four options are supported: +
|
+
fail_action + |
+Yes + |
+String + |
+Whether to continue to execute subsequent scripts and create a cluster after the custom automation script fails to be executed. +
|
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
name + |
+Yes + |
+String + |
+Name of an auto scaling rule. +It contains only 1 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. +Rule names must be unique in a node group. + |
+
description + |
+No + |
+String + |
+Description about an auto scaling rule. +It contains a maximum of 1,024 characters. + |
+
adjustment_type + |
+Yes + |
+String + |
+Auto scaling rule adjustment type. The options are as follows: +
|
+
cool_down_minutes + |
+Yes + |
+Integer + |
+Cluster cooling time after an auto scaling rule is triggered, when no auto scaling operation is performed. The unit is minute. +Value range: 0 to 10,080. One week is equal to 10,080 minutes. + |
+
scaling_adjustment + |
+Yes + |
+Integer + |
+Number of nodes that can be adjusted once. +Value range: 1 to 100 + |
+
trigger + |
+Yes + |
+Trigger + |
+Condition for triggering a rule. For details, see Table 13. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
metric_name + |
+Yes + |
+String + |
+Metric name. +This triggering condition makes a judgment according to the value of the metric. +A metric name contains a maximum of 64 characters. +Table 14 lists the supported metric names. + |
+
metric_value + |
+Yes + |
+String + |
+Metric threshold to trigger a rule +The parameter value must be an integer or number with two decimal places only. Table 14 provides value types and ranges corresponding to metric_name. + |
+
comparison_operator + |
+No + |
+String + |
+Metric judgment logic operator. The options are as follows: +
|
+
evaluation_periods + |
+Yes + |
+Integer + |
+Number of consecutive five-minute periods, during which a metric threshold is reached +Value range: 1 to 288 + |
+
Cluster Type + |
+Metric Name + |
+Value Type + |
+Description + |
+
|---|---|---|---|
Streaming cluster + |
+StormSlotAvailable + |
+Integer + |
+Number of available Storm slots. +Value range: 0 to 2147483646 + |
+
StormSlotAvailablePercentage + |
+Percentage + |
+Percentage of available Storm slots, that is, the proportion of the available slots to total slots +Value range: 0 to 100 + |
+|
StormSlotUsed + |
+Integer + |
+Number of the used Storm slots. +Value range: 0 to 2147483646 + |
+|
StormSlotUsedPercentage + |
+Percentage + |
+Percentage of the used Storm slots, that is, the proportion of the used slots to total slots. +Value range: 0 to 100 + |
+|
StormSupervisorMemAverageUsage + |
+Integer + |
+Average memory usage of the Supervisor process of Storm. +Value range: 0 to 2147483646 + |
+|
StormSupervisorMemAverageUsagePercentage + |
+Percentage + |
+Average percentage of the used memory of the Supervisor process of Storm to the total memory of the system. +Value range: 0 to 100 + |
+|
StormSupervisorCPUAverageUsagePercentage + |
+Percentage + |
+Average percentage of the used CPUs of the Supervisor process of Storm to the total CPUs. +Value range: 0 to 6,000 + |
+|
Analysis cluster + |
+YARNAppPending + |
+Integer + |
+Number of pending tasks on Yarn. +Value range: 0 to 2147483646 + |
+
YARNAppPendingRatio + |
+Ratio + |
+Ratio of pending tasks on Yarn, that is, the ratio of pending tasks to running tasks on Yarn. +Value range: 0 to 2147483646 + |
+|
YARNAppRunning + |
+Integer + |
+Number of running tasks on Yarn. +Value range: 0 to 2147483646 + |
+|
YARNContainerAllocated + |
+Integer + |
+Number of containers allocated to Yarn. +Value range: 0 to 2147483646 + |
+|
YARNContainerPending + |
+Integer + |
+Number of pending containers on Yarn. +Value range: 0 to 2147483646 + |
+|
YARNContainerPendingRatio + |
+Ratio + |
+Ratio of pending containers on Yarn, that is, the ratio of pending containers to running containers on Yarn. +Value range: 0 to 2147483646 + |
+|
YARNCPUAllocated + |
+Integer + |
+Number of virtual CPUs (vCPUs) allocated to Yarn +Value range: 0 to 2147483646 + |
+|
YARNCPUAvailable + |
+Integer + |
+Number of available vCPUs on Yarn. +Value range: 0 to 2147483646 + |
+|
YARNCPUAvailablePercentage + |
+Percentage + |
+Percentage of available vCPUs on Yarn, that is, the proportion of available vCPUs to total vCPUs. +Value range: 0 to 100 + |
+|
YARNCPUPending + + |
+Integer + |
+Number of pending vCPUs on Yarn. +Value range: 0 to 2147483646 + |
+|
YARNMemoryAllocated + |
+Integer + |
+Memory allocated to Yarn. The unit is MB. +Value range: 0 to 2147483646 + |
+|
YARNMemoryAvailable + |
+Integer + |
+Available memory on Yarn. The unit is MB. +Value range: 0 to 2147483646 + |
+|
YARNMemoryAvailablePercentage + |
+Percentage + |
+Percentage of available memory on Yarn, that is, the proportion of available memory to total memory on Yarn. +Value range: 0 to 100 + |
+|
YARNMemoryPending + |
+Integer + |
+Pending memory on Yarn. +Value range: 0 to 2147483646 + |
+
When the value type is percentage or ratio in Table 14, the valid value can be accurate to percentile. The percentage metric value is a decimal value with a percent sign (%) removed. For example, 16.80 represents 16.80%.
+Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
name + |
+Yes + |
+String + |
+Name of a bootstrap action script. It must be unique in a cluster. +The value can contain only digits, letters, spaces, hyphens (-), and underscores (_) and cannot start with a space. +The value can contain 1 to 64 characters. + |
+
uri + |
+Yes + |
+String + |
+Path of a bootstrap action script. Set this parameter to an OBS bucket path or a local VM path. +
|
+
parameters + |
+No + |
+String + |
+Bootstrap action script parameters. + |
+
nodes + |
+Yes + |
+Array String + |
+Type of a node where the bootstrap action script is executed. The value can be Master, Core, or Task. + |
+
active_master + |
+No + |
+Boolean + |
+Whether the bootstrap action script runs only on active Master nodes. +The default value is false, indicating that the bootstrap action script can run on all Master nodes. + |
+
before_component_start + |
+No + |
+Boolean + |
+Time when the bootstrap action script is executed. Currently, the following two options are available: Before component start and After component start +The default value is false, indicating that the bootstrap action script is executed after the component is started. + |
+
fail_action + |
+Yes + |
+String + |
+Whether to continue executing subsequent scripts and creating a cluster after the bootstrap action script fails to be executed. +
The default value is errorout, indicating that the action is stopped.
+ NOTE:
+You are advised to set this parameter to continue in the commissioning phase so that the cluster can continue to be installed and started no matter whether the bootstrap action is successful. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
cluster_id + |
+String + |
+Cluster ID, which is returned by the system after the cluster is created. + |
+
result + |
+Bool + |
+Operation result. +
|
+
msg + |
+String + |
+System message, which can be empty. + |
+
{
+ "billing_type": 12,
+ "data_center": "eu-de",
+ "available_zone_id": "bf84aba586ce4e948da0b97d9a7d62fb",
+ "cluster_name": "mrs_HEbK",
+ "cluster_version": "MRS 3.X.X",
+ "safe_mode": 0,
+ "cluster_type": 0,
+"component_list": [
+ {
+ "component_name": "Hadoop"
+ },
+ {
+ "component_name": "Spark"
+ },
+ {
+ "component_name": "HBase"
+ },
+ {
+ "component_name": "Hive"
+ },
+ {
+ "component_name": "Presto"
+ },
+ {
+ "component_name": "Tez"
+ },
+ {
+ "component_name": "Hue"
+ },
+ {
+ "component_name": "Loader"
+ },
+ {
+ "component_name": "Flink"
+ }
+],
+ "vpc": "vpc-4b1c",
+ "vpc_id": "4a365717-67be-4f33-80c5-98e98a813af8",
+ "subnet_id": "67984709-e15e-4e86-9886-d76712d4e00a",
+ "subnet_name": "subnet-4b44",
+ "security_groups_id": "4820eace-66ad-4f2c-8d46-cf340e3029dd",
+ "tags": [{
+ "key": "key1",
+ "value": "value1"
+ }, {
+ "key": "key2",
+ "value": "value2"
+ }],
+ "node_groups": [{
+ "group_name": "master_node_default_group",
+ "node_num": 2,
+ "node_size": "c6.4.xlarge.4linux.mrs",
+ "root_volume_size": 480,
+ "root_volume_type": "SATA",
+ "data_volume_type": "SATA",
+ "data_volume_count": 1,
+ "data_volume_size": 600
+ }, {
+ "group_name": "core_node_analysis_group",
+ "node_num": 3,
+ "node_size": "c6.4.xlarge.4linux.mrs",
+ "root_volume_size": 480,
+ "root_volume_type": "SATA",
+ "data_volume_type": "SATA",
+ "data_volume_count": 1,
+ "data_volume_size": 600
+ }, {
+ "group_name": "task_node_analysis_group",
+ "node_num": 2,
+ "node_size": "c6.4.xlarge.4linux.mrs",
+ "root_volume_size": 480,
+ "root_volume_type": "SATA",
+ "data_volume_type": "SATA",
+ "data_volume_count": 0,
+ "data_volume_size": 600,
+ "auto_scaling_policy": {
+ "auto_scaling_enable": true,
+ "min_capacity": 1,
+ "max_capacity": "3",
+ "resources_plans": [{
+ "period_type": "daily",
+ "start_time": "9:50",
+ "end_time": "10:20",
+ "min_capacity": 2,
+ "max_capacity": 3
+ }, {
+ "period_type ": "daily",
+ "start_time ": "10:20",
+ "end_time ": "12:30",
+ "min_capacity ": 0,
+ "max_capacity ": 2
+ }],
+ "exec_scripts": [{
+ "name": "before_scale_out",
+ "uri": "s3a://XXX/zeppelin_install.sh ",
+ "parameters": "${mrs_scale_node_num} ${mrs_scale_type} xxx",
+ "nodes": ["master", "core", "task"],
+ "active_master": "true",
+ "action_stage": "before_scale_out",
+ "fail_sction": "continue"
+ }, {
+ "name": "after_scale_out",
+ "uri": "s3a://XXX/storm_rebalance.sh",
+ "parameters": "${mrs_scale_node_hostnames} ${mrs_scale_node_ips}",
+ "nodes": ["master", "core", "task"],
+ "active_master": "true",
+ "action_stage": "after_scale_out",
+ "fail_action": "continue"
+ }],
+ "rules": [{
+ "name": "default-expand-1",
+ "adjustment_type": "scale_out",
+ "cool_down_minutes": 5,
+ "scaling_adjustment": 1,
+ "trigger": {
+ "metric_name": "YARNMemoryAvailablePercentage",
+ "metric_value": "25",
+ "comparison_operator": "LT",
+ "evaluation_periods": 10
+ }
+ }, {
+ "name": "default-shrink-1",
+ "adjustment_type": "scale_in",
+ "cool_down_minutes": 5,
+ "scaling_adjustment": 1,
+ "trigger": {
+ "metric_name": "YARNMemoryAvailablePercentage",
+ "metric_value": "70",
+ "comparison_operator": "GT",
+ "evaluation_periods": 10
+ }
+ }]
+ }
+ }
+ ],
+ "login_mode": 1,
+ "cluster_master_secret": "",
+ "cluster_admin_secret": "",
+ "log_collection": 1,
+ "add_jobs": [{
+ "job_type": 1,
+ "job_name": "tenji111",
+ "jar_path": "s3a://bigdata/program/hadoop-mapreduce-examples-2.7.2.jar",
+ "arguments": "wordcount",
+ "input": "s3a://bigdata/input/wd_1k/",
+ "output": "s3a://bigdata/ouput/",
+ "job_log": "s3a://bigdata/log/",
+ "shutdown_cluster": true,
+ "file_action": "",
+ "submit_job_once_cluster_run": true,
+ "hql": "",
+ "hive_script_path": ""
+ }],
+ "bootstrap_scripts": [{
+ "name": "Modify os config",
+ "uri": "s3a://XXX/modify_os_config.sh",
+ "parameters": "param1 param2",
+ "nodes": ["master", "core", "task"],
+ "active_master": "false",
+ "before_component_start": "true",
+ "fail_action": "continue"
+ }, {
+ "name": "Install zepplin",
+ "uri": "s3a://XXX/zeppelin_install.sh",
+ "parameters": "",
+ "nodes": ["master"],
+ "active_master": "true",
+ "before_component_start": "false",
+ "fail_action": "continue"
+ }]
+}
+{
+ "billing_type": 12,
+ "data_center": "eu-de",
+ "master_node_num": 2,
+ "master_node_size": "s1.8xlarge.linux.mrs",
+ "core_node_num": 3,
+ "core_node_size": "c6.4xlarge.4linux.mrs",
+ "available_zone_id": "bf84aba586ce4e948da0b97d9a7d62fb",
+ "cluster_name": "newcluster",
+ "vpc": "vpc1",
+ "vpc_id": "5b7db34d-3534-4a6e-ac94-023cd36aaf74",
+ "subnet_id": "815bece0-fd22-4b65-8a6e-15788c99ee43",
+ "subnet_name": "subnet",
+ "security_groups_id": "",
+ "tags": [
+ {
+ "key": "key1",
+ "value": "value1"
+ },
+ {
+ "key": "key2",
+ "value": "value2"
+ }
+ ],
+ "cluster_version": "MRS 3.X.X",
+ "cluster_type": 0,
+ "master_data_volume_type": "SATA",
+ "master_data_volume_size": 100,
+ "master_data_volume_count": 1,
+ "core_data_volume_type": "SATA",
+ "core_data_volume_size": 100,
+ "core_data_volume_count": 2,
+ "login_mode": 1,
+ "node_public_cert_name": "SSHkey-bba1",
+ "safe_mode": 0,
+ "cluster_admin_secret":"******",
+ "log_collection": 1,
+ "task_node_groups": [
+ {
+
+ "node_num": 2,
+ "node_size": "c6.4.xlarge.4linux.mrs",
+ "data_volume_type": "SATA",
+ "data_volume_count": 1,
+ "data_volume_size": 600,
+ "auto_scaling_policy":
+ {
+ "auto_scaling_enable": true,
+ "min_capacity": "1",
+ "max_capacity": "3",
+ "resources_plans": [{
+ "period_type": "daily",
+ "start_time": "9:50",
+ "end_time": "10:20",
+ "min_capacity": "2",
+ "max_capacity": "3"
+ },{
+ "period_type": "daily",
+ "start_time": "10:20",
+ "end_time": "12:30",
+ "min_capacity": "0",
+ "max_capacity": "2"
+ }],
+ "exec_scripts": [{
+ "name": "before_scale_out",
+ "uri": "s3a://XXX/zeppelin_install.sh",
+ "parameters": "",
+ "nodes": [
+ "master",
+ "core",
+ "task"
+ ],
+ "active_master": "true",
+ "action_stage": "before_scale_out",
+ "fail_action": "continue"
+ },{
+ "name": "after_scale_out",
+ "uri": "s3a://XXX/storm_rebalance.sh",
+ "parameters": "",
+ "nodes": [
+ "master",
+ "core",
+ "task"
+ ],
+ "active_master": "true",
+ "action_stage": "after_scale_out",
+ "fail_action": "continue"
+ }],
+ "rules": [
+ {
+ "name": "default-expand-1",
+ "adjustment_type": "scale_out",
+ "cool_down_minutes": 5,
+ "scaling_adjustment": 1,
+ "trigger": {
+ "metric_name": "YARNMemoryAvailablePercentage",
+ "metric_value": "25",
+ "comparison_operator": "LT",
+ "evaluation_periods": 10
+ }
+ },
+ {
+ "name": "default-shrink-1",
+ "adjustment_type": "scale_in",
+ "cool_down_minutes": 5,
+ "scaling_adjustment": 1,
+ "trigger": {
+ "metric_name": "YARNMemoryAvailablePercentage",
+ "metric_value": "70",
+ "comparison_operator": "GT",
+ "evaluation_periods": 10
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "component_list": [
+ {
+ "component_name": "Hadoop"
+ },
+ {
+ "component_name": "Spark"
+ },
+ {
+ "component_name": "HBase"
+ },
+ {
+ "component_name": "Hive"
+ },
+ {
+ "component_name": "Presto"
+ },
+ {
+ "component_name": "Tez"
+ },
+ {
+ "component_name": "Hue"
+ },
+ {
+ "component_name": "Loader"
+ },
+ {
+ "component_name": "Flink"
+ }
+ ],
+ "add_jobs": [
+ {
+ "job_type": 1,
+ "job_name": "tenji111",
+ "jar_path": "s3a://bigdata/program/hadoop-mapreduce-examples-XXX.jar",
+ "arguments": "wordcount",
+ "input": "s3a://bigdata/input/wd_1k/",
+ "output": "s3a://bigdata/ouput/",
+ "job_log": "s3a://bigdata/log/",
+ "shutdown_cluster": false,
+ "file_action": "",
+ "submit_job_once_cluster_run": true,
+ "hql": "",
+ "hive_script_path": ""
+ }
+ ],
+"bootstrap_scripts": [
+ {
+ "name":"Modify os config",
+ "uri":"s3a://XXX/modify_os_config.sh",
+ "parameters":"param1 param2",
+ "nodes":[
+ "master",
+ "core",
+ "task"
+ ],
+ "active_master":"false",
+ "before_component_start":"true",
+ "fail_action":"continue"
+ },
+ {
+ "name":"Install zepplin",
+ "uri":"s3a://XXX/zeppelin_install.sh",
+ "parameters":"",
+ "nodes":[
+ "master"
+ ],
+ "active_master":"true",
+ "before_component_start":"false",
+ "fail_action":"continue"
+ }
+ ]
+}
+{
+ "billing_type": 12,
+ "data_center": "eu-de",
+ "available_zone_id": "bf84aba586ce4e948da0b97d9a7d62fb",
+ "cluster_name": "mrs_HEbK",
+ "cluster_version": "MRS 3.X.X",
+ "safe_mode": 0,
+ "cluster_type": 0,
+"component_list": [
+ {
+ "component_name": "Hadoop"
+ },
+ {
+ "component_name": "Spark"
+ },
+ {
+ "component_name": "HBase"
+ },
+ {
+ "component_name": "Hive"
+ },
+ {
+ "component_name": "Presto"
+ },
+ {
+ "component_name": "Tez"
+ },
+ {
+ "component_name": "Hue"
+ },
+ {
+ "component_name": "Loader"
+ },
+ {
+ "component_name": "Flink"
+ }
+],
+ "vpc": "vpc-4b1c",
+ "vpc_id": "4a365717-67be-4f33-80c5-98e98a813af8",
+ "subnet_id": "67984709-e15e-4e86-9886-d76712d4e00a",
+ "subnet_name": "subnet-4b44",
+ "security_groups_id": "4820eace-66ad-4f2c-8d46-cf340e3029dd",
+ "tags": [{
+ "key": "key1",
+ "value": "value1"
+ }, {
+ "key": "key2",
+ "value": "value2"
+ }],
+ "node_groups": [{
+ "group_name": "master_node_default_group",
+ "node_num": 1,
+ "node_size": "c6.4.xlarge.4linux.mrs",
+ "root_volume_size": 480,
+ "root_volume_type": "SATA",
+ "data_volume_type": "SATA",
+ "data_volume_count": 1,
+ "data_volume_size": 600
+ }, {
+ "group_name": "core_node_analysis_group",
+ "node_num": 1,
+ "node_size": "c6.4.xlarge.4linux.mrs",
+ "root_volume_size": 480,
+ "root_volume_type": "SATA",
+ "data_volume_type": "SATA",
+ "data_volume_count": 1,
+ "data_volume_size": 600
+ }
+ ],
+ "login_mode": 1,
+ "cluster_master_secret": "",
+ "cluster_admin_secret": "",
+ "log_collection": 1,
+ "add_jobs": [{
+ "job_type": 1,
+ "job_name": "tenji111",
+ "jar_path": "s3a://bigdata/program/hadoop-mapreduce-examples-2.7.2.jar",
+ "arguments": "wordcount",
+ "input": "s3a://bigdata/input/wd_1k/",
+ "output": "s3a://bigdata/ouput/",
+ "job_log": "s3a://bigdata/log/",
+ "shutdown_cluster": true,
+ "file_action": "",
+ "submit_job_once_cluster_run": true,
+ "hql": "",
+ "hive_script_path": ""
+ }],
+ "bootstrap_scripts": [{
+ "name": "Modify os config",
+ "uri": "s3a://XXX/modify_os_config.sh",
+ "parameters": "param1 param2",
+ "nodes": ["master", "core", "task"],
+ "active_master": "false",
+ "before_component_start": "true",
+ "fail_action": "continue"
+ }, {
+ "name": "Install zepplin",
+ "uri": "s3a://XXX/zeppelin_install.sh",
+ "parameters": "",
+ "nodes": ["master"],
+ "active_master": "true",
+ "before_component_start": "false",
+ "fail_action": "continue"
+ }]
+}
+{
+ "billing_type": 12,
+ "data_center": "eu-de",
+ "master_node_num": 1
+ "master_node_size": "s1.8xlarge.linux.mrs",
+ "core_node_num": 1,
+ "core_node_size": "c6.4xlarge.4linux.mrs",
+ "available_zone_id": "bf84aba586ce4e948da0b97d9a7d62fb",
+ "cluster_name": "newcluster",
+ "vpc": "vpc1",
+ "vpc_id": "5b7db34d-3534-4a6e-ac94-023cd36aaf74",
+ "subnet_id": "815bece0-fd22-4b65-8a6e-15788c99ee43",
+ "subnet_name": "subnet",
+ "security_groups_id": "",
+ "tags": [
+ {
+ "key": "key1",
+ "value":"value1"
+ },
+ {
+ "key": "key2",
+ "value": "value2"
+ }
+ ],
+ "cluster_version": "MRS 3.X.X",
+ "cluster_type": 0,
+ "master_data_volume_type": "SATA",
+ "master_data_volume_size": 100,
+ "master_data_volume_count": 1,
+ "core_data_volume_type": "SATA",
+ "core_data_volume_size": 100,
+ "core_data_volume_count": 1,
+ "login_mode": 1,
+ "node_public_cert_name": "SSHkey-bba1",
+ "safe_mode": 0,
+ "cluster_admin_secret":"******",
+ "log_collection": 1,
+ "component_list": [
+ {
+ "component_name": "Hadoop"
+ },
+ {
+ "component_name": "Spark"
+ },
+ {
+ "component_name": "HBase"
+ },
+ {
+ "component_name": "Hive"
+ },
+ {
+ "component_name": "Presto"
+ },
+ {
+ "component_name": "Tez"
+ },
+ {
+ "component_name": "Hue"
+ },
+ {
+ "component_name": "Loader"
+ },
+ {
+ "component_name": "Flink"
+ }
+ ],
+ "add_jobs": [
+ {
+ "job_type": 1,
+ "job_name": "tenji111",
+ "jar_path": "s3a://bigdata/program/hadoop-mapreduce-examples-XXX.jar",
+ "arguments": "wordcount",
+ "input": "s3a://bigdata/input/wd_1k/",
+ "output": "s3a://bigdata/ouput/",
+ "job_log": "s3a://bigdata/log/",
+ "shutdown_cluster": false,
+ "file_action": "",
+ "submit_job_once_cluster_run": true,
+ "hql": "",
+ "hive_script_path": ""
+ }
+ ],
+"bootstrap_scripts": [
+ {
+ "name":"Install zepplin",
+ "uri":"s3a://XXX/zeppelin_install.sh",
+ "parameters":"",
+ "nodes":[
+ "master"
+ ],
+ "active_master":"false",
+ "before_component_start":"false",
+ "fail_action":"continue"
+ }
+ ]
+}
+{
+ "cluster_id": "da1592c2-bb7e-468d-9ac9-83246e95447a",
+ "result": true,
+ "msg": ""
+}
+Table 17 describes the status code of this API.
+ +Status Code + |
+Description + |
+
|---|---|
200 + |
+The cluster has been successfully created. + |
+
For the description about error status codes, see Status Codes.
+This API is used to manually scale out or scale in Core or Task nodes in a cluster that has been created. After an MRS cluster is created, the number of Master nodes cannot be adjusted. That is, Master nodes cannot be scaled in or out. This API is incompatible with Sahara.
+Only clusters in the Running state can be scaled out or in.
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
cluster_id + |
+Yes + |
+Cluster ID + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
service_id + |
+No + |
+String + |
+Service ID. This parameter is reserved for extension. You do not need to set this parameter. + |
+
plan_id + |
+No + |
+String + |
+Plan ID. This parameter is reserved for extension. You do not need to set this parameter. + |
+
parameters + |
+Yes + |
+Object + |
+Core parameters. For details, see Table 3. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
order_id + |
+No + |
+String + |
+Order ID obtained by the system during scale-out or scale-in. You do not need to set the parameter. + |
+
scale_type + |
+Yes + |
+String + |
+
|
+
node_id + |
+Yes + |
+String + |
+ID of the newly added or removed node. The parameter value is fixed to node_orderadd. The ID of a newly added or removed node includes node_orderadd, for example, node-orderadd-TBvSr.com. + |
+
node_group + |
+No + |
+String + |
+Node group to be scaled out or in
+
If it is left blank, the default value core_node_default_group is used. + |
+
task_node_info + |
+No + |
+Object + |
+Task node specifications. For more parameter description, see Table 5. +
|
+
instances + |
+Yes + |
+String/Integer + |
+Number of nodes to be added or removed +
|
+
skip_bootstrap_scripts + |
+No + |
+Boolean + |
+This parameter is valid only when a bootstrap action is configured during cluster creation and takes effect during scale-out. It indicates whether the bootstrap action specified during cluster creation is performed on nodes added during scale-out. The default value is false, indicating that the bootstrap action is performed. MRS 1.7.2 or later supports this parameter. + |
+
scale_without_start + |
+No + |
+boolean + |
+Whether to start components on the added nodes after cluster scale-out +
This parameter is valid only in MRS 1.7.2 or later. + |
+
server_ids + |
+No + |
+List<String> + |
+ID list of Task nodes to be deleted during task node scale-in. +
|
+
previous_values + |
+No + |
+Object + |
+Extension parameter. You do not need to set this parameter. For details, see Table 4. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
plan_id + |
+No + |
+String + |
+Reserve the parameter for extending APIs. +You do not need to set the parameter. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
node_size + |
+Yes + |
+String + |
+Instance specifications of a Task node, for example, c6.4xlarge.4linux.mrs +For details about instance specifications, see ECS Specifications Used by MRS. + |
+
data_volume_type + |
+No + |
+String + |
+Data disk storage type of the Task node, supporting SATA, SAS, and SSD currently +
|
+
data_volume_count + |
+No + |
+Integer + |
+Number of data disks of a Task node +Value range: 1 to 10 + |
+
data_volume_size + |
+No + |
+Integer + |
+Data disk storage space of a Task node +Value range: 100 GB to 32,000 GB + |
+
Response parameters
+ +{
+ "service_id": "",
+ "plan_id": "",
+ "parameters": {
+ "order_id": "",
+ "scale_type": "scale_out",
+ "node_id": "node_orderadd",
+ "node_group": "core_node_default_group",
+ "instances": "1",
+ "skip_bootstrap_scripts":false,
+ "scale_without_start":false
+ },
+ "previous_values": {
+ "plan_id": ""
+ }
+}
+Scaling out Task nodes when the number of the existing Task nodes is greater than zero:
+{
+ "service_id": "",
+ "plan_id": "",
+ "parameters": {
+ "order_id": "",
+ "scale_type": "scale_out",
+ "node_id": "node_orderadd",
+ "node_group": "task_node_default_group",
+ "instances": "1",
+ "skip_bootstrap_scripts":false,
+ "scale_without_start":false
+ },
+ "previous_values": {
+ "plan_id": ""
+ }
+}
+Scaling out Task nodes when the number of the existing Task nodes is zero:
+{
+ "service_id": "",
+ "plan_id": "",
+ "parameters": {
+ "order_id": "",
+ "scale_type": "scale_out",
+ "node_id": "node_orderadd",
+ "node_group": "task_node_default_group",
+ "task_node_info": {
+ "node_size": "s1.xlarge.linux.mrs",
+ "data_volume_type":"SATA",
+ "data_volume_count":2,
+ "data_volume_size":200
+ },
+ "instances": "1",
+ "scale_without_start":false
+
+
+ },
+ "previous_values": {
+ "plan_id": ""
+ }
+}
+Scaling in Core nodes:
+{
+ "service_id": "",
+ "plan_id": "",
+ "parameters": {
+ "order_id": "",
+ "scale_type": "scale_in",
+ "node_id": "node_orderadd",
+ "node_group": "core_node_default_group",
+ "instances": "1"
+
+
+ },
+ "previous_values": {
+ "plan_id": ""
+ }
+}
+Scaling in Task nodes:
+{
+ "service_id": "",
+ "plan_id": "",
+ "parameters": {
+ "order_id": "",
+ "scale_type": "scale_in",
+ "node_id": "node_orderadd",
+ "node_group": "task_node_default_group",
+ "instances": "1"
+
+
+ },
+ "previous_values": {
+ "plan_id": ""
+ }
+}
+{
+ "service_id": "",
+ "plan_id": "",
+ "parameters": {
+ "order_id": "",
+ "scale_type": "scale_in",
+ "node_id": "node_orderadd",
+ "node_group": "task_node_default_group",
+ "instances": "2",
+ "server_ids": ["c9573435-7814-4b2c-9131-ad78b814414c", "a4951009-6a0f-4e7b-9c81-9d4bd1f8c537"]
+ },
+ "previous_values": {
+ "plan_id": ""
+ }
+}
+{
+ "result": "succeeded"
+}
+Error Code + |
+Message + |
+
|---|---|
12000001 + |
+Identity verification is invalid + |
+
12000002 + |
+The parameter is invalid. + |
+
12000003 + |
+The cluster does not exist. + |
+
12000009 + |
+The method parameter is invalid. + |
+
12000013 + |
+Scale-in of cluster XX failed. + |
+
12000014 + |
+Scale-out of cluster XX failed. + |
+
12000017 + |
+Scale-out or scale-in is not allowed for clusters that are not in the Running state. + |
+
12000018 + |
+Scale-out or scale-in cannot be performed again because it is in progress. + |
+
12000019 + |
+Failed to obtain hosts of the cluster. + |
+
12000028 + |
+The maximum number of Core nodes in a cluster is N. + |
+
12000029 + |
+Failed to obtain the quota. + |
+
12000030 + |
+The requested number of nodes in the cluster exceeds the available quota. + |
+
12000031 + |
+The requested number of vCPUs in the cluster exceeds the available quota. + |
+
12000032 + |
+The requested memory of the cluster exceeds the available quota. + |
+
12000033 + |
+The requested number of disks in the cluster exceeds the available quota. + |
+
12000034 + |
+The requested disk capacity of the cluster exceeds the available quota. + |
+
12000054 + |
+The operation is not supported. + |
+
12000067 + |
+The cluster cannot be scaled out because its version is too early. Upgrade the cluster to the latest version. + |
+
12000068 + |
+The status of some nodes is not running in the cluster. Try again later. + |
+
12000121 + |
+Scale-out is not allowed because the cluster has an unpaid order. Scale out the cluster again after you pay the order. + |
+
MRS.101 + |
+Your request could not be fulfilled because your quota is insufficient. Contact technical support to increase the quota. + |
+
MRS.102 + |
+The token cannot be null or invalid. Try again later or contact customer service. + |
+
MRS.103 + |
+Invalid request. Try again later or contact customer service. + |
+
MRS.104 + |
+Insufficient resources. Try again later or contact customer service. + |
+
MRS.105 + |
+Insufficient IP addresses in the existing subnet. Try again later or contact customer service. + |
+
MRS.201 + |
+Failed due to an ECS error. Try again later or contact customer service. (ECS: xxxx, ECS error information) + |
+
MRS.202 + |
+Failed due to an IAM error. Try again later or contact customer service. (IAM: xxxx, IAM error information) + |
+
MRS.203 + |
+Failed due to a VPC error. Try again later or contact customer service. (VPC: xxxx, VPC error information) + |
+
MRS.300 + |
+MRS system error. Try again later or contact customer service. + |
+
This API is used to query a list of clusters created by a user. This API is incompatible with Sahara.
+GET /v1.1/{project_id}/cluster_infos?pageSize={page_size}¤tPage={current_page}&clusterState={cluster_state}&tags={tags}
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
pageSize + |
+No + |
+Maximum number of clusters displayed on a page +Value range: 1 to 2147483646 + |
+
currentPage + |
+No + |
+Current page number + |
+
clusterState + |
+No + |
+You can query a cluster list by cluster status. +
|
+
tags + |
+No + |
+You can search for a cluster by its tag. If you specify multiple tags, the relationship between them is AND. +
|
+
None.
+Parameter + |
+Type + |
+Description + |
+
|---|---|---|
clusterTotal + |
+String + |
+Total number of clusters in a list + |
+
clusters + |
+Array + |
+Cluster parameters. For details, see Table 3. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
clusterId + |
+String + |
+Cluster ID. + |
+
clusterName + |
+String + |
+Cluster name. + |
+
masterNodeNum + |
+String + |
+Number of Master nodes deployed in a cluster. + |
+
coreNodeNum + |
+String + |
+Number of Core nodes deployed in a cluster. + |
+
totalNodeNum + |
+String + |
+Total number of nodes deployed in a cluster. + |
+
clusterState + |
+String + |
+Cluster status. Valid values include:
+
|
+
createAt + |
+String + |
+Cluster creation time, which is a 10-bit timestamp. + |
+
updateAt + |
+String + |
+Cluster update time, which is a 10-bit timestamp. + |
+
billingType + |
+String + |
+Cluster billing mode. + |
+
dataCenter + |
+String + |
+Cluster work region. + |
+
vpc + |
+String + |
+VPC name. + |
+
fee + |
+String + |
+Cluster creation fee, which is automatically calculated. + |
+
hadoopVersion + |
+String + |
+Hadoop version. + |
+
masterNodeSize + |
+String + |
+Instance specifications of a Master node. + |
+
coreNodeSize + |
+String + |
+Instance specifications of a Core node. + |
+
componentList + |
+Array + |
+Component list. For details, see Table 4. + |
+
externalIp + |
+String + |
+External IP address. + |
+
externalAlternateIp + |
+String + |
+Backup external IP address. + |
+
internalIp + |
+String + |
+Internal IP address. + |
+
deploymentId + |
+String + |
+Cluster deployment ID. + |
+
remark + |
+String + |
+Cluster remarks. + |
+
orderId + |
+String + |
+Cluster creation order ID. + |
+
azId + |
+String + |
+AZ ID. + |
+
masterNodeProductId + |
+String + |
+Product ID of a Master node. + |
+
masterNodeSpecId + |
+String + |
+Specification ID of a Master node. + |
+
coreNodeProductId + |
+String + |
+Product ID of a Core node. + |
+
coreNodeSpecId + |
+String + |
+Specification ID of a Core node. + |
+
azName + |
+String + |
+AZ name. + |
+
instanceId + |
+String + |
+Instance ID. + |
+
vnc + |
+String + |
+URI for remotely logging in to an ECS. + |
+
tenantId + |
+String + |
+Project ID. + |
+
volumeSize + |
+Integer + |
+Disk storage space. + |
+
volumeType + |
+String + |
+Disk type. + |
+
subnetId + |
+String + |
+Subnet ID. + |
+
clusterType + |
+String + |
+Cluster type. + |
+
subnetName + |
+String + |
+Subnet name. + |
+
securityGroupsId + |
+String + |
+Security group ID. + |
+
slaveSecurityGroupsId + |
+String + |
+Security group ID of a non-Master node. Currently, one MRS cluster uses only one security group. Therefore, this field has been discarded. + |
+
stageDesc + |
+String + |
+Cluster operation progress description. +The cluster installation progress includes:
+
The cluster scale-out progress includes:
+
The cluster scale-in progress includes:
+
If the cluster installation, scale-out, or scale-in fails, stageDesc will display the failure cause. For details, see Table 8. + |
+
mrsManagerFinish + |
+boolean + |
+Whether MRS Manager installation is finished during cluster creation. +
|
+
safeMode + |
+String + |
+Running mode of an MRS cluster. +
|
+
clusterVersion + |
+String + |
+Cluster version. + |
+
nodePublicCertName + |
+String + |
+Name of the key file. + |
+
masterNodeIp + |
+String + |
+IP address of a Master node. + |
+
privateIpFirst + |
+String + |
+Preferred private IP address. + |
+
errorInfo + |
+String + |
+Error message. + |
+
chargingStartTime + |
+String + |
+Start time of billing. + |
+
logCollection + |
+Integer + |
+Whether to collect logs when cluster installation fails. +
|
+
taskNodeGroups + |
+List<NodeGroup> + |
+List of Task nodes. For more parameter description, see Table 5. + |
+
nodeGroups + |
+List<NodeGroup> + |
+List of Master, Core and Task nodes. For more parameter description, see Table 5. + |
+
masterDataVolumeType + |
+String + |
+Data disk storage type of the Master node. Currently, SATA, SAS and SSD are supported. + |
+
masterDataVolumeSize + |
+Integer + |
+Data disk storage space of the Master node To increase data storage capacity, you can add disks at the same time when creating a cluster. +Value range: 100 GB to 32,000 GB + |
+
masterDataVolumeCount + |
+Integer + |
+Number of data disks of the Master node +The value can be set to 1 only. + |
+
coreDataVolumeType + |
+String + |
+Data disk storage type of the Core node. Currently, SATA, SAS and SSD are supported. + |
+
coreDataVolumeSize + |
+Integer + |
+Data disk storage space of the Core node. To increase data storage capacity, you can add disks at the same time when creating a cluster. +Value range: 100 GB to 32,000 GB + |
+
coreDataVolumeCount + |
+Integer + |
+Number of data disks of the Core node. +Value range: 1 to 10 + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
componentId + |
+String + |
+Component ID +
For example, the component_id of Hadoop is MRS 2.1.0_001, MRS 1.9.2_001, MRS 1.7.2_001, MRS 1.6.3_001. + |
+
componentName + |
+String + |
+Component name + + |
+
componentVersion + |
+String + |
+Component version + + |
+
componentDesc + |
+String + |
+Component description + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
groupName + |
+String + |
+Node group name + |
+
nodeNum + |
+Integer + |
+Number of nodes. The value ranges from 0 to 500. The minimum number of Master and Core nodes is 1 and the total number of Core and Task nodes cannot exceed 500. + |
+
nodeSize + |
+String + |
+Instance specifications of a node + |
+
nodeSpecId + |
+String + |
+Instance specification ID of a node + |
+
nodeProductId + |
+String + |
+Instance product ID of a node + |
+
vmProductId + |
+String + |
+VM product ID of a node + |
+
vmSpecCode + |
+String + |
+VM specifications of a node + |
+
rootVolumeSize + |
+Integer + |
+System disk size of a node. This parameter is not configurable + |
+
rootVolumeProductId + |
+String + |
+System disk product ID of a node + |
+
rootVolumeType + |
+String + |
+System disk type of a node + |
+
rootVolumeResourceSpecCode + |
+String + |
+System disk product specifications of a node + |
+
rootVolumeResourceType + |
+String + |
+System disk product type of a node + |
+
dataVolumeType + |
+String + |
+Data disk storage type of a node. Currently, SATA, SAS and SSD are supported. +
|
+
dataVolumeCount + |
+Integer + |
+Number of data disks of a node + |
+
dataVolumeSize + |
+String + |
+Data disk storage space of a node + |
+
dataVolumeProductId + |
+String + |
+Data disk product ID of a node + |
+
dataVolumeResourceSpecCode + |
+String + |
+Data disk product specifications of a node + |
+
dataVolumeResourceType + |
+String + |
+Data disk product type of a node + |
+
Table 6 describes the status code of this API.
+ +Status Code + |
+Description + |
+
|---|---|
200 + |
+The cluster list information has been successfully queried. + |
+
For the description about error status codes, see Status Codes.
+This API is used to query details about a specified cluster. This API is incompatible with Sahara.
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
cluster_id + |
+Yes + |
+Cluster ID + |
+
Request parameters
+None.
+Parameter + |
+Type + |
+Description + |
+
|---|---|---|
clusterId + |
+String + |
+Cluster ID + |
+
clusterName + |
+String + |
+Cluster name + |
+
masterNodeNum + |
+String + |
+Number of Master nodes deployed in a cluster + |
+
coreNodeNum + |
+String + |
+Number of Core nodes deployed in a cluster + |
+
totalNodeNum + |
+String + |
+Total number of nodes deployed in a cluster + |
+
clusterState + |
+String + |
+Cluster status. Valid values include:
+
|
+
createAt + |
+String + |
+Cluster creation time, which is a 10-bit timestamp + |
+
updateAt + |
+String + |
+Cluster update time, which is a 10-bit timestamp + |
+
billingType + |
+String + |
+Cluster billing mode + |
+
dataCenter + |
+String + |
+Cluster work region + |
+
vpc + |
+String + |
+VPC name + |
+
fee + |
+String + |
+Cluster creation fee, which is automatically calculated + |
+
hadoopVersion + |
+String + |
+Hadoop version + |
+
masterNodeSize + |
+String + |
+Instance specifications of a Master node + |
+
coreNodeSize + |
+String + |
+Instance specifications of a Core node + |
+
componentList + |
+Array + |
+Component list. For details, see Table 3. + |
+
externalIp + |
+String + |
+External IP address + |
+
externalAlternateIp + |
+String + |
+Backup external IP address + |
+
internalIp + |
+String + |
+Internal IP address + |
+
deploymentId + |
+String + |
+Cluster deployment ID + |
+
remark + |
+String + |
+Cluster remarks + |
+
orderId + |
+String + |
+Cluster creation order ID + |
+
azId + |
+String + |
+AZ ID + |
+
masterNodeProductId + |
+String + |
+Product ID of a Master node + |
+
masterNodeSpecId + |
+String + |
+Specification ID of a Master node + |
+
coreNodeProductId + |
+String + |
+Product ID of a Core node + |
+
coreNodeSpecId + |
+String + |
+Specification ID of a Core node + |
+
azName + |
+String + |
+AZ name + |
+
instanceId + |
+String + |
+Instance ID + |
+
vnc + |
+String + |
+URI for remotely logging in to an ECS + |
+
tenantId + |
+String + |
+Project ID + |
+
volumeSize + |
+Integer + |
+Disk storage space + |
+
subnetId + |
+String + |
+Subnet ID + |
+
subnetName + |
+String + |
+Subnet name + |
+
securityGroupsId + |
+String + |
+Security group ID + |
+
slaveSecurityGroupsId + |
+String + |
+Security group ID of a non-Master node. Currently, one MRS cluster uses only one security group. Therefore, this field has been discarded. This field returns the same value as securityGroupsId does for compatibility consideration. + |
+
bootstrap_scripts + |
+Array + |
+Bootstrap action script information. For more parameter description, see Table 5. +MRS 1.7.2 or later supports this parameter. + |
+
stageDesc + |
+String + |
+Cluster operation progress description. +The cluster installation progress includes:
+
The cluster scale-out progress includes:
+
The cluster scale-in progress includes:
+
If the cluster installation, scale-out, or scale-in fails, stageDesc will display the failure cause. For details, see Table 8. + |
+
mrsManagerFinish + |
+boolean + |
+Whether MRS Manager installation is finished during cluster creation. +
|
+
safeMode + |
+String + |
+Running mode of an MRS cluster +
|
+
clusterVersion + |
+String + |
+Cluster version + |
+
nodePublicCertName + |
+String + |
+Name of the public key file + |
+
masterNodeIp + |
+String + |
+IP address of a Master node + |
+
privateIpFirst + |
+String + |
+Preferred private IP address + |
+
errorInfo + |
+String + |
+Error message + |
+
tags + |
+Array + |
+Tag information + |
+
chargingStartTime + |
+String + |
+Start time of billing + |
+
clusterType + |
+String + |
+Cluster type + |
+
logCollection + |
+Integer + |
+Whether to collect logs when cluster installation fails +
|
+
taskNodeGroups + |
+List<NodeGroup> + |
+List of Task nodes. For more parameter description, see Table 4. + |
+
nodeGroups + |
+List<NodeGroup> + |
+List of Master, Core and Task nodes. For more parameter description, +see Table 4. + |
+
masterDataVolumeType + |
+String + |
+Data disk storage type of the Master node. Currently, SATA, SAS and SSD are supported. + |
+
masterDataVolumeSize + |
+Integer + |
+Data disk storage space of the Master node. To increase data storage capacity, you can add disks at the same time when creating a cluster. +Value range: 100 GB to 32,000 GB + |
+
masterDataVolumeCount + |
+Integer + |
+Number of data disks of the Master node. +The value can be set to 1 only. + |
+
coreDataVolumeType + |
+String + |
+Data disk storage type of the Core node. Currently, SATA, SAS and SSD are supported. + |
+
coreDataVolumeSize + |
+Integer + |
+Data disk storage space of the Core node. To increase data storage capacity, you can add disks at the same time when creating a cluster. +Value range: 100 GB to 32,000 GB + |
+
coreDataVolumeCount + |
+Integer + |
+Number of data disks of the Core node. +Value range: 1 to 10 + |
+
scale + |
+String + |
+Node change status. If this parameter is left blank, the cluster nodes are not changed. +Possible values are as follows: +
|
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
componentId + |
+String + |
+Component ID +
For example, the component_id of Hadoop is MRS 2.1.0_001, MRS 1.9.2_001, MRS 1.7.2_001, MRS 1.6.3_001. + |
+
componentName + |
+String + |
+Component name + + |
+
componentVersion + |
+String + |
+Component version + + |
+
componentDesc + |
+String + |
+Component description + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
groupName + |
+String + |
+Node group name + |
+
nodeNum + |
+Integer + |
+Number of nodes. The value ranges from 0 to 500. The minimum number of Master and Core nodes is 1 and the total number of Core and Task nodes cannot exceed 500. + |
+
nodeSize + |
+String + |
+Instance specifications of a node + |
+
nodeSpecId + |
+String + |
+Instance specification ID of a node + |
+
nodeProductId + |
+String + |
+Instance product ID of a node + |
+
vmProductId + |
+String + |
+VM product ID of a node + |
+
vmSpecCode + |
+String + |
+VM specifications of a node + |
+
rootVolumeSize + |
+Integer + |
+System disk size of a node. This parameter is not configurable and its default value is 40 GB. + |
+
rootVolumeProductId + |
+String + |
+System disk product ID of a node + |
+
rootVolumeType + |
+String + |
+System disk type of a node + |
+
rootVolumeResourceSpecCode + |
+String + |
+System disk product specifications of a node + |
+
rootVolumeResourceType + |
+String + |
+System disk product type of a node + |
+
dataVolumeType + |
+String + |
+Data disk storage type of a node. Currently, SATA, SAS and SSD are supported. +
|
+
dataVolumeCount + |
+Integer + |
+Number of data disks of a node + |
+
dataVolumeSize + |
+String + |
+Data disk storage space of a node + |
+
dataVolumeProductId + |
+String + |
+Data disk product ID of a node + |
+
dataVolumeResourceSpecCode + |
+String + |
+Data disk product specifications of a node + |
+
dataVolumeResourceType + |
+String + |
+Data disk product type of a node + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
name + |
+String + |
+Name of a bootstrap action script. It must be unique in a cluster. +The value can contain only digits, letters, spaces, hyphens (-), and underscores (_) and cannot start with a space. +The value can contain 1 to 64 characters. + |
+
uri + |
+String + |
+Path of the shell script. Set this parameter to an OBS bucket path or a local VM path. +
|
+
parameters + |
+String + |
+Bootstrap action script parameters + |
+
nodes + |
+Array String + |
+Type of a node where the bootstrap action script is executed. The value can be Master, Core, or Task. + |
+
active_master + |
+Boolean + |
+Whether the bootstrap action script runs only on active Master nodes. +The default value is false, indicating that the bootstrap action script can run on all Master nodes. + |
+
before_component_start + |
+Boolean + |
+Time when the bootstrap action script is executed. Currently, the following two options are available: Before component start and After component start +The default value is false, indicating that the bootstrap action script is executed after the component is started. + |
+
fail_action + |
+String + |
+Whether to continue executing subsequent scripts and creating a cluster after the bootstrap action script fails to be executed. +
The default value is errorout, indicating that the action is stopped.
+ NOTE:
+You are advised to set this parameter to continue in the commissioning phase so that the cluster can continue to be installed and started no matter whether the bootstrap action is successful. + |
+
start_time + |
+String + |
+Execution time of one boot operation script. + |
+
state + |
+String + |
+Running state of one bootstrap action script +
|
+
Table 6 describes the status code of this API.
+ +Status Code + |
+Description + |
+
|---|---|
200 + |
+Cluster details have been queried successfully. + |
+
For the description about error status codes, see Status Codes.
+This API is used to delete a cluster after data processing and analysis are completed or the cluster is abnormal. This API is compatible with Sahara.
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
cluster_id + |
+Yes + |
+Cluster ID + |
+
Request parameters
+None.
+Response parameters
+None.
+Table 2 describes the status code of this API.
+ +Status Code + |
+Description + |
+
|---|---|
204 + |
+The cluster has been successfully terminated. + |
+
For the description about error status codes, see Status Codes.
+This API is used to create a job binary object. This API is compatible with Sahara.
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
name + |
+Yes + |
+String + |
+Binary object name +Contains 1 to 80 characters and consists of letters, digits, hyphens (-), and underscores (_) only. + |
+
url + |
+Yes + |
+String + |
+Binary object URL, which contains of 1 to 255 characters. +The URL must start with s3a:// or /. + |
+
is_protected + |
+No + |
+Bool + |
+Whether a binary object is protected +
The current version does not support this function. + |
+
is_public + |
+No + |
+Bool + |
+Whether a binary object is public +
The current version does not support this function. + |
+
description + |
+Yes + |
+String + |
+Binary object description +Contains a maximum of 65535 characters. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
description + |
+String + |
+Binary object description + |
+
url + |
+String + |
+Binary object URL + |
+
tenant_id + |
+String + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
created_at + |
+String + |
+Binary object creation time + |
+
updated_at + |
+String + |
+Binary object update time + |
+
is_protected + |
+Bool + |
+Whether a binary object is protected +
The current version does not support this function. + |
+
is_public + |
+Bool + |
+Whether a binary object is public +
The current version does not support this function. + |
+
id + |
+String + |
+Binary object ID + |
+
name + |
+String + |
+Binary object name + |
+
{
+ "name": "my-job-binary",
+ "url": "/simple/mapreduce/program",
+ "is_protected": false,
+ "is_public": false,
+ "description": "this is the job binary template"
+}
+{
+ "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
+ }
+}
+Table 4 describes the status code of this API.
+ +Status Code + |
+Description + |
+
|---|---|
202 + |
+The job binary object has been successfully created. + |
+
For the description about error status codes, see Status Codes.
+This API is used to update a job binary object. This API is compatible with Sahara.
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
job_binary_id + |
+Yes + |
+Binary object ID + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
name + |
+No + |
+String + |
+Binary object name +Contains 1 to 80 characters and consists of letters, digits, hyphens (-), and underscores (_) only. + |
+
url + |
+No + |
+String + |
+Binary object URL, which contains of 1 to 255 characters. +The URL must start with s3a:// or /. + |
+
is_protected + |
+No + |
+Bool + |
+Whether a binary object is protected +
The current version does not support this function. + |
+
is_public + |
+No + |
+Bool + |
+Whether a binary object is public +
The current version does not support this function. + |
+
description + |
+Yes + |
+String + |
+Binary object description +Contains a maximum of 65535 characters. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
description + |
+String + |
+Binary object description + |
+
url + |
+String + |
+Binary object URL + |
+
tenant_id + |
+String + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
created_at + |
+String + |
+Binary object creation time + |
+
updated_at + |
+String + |
+Binary object update time + |
+
is_protected + |
+Bool + |
+Whether a binary object is protected +
The current version does not support this function. + |
+
is_public + |
+Bool + |
+Whether a binary object is public +
The current version does not support this function. + |
+
id + |
+String + |
+Binary object ID + |
+
name + |
+String + |
+Binary object name + |
+
{
+ "name": "my-job-binary-update",
+ "url": "/simple/mapreduce/program",
+ "is_protected": false,
+ "is_public": false,
+ "description": "this is the job binary template"
+}
+{
+ "job_binary": {
+ "name": "my-job-binary-update",
+ "url": "/simple/mapreduce/program",
+ "description": "this is the job binary template",
+ "created_at": "2017-06-22T09:04:53",
+ "updated_at": "2017-06-22T09:06:50",
+ "id": "da37b581-042f-4d7a-9378-f628f32bd9ae",
+ "tenant_id": "5a3314075bfa49b9ae360f4ecd333695",
+ "is_public": false,
+ "is_protected": false
+ }
+}
+Table 4 describes the status code of this API.
+ +Status Code + |
+Description + |
+
|---|---|
202 + |
+The binary object has been updated successfully. + |
+
For the description about error status codes, see Status Codes.
+This API is used to query the binary object list. This API is compatible with Sahara.
+Parameter + |
+Mandatory + |
+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 binary object ID +Query the job binary object list, and select one job binary 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 +A hyphen (-) before the sort field indicates to sort in descending order. Example: +
|
+
Request parameters
+None.
+Parameter + |
+Type + |
+Description + |
+
|---|---|---|
markers + |
+Object + |
+Markers object +For details, see Table 3. + |
+
binaries + |
+Array + |
+Binary object list +For details, see Table 4. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
prev + |
+String + |
+Marker on the previous page + |
+
next + |
+String + |
+Marker on the next page + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
name + |
+String + |
+Binary object name + |
+
url + |
+String + |
+Binary object URL + |
+
description + |
+String + |
+Binary object description + |
+
created_at + |
+String + |
+Binary object creation time + |
+
updated_at + |
+String + |
+Binary object update time + |
+
id + |
+String + |
+Binary object ID + |
+
tenant_id + |
+String + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
is_public + |
+Bool + |
+Whether a binary object is public +
The current version does not support this function. + |
+
is_protected + |
+Bool + |
+Whether a binary object is protected +
The current version does not support this function. + |
+
GET /v1.1/{project_id}/job-binaries?limit=1&sort_by=name&marker= eadfb8ec-760b-499f-b8df-00a6def854f8
+{
+ "markers": {
+ "prev": "ddf13f9d-93e8-4999-b860-0dc0c01c517d",
+ "next": null
+ },
+ "binaries": [
+ {
+ "name": "my-job-binary-update",
+ "url": "/simple/mapreduce/program",
+ "description": "this is the job binary template",
+ "created_at": "2017-06-22T09:04:53",
+ "updated_at": "2017-06-22T09:06:50",
+ "id": "da37b581-042f-4d7a-9378-f628f32bd9ae",
+ "tenant_id": "5a3314075bfa49b9ae360f4ecd333695",
+ "is_public": false,
+ "is_protected": false
+ }
+ ]
+}
+Table 5 describes the status code of this API.
+ +Status Code + |
+Description + |
+
|---|---|
200 + |
+The binary object list is queried successfully. + |
+
For the description about error status codes, see Status Codes.
+This API is used to query detailed information about a binary object. This API is compatible with Sahara.
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
job_binary_id + |
+Yes + |
+Binary object ID + |
+
Request parameters
+None
+Parameter + |
+Type + |
+Description + |
+
|---|---|---|
is_public + |
+Bool + |
+Whether a binary object is public +
The current version does not support this function. + |
+
description + |
+String + |
+Binary object description + |
+
url + |
+String + |
+Binary object URL + |
+
tenant_id + |
+String + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
created_at + |
+String + |
+Binary object creation time + |
+
updated_at + |
+String + |
+Binary object update time + |
+
id + |
+String + |
+Binary object ID + |
+
name + |
+String + |
+Binary object name + |
+
is_protected + |
+Bool + |
+Whether a binary object is protected +
The current version does not support this function. + |
+
{
+ "job_binary": {
+ "name": "my-job-binary-update",
+ "url": "/simple/mapreduce/program",
+ "description": "this is the job binary template",
+ "created_at": "2017-06-22T09:04:53",
+ "updated_at": "2017-06-22T09:06:50",
+ "id": "da37b581-042f-4d7a-9378-f628f32bd9ae",
+ "tenant_id": "5a3314075bfa49b9ae360f4ecd333695",
+ "is_public": false,
+ "is_protected": false
+ }
+}
+Table 3 describes the status code of this API.
+ +Status code + |
+Description + |
+
|---|---|
200 + |
+The binary object details are queried successfully. + |
+
For the description about error status codes, see Status Codes.
+This API is used to delete a binary object. This API is compatible with Sahara.
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
job_binary_id + |
+Yes + |
+Job binary object ID + |
+
Request parameters
+None
+Response parameters
+None
+Table 2 describes the status code of this API.
+ +Status code + |
+Description + |
+
|---|---|
204 + |
+The binary object is deleted successfully. + |
+
For the description about error status codes, see Status Codes.
+This API is used to add a job to an MRS cluster and execute the job. This API is incompatible with Sahara.
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
job_type + |
+Yes + |
+Integer + |
+Job type code +
|
+
job_name + |
+Yes + |
+String + |
+Job name +Contains only 1 to 64 letters, digits, hyphens (-), and underscores (_). + NOTE:
+Identical job names are allowed but not recommended. + |
+
cluster_id + |
+Yes + |
+String + |
+Cluster ID + |
+
jar_path + |
+Yes + |
+String + |
+Path of the JAR or SQL file for program execution +The parameter must meet the following requirements: +
|
+
arguments + |
+No + |
+String + |
+Key parameter for program execution. The parameter is specified by the function of the user's program. MRS is only responsible for loading the parameter. +The parameter contains a maximum of 2,047 characters, excluding special characters such as ;|&>'<$, and can be left blank. + NOTE:
+When entering a parameter containing sensitive information (for example, login password), you can add an at sign (@) before the parameter name to encrypt the parameter value. This prevents the sensitive information from being persisted in plaintext. Therefore, when you view job information on the MRS, sensitive information will be displayed as asterisks (*). +For example, username=admin @password=admin_123. + |
+
input + |
+No + |
+String + |
+Path for inputting data, which must start with / or s3a://. Set this parameter to a correct OBS path. The OBS path does not support files or programs encrypted by KMS. +The parameter contains a maximum of 1,023 characters, excluding special characters such as ;|&>'<$, and can be left blank. + |
+
output + |
+No + |
+String + |
+Path for outputting data, which must start with / or s3a://. A correct OBS path is required. If the path does not exist, the system automatically creates it. +The parameter contains a maximum of 1,023 characters, excluding special characters such as ;|&>'<$, and can be left blank. + |
+
job_log + |
+No + |
+String + |
+Path for storing job logs that record job running status. The path must start with / or s3a://. A correct OBS path is required. +The parameter contains a maximum of 1,023 characters, excluding special characters such as ;|&>'<$, and can be left blank. + |
+
hive_script_path + |
+Yes + |
+String + |
+SQL program path +This parameter is needed by Spark Script and Hive Script jobs only, and must meet the following requirements: +
|
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
job_name + |
+Yes + |
+String + |
+Job name +Contains only 1 to 64 letters, digits, hyphens (-), and underscores (_). + NOTE:
+Identical job names are allowed but not recommended. + |
+
input + |
+No + |
+String + |
+Data source path +
|
+
output + |
+No + |
+String + |
+Data receiving path +
|
+
file_action + |
+Yes + |
+String + |
+Types of file operations, including: +
|
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
hql + |
+Yes + |
+String + |
+Spark SQL statement, which needs Base64 encoding and decoding. ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/ is a standard encoding table. MRS uses ABCDEFGHILKJMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/ for Base64 encoding. The value of the hql parameter is generated by adding any letter to the beginning of the encoded character string. The Spark SQL statement is generated by decoding the value in the background. +Example: +
|
+
job_name + |
+Yes + |
+String + |
+Job name. It contains 1 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. + NOTE:
+Identical job names are allowed but not recommended. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
job_execution + |
+Object + |
+For details, see Table 6. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
templated + |
+Bool + |
+Whether job execution objects are generated by job templates. + |
+
created_at + |
+Integer + |
+Creation time, which is a 10-bit timestamp. + |
+
updated_at + |
+Integer + |
+Update time, which is a 10-bit timestamp. + |
+
id + |
+String + |
+Job ID + |
+
tenant_id + |
+String + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
job_id + |
+String + |
+Job application ID + |
+
job_name + |
+String + |
+Job name + |
+
input_id + |
+String + |
+Data input ID + |
+
output_id + |
+String + |
+Data output ID + |
+
start_time + |
+Integer + |
+Start time of job execution, which is a 10-bit timestamp. + |
+
end_time + |
+Integer + |
+End time of job execution, which is a 10-bit timestamp. + |
+
cluster_id + |
+String + |
+Cluster ID + |
+
engine_job_id + |
+String + |
+Workflow ID of Oozie + |
+
return_code + |
+Integer + |
+Returned code for an execution result + |
+
is_public + |
+Bool + |
+Whether a job is public +
The current version does not support this function. + |
+
is_protected + |
+Bool + |
+Whether a job is protected +
The current version does not support this function. + |
+
group_id + |
+String + |
+Group ID of a job + |
+
jar_path + |
+String + |
+Path of the .jar file for program execution + |
+
input + |
+String + |
+Address for inputting data + |
+
output + |
+String + |
+Address for outputting data + |
+
job_log + |
+String + |
+Address for storing job logs + |
+
job_type + |
+Integer + |
+Job type code +
|
+
file_action + |
+String + |
+Data import and export + |
+
arguments + |
+String + |
+Key parameter for program execution. The parameter is specified by the function of the user's internal program. MRS is only responsible for loading the parameter. This parameter can be empty. + |
+
job_state + |
+Integer + |
+Job status code +
|
+
job_final_status + |
+Integer + |
+Final job status +
|
+
hive_script_path + |
+String + |
+Address of the Hive script + |
+
create_by + |
+String + |
+User ID for creating jobs +This parameter is not used in the current version, but is retained for compatibility with earlier versions. + |
+
finished_step + |
+Integer + |
+Number of completed steps +This parameter is not used in the current version, but is retained for compatibility with earlier versions. + |
+
job_main_id + |
+String + |
+Main ID of a job +This parameter is not used in the current version, but is retained for compatibility with earlier versions. + |
+
job_step_id + |
+String + |
+Step ID of a job +This parameter is not used in the current version, but is retained for compatibility with earlier versions. + |
+
postpone_at + |
+Integer + |
+Delay time, which is a 10-bit timestamp. +This parameter is not used in the current version, but is retained for compatibility with earlier versions. + |
+
step_name + |
+String + |
+Step name of a job +This parameter is not used in the current version, but is retained for compatibility with earlier versions. + |
+
step_num + |
+Integer + |
+Number of steps +This parameter is not used in the current version, but is retained for compatibility with earlier versions. + |
+
task_num + |
+Integer + |
+Number of tasks +This parameter is not used in the current version, but is retained for compatibility with earlier versions. + |
+
update_by + |
+String + |
+User ID for updating jobs + |
+
credentials + |
+String + |
+Token +The current version does not support this function. + |
+
user_id + |
+String + |
+User ID for creating jobs +This parameter is not used in the current version, but is retained for compatibility with earlier versions. + |
+
job_configs + |
+String + |
+Key-value pair set for saving job running configurations + |
+
extra + |
+String + |
+Authentication information +The current version does not support this function. + |
+
data_source_urls + |
+String + |
+Data source URL + |
+
info + |
+String + |
+Key-value pair set, containing job running information returned by Oozie + |
+
The following is an example of an MapReduce job request:
+{
+ "job_type": 1,
+ "job_name": "mrs_test_jobone_20170602_141106",
+ "cluster_id": "e955a7a3-d334-4943-a39a-994976900d56",
+ "jar_path": "s3a://mrs-opsadm/jarpath/hadoop-mapreduce-examples-2.7.2.jar",
+ "arguments": "wordcount",
+ "input": "s3a://mrs-opsadm/input/",
+ "output": "s3a://mrs-opsadm/output/",
+ "job_log": "s3a://mrs-opsadm/log/",
+ "file_action": "",
+ "hql": "",
+ "hive_script_path": ""
+}
+The request example of Spark job:
+{
+ "job_type": 2,
+ "job_name": "mrs_test_sparkjob_20170602_141106",
+ "cluster_id": "e955a7a3-d334-4943-a39a-994976900d56",
+ "jar_path": "s3a://mrs-opsadm/jarpath/spark-test.jar",
+ "arguments": "org.apache.spark.examples.SparkPi 10",
+ "input": "",
+ "output": "s3a://mrs-opsadm/output/",
+ "job_log": "s3a://mrs-opsadm/log/",
+ "file_action": "",
+ "hql": "",
+ "hive_script_path": ""
+}
+The request example of Hive Script job:
+{
+ "job_type": 3,
+ "job_name": "mrs_test_SparkScriptJob_20170602_141106",
+ "cluster_id": "e955a7a3-d334-4943-a39a-994976900d56",
+ "jar_path": "s3a://mrs-opsadm/jarpath/Hivescript.sql",
+ "arguments": "",
+ "input": "s3a://mrs-opsadm/input/",
+ "output": "s3a://mrs-opsadm/output/",
+ "job_log": "s3a://mrs-opsadm/log/",
+ "file_action": "",
+ "hql": "",
+ "hive_script_path": "s3a://mrs-opsadm/jarpath/Hivescript.sql"
+}
+The request example of DistCp job for import:
+{
+ "job_type": 5,
+ "job_name": "mrs_test_importjob_20170602_141106",
+ "cluster_id": "e955a7a3-d334-4943-a39a-994976900d56",
+ "input": "s3a://mrs-opsadm/jarpath/hadoop-mapreduce-examples-2.7.2.jar",
+ "output": "/user",
+ "file_action": "import"
+}
+The request example of DistCp job for export:
+{
+ "job_type": 5,
+ "job_name": "mrs_test_exportjob_20170602_141106",
+ "cluster_id": "e955a7a3-d334-4943-a39a-994976900d56",
+ "input": "/user/hadoop-mapreduce-examples-2.7.2.jar",
+ "output": "s3a://mrs-opsadm/jarpath/",
+ "file_action": "export"
+}
+The request example of Spark Script job:
+{
+ "job_type": 6,
+ "job_name": "mrs_test_sparkscriptjob_20170602_141106",
+ "cluster_id": "e955a7a3-d334-4943-a39a-994976900d56",
+ "jar_path": "s3a://mrs-opsadm/jarpath/sparkscript.sql",
+ "arguments": "",
+ "input": "s3a://mrs-opsadm/input/",
+ "output": "s3a://mrs-opsadm/output/",
+ "job_log": "s3a://mrs-opsadm/log/",
+ "file_action": "",
+ "hql": "",
+ "hive_script_path": "s3a://mrs-opsadm/jarpath/sparkscript.sql"
+}
+{
+ "job_execution": {
+ "templated": false,
+ "created_at": 1496387588,
+ "updated_at": 1496387588,
+ "id": "12ee9ae4-6ee1-48c6-bb84-fb0b4f76cf03",
+ "tenant_id": "c71ad83a66c5470496c2ed6e982621cc",
+ "job_id": "",
+ "job_name": "mrs_test_jobone_20170602_141106",
+ "input_id": null,
+ "output_id": null,
+ "start_time": 1496387588,
+ "end_time": null,
+ "cluster_id": "e955a7a3-d334-4943-a39a-994976900d56",
+ "engine_job_id": null,
+ "return_code": null,
+ "is_public": null,
+ "is_protected": false,
+ "group_id": "12ee9ae4-6ee1-48c6-bb84-fb0b4f76cf03",
+ "jar_path": "s3a://mrs-opsadm/jarpath/hadoop-mapreduce-examples-2.7.2.jar",
+ "input": "s3a://mrs-opsadm/input/",
+ "output": "s3a://mrs-opsadm/output/",
+ "job_log": "s3a://mrs-opsadm/log/",
+ "job_type": 1,
+ "file_action": "",
+ "arguments": "wordcount",
+ "hql": "",
+ "job_state": 2,
+ "job_final_status": 0,
+ "hive_script_path": "",
+ "create_by": "b67132be2f054a45b247365647e05af0",
+ "finished_step": 0,
+ "job_main_id": "",
+ "job_step_id": "",
+ "postpone_at": 1496387588,
+ "step_name": "",
+ "step_num": 0,
+ "task_num": 0,
+ "update_by": "b67132be2f054a45b247365647e05af0",
+ "credentials": "",
+ "user_id": "b67132be2f054a45b247365647e05af0",
+ "job_configs": null,
+ "extra": null,
+ "data_source_urls": null,
+ "info": null
+ }
+}
+Table 7 describes the status code of this API.
+ +Status Code + |
+Description + |
+
|---|---|
200 + |
+The job has been successfully added. + |
+
For the description about error status codes, see Status Codes.
+This API is used to create a job object. This API is compatible with Sahara.
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
name + |
+Yes + |
+String + |
+Job object name +Contains 1 to 64 characters and consists of letters, digits, hyphens (-), and underscores (_) only. + |
+
mains + |
+No + |
+Array + |
+Executable program set of a job object +If the job type is Hive or Spark Script, the value of mains must not be empty. +For details on how to obtain the executable program, see Creating a Job Binary Object. + |
+
libs + |
+No + |
+Array + |
+Dependency package set of a job object +If the job type is MapReduce or Spark, the value of libs must not be empty. +For details on how to obtain the dependency package, see Creating a Job Binary Object. + |
+
is_protected + |
+No + |
+Bool + |
+Whether a job object is protected +
The current version does not support this function. + |
+
interface + |
+No + |
+Array + |
+User-defined interface set +The current version does not support this function. + |
+
is_public + |
+No + |
+Bool + |
+Whether a job object is public +
The current version does not support this function. + |
+
type + |
+Yes + |
+String + |
+Job object type +
|
+
description + |
+No + |
+String + |
+Job object description +Contains a maximum of 65535 characters. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
description + |
+String + |
+Job object description + |
+
tenant_id + |
+String + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
created_at + |
+String + |
+Job object creation time + |
+
updated_at + |
+String + |
+Job object update time + |
+
mains + |
+Array + |
+Executable program set of a job object + |
+
libs + |
+Array + |
+Dependency package set of a job object + |
+
is_protected + |
+Bool + |
+Whether a job object is protected +
The current version does not support this function. + |
+
interface + |
+Array + |
+User-defined interface set + |
+
is_public + |
+Bool + |
+Whether a job object is public +
The current version does not support this function. + |
+
type + |
+String + |
+Job object type + |
+
id + |
+String + |
+Job object ID + |
+
name + |
+String + |
+Job object name + |
+
The request example of MapReduce job:
+{
+ "name": "my-mapreduce-job",
+ "mains": [ ],
+ "libs": [
+ "092b628b-26a3-4571-9ba4-f8d000df8877"
+ ],
+ "is_protected": false,
+ "interface": [ ],
+ "is_public": false,
+ "type": "MapReduce",
+ "description": "This is the Map Reduce job template"
+}
+
+The request example of Spark job:
+{
+ "name": "my-spark-job",
+ "type": "Spark",
+ "description": "This is the Spark job template",
+ "mains": [ ],
+ "libs": [
+ "ed2ffd92-6308-44cb-b930-e10b6d65d3aa"
+ ],
+ "is_public": false,
+ "is_protected": false,
+ "interface": [ ]
+}
+
+The request example of DistCp job:
+{
+ "name": "my-distcp-job",
+ "type": "DistCp",
+ "description": "This is the DistCp job template",
+ "mains": [ ],
+ "libs": [ ],
+ "is_public": false,
+ "is_protected": false,
+ "interface": [ ]
+}
+
+The request example of Hive job:
+{
+ "name": "my-hive-job",
+ "type": "Hive",
+ "description": "This is the Hive job template",
+"mains": [
+ "0d58a7e1-3ea7-413e-9a94-7702f99a9fa2"
+],
+ "libs": [ ],
+ "is_public": false,
+ "is_protected": false,
+ "interface": [ ]
+}
+
+The request example of SparkScript job:
+{
+ "name": "my-sparkscript-job",
+ "type": "SparkScript",
+ "description": "This is the SparkScript job template",
+ "mains": [
+ "89e6a8bc-dde1-4053-97c1-72504f630dbf"
+ ],
+ "libs": [ ],
+ "is_public": false,
+ "is_protected": false,
+ "interface": [ ]
+}
+{
+ "job": {
+ "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": false,
+ "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": []
+ }
+}
+Table 4 describes the status code of this API.
+ +Status code + |
+Description + |
+
|---|---|
202 + |
+The job object has been successfully created. + |
+
For the description about error status codes, see Status Codes.
+This API is used to update a job object. This API is compatible with Sahara.
+Parameter + |
+Mandatory + |
+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 + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
name + |
+No + |
+String + |
+Job object name +Contains 1 to 64 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. + |
+
is_protected + |
+No + |
+Bool + |
+Whether a job object is protected +
The current version does not support this function. + |
+
interface + |
+No + |
+Array + |
+User-defined interface set +The current version does not support this function. + |
+
is_public + |
+No + |
+Bool + |
+Whether a job object is public +
The current version does not support this function. + |
+
type + |
+No + |
+String + |
+Job object type +
|
+
description + |
+No + |
+String + |
+Job object description +Contains a maximum of 65535 characters. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
description + |
+String + |
+Job object description + |
+
tenant_id + |
+String + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
created_at + |
+String + |
+Job object creation time + |
+
updated_at + |
+String + |
+Job object update time + |
+
mains + |
+Array + |
+Executable program set of a job object + |
+
libs + |
+Array + |
+Dependency package set of a job object + |
+
is_protected + |
+Bool + |
+Whether a job object is protected +
The current version does not support this function. + |
+
interface + |
+Array + |
+User-defined interface set + |
+
is_public + |
+Bool + |
+Whether a job object is public +
The current version does not support this function. + |
+
type + |
+String + |
+Job object type + |
+
id + |
+String + |
+Job object ID + |
+
name + |
+String + |
+Job object name + |
+
{
+ "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"
+}
+{
+ "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": false,
+ "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": []
+ }
+}
+Table 4 describes the status code of this API.
+ +Status code + |
+Description + |
+
|---|---|
202 + |
+The job object has been successfully updated. + |
+
For the description about error status codes, see Status Codes.
+This API is used to execute a created job object. This API is compatible with Sahara.
+Parameter + |
+Mandatory + |
+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 + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
cluster_id + |
+Yes + |
+String + |
+Cluster ID + |
+
input_id + |
+Yes + |
+String + |
+Input data source ID of a job object +For details on how to obtain the input data source ID, see Creating a Data Source. + |
+
output_id + |
+Yes + |
+String + |
+Output data source ID of a job object +For details on how to obtain the output data source ID, see Creating a Data Source. + |
+
is_protected + |
+No + |
+Bool + |
+Whether a job object is protected +
The current version does not support this function. + |
+
is_public + |
+No + |
+Bool + |
+Whether a job object is public +
The current version does not support this function. + |
+
job_configs + |
+Yes + |
+Object + |
+Key-value pair set for saving job running configurations +If the job type is MapReduce or Spark, set the first parameter of args to be the same as the arguments parameter in Adding a Job and Executing the Job. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
output_id + |
+String + |
+Output data source ID of a job object + |
+
info + |
+Object + |
+Job object status information + |
+
job_id + |
+String + |
+Job object ID + |
+
tenant_id + |
+String + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
created_at + |
+String + |
+Job object creation time + |
+
updated_at + |
+String + |
+Job object update time + |
+
return_code + |
+String + |
+Response code after job execution + |
+
oozie_job_id + |
+String + |
+Workflow ID returned by Oozie + |
+
is_protected + |
+Bool + |
+Whether a job object is protected +
The current version does not support this function. + |
+
input_id + |
+String + |
+Input data source ID of a job object + |
+
cluster_id + |
+String + |
+Cluster ID + |
+
is_public + |
+Bool + |
+Whether a job object is public +
The current version does not support this function. + |
+
job_configs + |
+Object + |
+Key-value pair set for saving job running configurations + |
+
id + |
+String + |
+Job object ID + |
+
The request example of MapReduce job:
+{
+ "cluster_id": "811e1134-666f-4c48-bc92-afb5b10c9d8c",
+ "input_id": "3e1bc8e6-8c69-4749-8e52-90d9341d15bc",
+ "output_id": "52146b52-6540-4aac-a024-fee253cf52a9",
+ "is_protected": false,
+ "is_public": false,
+ "job_configs": {
+ "configs": {
+ "mapred.map.tasks": "1",
+ "mapred.reduce.tasks": "1"
+ },
+ "args": [
+ "wordcount",
+ "arg2"
+ ],
+ "params": {
+ "param2": "value2",
+ "param1": "value1"
+ }
+ }
+}
+
+The request example of Spark job:
+{
+ "cluster_id": "8f3a547d-d53a-44ba-9aad-ded0b0b26e9c",
+ "input_id": "3e1bc8e6-8c69-4749-8e52-90d9341d15bc",
+ "output_id": "8bb0259f-309a-49f4-843b-0be86ac1623a",
+ "job_configs": {
+ "configs": { },
+ "args": [
+ "org.apache.spark.examples.SparkPi 10",
+ "arg2"
+ ],
+ "params": {
+ "param2": "value2",
+ "param1": "value1"
+ }
+ }
+}
+
+The request example of DistCp job:
+{
+ "cluster_id": "811e1134-666f-4c48-bc92-afb5b10c9d8c",
+ "input_id": "3e1bc8e6-8c69-4749-8e52-90d9341d15bc",
+ "output_id": "52146b52-6540-4aac-a024-fee253cf52a9",
+ "is_protected": false,
+ "is_public": false,
+ "job_configs": {
+ "configs": { },
+ "args": [
+ "arg1",
+ "arg2"
+ ],
+ "params": {
+ "param2": "value2",
+ "param1": "value1"
+ }
+ }
+}
+
+The request example of Hive job:
+{
+ "cluster_id": "8f3a547d-d53a-44ba-9aad-ded0b0b26e9c",
+ "input_id": "3e1bc8e6-8c69-4749-8e52-90d9341d15bc",
+ "output_id": "8bb0259f-309a-49f4-843b-0be86ac1623a",
+ "is_protected": false,
+ "is_public": false,
+ "job_configs": {
+ "configs": { },
+ "args": [
+ "arg1",
+ "arg2"
+ ],
+ "params": {
+ "param2": "value2",
+ "param1": "value1"
+ }
+ }
+}
+
+The request example of SparkScript job:
+{
+ "cluster_id": "811e1134-666f-4c48-bc92-afb5b10c9d8c",
+ "input_id": "3e1bc8e6-8c69-4749-8e52-90d9341d15bc",
+ "output_id": "52146b52-6540-4aac-a024-fee253cf52a9",
+ "is_protected": false,
+ "is_public": false,
+ "job_configs": {
+ "configs": { },
+ "args": [
+ "arg1",
+ "arg2"
+ ],
+ "params": {
+ "param2": "value2",
+ "param1": "value1"
+ }
+ }
+}
+{
+ "job_execution":{
+ "created_at":"2017-02-20T09:11:32",
+ "updated_at":"2017-02-20T09:11:32",
+ "id":"4a56525d-34db-43e3-99c9-af67491025cd",
+ "tenant_id":"3f99e3319a8943ceb15c584f3325d064",
+ "job_id":"2c12ff33-da22-47b1-b51f-2828c16bbad8",
+ "start_time":"2017-02-20T09:11:32",
+ "end_time":null,
+ "cluster_id":"c1000b4f-f2a1-49e1-af3c-2e19fc1eb72d",
+ "oozie_job_id":null,
+ "return_code":null,
+ "input_id":"ce8c2b04-f46c-4580-8b58-5b6aaf4a44a9",
+ "output_id":"9d59ce5b-d0f4-46d4-8738-6e50c2a5c68a",
+ "is_protected":null,
+ "is_public":null,
+ "job_configs":{
+ "configs":{
+ "mapred.map.tasks":"1",
+ "mapred.reduce.tasks":"1"
+ },
+ "args":[
+ "wordcount ",
+ "arg2"
+ ],
+ "params":{
+ "param2":"value2",
+ "param1":"value1"
+ }
+ },
+ "data_source_urls":null,
+ "info":null
+ }
+}
+Table 4 describes the status code of this API.
+ +Status code + |
+Description + |
+
|---|---|
202 + |
+The job object has been executed successfully. + |
+
For the description about error status codes, see Status Codes.
+This API is used to query the job object list. This API is compatible with Sahara.
+Parameter + |
+Mandatory + |
+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 + |
+The ID is the ID of the last element in the list that will not be returned. + |
+
sort_by + |
+No + |
+Sort field. A hyphen (-) before the sort field indicates to sort in descending order. Examples: +
|
+
Request parameters
+None
+Parameter + |
+Type + |
+Description + |
+
|---|---|---|
markers + |
+Object + |
+Markers object +For details, see Table 3. + |
+
jobs + |
+Array + |
+Job object list +For details, see Table 4. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
prev + |
+String + |
+Marker on the previous page + |
+
next + |
+String + |
+Marker on the next page + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
description + |
+String + |
+Job object description + |
+
tenant_id + |
+String + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
created_at + |
+String + |
+Job object creation time + |
+
mains + |
+Array + |
+Executable program set of a job object + |
+
updated_at + |
+String + |
+Job object update time + |
+
libs + |
+Array + |
+Dependency package set of a job object + |
+
is_protected + |
+Bool + |
+Whether a job object is protected +
The current version does not support this function. + |
+
interface + |
+Array + |
+User-defined interface set + |
+
is_public + |
+Bool + |
+Whether a job object is public +
The current version does not support this function. + |
+
type + |
+String + |
+Job object type + |
+
id + |
+String + |
+Job object ID + |
+
name + |
+String + |
+Job object name + |
+
GET /v1.1/{project_id}/jobs?limit=2&sort_by=name&marker=4f59aa66-bf38-402c-9b6f-320e77219b9b
+{
+ "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": false,
+ "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": false,
+ "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": []
+ }
+ ]
+}
+Table 5 describes the status code of this API.
+ +Status code + |
+Description + |
+
|---|---|
200 + |
+The job object list is queried successfully. + |
+
For the description about error status codes, see Status Codes.
+This API is used to query detailed information about a job object. This API is compatible with Sahara.
+Parameter + |
+Mandatory + |
+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 parameters
+None
+Parameter + |
+Type + |
+Description + |
+
|---|---|---|
tenant_id + |
+String + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
created_at + |
+String + |
+Job object creation time + |
+
id + |
+String + |
+Job object ID + |
+
name + |
+String + |
+Job object name + |
+
updated_at + |
+String + |
+Job object update time + |
+
description + |
+String + |
+Job object description + |
+
interface + |
+Array + |
+User-defined interface set + |
+
libs + |
+Array + |
+Dependency package set of a job object + |
+
type + |
+String + |
+Job object type + |
+
mains + |
+Array + |
+Executable program set of a job object + |
+
is_protected + |
+Bool + |
+Whether a job object is protected +
The current version does not support this function. + |
+
{
+ "job": {
+ "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": false,
+ "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": []
+ }
+}
+Table 3 describes the status code of this API.
+ +Status code + |
+Description + |
+
|---|---|
200 + |
+The job object details are queried successfully. + |
+
For the description about error status codes, see Status Codes.
+This API is used to query the exe object list of all jobs. This API is incompatible with Sahara.
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
cluster_id + |
+Yes + |
+String + |
+Cluster ID + |
+
id + |
+No + |
+String + |
+Job execution object ID + |
+
page_size + |
+No + |
+Integer + |
+Maximum number of jobs displayed on a page +Value range: 1 to 100 + |
+
current_page + |
+No + |
+Integer + |
+Current page number + |
+
job_name + |
+No + |
+String + |
+Job name + |
+
state + |
+No + |
+Integer + |
+Job status code +
|
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
totalRecord + |
+Integer + |
+Total number of jobs in a list + |
+
job_executions + |
+Array + |
+Job list parameter +For details, see Table 4. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
id + |
+String + |
+Job ID + |
+
create_at + |
+Integer + |
+Creation time, which is a 13-bit timestamp. + |
+
update_at + |
+Integer + |
+Update time, which is a 13-bit timestamp. + |
+
tenant_id + |
+String + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
job_id + |
+String + |
+Job ID of the YARN + |
+
job_name + |
+String + |
+Job name + |
+
start_time + |
+Integer + |
+Start time of job execution, which is a 13-bit timestamp. + |
+
end_time + |
+Integer + |
+End time of job execution, which is a 13-bit timestamp. + |
+
cluster_id + |
+String + |
+Cluster ID of a job + |
+
group_id + |
+String + |
+Group ID of a job + |
+
jar_path + |
+String + |
+Path of the .jar file or .sql file for program execution + |
+
input + |
+String + |
+Address for inputting data + |
+
output + |
+String + |
+Address for outputting data + |
+
job_log + |
+String + |
+Address for storing job logs + |
+
job_type + |
+Integer + |
+Job type code +
|
+
file_action + |
+String + |
+Data import and export + |
+
arguments + |
+String + |
+Key parameter for program execution. The parameter is specified by the function of the user's internal program. MRS is only responsible for loading the parameter. This parameter can be empty. + |
+
hql + |
+String + |
+HiveQL statement + |
+
job_state + |
+Integer + |
+Job status code +
|
+
job_final_status + |
+Integer + |
+Final job status. +
|
+
hive_script_path + |
+String + |
+Address of the Hive script + |
+
create_by + |
+String + |
+User ID for creating jobs + |
+
finished_step + |
+Integer + |
+Number of completed steps + |
+
job_main_id + |
+String + |
+Main ID of a job + |
+
job_step_id + |
+String + |
+Step ID of a job + |
+
postpone_at + |
+Integer + |
+Delay time, which is a 13-bit timestamp. + |
+
step_name + |
+String + |
+Step name of a job + |
+
step_num + |
+Integer + |
+Number of steps + |
+
task_num + |
+Integer + |
+Number of tasks + |
+
update_by + |
+String + |
+User ID for updating jobs + |
+
spend_time + |
+Integer + |
+Duration of job execution (unit: s) + |
+
step_seq + |
+Integer + |
+Step sequence of a job + |
+
progress + |
+String + |
+Job execution progress + |
+
GET/v1.1/{project_id}/job-exes?page_size=10¤t_page=1&state=3&job_name=myfirstjob&clusterId=20ca8601-72a2-4570-b788-2a20fec81a95
+{
+ "totalRecord": 14,
+ "job_executions": [
+ {
+ "id": "669476bd-89d2-45aa-8f1a-872d16de377e",
+ "create_at": 1484641003707,
+ "update_at": 1484641003707,
+ "tenant_id": "3f99e3319a8943ceb15c584f3325d064",
+ "job_id": "",
+ "job_name": "myfirstjob",
+ "start_time": 1484641003707,
+ "end_time": null,
+ "cluster_id": "2b460e01-3351-4170-b0a7-57b9dd5ffef3",
+ "group_id": "669476bd-89d2-45aa-8f1a-872d16de377e",
+ "jar_path": "s3a://jp-test1/program/hadoop-mapreduce-examples-2.4.1.jar",
+ "input": "s3a://jp-test1/input/",
+ "output": "s3a://jp-test1/output/",
+ "job_log": "s3a://jp-test1/joblogs/",
+ "job_type": 1,
+ "file_action": "",
+ "arguments": "wordcount",
+ "hql": "",
+ "job_state": 2,
+ "job_final_status": 1,
+ "hive_script_path": null,
+ "create_by": "3f99e3319a8943ceb15c584f3325d064",
+ "finished_step": 0,
+ "job_main_id": "",
+ "job_step_id": "",
+ "postpone_at": 1484641003174,
+ "step_name": "",
+ "step_num": 0,
+ "task_num": 0,
+ "update_by": "3f99e3319a8943ceb15c584f3325d064",
+ "spend_time": null,
+ "step_seq": 222,
+ "progress": "first progress"
+ }
+ ]
+}
+Table 5 describes the status code of this API.
+ +Status Code + |
+Description + |
+
|---|---|
200 + |
+The exe object list of jobs is queried successfully. + |
+
For the description about error status codes, see Status Codes.
+This API is used to query detailed information about the exe object of a job. This API is incompatible with Sahara.
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
job_exe_id + |
+Yes + |
+Job ID + |
+
Request parameters
+None.
+Parameter + |
+Type + |
+Description + |
+
|---|---|---|
job_execution + |
+Object + |
+For details, see Table 3. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
id + |
+String + |
+Job ID + |
+
create_at + |
+Integer + |
+Creation time, which is a 13-bit timestamp. + |
+
update_at + |
+Integer + |
+Update time, which is a 13-bit timestamp. + |
+
tenant_id + |
+String + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
job_id + |
+String + |
+Job ID + |
+
job_name + |
+String + |
+Job name + |
+
start_time + |
+Integer + |
+Start time of job execution, which is a 13-bit timestamp. + |
+
end_time + |
+Integer + |
+End time of job execution, which is a 13-bit timestamp. + |
+
cluster_id + |
+String + |
+Cluster ID of a job + |
+
group_id + |
+String + |
+Group ID of a job + |
+
jar_path + |
+String + |
+Path of the .jar file or .sql file for program execution + |
+
input + |
+String + |
+Address for inputting data + |
+
output + |
+String + |
+Address for outputting data + |
+
job_log + |
+String + |
+Address for storing job logs + |
+
job_type + |
+Integer + |
+Job type code +
|
+
file_action + |
+String + |
+Data import and export + |
+
arguments + |
+String + |
+Key parameter for program execution. The parameter is specified by the function of the user's program. MRS is only responsible for loading the parameter. This parameter can be empty. + |
+
hql + |
+String + |
+HiveQL statement + |
+
job_state + |
+Integer + |
+Job status code +
|
+
job_final_status + |
+Integer + |
+Final job status +
|
+
hive_script_path + |
+String + |
+Address of the Hive script + |
+
create_by + |
+String + |
+User ID for creating jobs + |
+
finished_step + |
+Integer + |
+Number of completed steps + |
+
job_main_id + |
+String + |
+Main ID of a job + |
+
job_step_id + |
+String + |
+Step ID of a job + |
+
postpone_at + |
+Integer + |
+Delay time, which is a 13-bit timestamp. + |
+
step_name + |
+String + |
+Step name of a job + |
+
step_num + |
+Integer + |
+Number of steps + |
+
task_num + |
+Integer + |
+Number of tasks + |
+
update_by + |
+String + |
+User ID for updating jobs + |
+
spend_time + |
+Integer + |
+Duration of job execution (unit: s) + |
+
step_seq + |
+Integer + |
+Step sequence of a job + |
+
progress + |
+String + |
+Job execution progress + |
+
{
+ "job_execution": {
+ "id": "632863d5-15d4-4691-9dc1-1a72340cb097",
+ "create_at": 1484240559176,
+ "update_at": 1484240559176,
+ "tenant_id": "3f99e3319a8943ceb15c584f3325d064",
+ "job_id": "632863d5-15d4-4691-9dc1-1a72340cb097",
+ "job_name": "hive_script",
+ "start_time": 1484240559176,
+ "end_time": null,
+ "cluster_id": "8b1d55f6-150e-45e2-8347-b2ca608d366b",
+ "group_id": "632863d5-15d4-4691-9dc1-1a72340cb097",
+ "jar_path": "s3a://jp-test1/program/Hivescript.sql",
+ "input": "s3a://jp-test1/input/",
+ "output": "s3a://jp-test1/output/",
+ "job_log": "s3a://jp-test1/joblogs/",
+ "job_type": 3,
+ "file_action": "",
+ "arguments": "wordcount",
+ "hql": null,
+ "job_state": 3,
+ "job_final_status": 1,
+ "hive_script_path": "s3a://jp-test1/program/Hivescript.sql",
+ "create_by": "3f99e3319a8943ceb15c584f3325d064",
+ "finished_step": 0,
+ "job_main_id": "",
+ "job_step_id": "",
+ "postpone_at": 1484240558705,
+ "step_name": "",
+ "step_num": 0,
+ "task_num": 0,
+ "update_by": "3f99e3319a8943ceb15c584f3325d064",
+ "spend_time": null,
+ "step_seq": 222,
+ "progress": "first progress"
+ }
+}
+Table 4 describes the status code of this API.
+ +Status code + |
+Description + |
+
|---|---|
200 + |
+The exe object details are queried successfully. + |
+
For the description about error status codes, see Status Codes.
+This API is used to delete a job object. This API is compatible with Sahara.
+Parameter + |
+Mandatory + |
+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 parameters
+None.
+Response parameters
+None.
+Table 2 describes the status code of this API.
+ +Status Code + |
+Description + |
+
|---|---|
204 + |
+The job object has been successfully deleted. + |
+
For the description about error status codes, see Status Codes.
+This API is used to query the job execution object list. This API is compatible with Sahara.
+Parameter + |
+Mandatory + |
+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 execution ID +Query the job execution list, and select one job execution 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 +A hyphen (-) before the sort field indicates to sort in descending order. Example: +
|
+
Request parameters
+None.
+Parameter + |
+Type + |
+Description + |
+
|---|---|---|
markers + |
+Object + |
+Markers object +For details, see Table 3. + |
+
job_executions + |
+Array + |
+Job execution list +For details, see Table 4. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
prev + |
+String + |
+Marker on the previous page + |
+
next + |
+String + |
+Marker on the next page + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
job_configs + |
+Object + |
+Key-value pair set for saving job running configurations For more parameter description, see Table 5. + |
+
is_protected + |
+Bool + |
+Whether a job execution object is protected +
The current version does not support this function. + |
+
input_id + |
+String + |
+Input data source ID of a job execution object + |
+
job_id + |
+String + |
+Job ID + |
+
cluster_id + |
+String + |
+Cluster ID + |
+
created_at + |
+String + |
+Job execution object creation time + |
+
end_time + |
+String + |
+Job end time + |
+
output_id + |
+String + |
+Output data source ID of a job execution object + |
+
is_public + |
+Bool + |
+Whether a job execution object is public +
The current version does not support this function. + |
+
updated_at + |
+String + |
+Job execution object update time + |
+
return_code + |
+String + |
+Response code after job execution + |
+
data_source_urls + |
+Object + |
+Data source URL of a job execution object + |
+
tenant_id + |
+String + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
start_time + |
+String + |
+Job start time + |
+
Id + |
+String + |
+Job execution object ID + |
+
engine_job_id + |
+String + |
+Workflow ID of Oozie + |
+
oozie_job_id + |
+String + |
+Workflow ID returned by Oozie + |
+
info + |
+String + |
+Key-value pair set, containing job running information returned by Oozie + |
+
GET /v1.1/{project_id}/job-executions?limit=2&sort_by=id&marker=839244be-c471-469b-80c0-6f63e376bcbc
+{
+ "markers": {
+ "prev": "821c8924-5249-4dd8-8069-b8d425f3f54a",
+ "next": null
+ },
+ "job_executions": [
+ {
+ "created_at": "2017-06-22T06:24:57",
+ "updated_at": "2017-06-22T06:24:59",
+ "id": "84900772-8807-4ddc-9484-f719fa43711f",
+ "tenant_id": "5a3314075bfa49b9ae360f4ecd333695",
+ "job_id": "",
+ "start_time": "2017-06-22T06:24:49",
+ "end_time": "2017-06-22T06:25:02",
+ "cluster_id": "33dff020-7f96-4270-9c3a-88b99627f6e2",
+ "oozie_job_id": null,
+ "return_code": null,
+ "input_id": null,
+ "output_id": null,
+ "is_protected": false,
+ "is_public": null,
+ "engine_job_id": null,
+ "job_configs": null,
+ "data_source_urls": null,
+ "info": null
+ },
+ {
+ "created_at": "2017-06-22T06:23:51",
+ "updated_at": "2017-06-22T06:23:51",
+ "id": "852042ea-a32c-424b-aacf-df2e6d6642b5",
+ "tenant_id": "5a3314075bfa49b9ae360f4ecd333695",
+ "job_id": "",
+ "start_time": "2017-06-22T06:23:51",
+ "end_time": null,
+ "cluster_id": "33dff020-7f96-4270-9c3a-88b99627f6e2",
+ "oozie_job_id": null,
+ "return_code": null,
+ "input_id": null,
+ "output_id": null,
+ "is_protected": false,
+ "is_public": null,
+ "engine_job_id": null,
+ "job_configs": null,
+ "data_source_urls": null,
+ "info": null
+ }
+ ]
+}
+Table 6 describes the status code of this API.
+ +Status Code + |
+Description + |
+
|---|---|
200 + |
+The job execution object list is queried successfully. + |
+
For the description about error status codes, see Status Codes.
+This API is used to query detailed information about a job execution object. This API is compatible with Sahara.
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
job_execution_id + |
+Yes + |
+Job execution object ID + |
+
Request parameters
+None.
+Parameter + |
+Type + |
+Description + |
+
|---|---|---|
info + |
+String + |
+Key-value pair set, containing job running information returned by Oozie + |
+
cluster_id + |
+String + |
+Cluster ID + |
+
job_id + |
+String + |
+Job ID + |
+
engine_job_id + |
+String + |
+Workflow ID of Oozie + |
+
oozie_job_id + |
+String + |
+Workflow ID returned by Oozie + |
+
tenant_id + |
+String + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
created_at + |
+String + |
+Job execution object creation time + |
+
updated_at + |
+String + |
+Job execution object update time + |
+
start_time + |
+String + |
+Job start time + |
+
end_time + |
+String + |
+Job end time + |
+
return_code + |
+String + |
+Response code after job execution + |
+
input_id + |
+String + |
+Input data source ID of a job execution object + |
+
output_id + |
+String + |
+Output data source ID of a job execution object + |
+
is_protected + |
+Bool + |
+Whether a job execution object is protected +
The current version does not support this function. + |
+
is_public + |
+Bool + |
+Whether a job execution object is public +
The current version does not support this function. + |
+
job_configs + |
+Object + |
+Key-value pair set for saving job running configurations +For details, see Table 3. + |
+
data_source_urls + |
+Object + |
+Data source URL of a job execution object + |
+
Id + |
+String + |
+Job execution object ID + |
+
{
+ "job_execution": {
+ "created_at": "2017-06-22T06:23:51",
+ "updated_at": "2017-06-22T06:23:51",
+ "id": "852042ea-a32c-424b-aacf-df2e6d6642b5",
+ "tenant_id": "5a3314075bfa49b9ae360f4ecd333695",
+ "job_id": "",
+ "start_time": "2017-06-22T06:23:51",
+ "end_time": null,
+ "cluster_id": "33dff020-7f96-4270-9c3a-88b99627f6e2",
+ "oozie_job_id": null,
+ "return_code": null,
+ "input_id": null,
+ "output_id": null,
+ "is_protected": false,
+ "is_public": null,
+ "engine_job_id": null,
+ "job_configs": null,
+ "data_source_urls": null,
+ "info": null
+ }
+}
+Table 4 describes the status code of this API.
+ +Status Code + |
+Description + |
+
|---|---|
200 + |
+The job execution object details are queried successfully. + |
+
For the description about error status codes, see Status Codes.
+This API is used to cancel a job object being executed. This API is compatible with Sahara.
+GET /v1.1/{project_id}/job-executions/{job_execution_id}/cancel
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
job_execution_id + |
+Yes + |
+Job execution object ID + |
+
Request parameters
+None.
+Parameter + |
+Type + |
+Description + |
+
|---|---|---|
info + |
+String + |
+Key-value pair set, containing job running information returned by Oozie + |
+
cluster_id + |
+String + |
+Cluster ID + |
+
job_id + |
+String + |
+Job ID + |
+
oozie_job_id + |
+String + |
+Workflow ID returned by Oozie + |
+
tenant_id + |
+String + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
created_at + |
+String + |
+Job execution object creation time + |
+
updated_at + |
+String + |
+Job execution object update time + |
+
start_time + |
+String + |
+Job start time + |
+
end_time + |
+Bool + |
+Job end time + |
+
return_code + |
+String + |
+Response code after job execution + |
+
input_id + |
+String + |
+Input data source ID of a job execution object + |
+
output_id + |
+String + |
+Output data source ID of a job execution object + |
+
is_protected + |
+Bool + |
+Whether a job execution object is protected +
The current version does not support this function. + |
+
is_public + |
+Bool + |
+Whether a job execution object is public +
The current version does not support this function. + |
+
job_configs + |
+Object + |
+Key-value pair set for saving job running configurations + |
+
id + |
+String + |
+Job execution object ID + |
+
oozie_job_id + |
+String + |
+Workflow ID returned by Oozie + |
+
info + |
+String + |
+Key-value pair set, containing job running information returned by Oozie + |
+
{
+ "job_execution": {
+ "created_at": "2017-05-25T07:28:12",
+ "updated_at": "2017-05-25T07:28:13",
+ "id": "2de74673-1a78-48af-a95b-e1fec4a4ae9c",
+ "tenant_id": "37caa80116e1403ab603e5eeb48a2f74",
+ "job_id": "",
+ "start_time": "2017-05-25T07:28:12",
+ "end_time": null,
+ "cluster_id": "ef7b54f2-3d92-49b2-a6d7-94607e1ea7df",
+ "oozie_job_id": null,
+ "return_code": null,
+ "input_id": null,
+ "output_id": null,
+ "is_protected": false,
+ "is_public": null,
+ "engine_job_id": null,
+ "job_configs": null,
+ "data_source_urls": null,
+ "info": null
+ }
+}
+Table 3 describes the status code of this API.
+ +Status Code + |
+Description + |
+
|---|---|
200 + |
+The job object being executed has been canceled successfully. + |
+
For the description about error status codes, see Status Codes.
+This API is used to delete a job execution object. This API is compatible with Sahara.
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
job_execution_id + |
+Yes + |
+Job ID + |
+
Request parameters
+None.
+Response parameters
+None.
+Table 2 describes the status code of this API.
+ +Status Code + |
+Description + |
+
|---|---|
204 + |
+The job execution object is deleted successfully. + |
+
For the description about error status codes, see Status Codes.
+This API is used to configure an auto scaling rule.
+The API used for cluster creation and job execution can also be used to create an auto scaling rule.
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
cluster_id + |
+Yes + |
+Cluster ID + |
+
Request parameters
+Table 2 and Table 3 describe the request parameters.
+ +Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
node_group + |
+Yes + |
+String + |
+Type of the node to which an auto scaling rule applies. Currently, only Task nodes support auto scaling rules, that is, the request value is task_node_default_group. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
auto_scaling_enable + |
+Yes + |
+Boolean + |
+Whether to enable the auto scaling rule. + |
+
min_capacity + |
+Yes + |
+Integer + |
+Minimum number of nodes left in the node group. +Value range: 0 to 500 + |
+
max_capacity + |
+Yes + |
+Integer + |
+Maximum number of nodes in the node group. +Value range: 0 to 500 + |
+
resources_plans + |
+No + |
+List + |
+Resource plan list. For details, see Table 4. If this parameter is left blank, the resource plan is disabled. +When auto scaling is enabled, either a resource plan or an auto scaling rule must be configured. +MRS 1.6.3 or later supports this parameter. + |
+
exec_scripts + |
+No + |
+List + |
+List of custom scaling automation scripts. For details, see Table 5. If this parameter is left blank, a hook script is disabled. +MRS 1.7.2 or later supports this parameter. + |
+
rules + |
+No + |
+List + |
+List of auto scaling rules. For details, see Table 6. +When auto scaling is enabled, either a resource plan or an auto scaling rule must be configured. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
period_type + |
+Yes + |
+String + |
+Cycle type of a resource plan. Currently, only the following cycle type is supported: +
|
+
start_time + |
+Yes + |
+String + |
+Start time of a resource plan. The value is in the format of hour:minute, indicating that the time ranges from 0:00 to 23:59. + |
+
end_time + |
+Yes + |
+String + |
+End time of a resource plan. The value is in the same format as that of start_time. The interval between end_time and start_time must be greater than or equal to 30 minutes. + |
+
min_capacity + |
+Yes + |
+Integer + |
+Minimum number of the preserved nodes in a node group in a resource plan. +Value range: 0 to 500 + |
+
max_capacity + |
+Yes + |
+Integer + |
+Maximum number of the preserved nodes in a node group in a resource plan. +Value range: 0 to 500 + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
name + |
+Yes + |
+String + |
+Name of a custom automation script. It must be unique in a same cluster. +The value can contain only digits, letters, spaces, hyphens (-), and underscores (_) and must not start with a space. +The value can contain 1 to 64 characters. + |
+
uri + |
+Yes + |
+String + |
+Path of a custom automation script. Set this parameter to an OBS bucket path or a local VM path. +
|
+
parameters + |
+No + |
+String + |
+Parameters of a custom automation script. +
|
+
nodes + |
+Yes + |
+List<String> + |
+Type of a node where the custom automation script is executed. The node type can be Master, Core, or Task. + |
+
active_master + |
+No + |
+Boolean + |
+Whether the custom automation script runs only on the active Master node. +The default value is false, indicating that the custom automation script can run on all Master nodes. + |
+
action_stage + |
+Yes + |
+String + |
+Time when a script is executed. +The following four options are supported: +
|
+
fail_action + |
+Yes + |
+String + |
+Whether to continue to execute subsequent scripts and create a cluster after the custom automation script fails to be executed. +
|
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
name + |
+Yes + |
+String + |
+Name of an auto scaling rule. +A cluster name can contain only 1 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. +Rule names must be unique in a node group. + |
+
description + |
+No + |
+String + |
+Description about an auto scaling rule. +It contains a maximum of 1,024 characters. + |
+
adjustment_type + |
+Yes + |
+String + |
+Auto scaling rule adjustment type. The options are as follows: +
|
+
cool_down_minutes + |
+Yes + |
+Integer + |
+Cluster cooling time after an auto scaling rule is triggered, when no auto scaling operation is performed. The unit is minute. +Value range: 0 to 10,080. One week is equal to 10,080 minutes. + |
+
scaling_adjustment + |
+Yes + |
+Integer + |
+Number of nodes that can be adjusted once. +Value range: 1 to 100 + |
+
trigger + |
+Yes + |
+Trigger + |
+Condition for triggering a rule. For details, see Table 7. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
metric_name + |
+Yes + |
+String + |
+Metric name. +This triggering condition makes a judgment according to the value of the metric. +A metric name contains a maximum of 64 characters. +Table 8 lists the supported metric names. + |
+
metric_value + |
+Yes + |
+String + |
+Metric threshold to trigger a rule +The parameter value must be an integer or number with two decimal places only. Table 8 provides value types and ranges corresponding to metric_name. + |
+
comparison_operator + |
+No + |
+String + |
+Metric judgment logic operator. The options are as follows: +
|
+
evaluation_periods + |
+Yes + |
+Integer + |
+Number of consecutive five-minute periods, during which a metric threshold is reached +Value range: 1 to 288 + |
+
Cluster Type + |
+Metric + |
+Value Type + |
+Description + |
+
|---|---|---|---|
Streaming cluster + |
+StormSlotAvailable + |
+Integer + |
+Number of available Storm slots. +Value range: 0 to 2147483646. + |
+
StormSlotAvailablePercentage + |
+Percentage + |
+Percentage of available Storm slots, that is, the proportion of the available slots to total slots. +Value range: 0 to 100. + |
+|
StormSlotUsed + |
+Integer + |
+Number of the used Storm slots. +Value range: 0 to 2147483646. + |
+|
StormSlotUsedPercentage + |
+Percentage + |
+Percentage of the used Storm slots, that is, the proportion of the used slots to total slots. +Value range: 0 to 100. + |
+|
StormSupervisorMemAverageUsage + |
+Integer + |
+Average memory usage of the Supervisor process of Storm. +Value range: 0 to 2147483646. + |
+|
StormSupervisorMemAverageUsagePercentage + |
+Percentage + |
+Average percentage of the used memory of the Supervisor process of Storm to the total memory of the system. +Value range: 0 to 100. + |
+|
StormSupervisorCPUAverageUsagePercentage + |
+Percentage + |
+Average percentage of the used CPUs of the Supervisor process of Storm to the total CPUs. +Value range: 0 to 6000. + |
+|
Analysis cluster + |
+YARNAppPending + |
+Integer + |
+Number of pending tasks on Yarn. +Value range: 0 to 2147483646. + |
+
YARNAppPendingRatio + |
+Ratio + |
+Ratio of pending tasks on Yarn, that is, the ratio of pending tasks to running tasks on Yarn. +Value range: 0 to 2147483646. + |
+|
YARNAppRunning + |
+Integer + |
+Number of running tasks on Yarn. +Value range: 0 to 2147483646. + |
+|
YARNContainerAllocated + |
+Integer + |
+Number of containers allocated to Yarn. +Value range: 0 to 2147483646. + |
+|
YARNContainerPending + |
+Integer + |
+Number of pending containers on Yarn. +Value range: 0 to 2147483646. + |
+|
YARNContainerPendingRatio + |
+Ratio + |
+Ratio of pending containers on Yarn, that is, the ratio of pending containers to running containers on Yarn. +Value range: 0 to 2147483646. + |
+|
YARNCPUAllocated + |
+Integer + |
+Number of virtual CPUs (vCPUs) allocated to Yarn +Value range: 0 to 2147483646. + |
+|
YARNCPUAvailable + |
+Integer + |
+Number of available vCPUs on Yarn. +Value range: 0 to 2147483646. + |
+|
YARNCPUAvailablePercentage + |
+Percentage + |
+Percentage of available vCPUs on Yarn, that is, the proportion of available vCPUs to total vCPUs. +Value range: 0 to 100. + |
+|
YARNCPUPending + + |
+Integer + |
+Number of pending vCPUs on Yarn. +Value range: 0 to 2147483646. + |
+|
YARNMemoryAllocated + |
+Integer + |
+Memory allocated to Yarn. The unit is MB. +Value range: 0 to 2147483646. + |
+|
YARNMemoryAvailable + |
+Integer + |
+Available memory on Yarn. The unit is MB. +Value range: 0 to 2147483646. + |
+|
YARNMemoryAvailablePercentage + |
+Percentage + |
+Percentage of available memory on Yarn, that is, the proportion of available memory to total memory on Yarn. +Value range: 0 to 100. + |
+|
YARNMemoryPending + |
+Integer + |
+Pending memory on Yarn. +Value range: 0 to 2147483646. + |
+
When the value type is percentage or ratio in Table 8, the valid value can be accurate to percentile. The percentage metric value is a decimal value with a percent sign (%) removed. For example, 16.80 represents 16.80%.
+Parameter + |
+Type + |
+Description + |
+
|---|---|---|
result + |
+String + |
+Operation result +
|
+
{
+ "node_group":"task_node_default_group",
+ "auto_scaling_policy": {
+ "auto_scaling_enable": true,
+ "min_capacity": "1",
+ "max_capacity": "3",
+ "resources_plans": [{
+ "period_type": "daily",
+ "start_time": "9:50",
+ "end_time": "10:20",
+ "min_capacity": "2",
+ "max_capacity": "3"
+ },{
+ "period_type": "daily",
+ "start_time": "10:20",
+ "end_time": "12:30",
+ "min_capacity": "0",
+ "max_capacity": "2"
+ }],
+ "exec_scripts": [{
+ "name": "before_scale_out",
+ "uri": "s3a://XXX/zeppelin_install.sh",
+ "parameters": "",
+ "nodes": [
+ "master",
+ "core",
+ "task"
+ ],
+ "active_master": "true",
+ "action_stage": "before_scale_out",
+ "fail_action": "continue"
+ },{
+ "name": "after_scale_out",
+ "uri": "s3a://XXX/storm_rebalance.sh",
+ "parameters": "",
+ "nodes": [
+ "master",
+ "core",
+ "task"
+ ],
+ "active_master": "true",
+ "action_stage": "after_scale_out",
+ "fail_action": "continue"
+ }],
+ "rules": [{
+ "name": "default-expand-1",
+ "adjustment_type": "scale_out",
+ "cool_down_minutes": 5,
+ "scaling_adjustment": 1,
+ "trigger": {
+ "metric_name": "YARNMemoryAvailablePercentage",
+ "metric_value": "25",
+ "comparison_operator": "LT",
+ "evaluation_periods": 10
+ }
+ },
+ {
+ "name": "default-shrink-1",
+ "adjustment_type": "scale_in",
+ "cool_down_minutes": 5,
+ "scaling_adjustment": 1,
+ "trigger": {
+ "metric_name": "YARNMemoryAvailablePercentage",
+ "metric_value": "70",
+ "comparison_operator": "GT",
+ "evaluation_periods": 10
+ }
+ }]
+ }
+}
+
A new auto scaling rule will overwrite the auto scaling rule saved in the original database. If you want to modify the original rule, query the original rule first, modify the rule, and submit a modification task. For details, see Querying Cluster Details.
+{ "result": "succeeded" }
+Table 10 describes the status code of this API.
+ +Status Code + |
+Description + |
+
|---|---|
200 + |
+The cluster has been successfully created. + |
+
For the description about error status codes, see Status Codes.
+This API is used to query a host list of a specified cluster.
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
cluster_id + |
+Yes + |
+Cluster ID + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
pageSize + |
+No + |
+Integer + |
+Maximum number of clusters displayed on a page +Value range: [1-2147483646]. The default value is 10. + |
+
currentPage + |
+No + |
+Integer + |
+Current page number The default value is 1. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
total + |
+Integer + |
+Total number of hosts in a list + |
+
hosts + |
+Array + |
+Host parameters +For details, see Table 4. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
id + |
+String + |
+VM ID + |
+
ip + |
+String + |
+VM IP address + |
+
flavor + |
+String + |
+VM flavor ID + |
+
type + |
+String + |
+VM type +Currently, MasterNode, CoreNode, and TaskNode are supported. + |
+
name + |
+String + |
+VM name + |
+
status + |
+String + |
+Current VM state + |
+
mem + |
+String + |
+Memory + |
+
cpu + |
+String + |
+Number of CPU cores + |
+
root_volume_size + |
+String + |
+OS disk capacity + |
+
data_volume_type + |
+String + |
+Data disk type + |
+
data_volume_size + |
+Integer + |
+Data disk capacity + |
+
data_volume_count + |
+Integer + |
+Number of data disks + |
+
{
+ "total": 5,
+ "hosts": [
+ {
+ "id": "063d1d47-ae91-4a48-840c-b3cfe4efbcf0",
+ "name": "a78e161c-d14f-4b68-8c2d-0219920ce844_node_core_IQhiC",
+ "ip": "192.168.0.169",
+ "status": "ACTIVE",
+ "flavor": "c6.4xlarge.4linux.mrs",
+ "type": "Core",
+ "mem": "16384",
+ "cpu": "8",
+ "root_volume_size": "40",
+ "data_volume_type": "SATA",
+ "data_volume_size": 100,
+ "data_volume_count": 1
+ },
+ {
+ "id": "dc5c6208-faa2-4727-a65a-2b1ce235d350",
+ "name": "a78e161c-d14f-4b68-8c2d-0219920ce844_node_master1_ASzkl",
+ "ip": "192.168.0.156",
+ "status": "ACTIVE",
+ "flavor": "c2.4xlarge.linux.mrs",
+ "type": "Master",
+ "mem": "32768",
+ "cpu": "16",
+ "root_volume_size": "40",
+ "data_volume_type": "SATA",
+ "data_volume_size": 100,
+ "data_volume_count": 1
+ },
+ {
+ "id": "c0ce793d-848b-448a-835b-ea0cac534b09",
+ "name": "a78e161c-d14f-4b68-8c2d-0219920ce844_node_core_ANnRN",
+ "ip": "192.168.0.243",
+ "status": "ACTIVE",
+ "flavor": "c6.4xlarge.4linux.mrs",
+ "type": "Core",
+ "mem": "16384",
+ "cpu": "8",
+ "root_volume_size": "40",
+ "data_volume_type": "SATA",
+ "data_volume_size": 100,
+ "data_volume_count": 1
+ },
+ {
+ "id": "95c23e43-ef6e-4732-b6ed-a5f1c7779fae",
+ "name": "a78e161c-d14f-4b68-8c2d-0219920ce844_node_core_uRRiA",
+ "ip": "192.168.0.126",
+ "status": "ACTIVE",
+ "flavor": "c6.4xlarge.4linux.mrs",
+ "type": "Core",
+ "mem": "16384",
+ "cpu": "8",
+ "root_volume_size": "40",
+ "data_volume_type": "SATA",
+ "data_volume_size": 100,
+ "data_volume_count": 1
+ },
+ {
+ "id": "63bdbf75-1133-4a94-8c27-1fa12c8b9e70",
+ "name": "a78e161c-d14f-4b68-8c2d-0219920ce844_node_master2_StqFu",
+ "ip": "192.168.0.22",
+ "status": "ACTIVE",
+ "flavor": "c2.4xlarge.linux.mrs",
+ "type": "Master",
+ "mem": "32768",
+ "cpu": "16",
+ "root_volume_size": "40",
+ "data_volume_type": "SATA",
+ "data_volume_size": 100,
+ "data_volume_count": 1
+ }
+ ]
+}
+Table 5 describes the status code of this API.
+ + +For the description about error status codes, see Status Codes.
+ +This API is used to add a tag to a specified cluster.
+A cluster has a maximum of 10 tags. This API is idempotent. If a tag to be created has the same key as an existing tag, the tag will overwrite the existing one.
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
cluster_id + |
+Yes + |
+Cluster ID + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
key + |
+Yes + |
+String + |
+Key. A tag key can contain only uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_). + |
+
value + |
+Yes + |
+String + |
+Tag value. A tag value can contain only uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_). + |
+
Response parameters
+None.
+{
+ "tag":
+ {
+ "key":"DEV",
+ "value":"DEV1"
+ }
+}
+
+Table 3 describes the status code of this API.
+ + +This API is used to delete a tag of a specified cluster.
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
cluster_id + |
+Yes + |
+Cluster ID + |
+
Request parameters
+None.
+Response parameters
+None
+Table 2 describes the status code of this API.
+ + +This API is used to query tags of a specified cluster.
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
cluster_id + |
+Yes + |
+Cluster ID + |
+
Request parameters
+None.
+Parameter + |
+Type + |
+Description + |
+
|---|---|---|
tags + |
+Array of objects + |
+Tag list. For details, see Table 3. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
key + |
+String + |
+Key. A tag key can contain only uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_). + |
+
value + |
+String + |
+Tag value. A tag value can contain only uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_). + |
+
Table 4 describes the status code of this API.
+ + +This API is used to add or delete tags to or from a specified cluster in batches.
+You can add a maximum of 10 tags to a cluster.
+This API is idempotent.
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
cluster_id + |
+Yes + |
+Cluster ID + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
action + |
+Yes + |
+String + |
+Operation to be performed. The value can be set to create or delete only. + |
+
tags + |
+Yes + |
+List<resource_tag> + |
+Tag list. For details about the parameter, see Table 3. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
key + |
+Yes + |
+String + |
+Key. A tag key can contain only uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_). + |
+
value + |
+Yes + |
+String + |
+Tag value. A tag value can contain only uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_). +Note: +
|
+
Response parameters
+None.
+{
+ "action": "create",
+ "tags": [
+ {
+ "key": "key1",
+ "value": "value1"
+ },
+ {
+ "key": "key",
+ "value": "value3"
+ }
+ ]
+}
+
+
+Table 4 describes the status code of this API.
+ + +This API is used to query all tag sets of a specified region.
+ +Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
Request parameters
+None.
+Parameter + |
+Type + |
+Description + |
+
|---|---|---|
tags + |
+Array of objects + |
+Tag list. For details, see Table 3. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
key + |
+String + |
+Tag key. A tag key can contain only uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_). + |
+
value + |
+String + |
+Tag value. A tag value can contain only uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_). + |
+
None.
+{
+ "tags": [
+ {
+ "key": "key1",
+ "values": [
+ "value1",
+ "value2"
+ ]
+ },
+ {
+ "key": "key2",
+ "values": [
+ "value1",
+ "value2"
+ ]
+ }
+ ]
+}
+
+Table 4 describes the status code of this API.
+ + +This API is used to filter clusters by tag.
+By default, clusters and tags are sorted in descending order of creation time.
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
tags + |
+No + |
+List<tag> + |
+The return result contains resources corresponding to all tags in this parameter. This parameter contains a maximum of 10 keys, and each key contains a maximum of 10 values. The structure body cannot be missing, and the key cannot be left blank or set to an empty string. + |
+
tags_any + |
+No + |
+List<tag> + |
+The return result contains resources corresponding to any tag in this parameter. This parameter contains a maximum of 10 keys, and each key contains a maximum of 10 values. The structure body cannot be missing, and the key cannot be left blank or set to an empty string. Keys must be unique and values of a key must be unique. + |
+
not_tags + |
+No + |
+List<tag> + |
+The return result does not contain resources corresponding to all tags in this parameter. This parameter contains a maximum of 10 keys, and each key contains a maximum of 10 values. The structure body cannot be missing, and the key cannot be left blank or set to an empty string. Keys must be unique and values of a key must be unique. + |
+
not_tags_any + |
+No + |
+List<tag> + |
+The return result does not contain resources corresponding to any tag in this parameter. This parameter contains a maximum of 10 keys, and each key contains a maximum of 10 values. The structure body cannot be missing, and the key cannot be left blank or set to an empty string. Keys must be unique and values of a key must be unique. + |
+
limit + |
+No + |
+String + |
+Number of records. This parameter is not available when action is set to count. The default value is 1000 when action is set to filter. The maximum value is 1000, and the minimum value is 1. The value cannot be a negative number. + |
+
offset + |
+No + |
+String + |
+Index position. The query starts from the next piece of data specified by the offset parameter. This parameter is not required when you query data on the first page. The value in the response body returned for querying data on the previous page will be included in this parameter for querying data on subsequent pages. This parameter is not available when action is set to count. If action is set to filter, the value must be a number, and the default value is 0. The value cannot be a negative number. + |
+
action + |
+Yes + |
+String + |
+Operation to be performed. The value can be filter or count. +The value filter indicates pagination query. The value count indicates that the total number of query results meeting the search criteria will be returned. + |
+
matches + |
+No + |
+List<match> + |
+Search field. key indicates the field to be matched, for example, resource_name. value indicates the matched value. This field is a fixed dictionary value. +Determine whether fuzzy match is required based on different fields. For example, if key is resource_name, fuzzy search is used by default. If value is an empty string, exact match is used. + + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
key + |
+Yes + |
+String + |
+Key. It contains a maximum of 127 Unicode characters. It cannot be left empty. (This parameter is not verified in the search process.) + |
+
values + |
+Yes + |
+List<String> + |
+List of values. A value contains a maximum of 255 Unicode characters. +If the values are null, it indicates any_value. The relationship between values is OR. By default, only the first value is used for search. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
key + |
+Yes + |
+String + |
+Key. The value is fixed to resource_name, indicating a cluster name. + |
+
value + |
+Yes + |
+String + |
+Value. A value contains a maximum of 64 Unicode characters. Enter a cluster name. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
resources + |
+Array of objects + |
+Resource details. For details, see Table 6. + |
+
total_count + |
+Integer + |
+Total number of resources. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
resource_detail + |
+String + |
+Resource details. + |
+
resource_id + |
+String + |
+Resource ID. + |
+
resource_name + |
+String + |
+Resource name. + |
+
tags + |
+objects + |
+Tag list. For details, see Table 7. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
key + |
+String + |
+Key. A tag key can contain only uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_). + |
+
value + |
+String + |
+Tag value. A tag value can contain only uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_). + |
+
Request body when action is set to filter
+{
+ "offset": "100",
+ "limit": "100",
+"action": "filter",
+ "matches":[
+{
+ "key": "resource_name",
+ "value": "clusterA"
+ }
+],
+ "not_tags": [
+ {
+ "key": "key1",
+ "values": [
+ "value1",
+ "value2"
+ ]
+ }
+ ],
+ "tags": [
+ {
+ "key": "key1",
+ "values": [
+ "value1",
+ "value2"
+ ]
+ }
+ ],
+ "tags_any": [
+ {
+ "key": "key1",
+ "values": [
+ "value1",
+ "value2"
+ ]
+ }
+ ],
+"not_tags_any": [
+ {
+ "key": "key1",
+ "values": [
+ "value1",
+ "value2"
+ ]
+ }
+ ]
+}
+Request body when action is set to count
+{
+ "action": "count",
+ "not_tags": [
+ {
+ "key": "key1",
+ "values": [
+ "value1",
+ "value2"
+ ]
+ }
+ ],
+ "tags": [
+ {
+ "key": "key1",
+ "values": [
+ "value1",
+ "value2"
+ ]
+ },
+ {
+ "key": "key2",
+ "values": [
+ "value1",
+ "value2"
+ ]
+ }
+ ],
+ "tags_any": [
+ {
+ "key": "key1",
+ "values": [
+ "value1",
+ "value2"
+ ]
+ }
+ ],
+"not_tags_any": [
+ {
+ "key": "key1",
+ "values": [
+ "value1",
+ "value2"
+ ]
+ }
+ ],
+"matches":[
+{
+ "key": "resource_name",
+ "value": "clusterA"
+ }
+]
+}
+Table 8 describes the status code of this API.
+ + +This API is used to add and submit a job in an MRS cluster.
+
Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
cluster_id + |
+Yes + |
+Cluster ID. For details on how to obtain the cluster ID, see Obtaining a Cluster ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
job_type + |
+Yes + |
+String + |
+Type of a job. +
NOTE:
+Spark, Hive, and Flink jobs can be added to only clusters that include Spark, Hive, and Flink components. + |
+
job_name + |
+Yes + |
+String + |
+Job name. It contains 1 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. + NOTE:
+Identical job names are allowed but not recommended. + |
+
arguments + |
+No + |
+Array + |
+Key parameter for program execution. The parameter is specified by the function of the user's program. MRS is only responsible for loading the parameter. +The parameter contains a maximum of 4,096 characters, excluding special characters such as ;|&>'<$, and can be left blank. + NOTE:
+
|
+
properties + |
+No + |
+Object + |
+Program system parameter. +The parameter contains a maximum of 2,048 characters, excluding special characters such as ><|'`&!\, and can be left blank. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
job_submit_result + |
+Object + |
+Job execution result + |
+
job_id + |
+String + |
+Job ID + |
+
state + |
+String + |
+Job submission status. +
|
+
error_msg + |
+String + |
+Error message + |
+
error_code + |
+String + |
+Error code + |
+
The following is an example of an MapReduce job request:
+{
+ "job_name":"MapReduceTest",
+ "job_type":"MapReduce",
+ "arguments":[
+ "obs://obs-test/program/hadoop-mapreduce-examples-x.x.x.jar",
+ "wordcount",
+ "obs://obs-test/input/",
+ "obs://obs-test/job/mapreduce/output"
+ ],
+ "properties":{
+ "fs.obs.endpoint":"obs endpoint",
+ "fs.obs.access.key":"xxx",
+ "fs.obs.secret.key":"yyy"
+ }
+}
+The following is an example of a SparkSubmit job request:
+{
+ "job_name":"SparkSubmitTest",
+ "job_type":"SparkSubmit",
+ "arguments":[
+ "--master",
+ "yarn",
+ "--deploy-mode",
+ "cluster",
+ "--py-files",
+ "obs://obs-test/a.py",
+ "--conf",
+ "spark.yarn.appMasterEnv.PYTHONPATH=/tmp:$PYTHONPATH",
+ "--conf",
+ "spark.yarn.appMasterEnv.aaa=aaaa",
+ "--conf",
+ "spark.executorEnv.aaa=executoraaa",
+ "--properties-file",
+ "obs://obs-test/test-spark.conf",
+ "obs://obs-test/pi.py",
+ "100000"
+ ],
+ "properties":{
+ "fs.obs.access.key":"xxx",
+ "fs.obs.secret.key":"yyy"
+ }
+}
+The following is an example of a HiveScript job request:
+{
+ "job_name":"HiveScriptTest",
+ "job_type":"HiveScript",
+ "arguments":[
+ "obs://obs-test/sql/test_script.sql"
+ ],
+ "properties":{
+ "fs.obs.endpoint":"obs endpoint",
+ "fs.obs.access.key":"xxx",
+ "fs.obs.secret.key":"yyy"
+ }
+}
+The following is an example of a HiveSQL job request:
+{
+ "job_name":"HiveSqlTest",
+ "job_type":"HiveSql",
+ "arguments":[
+ "DROP TABLE IF EXISTS src_wordcount;create external table src_wordcount(line string);insert into src_wordcount values('v1')"
+ ],
+ "properties":{
+ "fs.obs.endpoint":"obs endpoint",
+ "fs.obs.access.key":"xxx",
+ "fs.obs.secret.key":"yyy"
+ }
+}
+The following is an example of a DistCp job request:
+{
+ "job_name":"DistCpTest",
+ "job_type":"DistCp",
+ "arguments":[
+ "obs://obs-test/DistcpJob/",
+ "/user/test/sparksql/"
+ ],
+ "properties":{
+ "fs.obs.endpoint":"obs endpoint",
+ "fs.obs.access.key":"xxx",
+ "fs.obs.secret.key":"yyy"
+ }
+}
+The following is an example of a SparkScript job request:
+{
+ "job_name":"SparkScriptTest",
+ "job_type":"SparkScript",
+ "arguments":[
+ "op-key1",
+ "op-value1",
+ "op-key2",
+ "op-value2",
+ "obs://obs-test/sql/test_script.sql"
+ ],
+ "properties":{
+ "fs.obs.access.key":"xxx",
+ "fs.obs.secret.key":"yyy"
+ }
+}
+The following is an example of a SparkSQL job request:
+{
+ "job_name":"SparkSqlTest",
+ "job_type":"SparkSql",
+ "arguments":[
+ "op-key1",
+ "op-value1",
+ "op-key2",
+ "op-value2",
+ "create table student_info3 (id string,name string,gender string,age int,addr string);"
+ ],
+ "properties":{
+ "fs.obs.access.key":"xxx",
+ "fs.obs.secret.key":"yyy"
+ }
+}
+The following is an example of a Flink job request:
+{
+ "job_name":"FlinkTest",
+ "job_type":"Flink",
+ "arguments":[
+ "run",
+ "-d",
+ "-ynm",
+ "testExcutorejobhdfsbatch",
+ "-m",
+ "yarn-cluster",
+ "hdfs://test/examples/batch/WordCount.jar"
+ ],
+ "properties":{
+ "fs.obs.endpoint":"obs endpoint",
+ "fs.obs.access.key":"xxx",
+ "fs.obs.secret.key":"yyy"
+ }
+}
+{
+ "job_submit_result":{
+ "job_id":"44b37a20-ffe8-42b1-b42b-78a5978d7e40",
+ "state":"COMPLETE"
+ }
+}
+{
+"error_msg": Hive jobs cannot be submitted.
+"error_code":"0168"
+}
+For details about status codes, see Status Codes.
+This API is used to query information about a specified job in an MRS cluster.
+GET /v2/{project_id}/clusters/{cluster_id}/job-executions/{job_execution_id}
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
cluster_id + |
+Yes + |
+Cluster ID. For details on how to obtain the cluster ID, see Obtaining a Cluster ID. + |
+
job_execution_id + |
+Yes + |
+Job ID. For details on how to obtain the job ID, see Obtaining a Job ID. + |
+
Request parameters
+None.
+Parameter + |
+Type + |
+Description + |
+
|---|---|---|
job_detail + |
+Object + |
+Job details. For details about the parameter, see Table 3. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
job_id + |
+String + |
+Job ID. + |
+
user + |
+String + |
+Name of the user who submits a job. + |
+
job_name + |
+String + |
+Job name. It contains 1 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. + |
+
job_result + |
+String + |
+Final result of a job. +
|
+
job_state + |
+String + |
+Execution status of a job. +
|
+
job_progress + |
+Float + |
+Job execution progress. + |
+
job_type + |
+String + |
+Type of a job. +
|
+
started_time + |
+Long + |
+Start time to run a job. Unit: ms. + |
+
submitted_time + |
+Long + |
+Time when a job is submitted. Unit: ms. + |
+
finished_time + |
+Long + |
+End time to run a job. Unit: ms. + |
+
elapsed_time + |
+Long + |
+Running duration of a job. Unit: ms. + |
+
arguments + |
+Array + |
+Running parameter. The parameter contains a maximum of 4,096 characters, excluding special characters such as ;|&>'<$, and can be left blank. + |
+
properties + |
+Object + |
+Configuration parameter, which is used to configure -d parameters. The parameter contains a maximum of 2,048 characters, excluding special characters such as ><|'`&!\, and can be left blank. + |
+
launcher_id + |
+String + |
+Launcher job ID. + |
+
app_id + |
+String + |
+Actual job ID. + |
+
{
+ "job_detail": {
+ "job_id": "431b135e-c090-489f-b1db-0abe3822b855",
+ "user": "xxxx",
+ "job_name": "pyspark1",
+ "job_result": "SUCCEEDED",
+ "job_state": "FINISHED",
+ "job_progress": 100,
+ "job_type": "SparkSubmit",
+ "started_time": 1564626578817,
+ "submitted_time": 1564626561541,
+ "finished_time": 1564626664930,
+ "elapsed_time": 86113,
+ "queue": "default",
+ "arguments": "[--class, org.apache.spark.examples.SparkPi, --driver-memory, 512MB, --num-executors, 1, --executor-cores, 1, --master, yarn-cluster, obs://obs-test/jobs/spark/spark-examples_2.11-2.1.0.jar, 10000]",
+ "launcher_id": "application_1564622673393_0006",
+ "app_id": "application_1564622673393_0007",
+ "properties": "{}"
+ }
+}
+{
+"error_msg": "Failed to query the job."
+"error_code":"0162"
+}
+For details about status codes, see Status Codes.
+This API is used to query the job list in an MRS cluster.
+Name + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
cluster_id + |
+Yes + |
+Cluster ID. For details on how to obtain the cluster ID, see Obtaining a Cluster ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
job_name + |
+No + |
+String + |
+Job name. It contains 1 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. + |
+
job_type + |
+No + |
+String + |
+Type of a job. +
|
+
job_state + |
+No + |
+String + |
+Execution status of a job. +
|
+
job_result + |
+No + |
+String + |
+Execution result of a job. +
|
+
limit + |
+No + |
+Integer + |
+Number of records displayed on each page in the returned result. The default value is 10. + |
+
offset + |
+No + |
+Integer + |
+Offset. +The default offset from which the job list starts to be queried is 1. + |
+
sort_by + |
+No + |
+String + |
+Ranking mode of returned results. The default value is desc. +
|
+
submitted_time_begin + |
+No + |
+TimeStamp + |
+UTC timestamp after which a job is submitted, in milliseconds. For example, 1562032041362. + |
+
submitted_time_end + |
+No + |
+TimeStamp + |
+UTC timestamp before which a job is submitted, in milliseconds. For example, 1562032041362. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
total_record + |
+Integer + |
+Total number of jobs + |
+
job_list + |
+Array + |
+Job list. For details about the parameter, see Table 4. + |
+
Parameter + |
+Type + |
+Description + |
+
|---|---|---|
job_id + |
+String + |
+Job ID + |
+
user + |
+String + |
+Name of the user who submits a job. + |
+
job_name + |
+String + |
+Job name. It contains 1 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. + |
+
job_result + |
+String + |
+Final result of a job. +
|
+
job_state + |
+String + |
+Execution status of a job. +
|
+
job_progress + |
+Float + |
+Job execution progress. + |
+
job_type + |
+String + |
+Type of a job. +
|
+
started_time + |
+Long + |
+Start time to run a job. Unit: milliseconds + |
+
submitted_time + |
+Long + |
+Time when a job is submitted. Unit: milliseconds + |
+
finished_time + |
+Long + |
+End time to run a job. Unit: milliseconds + |
+
elapsed_time + |
+Long + |
+Running duration of a job. Unit: milliseconds + |
+
arguments + |
+Array + |
+Run parameters. The parameter contains a maximum of 4,096 characters, excluding special characters such as ;|&>'<$, and can be left blank. + |
+
properties + |
+Object + |
+Configuration parameter, which is used to configure -d parameters. The parameter contains a maximum of 2,048 characters, excluding special characters such as ><|'`&!\, and can be left blank. + |
+
launcher_id + |
+String + |
+Launcher job ID. + |
+
app_id + |
+String + |
+Actual job ID. + |
+
{
+ "total_record": 2,
+ "job_list": [{
+ "job_id": "981374c1-85da-44ee-be32-edfb4fba776c",
+ "user": "xxxx",
+ "job_name": "SparkSubmitTset",
+ "job_result": "UNDEFINED",
+ "job_state": "ACCEPTED",
+ "job_progress": 0,
+ "job_type": "SparkSubmit",
+ "started_time": 0,
+ "submitted_time": 1564714763119,
+ "finished_time": 0,
+ "elapsed_time": 0,
+ "queue": "default",
+ "arguments": "[--class, --driver-memory, --executor-cores, --master, yarn-cluster, obs://obs-test/hadoop-mapreduce-examples-3.1.1.jar, dddd]",
+ "launcher_id": "application_1564622673393_0613",
+ "properties": "{}"
+ },
+ {
+ "job_id": "c54c8aa0-c277-4f83-8acc-521d85cfa32b",
+ "user": "xxxx",
+ "job_name": "SparkSubmitTset2",
+ "job_result": "UNDEFINED",
+ "job_state": "ACCEPTED",
+ "job_progress": 0,
+ "job_type": "SparkSubmit",
+ "started_time": 0,
+ "submitted_time": 1564714020099,
+ "finished_time": 0,
+ "elapsed_time": 0,
+ "queue": "default",
+ "arguments": "[--conf, yujjsjhe, --driver-memory, yueujdjjd, --master, yarn-cluster, obs://obs-test/hadoop-mapreduce-examples-3.1.1.jar]",
+ "launcher_id": "application_1564622673393_0611",
+ "properties": "{}"
+ }
+ ]
+}
+{
+"error_msg": "Failed to query the job list."
+"error_code":"0166"
+}
+For details about status codes, see Status Codes.
+This API is used to terminate a specified job in an MRS cluster.
+POST /v2/{project_id}/clusters/{cluster_id}/job-executions/{job_execution_id}/kill
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
cluster_id + |
+Yes + |
+Cluster ID. For details on how to obtain the cluster ID, see Obtaining a Cluster ID. + |
+
job_execution_id + |
+Yes + |
+Job ID. For details on how to obtain the job ID, see Obtaining a Job ID. + |
+
Request parameters
+None
+Response parameters
+None
+Table 2 describes status codes.
+ +Status Code + |
+Description + |
+
|---|---|
202 + |
+The job termination request has been accepted. Please wait. + |
+
For details about status codes, see Status Codes.
+This API is used to delete APIs in batches.
+POST /v2/{project_id}/clusters/{cluster_id}/job-executions/batch-delete
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
cluster_id + |
+Yes + |
+Cluster ID. For details on how to obtain the cluster ID, see Obtaining a Cluster ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
job_id_list + |
+Yes + |
+Array + |
+List of job IDs. For details on how to obtain the list of job IDs, see Obtaining a Job ID. + |
+
Response parameters
+None
+For details about status codes, see Status Codes.
+This API is used to obtain results returned after the SQL statements for querying SparkSQL and SparkScript jobs in an MRS cluster are executed.
+GET /v2/{project_id}/clusters/{cluster_id}/job-executions/{job_execution_id}/sql-result
+Parameter + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
cluster_id + |
+Yes + |
+Cluster ID. For details on how to obtain the cluster ID, see Obtaining a Cluster ID. + |
+
job_execution_id + |
+Yes + |
+Job ID. For details on how to obtain the job ID, see Obtaining a Job ID. + |
+
Request parameters
+None
+Parameter + |
+Type + |
+Description + |
+
|---|---|---|
sql-results + |
+Object + |
+SQL statement query result. + |
+
{
+ "job_name": "111",
+ "job_type": "SparkSql",
+ "arguments": [
+ "create table src_wordcount (id int,name string);
+ show tables;
+ insert INTO src_wordcount VALUES (1, 'a');
+ insert INTO src_wordcount VALUES (2, 'b');SELECT * FROM src_wordcount;"
+ ],
+ "properties": {}
+}
+{
+ "sql_results": {
+ "0": [{
+ "result": "succeed"
+ }],
+ "1": [{
+ "database": "default",
+ "isTemporary": "false",
+ "tableName": "src_wordcount"
+ }],
+ "2": [{
+ "result": "succeed"
+ }],
+ "3": [{
+ "result": "succeed"
+ }],
+ "4": [{
+ "name": "a",
+ "id": "1"
+ }, {
+ "name": "b",
+ "id": "2"
+ }]
+ }
+}
+{
+"error_msg": "Failed to collect SQL job results."
+"error_code":"0172"
+}
+For details about status codes, see Status Codes.
+A cluster ID (cluster_id) is required for some URLs when an API is called. To obtain a cluster ID, perform the following operations:
+A job ID (job_execution_id) is required for some URLs when an API is called. To obtain a job ID, perform the following operations:
+This API is used to create an MRS cluster.
+Before using the API, you need to obtain the resources listed in Table 1.
+ +Resource + |
+How to Obtain + |
+
|---|---|
VPC + |
+See operation instructions in VPC > Querying VPCs and VPC > Creating a VPC in the VPC API Reference. + |
+
Subnet + |
+See operation instructions in Subnet > Querying Subnets and Subnet > Creating a Subnet in the VPC API Reference. + |
+
Key Pair + |
+See operation instructions in ECS SSH Key Management > Querying SSH Key Pairs and ECS SSH Key Management > Creating and Importing an SSH Key Pair in the ECS API Reference. + |
+
Zone + |
+Obtain the region and AZ information. For more information about regions and AZs, see Regions and Endpoints. + |
+
Version + |
+Currently, MRS 1.6.3, MRS 1.7.2, MRS 1.9.2 MRS 2.1.0, MRS 3.1.0-LTS.1 and MRS 3.1.2-LTS.3 are supported. + |
+
Component + |
+
|
+
Name + |
+Mandatory + |
+Description + |
+
|---|---|---|
project_id + |
+Yes + |
+Project ID. For details on how to obtain the project ID, see Obtaining a Project ID. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
cluster_version + |
+Yes + |
+String + |
+Cluster version. +Possible values are as follows: +
|
+
cluster_name + |
+Yes + |
+String + |
+Cluster name. It must be unique. +A cluster name can contain only 2 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. + |
+
cluster_type + |
+Yes + |
+String + |
+Cluster type. The options are as follows: +
|
+
charge_info + |
+No + |
+ChargeInfo + |
+Charging type information. For details, see Table 6. + |
+
region + |
+Yes + |
+String + |
+Region of the cluster. For details, see Regions and Endpoints. + |
+
vpc_name + |
+Yes + |
+String + |
+Name of the VPC where the subnet locates +Perform the following operations to obtain the VPC name from the VPC management console: +
On the Virtual Private Cloud page, obtain the VPC name from the list. + |
+
subnet_name + |
+Yes + |
+String + |
+Subnet name. +Perform the following operations to obtain the subnet name from the VPC management console: +
On the Virtual Private Cloud page, obtain the subnet name of the VPC from the list. + |
+
components + |
+Yes + |
+String + |
+List of component names, which are separated by commas (,). For details about the component names, see the component list of each version in Table 4-1. + |
+
availability_zone + |
+Yes + |
+String + |
+Name of an AZ. +AZ information. For details, see Regions and Endpoints. + |
+
security_groups_id + |
+No + |
+String + |
+Security group ID of the cluster +
|
+
safe_mode + |
+Yes + |
+String + |
+Running mode of an MRS cluster +
|
+
manager_admin_password + |
+Yes + |
+String + |
+Password of the MRS Manager administrator. +
|
+
login_mode + |
+Yes + |
+String + |
+Node login mode. +
|
+
node_root_password + |
+No + |
+String + |
+Password of user root for logging in to a cluster node +A password must meet the following requirements: +
|
+
node_keypair_name + |
+No + |
+String + |
+Name of a key pair You can use a key pair to log in to the Master node in the cluster. + |
+
log_collection + |
+No + |
+Integer + |
+Whether to collect logs when cluster creation fails +
The default value is 1, indicating that OBS buckets will be created and only used to collect logs that record MRS cluster creation failures. + |
+
eip_address + |
+No + |
+String + |
+An EIP bound to an MRS cluster can be used to access MRS Manager. The EIP must have been created and must be in the same region as the cluster. + |
+
mrs_ecs_default_agency + |
+No + |
+String + |
+Name of the agency bound to a cluster node by default. The value is fixed to MRS_ECS_DEFAULT_AGENCY. +An agency allows ECS or BMS to manage MRS resources. You can configure an agency of the ECS type to automatically obtain the AK/SK to access OBS. +The MRS_ECS_DEFAULT_AGENCY agency has the OBS OperateAccess permission of OBS and the CES FullAccess (for users who have enabled fine-grained policies), CES Administrator, and KMS Administrator permissions in the region where the cluster is located. + |
+
template_id + |
+No + |
+String + |
+For Custom cluster type, it is used to specify the common node configurations used for deployment. +
|
+
tags + |
+No + |
+Array of Tag + |
+Cluster tag For more parameter description, see Table 4. +A maximum of 10 tags can be added to a cluster. + |
+
node_groups + |
+Yes + |
+Array of NodeGroup + |
+Information about the node groups in the cluster. For details about the parameters, see Table 5. + |
+
bootstrap_scripts + |
+No + |
+Array of BootstrapScript + |
+Bootstrap action script information. For more parameter description, see Table 8. +MRS 1.7.2 or later supports this parameter. + |
+
add_jobs + |
+No + |
+Array of AddJobReq + |
+Jobs can be submitted when a cluster is created. Currently, only one job can be created. For details about job parameters, see Table 9. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
key + |
+Yes + |
+String + |
+Tag key. +
|
+
value + |
+Yes + |
+String + |
+Value. +
|
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
group_name + |
+Yes + |
+String + |
+Node group name. The value can contain a maximum of 64 characters, including uppercase and lowercase letters, arrays, hyphens (-), and underscores (_). The rules for configuring node groups are as follows: +
|
+
node_num + |
+Yes + |
+Integer + |
+Number of nodes. The value ranges from 0 to 500. The maximum number of Core and Task nodes is 500. + |
+
node_size + |
+Yes + |
+String + |
+Instance specifications of a node. for example, c6.4xlarge4.linux.mrs MRS supports host specifications determined by CPU, memory, and disk space. For details about instance specifications, see ECS Specifications Used by MRS. + |
+
root_volume + |
+No + |
+Volume + |
+Specifies the system disk information of the node. This parameter is optional for some VMs or the system disk of the BMS. This parameter is mandatory in other cases. For details about the parameter description, see Table 7. + |
+
data_volume + |
+No + |
+Volume + |
+Data disk information. This parameter is mandatory when data_volume_count is not 0. For details about this parameter, see Table 4-7. + |
+
data_volume_count + |
+No + |
+Integer + |
+Number of data disks of a node. +Value range: 0 to 10 + |
+
charge_info + |
+No + |
+ChargeInfo + |
+Billing type of the node group. The billing types of Master and Core node groups are the same as those of the cluster. The billing type of the Task node group can be different from that of the cluster. + |
+
auto_scaling_policy + |
+No + |
+AutoScalingPolicy + |
+Autoscaling rule corresponding to the node group. For details about the parameters, see Table 10. + |
+
assigned_roles + |
+No + |
+Array of String + |
+When the cluster type is CUSTOM, this parameter is mandatory. You can specify the roles deployed in the node group. This parameter is a string array. Each string represents a role expression. +Role expression definition: +
For details about available roles, see Roles and components supported by MRS11. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
charge_mode + |
+Yes + |
+String + |
+Billing mode +The value of this parameter can be: +
|
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
type + |
+Yes + |
+String + |
+Disk Type +The following disk types are supported: +
|
+
size + |
+Yes + |
+Integer + |
+Specifies the data disk size, in GB. The value range is 10 to 32768. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
name + |
+Yes + |
+String + |
+Name of a bootstrap action script. It must be unique in a cluster. +The value can contain only digits, letters, spaces, hyphens (-), and underscores (_) and must not start with a space. +The value can contain 1 to 64 characters. + |
+
uri + |
+Yes + |
+String + |
+Path of a bootstrap action script. Set this parameter to an OBS bucket path or a local VM path. +
|
+
parameters + |
+No + |
+String + |
+Bootstrap action script parameters. + |
+
nodes + |
+Yes + |
+Array String + |
+Type of a node where the bootstrap action script is executed. The value can be Master, Core, or Task. + |
+
active_master + |
+No + |
+Boolean + |
+Whether the bootstrap action script runs only on active Master nodes. +The default value is false, indicating that the bootstrap action script can run on all Master nodes. + |
+
before_component_start + |
+No + |
+Boolean + |
+Time when the bootstrap action script is executed. Currently, the following two options are available: Before component start and After component start +The default value is false, indicating that the bootstrap action script is executed after the component is started. + |
+
fail_action + |
+Yes + |
+String + |
+Whether to continue executing subsequent scripts and creating a cluster after the bootstrap action script fails to be executed. +
The default value is errorout, indicating that the action is stopped.
+ NOTE:
+You are advised to set this parameter to continue in the commissioning phase so that the cluster can continue to be installed and started no matter whether the bootstrap action is successful. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
job_type + |
+Yes + |
+Integer + |
+Job type code +
|
+
job_name + |
+Yes + |
+String + |
+Job name. It contains 1 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. + NOTE:
+Identical job names are allowed but not recommended. + |
+
jar_path + |
+No + |
+String + |
+Path of the JAR or SQL file for program execution. The parameter must meet the following requirements: +
|
+
arguments + |
+No + |
+String + |
+Key parameter for program execution. The parameter is specified by the function of the user's program. MRS is only responsible for loading the parameter. +The parameter contains a maximum of 2,047 characters, excluding special characters such as ;|&>'<$, and can be left blank. + |
+
input + |
+No + |
+String + |
+Address for inputting data +Files can be stored in HDFS or OBS. The path varies depending on the file system.
+
The parameter contains a maximum of 1,023 characters, excluding special characters such as ;|&>'<$, and can be left blank. + |
+
output + |
+No + |
+String + |
+Address for outputting data +Files can be stored in HDFS or OBS. The path varies depending on the file system.
+
If the specified path does not exist, the system will automatically create it. +The parameter contains a maximum of 1,023 characters, excluding special characters such as ;|&>'<$, and can be left blank. + |
+
job_log + |
+No + |
+String + |
+Path for storing job logs that record job running status. +Files can be stored in HDFS or OBS. The path varies depending on the file system.
+
The parameter contains a maximum of 1,023 characters, excluding special characters such as ;|&>'<$, and can be left blank. + |
+
shutdown_cluster + |
+No + |
+Bool + |
+Whether to delete the cluster after the job execution is complete +
|
+
file_action + |
+No + |
+String + |
+Data import and export +
|
+
submit_job_once_cluster_run + |
+Yes + |
+Bool + |
+
Set this parameter to true in this example. + |
+
hql + |
+No + |
+String + |
+HiveQL statement + |
+
hive_script_path + |
+Yes + |
+String + |
+SQL program path. This parameter is needed by Spark Script and Hive Script jobs only, and must meet the following requirements: +
|
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
auto_scaling_enable + |
+Yes + |
+Boolean + |
+Whether to enable the auto scaling rule. + |
+
min_capacity + |
+Yes + |
+Integer + |
+Minimum number of nodes left in the node group. +Value range: 0 to 500 + |
+
max_capacity + |
+Yes + |
+Integer + |
+Maximum number of nodes in the node group. +Value range: 0 to 500 + |
+
resources_plans + |
+No + |
+List + |
+Resource plan list. For details, see Table 11. If this parameter is left blank, the resource plan is disabled. +When auto scaling is enabled, either a resource plan or an auto scaling rule must be configured. +MRS 1.6.3 or later supports this parameter. + |
+
exec_scripts + |
+No + |
+List + |
+List of custom scaling automation scripts. For details, see Table 12. If this parameter is left blank, a hook script is disabled. +MRS 1.7.2 or later supports this parameter. + |
+
rules + |
+No + |
+List + |
+List of auto scaling rules. For details, see Table 13. +When auto scaling is enabled, either a resource plan or an auto scaling rule must be configured. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
period_type + |
+Yes + |
+String + |
+Cycle type of a resource plan. Currently, only the following cycle type is supported: +
|
+
start_time + |
+Yes + |
+String + |
+Start time of a resource plan. The value is in the format of hour:minute, indicating that the time ranges from 0:00 to 23:59. + |
+
end_time + |
+Yes + |
+String + |
+End time of a resource plan. The value is in the same format as that of start_time. The interval between end_time and start_time must be greater than or equal to 30 minutes. + |
+
min_capacity + |
+Yes + |
+Integer + |
+Minimum number of the preserved nodes in a node group in a resource plan. +Value range: 0 to 500 + |
+
max_capacity + |
+Yes + |
+Integer + |
+Maximum number of the preserved nodes in a node group in a resource plan. +Value range: 0 to 500 + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
name + |
+Yes + |
+String + |
+Name of a custom automation script. It must be unique in a same cluster. +The value can contain only digits, letters, spaces, hyphens (-), and underscores (_) and must not start with a space. +The value can contain 1 to 64 characters. + |
+
uri + |
+Yes + |
+String + |
+Path of a custom automation script. Set this parameter to an OBS bucket path or a local VM path. +
|
+
parameters + |
+No + |
+String + |
+Parameters of a custom automation script. +
|
+
nodes + |
+Yes + |
+List<String> + |
+Type of a node where the custom automation script is executed. The node type can be Master, Core, or Task. + |
+
active_master + |
+No + |
+Boolean + |
+Whether the custom automation script runs only on the active Master node. +The default value is false, indicating that the custom automation script can run on all Master nodes. + |
+
action_stage + |
+Yes + |
+String + |
+Time when a script is executed. +The following four options are supported: +
|
+
fail_action + |
+Yes + |
+String + |
+Whether to continue to execute subsequent scripts and create a cluster after the custom automation script fails to be executed. +
|
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
name + |
+Yes + |
+String + |
+Name of an auto scaling rule. +A cluster name can contain only 1 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. +Rule names must be unique in a node group. + |
+
description + |
+No + |
+String + |
+Description about an auto scaling rule. +It contains a maximum of 1,024 characters. + |
+
adjustment_type + |
+Yes + |
+String + |
+Auto scaling rule adjustment type. The options are as follows: +
|
+
cool_down_minutes + |
+Yes + |
+Integer + |
+Cluster cooling time after an auto scaling rule is triggered, when no auto scaling operation is performed. The unit is minute. +Value range: 0 to 10,080. One week is equal to 10,080 minutes. + |
+
scaling_adjustment + |
+Yes + |
+Integer + |
+Number of nodes that can be adjusted once. +Value range: 1 to 100 + |
+
trigger + |
+Yes + |
+Trigger + |
+Condition for triggering a rule. For details, see Table 14. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Description + |
+
|---|---|---|---|
metric_name + |
+Yes + |
+String + |
+Metric name. +This triggering condition makes a judgment according to the value of the metric. +A metric name contains a maximum of 64 characters. +Table 15 lists the supported metric names. + |
+
metric_value + |
+Yes + |
+String + |
+Metric threshold to trigger a rule +The parameter value must be an integer or number with two decimal places only. Table 15 provides value types and ranges corresponding to metric_name. + |
+
comparison_operator + |
+No + |
+String + |
+Metric judgment logic operator. The options are as follows: +
|
+
evaluation_periods + |
+Yes + |
+Integer + |
+Number of consecutive five-minute periods, during which a metric threshold is reached +Value range: 1 to 288 + |
+
Cluster Type + |
+Metric + |
+Value Type + |
+Description + |
+
|---|---|---|---|
Streaming cluster + |
+StormSlotAvailable + |
+Integer + |
+Number of available Storm slots. +Value range: 0 to 2147483646. + |
+
StormSlotAvailablePercentage + |
+Percentage + |
+Percentage of available Storm slots, that is, the proportion of the available slots to total slots. +Value range: 0 to 100. + |
+|
StormSlotUsed + |
+Integer + |
+Number of the used Storm slots. +Value range: 0 to 2147483646. + |
+|
StormSlotUsedPercentage + |
+Percentage + |
+Percentage of the used Storm slots, that is, the proportion of the used slots to total slots. +Value range: 0 to 100. + |
+|
StormSupervisorMemAverageUsage + |
+Integer + |
+Average memory usage of the Supervisor process of Storm. +Value range: 0 to 2147483646. + |
+|
StormSupervisorMemAverageUsagePercentage + |
+Percentage + |
+Average percentage of the used memory of the Supervisor process of Storm to the total memory of the system. +Value range: 0 to 100. + |
+|
StormSupervisorCPUAverageUsagePercentage + |
+Percentage + |
+Average percentage of the used CPUs of the Supervisor process of Storm to the total CPUs. +Value range: 0 to 6000. + |
+|
Analysis cluster + |
+YARNAppPending + |
+Integer + |
+Number of pending tasks on Yarn. +Value range: 0 to 2147483646. + |
+
YARNAppPendingRatio + |
+Ratio + |
+Ratio of pending tasks on Yarn, that is, the ratio of pending tasks to running tasks on Yarn. +Value range: 0 to 2147483646. + |
+|
YARNAppRunning + |
+Integer + |
+Number of running tasks on Yarn. +Value range: 0 to 2147483646. + |
+|
YARNContainerAllocated + |
+Integer + |
+Number of containers allocated to Yarn. +Value range: 0 to 2147483646. + |
+|
YARNContainerPending + |
+Integer + |
+Number of pending containers on Yarn. +Value range: 0 to 2147483646. + |
+|
YARNContainerPendingRatio + |
+Ratio + |
+Ratio of pending containers on Yarn, that is, the ratio of pending containers to running containers on Yarn. +Value range: 0 to 2147483646. + |
+|
YARNCPUAllocated + |
+Integer + |
+Number of virtual CPUs (vCPUs) allocated to Yarn +Value range: 0 to 2147483646. + |
+|
YARNCPUAvailable + |
+Integer + |
+Number of available vCPUs on Yarn. +Value range: 0 to 2147483646. + |
+|
YARNCPUAvailablePercentage + |
+Percentage + |
+Percentage of available vCPUs on Yarn, that is, the proportion of available vCPUs to total vCPUs. +Value range: 0 to 100. + |
+|
YARNCPUPending + + |
+Integer + |
+Number of pending vCPUs on Yarn. +Value range: 0 to 2147483646. + |
+|
YARNMemoryAllocated + |
+Integer + |
+Memory allocated to Yarn. The unit is MB. +Value range: 0 to 2147483646. + |
+|
YARNMemoryAvailable + |
+Integer + |
+Available memory on Yarn. The unit is MB. +Value range: 0 to 2147483646. + |
+|
YARNMemoryAvailablePercentage + |
+Percentage + |
+Percentage of available memory on Yarn, that is, the proportion of available memory to total memory on Yarn. +Value range: 0 to 100. + |
+|
YARNMemoryPending + |
+Integer + |
+Pending memory on Yarn. +Value range: 0 to 2147483646. + |
+
When the value type is percentage or ratio in Table 15, the valid value can be accurate to percentile. The percentage metric value is a decimal value with a percent sign (%) removed. For example, 16.80 represents 16.80%.
+Parameter + |
+Type + |
+Description + |
+
|---|---|---|
cluster_id + |
+String + |
+Cluster ID, which is returned by the system after the cluster is created. + |
+
{
+ "cluster_version": "MRS 3.X.X",
+ "cluster_name": "mrs_DyJA_dm",
+ "cluster_type": "ANALYSIS",
+ "charge_info": {
+ "charge_mode": "postPaid"
+ },
+ "region": "",
+ "availability_zone": "",
+ "vpc_name": "vpc-37cd",
+ "subnet_name": "subnet-ed99",
+ "components": "Hadoop,Spark2x,HBase,Hive,Hue,Loader,Flink,Oozie,Ranger,Tez",
+ "safe_mode": "KERBEROS",
+ "manager_admin_password": "Mrs@1234",
+ "login_mode": "PASSWORD",
+ "node_root_password": "Mrs@1234",
+ "log_collection": 1,
+ "mrs_ecs_default_agency": "MRS_ECS_DEFAULT_AGENCY",
+ "tags": [
+ {
+ "key": "tag1",
+ "value": "111"
+ },
+ {
+ "key": "tag2",
+ "value": "222"
+ }
+ ],
+ "node_groups": [
+ {
+ "group_name": "master_node_default_group",
+ "node_num": 2,
+ "node_size": "rc3.4xlarge.4.linux.bigdata",
+ "root_volume": {
+ "type": "SAS",
+ "size": 100
+ },
+ "data_volume": {
+ "type": "SAS",
+ "size": 600
+ },
+ "data_volume_count": 1
+ },
+ {
+ "group_name": "core_node_analysis_group",
+ "node_num": 3,
+ "node_size": "rc3.4xlarge.4.linux.bigdata",
+ "root_volume": {
+ "type": "SAS",
+ "size": 100
+ },
+ "data_volume": {
+ "type": "SAS",
+ "size": 600
+ },
+ "data_volume_count": 1
+ },
+ {
+ "group_name": "task_node_analysis_group",
+ "node_num": 3,
+ "node_size": "rc3.4xlarge.4.linux.bigdata",
+ "root_volume": {
+ "type": "SAS",
+ "size": 100
+ },
+ "data_volume": {
+ "type": "SAS",
+ "size": 600
+ },
+ "data_volume_count": 1,
+ "auto_scaling_policy": {
+ "auto_scaling_enable": true,
+ "min_capacity": 0,
+ "max_capacity": 1,
+ "resources_plans": [],
+ "exec_scripts": [],
+ "rules": [
+ {
+ "name": "default-expand-1",
+ "description": "",
+ "adjustment_type": "scale_out",
+ "cool_down_minutes": 5,
+ "scaling_adjustment": "1",
+ "trigger": {
+ "metric_id": 2003,
+ "metric_name": "StormSlotAvailablePercentage",
+ "metric_value": 100,
+ "comparison_operator_id": 2003,
+ "comparison_operator": "LTOE",
+ "evaluation_periods": "1"
+ }
+ }
+ ]
+ }
+ }
+ ]
+}
+{
+ "cluster_version": "MRS 3.X.X",
+ "cluster_name": "mrs_Dokle_dm",
+ "cluster_type": "STREAMING",
+ "charge_info": {
+ "charge_mode": "postPaid"
+ },
+ "region": "",
+ "availability_zone": "",
+ "vpc_name": "vpc-37cd",
+ "subnet_name": "subnet-ed99",
+ "components": "Storm,Kafka,Flume,Ranger",
+ "safe_mode": "KERBEROS",
+ "manager_admin_password": "Mrs@1234",
+ "login_mode": "PASSWORD",
+ "node_root_password": "Mrs@1234",
+ "log_collection": 1,
+ "mrs_ecs_default_agency": "MRS_ECS_DEFAULT_AGENCY",
+ "tags": [
+ {
+ "key": "tag1",
+ "value": "111"
+ },
+ {
+ "key": "tag2",
+ "value": "222"
+ }
+ ],
+ "node_groups": [
+ {
+ "group_name": "master_node_default_group",
+ "node_num": 2,
+ "node_size": "rc3.4xlarge.4.linux.bigdata",
+ "root_volume": {
+ "type": "SAS",
+ "size": 100
+ },
+ "data_volume": {
+ "type": "SAS",
+ "size": 300
+ },
+ "data_volume_count": 1
+ },
+ {
+ "group_name": "core_node_streaming_group",
+ "node_num": 3,
+ "node_size": "rc3.4xlarge.4.linux.bigdata",
+ "root_volume": {
+ "type": "SAS",
+ "size": 100
+ },
+ "data_volume": {
+ "type": "SAS",
+ "size": 300
+ },
+ "data_volume_count": 1,
+ },
+ {
+ "group_name": "task_node_streaming_group",
+ "node_num": 0,
+ "node_size": "rc3.4xlarge.4.linux.bigdata",
+ "root_volume": {
+ "type": "SAS",
+ "size": 100
+ },
+ "data_volume": {
+ "type": "SAS",
+ "size": 300
+ },
+ "data_volume_count": 1,
+ "auto_scaling_policy": {
+ "auto_scaling_enable": true,
+ "min_capacity": 0,
+ "max_capacity": 1,
+ "resources_plans": [],
+ "exec_scripts": [],
+ "rules": [
+ {
+ "name": "default-expand-1",
+ "description": "",
+ "adjustment_type": "scale_out",
+ "cool_down_minutes": 5,
+ "scaling_adjustment": "1",
+ "trigger": {
+ "metric_id": 2003,
+ "metric_name": "StormSlotAvailablePercentage",
+ "metric_value": 100,
+ "comparison_operator_id": 2003,
+ "comparison_operator": "LTOE",
+ "evaluation_periods": "1"
+ }
+ }
+ ]
+ }
+ }
+ ]
+}
+{
+ "cluster_version": "MRS 3.X.X",
+ "cluster_name": "mrs_onmm_dm",
+ "cluster_type": "MIXED",
+ "charge_info": {
+ "charge_mode": "postPaid"
+ },
+ "region": "",
+ "availability_zone": "",
+ "vpc_name": "vpc-37cd",
+ "subnet_name": "subnet-ed99",
+ "components": "Hadoop,Spark2x,HBase,Hive,Hue,Loader,Kafka,Storm,Flume,Flink,Oozie,Ranger,Tez",
+ "safe_mode": "KERBEROS",
+ "manager_admin_password": "Mrs@1234",
+ "login_mode": "PASSWORD",
+ "node_root_password": "Mrs@1234",
+ "log_collection": 1,
+ "mrs_ecs_default_agency": "MRS_ECS_DEFAULT_AGENCY",
+ "tags": [
+ {
+ "key": "tag1",
+ "value": "111"
+ },
+ {
+ "key": "tag2",
+ "value": "222"
+ }
+ ],
+ "node_groups": [
+ {
+ "group_name": "master_node_default_group",
+ "node_num": 2,
+ "node_size": "Sit3.4xlarge.4.linux.bigdata",
+ "root_volume": {
+ "type": "SAS",
+ "size": 100
+ },
+ "data_volume": {
+ "type": "SAS",
+ "size": 300
+ },
+ "data_volume_count": 1
+ },
+ {
+ "group_name": "core_node_streaming_group",
+ "node_num": 3,
+ "node_size": "Sit3.4xlarge.4.linux.bigdata",
+ "root_volume": {
+ "type": "SAS",
+ "size": 100
+ },
+ "data_volume": {
+ "type": "SAS",
+ "size": 300
+ },
+ "data_volume_count": 1
+ },
+ {
+ "group_name": "core_node_analysis_group",
+ "node_num": 3,
+ "node_size": "Sit3.4xlarge.4.linux.bigdata",
+ "root_volume": {
+ "type": "SAS",
+ "size": 100
+ },
+ "data_volume": {
+ "type": "SAS",
+ "size": 300
+ },
+ "data_volume_count": 1,
+ },
+ {
+ "group_name": "task_node_analysis_group",
+ "node_num": 1,
+ "node_size": "Sit3.4xlarge.4.linux.bigdata",
+ "root_volume": {
+ "type": "SAS",
+ "size": 100
+ },
+ "data_volume": {
+ "type": "SAS",
+ "size": 300
+ },
+ "data_volume_count": 1
+ },
+ {
+ "group_name": "task_node_streaming_group",
+ "node_num": 0,
+ "node_size": "Sit3.4xlarge.4.linux.bigdata",
+ "root_volume": {
+ "type": "SAS",
+ "size": 100
+ },
+ "data_volume": {
+ "type": "SAS",
+ "size": 300
+ },
+ "data_volume_count": 1
+ }
+ ]
+}
+{
+ "cluster_version": "MRS 3.X.X",
+ "cluster_name": "mrs_heshe_dm",
+ "cluster_type": "CUSTOM",
+ "charge_info": {
+ "charge_mode": "postPaid"
+ },
+ "region": "",
+ "availability_zone": "",
+ "vpc_name": "vpc-37cd",
+ "subnet_name": "subnet-ed99",
+ "components": "Hadoop,Spark2x,HBase,Hive,Hue,Loader,Kafka,Storm,Flume,Flink,Oozie,Ranger,Tez",
+ "safe_mode": "KERBEROS",
+ "manager_admin_password": "Mrs@1234",
+ "login_mode": "PASSWORD",
+ "node_root_password": "Mrs@1234",
+ "mrs_ecs_default_agency": "MRS_ECS_DEFAULT_AGENCY",
+ "template_id": "mgmt_control_combined_v2",
+ "log_collection": 1,
+ "tags": [
+ {
+ "key": "tag1",
+ "value": "111"
+ },
+ {
+ "key": "tag2",
+ "value": "222"
+ }
+ ],
+ "node_groups": [
+ {
+ "group_name": "master_node_default_group",
+ "node_num": 3,
+ "node_size": "Sit3.4xlarge.4.linux.bigdata",
+ "root_volume": {
+ "type": "SAS",
+ "size": 100
+ },
+ "data_volume": {
+ "type": "SAS",
+ "size": 300
+ },
+ "data_volume_count": 1,
+ "assigned_roles": [
+ "OMSServer:1,2",
+ "SlapdServer:1,2",
+ "KerberosServer:1,2",
+ "KerberosAdmin:1,2",
+ "quorumpeer:1,2,3",
+ "NameNode:2,3",
+ "Zkfc:2,3",
+ "JournalNode:1,2,3",
+ "ResourceManager:2,3",
+ "JobHistoryServer:2,3",
+ "DBServer:1,3",
+ "Hue:1,3",
+ "LoaderServer:1,3",
+ "MetaStore:1,2,3",
+ "WebHCat:1,2,3",
+ "HiveServer:1,2,3",
+ "HMaster:2,3",
+ "MonitorServer:1,2",
+ "Nimbus:1,2",
+ "UI:1,2",
+ "JDBCServer2x:1,2,3",
+ "JobHistory2x:2,3",
+ "SparkResource2x:1,2,3",
+ "oozie:2,3",
+ "LoadBalancer:2,3",
+ "TezUI:1,3",
+ "TimelineServer:3",
+ "RangerAdmin:1,2",
+ "UserSync:2",
+ "TagSync:2",
+ "KerberosClient",
+ "SlapdClient",
+ "meta",
+ "HSConsole:2,3",
+ "FlinkResource:1,2,3",
+ "DataNode:1,2,3",
+ "NodeManager:1,2,3",
+ "IndexServer2x:1,2",
+ "ThriftServer:1,2,3",
+ "RegionServer:1,2,3",
+ "ThriftServer1:1,2,3",
+ "RESTServer:1,2,3",
+ "Broker:1,2,3",
+ "Supervisor:1,2,3",
+ "Logviewer:1,2,3",
+ "Flume:1,2,3",
+ "HSBroker:1,2,3"
+]
+ },
+ {
+ "group_name": "node_group_1",
+ "node_num": 3,
+ "node_size": "Sit3.4xlarge.4.linux.bigdata",
+ "root_volume": {
+ "type": "SAS",
+ "size": 100
+ },
+ "data_volume": {
+ "type": "SAS",
+ "size": 300
+ },
+ "data_volume_count": 1,
+ "assigned_roles": [
+ "DataNode",
+ "NodeManager",
+ "RegionServer",
+ "Flume:1",
+ "Broker",
+ "Supervisor",
+ "Logviewer",
+ "HBaseIndexer",
+ "KerberosClient",
+ "SlapdClient",
+ "meta",
+ "HSBroker:1,2",
+ "ThriftServer",
+ "ThriftServer1",
+ "RESTServer",
+ "FlinkResource"]
+ },
+ {
+ "group_name": "node_group_2",
+ "node_num": 1,
+ "node_size": "Sit3.4xlarge.4.linux.bigdata",
+ "root_volume": {
+ "type": "SAS",
+ "size": 100
+ },
+ "data_volume": {
+ "type": "SAS",
+ "size": 300
+ },
+ "data_volume_count": 1,
+ "assigned_roles": [
+ "NodeManager",
+ "KerberosClient",
+ "SlapdClient",
+ "meta",
+ "FlinkResource"]
+ }
+ ]
+}
+{
+ "cluster_version": "MRS 3.X.X",
+ "cluster_name": "mrs_jdRU_dm01",
+ "cluster_type": "CUSTOM",
+ "charge_info": {
+ "charge_mode": "postPaid"
+ },
+ "region": "",
+ "availability_zone": "",
+ "vpc_name": "vpc-37cd",
+ "subnet_name": "subnet-ed99",
+ "components": "Hadoop,Spark2x,HBase,Hive,Hue,Loader,Kafka,Storm,Flume,Flink,Oozie,Ranger,Tez",
+ "safe_mode": "KERBEROS",
+ "manager_admin_password": "Mrs@1234",
+ "login_mode": "PASSWORD",
+ "node_root_password": "Mrs@1234",
+ "mrs_ecs_default_agency": "MRS_ECS_DEFAULT_AGENCY",
+ "log_collection": 1,
+ "template_id": "mgmt_control_separated_v2",
+ "tags": [
+ {
+ "key": "aaa",
+ "value": "111"
+ },
+ {
+ "key": "bbb",
+ "value": "222"
+ }
+ ],
+ "node_groups": [
+ {
+ "group_name": "master_node_default_group",
+ "node_num": 5,
+ "node_size": "rc3.4xlarge.4.linux.bigdata",
+ "root_volume": {
+ "type": "SAS",
+ "size": 100
+ },
+ "data_volume": {
+ "type": "SAS",
+ "size": 300
+ },
+ "data_volume_count": 1,
+ "assigned_roles": [
+ "OMSServer:1,2",
+ "SlapdServer:3,4",
+ "KerberosServer:3,4",
+ "KerberosAdmin:3,4",
+ "quorumpeer:3,4,5",
+ "NameNode:4,5",
+ "Zkfc:4,5",
+ "JournalNode:1,2,3,4,5",
+ "ResourceManager:4,5",
+ "JobHistoryServer:4,5",
+ "DBServer:3,5",
+ "Hue:1,2",
+ "LoaderServer:1,2",
+ "MetaStore:1,2,3,4,5",
+ "WebHCat:1,2,3,4,5",
+ "HiveServer:1,2,3,4,5",
+ "HMaster:4,5",
+ "MonitorServer:1,2",
+ "Nimbus:1,2",
+ "UI:1,2",
+ "JDBCServer2x:1,2,3,4,5",
+ "JobHistory2x:4,5",
+ "SparkResource2x:1,2,3,4,5",
+ "oozie:1,2",
+ "LoadBalancer:1,2",
+ "TezUI:1,2",
+ "TimelineServer:5",
+ "RangerAdmin:1,2",
+ "KerberosClient",
+ "SlapdClient",
+ "meta",
+ "HSConsole:1,2",
+ "FlinkResource:1,2,3,4,5",
+ "DataNode:1,2,3,4,5",
+ "NodeManager:1,2,3,4,5",
+ "IndexServer2x:1,2",
+ "ThriftServer:1,2,3,4,5",
+ "RegionServer:1,2,3,4,5",
+ "ThriftServer1:1,2,3,4,5",
+ "RESTServer:1,2,3,4,5",
+ "Broker:1,2,3,4,5",
+ "Supervisor:1,2,3,4,5",
+ "Logviewer:1,2,3,4,5",
+ "Flume:1,2,3,4,5",
+ "HBaseIndexer:1,2,3,4,5",
+ "TagSync:1",
+ "UserSync:1"]
+ },
+ {
+ "group_name": "node_group_1",
+ "node_num": 3,
+ "node_size": "rc3.4xlarge.4.linux.bigdata",
+ "root_volume": {
+ "type": "SAS",
+ "size": 100
+ },
+ "data_volume": {
+ "type": "SAS",
+ "size": 300
+ },
+ "data_volume_count": 1,
+ "assigned_roles": [
+ "DataNode",
+ "NodeManager",
+ "RegionServer",
+ "Flume:1",
+ "Broker",
+ "Supervisor",
+ "Logviewer",
+ "HBaseIndexer",
+ "KerberosClient",
+ "SlapdClient",
+ "meta",
+ "HSBroker:1,2",
+ "ThriftServer",
+ "ThriftServer1",
+ "RESTServer",
+ "FlinkResource"]
+ }
+ ]
+}
+{
+ "cluster_version": "MRS 3.X.X",
+ "cluster_name": "mrs_jdRU_dm02",
+ "cluster_type": "CUSTOM",
+ "charge_info": {
+ "charge_mode": "postPaid"
+ },
+ "region": "",
+ "availability_zone": "",
+ "vpc_name": "vpc-37cd",
+ "subnet_name": "subnet-ed99",
+ "components": "Hadoop,Spark2x,HBase,Hive,Hue,Loader,Kafka,Storm,Flume,Flink,Oozie,Ranger,Tez",
+ "safe_mode": "KERBEROS",
+ "manager_admin_password": "Mrs@1234",
+ "login_mode": "PASSWORD",
+ "node_root_password": "Mrs@1234",
+ "mrs_ecs_default_agency": "MRS_ECS_DEFAULT_AGENCY",
+ "template_id": "mgmt_control_data_separated_v2",
+ "log_collection": 1,
+ "tags": [
+ {
+ "key": "aaa",
+ "value": "111"
+ },
+ {
+ "key": "bbb",
+ "value": "222"
+ }
+ ],
+ "node_groups": [
+ {
+ "group_name": "master_node_default_group",
+ "node_num": 9,
+ "node_size": "rc3.4xlarge.4.linux.bigdata",
+ "root_volume": {
+ "type": "SAS",
+ "size": 100
+ },
+ "data_volume": {
+ "type": "SAS",
+ "size": 600
+ },
+ "data_volume_count": 1,
+ "assigned_roles": [
+ "OMSServer:1,2",
+ "SlapdServer:5,6",
+ "KerberosServer:5,6",
+ "KerberosAdmin:5,6",
+ "quorumpeer:5,6,7,8,9",
+ "NameNode:3,4",
+ "Zkfc:3,4",
+ "JournalNode:5,6,7",
+ "ResourceManager:8,9",
+ "JobHistoryServer:8",
+ "DBServer:8,9",
+ "Hue:8,9",
+ "FlinkResource:3,4",
+ "LoaderServer:3,5",
+ "MetaStore:8,9",
+ "WebHCat:5",
+ "HiveServer:8,9",
+ "HMaster:8,9",
+ "FTP-Server:3,4",
+ "MonitorServer:3,4",
+ "Nimbus:8,9",
+ "UI:8,9",
+ "JDBCServer2x:8,9",
+ "JobHistory2x:8,9",
+ "SparkResource2x:5,6,7",
+ "oozie:4,5",
+ "EsMaster:7,8,9",
+ "LoadBalancer:8,9",
+ "TezUI:5,6",
+ "TimelineServer:5",
+ "RangerAdmin:4,5",
+ "UserSync:5",
+ "TagSync:5",
+ "KerberosClient",
+ "SlapdClient",
+ "meta",
+ "HSBroker:5",
+ "HSConsole:3,4",
+ "FlinkResource:3,4"]
+ },
+ {
+ "group_name": "node_group_1",
+ "node_num": 3,
+ "node_size": "rc3.4xlarge.4.linux.bigdata",
+ "root_volume": {
+ "type": "SAS",
+ "size": 100
+ },
+ "data_volume": {
+ "type": "SAS",
+ "size": 600
+ },
+ "data_volume_count": 1,
+ "assigned_roles": [
+ "DataNode",
+ "NodeManager",
+ "RegionServer",
+ "Flume:1",
+ "GraphServer",
+ "KerberosClient",
+ "SlapdClient",
+ "meta",
+ "HSBroker:1,2"
+]
+ },
+ {
+ "group_name": "node_group_2",
+ "node_num": 3,
+ "node_size": "rc3.4xlarge.4.linux.bigdata",
+ "root_volume": {
+ "type": "SAS",
+ "size": 100
+ },
+ "data_volume": {
+ "type": "SAS",
+ "size": 600
+ },
+ "data_volume_count": 1,
+ "assigned_roles": [
+ "HBaseIndexer",
+ "SolrServer[3]",
+ "EsNode[2]",
+ "KerberosClient",
+ "SlapdClient",
+ "meta",
+ "SolrServerAdmin:1,2"]
+ },
+ {
+ "group_name": "node_group_3",
+ "node_num": 3,
+ "node_size": "rc3.4xlarge.4.linux.bigdata",
+ "root_volume": {
+ "type": "SAS",
+ "size": 100
+ },
+ "data_volume": {
+ "type": "SAS",
+ "size": 600
+ },
+ "data_volume_count": 1,
+ "assigned_roles": [
+ "Redis[2]",
+ "KerberosClient",
+ "SlapdClient",
+ "meta"]
+ },
+ {
+ "group_name": "node_group_4",
+ "node_num": 3,
+ "node_size": "rc3.4xlarge.4.linux.bigdata",
+ "root_volume": {
+ "type": "SAS",
+ "size": 100
+ },
+ "data_volume": {
+ "type": "SAS",
+ "size": 600
+ },
+ "data_volume_count": 1,
+ "assigned_roles": [
+ "Broker",
+ "Supervisor",
+ "Logviewer",
+ "KerberosClient",
+ "SlapdClient",
+ "meta"]
+ }
+ ]
+}
+{
+ "cluster_id": "da1592c2-bb7e-468d-9ac9-83246e95447a"
+}
+{
+ "error_code": "MRS.0002",
+ "error_msg": "The parameter is invalid."
+}
+Table 17 describes the status code of this API.
+ +Status Code + |
+Description + |
+
|---|---|
200 + |
+A cluster is created successfully. + |
+
For the description about error status codes, see Status Codes.
+Role Name + |
+Component + |
+
|---|---|
OMSServer + |
+OMSServer + |
+
NameNode + |
+HDFS + |
+
Zkfc + |
+HDFS + |
+
JournalNode + |
+HDFS + |
+
DataNode + |
+HDFS + |
+
ResourceManager + |
+Yarn + |
+
NodeManager + |
+Yarn + |
+
JobHistoryServer + |
+Mapreduce + |
+
quorumpeer + |
+ZooKeeper + |
+
HMaster + |
+HBase + |
+
ThriftServer + |
+HBase + |
+
RegionServer + |
+HBase + |
+
SlapdServer + |
+LdapServer + |
+
KerberosServer + |
+KrbServer + |
+
KerberosAdmin + |
+KrbServer + |
+
Hue + |
+Hue + |
+
LoaderServer + |
+Loader + |
+
JDBCServer + |
+Spark + |
+
JobHistory + |
+Spark + |
+
SparkResource + |
+Spark + |
+
JDBCServer2x + |
+Spark2x + |
+
JobHistory2x + |
+Spark2x + |
+
SparkResource2x + |
+Spark2x + |
+
MetaStore + |
+Hive + |
+
WebHCat + |
+Hive + |
+
HiveServer + |
+Hive + |
+
MonitorServer + |
+Flume + |
+
Flume + |
+Flume + |
+
oozie + |
+Oozie + |
+
KerberosClient + |
+KrbClient + |
+
SlapdClient + |
+LdapClient + |
+
meta + |
+meta + |
+
DBServer + |
+DBService + |
+
Broker + |
+Kafka + |
+
Supervisor + |
+Storm + |
+
Logviewer + |
+Storm + |
+
Nimbus + |
+Storm + |
+
UI + |
+Storm + |
+
FlinkResource + |
+Flink + |
+
TezUI + |
+Tez + |
+
RangerAdmin + |
+Ranger + |
+
RangerUserSync + |
+Ranger + |
+
MRS Manager APIs are provided for you to query basic information about MRS clusters and monitoring status, as well as start and stop services.
+MRS Manager APIs can be accessed by only nodes in the same VPC as the cluster.
+Clusters with Kerberos authentication disabled can directly call MRS Manager APIs in the same VPC for access. However, clusters with Kerberos authentication enabled must obtain authentication information before calling MRS Manager APIs.
+An MRS Manager API request/response consists of the following six parts:
+A request URI is in the following format:
+{URI-scheme} :// {MRS Manager floating IP address} :{MRS Manager port}/ {resource-path} ? {query-string}
+Although the request URI is included in the request header, most languages or frameworks require that it be transmitted separately from the request message. Therefore, the request URI is listed independently.
+ +Parameter + |
+Description + |
+
|---|---|
URI-scheme + |
+Protocol used to transmit requests. HTTPS must be used in MRS APIs. + |
+
MRS Manager floating IP address + |
+IP address for logging in to MRS Manager. +For clusters that support Kerberos authentication (security clusters), the floating IP address (cluster console address) of the cluster is displayed on the basic cluster information page. +For a non-security cluster that does not support Kerberos authentication, you can log in to the Master2 node of the cluster using VNC and run the ifconfig command to view the floating IP address of the cluster. eth0:wsom indicates the floating IP address of MRS Manager. The value of the inet parameter is the floating IP address. + NOTE:
+If the floating IP address of MRS Manager cannot be queried on the Master2 node, switch to the Master1 node to query and record the floating IP address. + |
+
MRS Manager port + |
+Port number for logging in to the MRS Manager. The default value is 28443. + |
+
resource-path + |
+The path for accessing an API. Obtain the value from the URI of the API, for example, v3/auth/tokens. + |
+
Query string + |
+Optional. For example, API version or resource selection criterion. + |
+
HTTP-based request methods, which are also called operations or actions, specify the type of operations that you are requesting.
+ +Method + |
+Description + |
+
|---|---|
GET + |
+Requests the server to return specified resources. + |
+
PUT + |
+Requests the server to update specified resources. + |
+
POST + |
+Requests the server to add resources or perform special operations. + |
+
DELETE + |
+Requests the server to delete specified resources, for example, an object. + |
+
HEAD + |
+Same as GET except that the server must return only the response header. + |
+
PATCH + |
+Requests the server to update partial content of a specified resource. +If the resource does not exist, a new resource will be created. + |
+
A request header consists of several header fields. Each header field consists of a field name, a colon (:), and a field value.
+Optional additional request header field, such as the field required by a specified URI and HTTP method. Table 3 lists common MRS request headers. For details about the request authentication information, see Authentication.
+ +Name + |
+Description + |
+Mandatory + |
+Example + |
+
|---|---|---|---|
Content-type + |
+Specifies the request body MIME type. + |
+Yes + |
+application/json + |
+
Content-Length + |
+Specifies the length of the request body. The unit is byte. + |
+This field is mandatory for POST and PUT requests, but must be left blank for GET requests. + |
+3495 + |
+
X-Language + |
+Request language. The options are as follows: +en-us: English + |
+No + |
+en-us + |
+
For details about other headers, see the HTTP protocol.
+A request body is generally sent in a structured format (for example, JSON or XML). It corresponds to Content-type in the request header and is used to transfer content other than the request header.
+A response header contains the following parts:
+Parameter + |
+Description + |
+Mandatory + |
+Examples + |
+
|---|---|---|---|
Date + |
+(Standard HTTP header). The time when a response is sent, whose format follows RFC 822. + |
+Yes + |
+Mon, 12 Nov 2007 15:55:01 GMT + |
+
Server + |
+(Standard HTTP header). The software information that the server uses to process the request + |
+Yes + |
+Apache + |
+
Content-Length + |
+(Standard HTTP header). The size of a message body in decimal number of bytes + |
+No + |
+xxx + |
+
Content-type + |
+(Standard HTTP header) Media type of the message body sent to a receiver + |
+Yes + |
+application/json + |
+
A response body is generally returned in a structured format (for example, JSON or XML). It corresponds to Content-type in the response header and is used to transfer content other than the response header.
+You can initiate a request based on the constructed request message using any of the following:
+cURL is a command-line tool used to perform URL operations and transmit information. It serves as an HTTP client that can send HTTP requests to the server and receive response messages. cURL is applicable to API debugging. For more information about cURL, visit https://curl.haxx.se/.
+You can call APIs using code to assemble, send, and process request messages.
+Both Mozilla Firefox and Google Chrome provide a graphical browser plug-in, that is, REST client, to send and process requests. For Mozilla Firefox, see Firefox REST Client. For Google Chrome, see Chrome REST Client.
+The process for calling an MRS Manager API is as follows:
+Before you call an API, obtain request authentication information, and fill it in a request header.
+Configure request parameters to construct a request.
+Currently, CAS can be used for login authentication when an API is called.
+After login authentication, obtain the JSESSIONID of a web request and check the current user using the JSESSIONID.
+Procedure for Calling an API (Security Cluster)
+The following example describes how to obtain casSessionId and loginTicket from the response object of the request.
+// Obtain the CAS login page.
+HttpResponse casLoginPageResponse = getCasLoginPage(casUrl, httpClient);
+LOG.info("get cas login page request status is :{} , casLoginPageResponse is :{}.", casLoginPageResponse.getStatusLine(), casLoginPageResponse);
+
+// Obtain casSessionId and loginTicket.
+String casSessionId = getCasSessionId(casLoginPageResponse);
+String loginTicket = getLoginTicket(casLoginPageResponse);
+LOG.info("casSessionId = {} , loginTicket = {}.", casSessionId, loginTicket);
+// Authenticate the username and password on the CAS server.
+HttpResponse loginPostResponse =
+ loginCasServer(casUrl, webUrl, userName, password, httpClient, casSessionId, loginTicket, userTLSVersion);
+LOG.info("the post response is: {}.", loginPostResponse);
+
+// Obtain the authenticated TGC.
+String casTgc = getCASTGC(loginPostResponse);
+LOG.info("casTgc = {}.", casTgc);
+...
+
+
+/**
+ * Log in to the CAS server and verify user information.
+* @param casUrl CAS server address
+* @param webUrl Web application address
+ * @param userName Login user name
+ * @param password Login password
+ * @param casSessionId CAS session ID
+ * @param loginTicket CAS login ticket
+ * @return http client HTTP client
+ */
+private HttpResponse loginCasServer(String casUrl, String webUrl, String userName, String password,
+ HttpClient httpClient, String casSessionId, String loginTicket,String userTLSVersion)
+{
+ if (ParamsValidUtil.isEmpty(casUrl, webUrl, userName, password, casSessionId, loginTicket))
+ {
+ LOG.error("Invalid input param.");
+ }
+ String postUrl = generateCasLoginUrl(casUrl, webUrl);
+ LOG.info("login cas server URL is : {}.", postUrl);
+
+ HttpPost httpPost = new HttpPost(postUrl);
+ // Parameters contained in the request body
+ List<BasicNameValuePair> FormData = new ArrayList<BasicNameValuePair>();
+ FormData.add(new BasicNameValuePair("username", userName));
+ FormData.add(new BasicNameValuePair("password", password));
+ FormData.add(new BasicNameValuePair("lt", loginTicket));
+ FormData.add(new BasicNameValuePair("_eventId", "submit"));
+ FormData.add(new BasicNameValuePair("submit", "Login"));
+ HttpResponse response = null;
+ BufferedReader bufferedReader = null;
+ // Parameters contained in the request header
+ httpPost.addHeader("Cookie", CAS_SESSION_ID_STRING + casSessionId);
+...
+
+
+/**
+ * Generate a complete URL for logging in to CAS.
+ * After the login is successful, the specified CAS security check page is displayed.
+ * @param casUrl
+ * @param webUrl
+ * @return
+ */
+private String generateCasLoginUrl(String casUrl, String webUrl)
+{
+ StringBuilder sb = new StringBuilder();
+ sb.append(casUrl);
+ sb.append("?service=");
+ sb.append(webUrl);
+ sb.append("/cas_security_check.htm");
+ return sb.toString();
+}
+/**
+ * Initiate a request for web application login authentication.
+ * @param webUrl Web application URL
+ * @param httpclient http client
+ * @return response Login verification response object
+ */
+private HttpResponse webLoginCheck(String webUrl, HttpClient httpclient)
+{
+ //Web login authentication request path
+ HttpGet loginCheckHttpGet = new HttpGet(webUrl + "/v1/access/login_check");
+ LOG.info("web login check URL is: {}.", (webUrl + "/v1/access/login_check"));
+
+ HttpResponse response = null;
+ BufferedReader bufferedReader = null;
+ InputStream inputStream = null;
+ boolean flag = false;
+ try
+ {
+ response = httpclient.execute(loginCheckHttpGet);
+
+ inputStream = response.getEntity().getContent();
+ bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
+ String lineContent = "";
+ lineContent = bufferedReader.readLine();
+ LOG.info("response content is {} : " + lineContent);
+ String postResponseState = "";
+...
+
For a non-security cluster, you can skip CAS authentication in step 1 and step 2 and directly send the GET https://MRS Manager floating IP:28443/web/v1/access/login_check web login authentication request. And then, you can obtain the FISessionId of the web request from the cookie of the response header of the response object.
+Invoke API demo code.
+This class is a running entry class for calling APIs. Before running this class, you need to set the following parameters:
+Before calling service APIs, call login authentication APIs for performing login authentication first. For details about how to call login authentication APIs, see CASLogin.java.
+The following example describes how to call the GET and POST APIs.
+This example describes how to call the API for querying the installed clusters (/web/v1/clusters).
+Before the service API is called, the IP address, port number, and the /web path are added to the webUrl. Therefore, you need to combine the webUrl with the request API path /v1/clusters in the operationUrl of the service API.
+This example describes how to call the API for starting a service (/web/v1/maintain/cluster/{cluster_id}/service/{service_name}/start).
+In the operationUrl of this API, you need to combine the webUrl with the request API path v1/maintain/cluster/{cluster_id}/service/{service_name}/start. In the request path URL, enter the current cluster ID and the name of the service to be started.
+According to the requirements of the API for starting a service, specified parameters need to be inputted in the request body. These parameters are written in the example StartService.json file in JSON format, and the file path is specified in jsonFilePath.
+You can view information about API calling in the generated Demo.log file. For details about log configurations, see Log4j.properties.
+package com.MRS;
+
+import org.apache.http.client.HttpClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import com.MRS.login.CASLogin;
+import com.MRS.operation.HttpManager;
+
+/**
+ * Program running entry
+ *
+ */
+public class Main
+{
+ private static final Logger LOG = LoggerFactory.getLogger(Main.class);
+
+ // IP address of the cluster management node
+ public static final String IP_Address = "xxx.xxx.xxx.xxx";
+
+ public static void main(String[] args)
+ {
+ //############# Step 1. Prepare for calling an API.#############
+ // Login username and password
+ String userName = "xxxxxx";
+ String password = "xxxxxxxxx";
+ HttpManager httpManager = new HttpManager();
+
+ // CAS and Web URLs
+ String casUrl = "https://" + IP_Address + ":20009/cas/login";
+ String webUrl = "https://" + IP_Address + ":28443/web/";
+
+ // userTLSVersion is a mandatory parameter. It is an important parameter used for connecting a JDK 1.6 server to a JDK 1.8 server. If you use JDK 1.8, set this parameter to an empty character string.
+ String userTLSVersion = "";
+
+ //############# Step 2. Call an API to complete login authentication.#############
+ LOG.info("Begin to get httpclient and login cas.");
+ HttpClient httpClient = new CASLogin().login(casUrl, webUrl, userName, password, userTLSVersion);
+
+ //############# Step 3. Call APIs based on the service.#############
+
+ // Send a GET request to call the API for querying the installed clusters.
+ String operationUrl = webUrl + "/v1/clusters";
+ httpManager.sendHttpGetRequest(httpClient, operationUrl);
+
+ // Send a POST request to call the API for adding a user.
+ String jsonFilePath = "./conf/startService.json";
+ String operationUrl = webUrl + "/v1/maintain/cluster/{cluster_id}/service/{service_name}/start";
+ httpManager.sendHttpPostRequest(httpClient, operationUrl, jsonFilePath);
+
+ //############# Step 4. Close the connection.#############
+ httpClient.getConnectionManager().shutdown();
+ }
+}
+This class allows login authentication with a token.
+The method is to send a GET request to the cluster. The request path is https://casUrl/login.
+This method is to send a POST login authentication request to the cluster. The request path is https://casUrl/login?service= https://webUrl/ cas_security_check.htm.
+The method is to send a GET verification request to the cluster. The request path is https://webUrl/v1/access/login_check.
+package com.MRS.login;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.commons.lang.StringUtils;
+import org.apache.http.Header;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
+import org.apache.http.message.BasicNameValuePair;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import com.MRS.operation.WebClientWrapper;
+import com.MRS.utils.ParamsValidUtil;
+
+public class CASLogin
+{
+ private static final Logger LOG = LoggerFactory.getLogger(CASLogin.class);
+ private static final String SET_COOKIE = "Set-Cookie";
+ private static final String CAS_SESSION_ID_STRING = "casSessionId=";
+ private static final String CAS_TGC_STRING = "CASTGC=";
+ private static final String SEMICOLON_SEPARATOR = ";";
+ private static final String DOUBLE_QUOTAYION = "\"";
+ private static final String LOGINTICKET_STRING = "name=\"lt\" value=";
+ private static final int LOGINTICKET_INDEX = 5;
+ private static final String WRONGPASSWORD = "The credentials you provided cannot be determined to be authentic";
+ private static final String RESETPASSWORD = "modify_password.html";
+ private static final String ENCODING = "UTF-8";
+ public String tgc = "";
+
+ public HttpClient login(String casUrl, String webUrl, String userName, String password, String userTLSVersion)
+ {
+ if (ParamsValidUtil.isEmpty(casUrl, webUrl, userName, password))
+ {
+ LOG.error("Invalid input param.");
+ return null;
+ }
+ if (userTLSVersion == null || userTLSVersion.isEmpty())
+ {
+ userTLSVersion = "TLS";
+ }
+ LOG.info("Get http client for sending https request, username is {}, casUrl is {}, webUrl is {}.",
+ userName, casUrl, webUrl);
+
+ // Obtain the HttpClient.
+ HttpClient httpClient = getHttpClient(userTLSVersion);
+
+ // Obtain the CAS login page.
+ HttpResponse casLoginPageResponse = getCasLoginPage(casUrl, httpClient);
+ LOG.info("get cas login page response is :{}.", casLoginPageResponse);
+
+ // Obtain casSessionId and loginTicket.
+ String casSessionId = getCasSessionId(casLoginPageResponse);
+ String loginTicket = getLoginTicket(casLoginPageResponse);
+ LOG.info("casSessionId = {} , loginTicket = {}.", casSessionId, loginTicket);
+ if(StringUtils.isBlank(casSessionId) || StringUtils.isBlank(loginTicket))
+ {
+ LOG.error("Invalid input param.");
+ return null;
+ }
+
+ // Authenticate the username and password on the CAS server.
+ HttpResponse loginPostResponse =
+ loginCasServer(casUrl, webUrl, userName, password, httpClient, casSessionId, loginTicket, userTLSVersion);
+ LOG.info("the login post response is: {}.", loginPostResponse);
+
+ // Obtain the authenticated TGC.
+ String casTgc = getCASTGC(loginPostResponse);
+ LOG.info("casTgc = {}.", casTgc);
+
+ // Check the login.
+ HttpResponse webLoginCheck = webLoginCheck(webUrl, httpClient);
+ LOG.info("web login check response is: {}.", webLoginCheck);
+
+ // If the login authentication is successful, the available HttpClient is returned.
+ return httpClient;
+ }
+
+ /**
+ * Obtain the HttpClient.
+ * @return http client
+ */
+ @SuppressWarnings("deprecation")
+ public HttpClient getHttpClient(String userTLSVersion)
+ {
+ ThreadSafeClientConnManager safeClientConnManager = new ThreadSafeClientConnManager();
+ safeClientConnManager.setMaxTotal(100);
+ HttpClient httpclient = WebClientWrapper.wrapClient(new DefaultHttpClient(safeClientConnManager), userTLSVersion);
+ return httpclient;
+ }
+
+ /**
+ * Obtain the CAS login page.
+ * @param casUrl CAS homepage address
+ * @param httpclient http client
+ * @return response Response of the request
+ */
+ private HttpResponse getCasLoginPage(String casUrl, HttpClient httpclient)
+ {
+ LOG.info("Enter getCasLoginPage, the casUrl is: {}", casUrl);
+ HttpGet preLoginHttpGet = new HttpGet(casUrl);
+ HttpResponse httpResponse = null;
+ try
+ {
+ httpResponse = httpclient.execute(preLoginHttpGet);
+ }
+ catch (Exception e)
+ {
+ LOG.error("Execute cas login failed.");
+ }
+ return httpResponse;
+ }
+
+ /**
+ * Obtain the CAS session ID from the returned login page response.
+ * @param preLoginResponse Response of the login page request
+ * @return session id Session ID
+ */
+ private String getCasSessionId(HttpResponse preLoginResponse)
+ {
+ Header resHeader = preLoginResponse.getFirstHeader(SET_COOKIE);
+ String setCookie = resHeader == null ? "" : resHeader.getValue();
+ String casSessionId =
+ setCookie.substring(CAS_SESSION_ID_STRING.length(), setCookie.indexOf(SEMICOLON_SEPARATOR));
+ return casSessionId;
+ }
+
+ /**
+ * Obtain the login ticket from the returned login page response.
+ * @param preLoginResponse Response of the login page request
+ * @return loginTicket Login authentication ticket
+ */
+ private String getLoginTicket(HttpResponse preLoginResponse)
+ {
+ BufferedReader bufferedReader = null;
+ String loginTicket = "";
+ try
+ {
+ InputStream inputStream = preLoginResponse.getEntity().getContent();
+
+ // When the http response is not empty, the context attribute is not null.
+ bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
+ String lineContent = "";
+ while (null != lineContent)
+ {
+ lineContent = bufferedReader.readLine();
+ if ((null != lineContent) && (lineContent.contains(LOGINTICKET_STRING)))
+ {
+ // Delete spaces at the beginning and end of the line.
+ lineContent = lineContent.trim();
+ // If LOGINTICKET_STRING (name=\"loginTicket\" value=) exists, split it based on the double quotation marks. The array length cannot be less than 6.
+ loginTicket = lineContent.split(DOUBLE_QUOTAYION)[LOGINTICKET_INDEX];
+ break;
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ LOG.error("Get loginTicket failed.");
+ }
+ finally
+ {
+ if (bufferedReader != null)
+ {
+ try
+ {
+ bufferedReader.close();
+ }
+ catch (IOException e)
+ {
+ LOG.warn("Close buffer reader failed.");
+ }
+ }
+ }
+ return loginTicket;
+ }
+
+ /**
+ * Obtain the TGC from the response of the request for logging in to the CAS Server.
+ * @param loginPostResponse Response object
+ * @return TGC Authenticated ticket
+ */
+ private String getCASTGC(HttpResponse loginPostResponse)
+ {
+ Header header = loginPostResponse.getLastHeader(SET_COOKIE);
+ String casTgcHeader = header == null ? "" : header.getValue();
+ String tempCasTgc = casTgcHeader.split(SEMICOLON_SEPARATOR)[0];
+ if (StringUtils.isEmpty(tempCasTgc))
+ {
+ return "";
+ }
+ String casTgc = tempCasTgc.substring(CAS_TGC_STRING.length());
+ this.tgc = casTgc;
+ return casTgc;
+ }
+
+ /**
+ * Log in to the CAS server and verify user information.
+ * @param casUrl CAS server address
+ * @param webUrl Web application address
+ * @param userName Login username
+ * @param password Login password
+ * @param casSessionId CAS session ID
+ * @param loginTicket CAS login ticket
+ * @return http client HTTP client
+ */
+ private HttpResponse loginCasServer(String casUrl, String webUrl, String userName, String password,
+ HttpClient httpClient, String casSessionId, String loginTicket,String userTLSVersion)
+ {
+ if (ParamsValidUtil.isEmpty(casUrl, webUrl, userName, password, casSessionId, loginTicket))
+ {
+ LOG.error("Invalid input param.");
+ return null;
+ }
+ String postUrl = generateCasLoginUrl(casUrl, webUrl);
+ LOG.info("login cas server URL is : {}.", postUrl);
+
+ HttpPost httpPost = new HttpPost(postUrl);
+ List<BasicNameValuePair> FormData = new ArrayList<BasicNameValuePair>();
+ FormData.add(new BasicNameValuePair("username", userName));
+ FormData.add(new BasicNameValuePair("password", password));
+ FormData.add(new BasicNameValuePair("lt", loginTicket));
+ FormData.add(new BasicNameValuePair("_eventId", "submit"));
+ FormData.add(new BasicNameValuePair("submit", "Login"));
+ HttpResponse response = null;
+ BufferedReader bufferedReader = null;
+ httpPost.addHeader("Cookie", CAS_SESSION_ID_STRING + casSessionId);
+
+ try
+ {
+ httpPost.setEntity(new UrlEncodedFormEntity(FormData, ENCODING));
+ response = httpClient.execute(httpPost);
+ LOG.info("Login CasServer status is {}", response.getStatusLine());
+
+ InputStream inputStream = response.getEntity().getContent();
+ bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
+ String lineContent = "";
+ lineContent = bufferedReader.readLine();
+
+ // Performs corresponding operations based on the message returned. Currently, only two types of results are returned on the CAS login page in Java mode.
+ while (lineContent != null)
+ {
+ // Incorrect username or password
+ if (lineContent.contains(WRONGPASSWORD))
+ {
+ LOG.error("The username or password is wrong");
+ }
+ // Reset the password upon the first login.
+ if (lineContent.contains(RESETPASSWORD))
+ {
+ LOG.warn("Login first time,please reset password.");
+ }
+ lineContent = bufferedReader.readLine();
+ }
+ }
+ catch (Exception e)
+ {
+ LOG.error("Login cas server failed.");
+ }
+ finally
+ {
+ if (bufferedReader != null)
+ {
+ try
+ {
+ bufferedReader.close();
+ }
+ catch (IOException e)
+ {
+ LOG.error("Login cas server failed because of IOException.");
+ }
+ }
+ }
+ return response;
+ }
+
+ /**
+ * Generate a complete URL for logging in to CAS.
+ * After the login is successful, the specified CAS security check page is displayed.
+ * @param casUrl
+ * @param webUrl
+ * @return
+ */
+ private String generateCasLoginUrl(String casUrl, String webUrl)
+ {
+ StringBuilder sb = new StringBuilder();
+ sb.append(casUrl);
+ sb.append("?service=");
+ sb.append(webUrl);
+ sb.append("/cas_security_check.htm");
+ return sb.toString();
+ }
+
+ /**
+ * Initiate a request for web application login verification.
+ * @param webUrl Web application URL
+ * @param httpclient http client
+ * @return response Login verification response object
+ */
+ private HttpResponse webLoginCheck(String webUrl, HttpClient httpclient)
+ {
+ // Web login authentication request path
+ HttpGet loginCheckHttpGet = new HttpGet(webUrl + "/v1/access/login_check");
+ LOG.info("web login check URL is: {}.", (webUrl + "/v1/access/login_check "));
+
+ HttpResponse response = null;
+ BufferedReader bufferedReader = null;
+ InputStream inputStream = null;
+ try
+ {
+ response = httpclient.execute(loginCheckHttpGet);
+ inputStream = response.getEntity().getContent();
+ bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
+ String lineContent = "";
+ lineContent = bufferedReader.readLine();
+ LOG.info("response content is {} : " + lineContent);
+ }
+ catch (Exception e)
+ {
+ LOG.error("Get loginTicket failed.");
+ }
+ finally
+ {
+ if (bufferedReader != null)
+ {
+ try
+ {
+ bufferedReader.close();
+ }
+ catch (IOException e)
+ {
+ LOG.warn("Close bufferedReader failed.");
+ }
+ }
+ if (inputStream != null)
+ {
+ try
+ {
+ inputStream.close();
+ }
+ catch (IOException e)
+ {
+ LOG.warn("Close inputStream failed.");
+ }
+ }
+ }
+ return response;
+ }
+}
+This class provides specific GET and POST request methods.
+package com.MRS.operation;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.LinkedList;
+import java.util.List;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.HttpDelete;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.StringEntity;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class HttpManager
+{
+ private static final String ENCODING = "UTF-8";
+ private static final Logger LOG = LoggerFactory.getLogger(HttpManager.class);
+
+ /**
+ * Send an httpGet request based on the input parameters such as httpclient and url.
+ * @param httpclient
+ * @param operationUrl
+ */
+ public String sendHttpGetRequest(HttpClient httpClient, String operationUrl)
+ {
+ if (operationUrl == null || operationUrl.isEmpty())
+ {
+ LOG.error("The operationUrl is emptey.");
+ return null;
+ }
+ LOG.info("The operationUrl is:{}", operationUrl);
+
+ BufferedReader bufferedReader = null;
+ InputStream inputStream = null;
+ StringBuffer lineContent = new StringBuffer();
+ try
+ {
+ HttpGet httpGet = new HttpGet(operationUrl);
+ HttpResponse rsp = httpClient.execute(httpGet);
+ LOG.info("Operation status is {}.", rsp.getStatusLine());
+ inputStream = rsp.getEntity().getContent();
+ bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
+
+ String temp = bufferedReader.readLine();
+ while (temp != null)
+ {
+ lineContent.append(temp);
+ temp = bufferedReader.readLine();
+ }
+ bufferedReader.close();
+ inputStream.close();
+ LOG.info("The get response lineContent is {}.", lineContent);
+ }
+ catch (Exception e)
+ {
+ LOG.info("Send http get request field..");
+ }
+ finally
+ {
+ if (bufferedReader != null)
+ {
+ try
+ {
+ bufferedReader.close();
+ }
+ catch (IOException e)
+ {
+ LOG.info("Close bufferedReader failed.");
+ }
+ }
+ if (inputStream != null)
+ {
+ try
+ {
+ inputStream.close();
+ }
+ catch (IOException e)
+ {
+ LOG.info("Close inputStream failed.");
+ }
+ }
+ }
+ LOG.info("SendHttpGetMessage completely.");
+ return lineContent.toString();
+ }
+
+ /**
+ * Send an httpPost request based on the input parameters such as httpclient, url, and jsonFilePath.
+ * @param httpclient
+ * @param operationUrl
+ * @param jsonFilePath
+ * @return Return the operation command ID.
+ */
+ public void sendHttpPostRequest(HttpClient httpClient, String operationUrl, String jsonFilePath)
+ {
+ if (jsonFilePath == null || jsonFilePath.isEmpty())
+ {
+ LOG.error("The jsonFilePath is emptey.");
+ }
+
+ String filePath = jsonFilePath;
+ File jsonFile = null;
+ BufferedReader br = null;
+ InputStream inputStream = null;
+ BufferedReader bufferedReader = null;
+ try
+ {
+ jsonFile = new File(filePath);
+ List<String> list = new LinkedList<String>();
+ br = new BufferedReader(new FileReader(jsonFile));
+ String temp = br.readLine();
+ // Add the request body in the JSON file to the list. Each line is a complete request. A request may be a line or multiple lines. Multiple HTTP requests need to be sent for multiple lines.
+ while (temp != null)
+ {
+ list.add(temp);
+ temp = br.readLine();
+ }
+ br.close();
+
+ for (int line = 0; line < list.size(); line++)
+ {
+ String tempString = list.get(line);
+ String json = tempString;
+
+ if (json == null || json.length() == 0)
+ {
+ break;
+ }
+
+ HttpResponse response = null;
+ // Build a request header and a request body.
+ HttpPost httpPost = new HttpPost(operationUrl);
+ httpPost.addHeader("Content-Type", "application/json;charset=UTF-8");
+ httpPost.setEntity(new StringEntity(json, "text/plain", ENCODING));
+ // Send a POST request.
+ response = httpClient.execute(httpPost);
+
+ String status = response.getStatusLine().toString();
+ LOG.info("The status is :{} ", status);
+
+ inputStream = response.getEntity().getContent();
+ bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
+ String lineContent = "";
+ lineContent = bufferedReader.readLine();
+ LOG.info("the post response lineContent is {}.", lineContent);
+
+ bufferedReader.close();
+ inputStream.close();
+ LOG.info("sendHttpPostRequest completely.");
+ }
+ }
+ catch (Exception e)
+ {
+ LOG.error("Send http post request field.");
+ }
+ finally
+ {
+ if (bufferedReader != null)
+ {
+ try
+ {
+ bufferedReader.close();
+ }
+ catch (IOException e)
+ {
+ LOG.info("Close bufferedReader failed.");
+ }
+ }
+ if (inputStream != null)
+ {
+ try
+ {
+ inputStream.close();
+ }
+ catch (IOException e)
+ {
+ LOG.info("Close inputStream failed.");
+ }
+ }
+ if (br != null)
+ {
+ try
+ {
+ br.close();
+ }
+ catch (IOException e)
+ {
+ LOG.info("Close bufferedReader failed.");
+ }
+ }
+ }
+ }
+}
+package com.MRS.operation;
+
+import java.io.IOException;
+import java.net.Socket;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSocket;
+import org.apache.http.conn.ssl.SSLSocketFactory;
+import org.apache.http.conn.ssl.X509HostnameVerifier;
+import org.apache.http.params.HttpParams;
+
+/**
+ * Make the TLS version set by the user take effect.
+ * Inherit SSLSocketFactory.
+ */
+public class MRSSSLSocketFactory extends SSLSocketFactory
+{
+ private static String[] enabelPro = {"TLS"};
+
+ public MRSSSLSocketFactory(SSLContext sslContext, X509HostnameVerifier hostnameVerifier,String userTLSVersion)
+ {
+ super(sslContext, hostnameVerifier);
+ enabelPro[0] = userTLSVersion;
+ }
+
+ @Override
+ public Socket createSocket(HttpParams params)
+ throws IOException
+ {
+ Socket result = super.createSocket(params);
+ ((SSLSocket)result).setEnabledProtocols(enabelPro);
+ return result;
+ }
+}
+package com.MRS.operation;
+
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+import org.apache.http.client.HttpClient;
+import org.apache.http.conn.ClientConnectionManager;
+import org.apache.http.conn.scheme.Scheme;
+import org.apache.http.conn.scheme.SchemeRegistry;
+import org.apache.http.conn.ssl.SSLSocketFactory;
+import org.apache.http.impl.client.DefaultHttpClient;
+
+public class WebClientWrapper
+{
+ /**
+ * Extend the HttpClient class to automatically accept all certificates.
+ * @param base
+ * @param userTLSVersion
+ * @return
+ */
+ public static HttpClient wrapClient(HttpClient baseHttpClient, String userTLSVersion)
+ {
+ ClientConnectionManager clientConnectionManager;
+ SSLContext sslContext = null;
+ try {
+ sslContext = SSLContext.getInstance(userTLSVersion);
+ }
+ catch (NoSuchAlgorithmException e1)
+ {
+ e1.printStackTrace();
+ }
+
+ if (sslContext == null)
+ {
+ return null;
+ }
+
+ X509TrustManager tm = new X509TrustManager()
+ {
+ public X509Certificate[] getAcceptedIssuers()
+ {
+ return null;
+ }
+
+ public void checkClientTrusted(X509Certificate ax509certificate[], String s) throws CertificateException
+ {
+ }
+
+ public void checkServerTrusted(X509Certificate ax509certificate[], String s) throws CertificateException
+ {
+ }
+ };
+
+ try
+ {
+ sslContext.init(null, new TrustManager[] {tm}, new SecureRandom());
+ }
+ catch (KeyManagementException e)
+ {
+ e.printStackTrace();
+ }
+
+ SSLSocketFactory sslSocketFactory = null;
+ if(userTLSVersion == null || userTLSVersion.isEmpty() || userTLSVersion.equals("TLS"))
+ {
+ sslSocketFactory = new SSLSocketFactory(sslContext, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
+ }
+ else
+ {
+ sslSocketFactory = new MRSSSLSocketFactory(sslContext, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER,userTLSVersion);
+ }
+
+ clientConnectionManager = baseHttpClient.getConnectionManager();
+ SchemeRegistry schemeRegistry = clientConnectionManager.getSchemeRegistry();
+ schemeRegistry.register(new Scheme("https", 443, sslSocketFactory));
+ return new DefaultHttpClient(clientConnectionManager, baseHttpClient.getParams());
+ }
+}
+package com.MRS.utils;
+
+import org.apache.commons.lang.StringUtils;
+
+public class ParamsValidUtil {
+ /**
+ * Check whether there are null parameters.
+ * @param obj Input parameter set
+ * @return Whether there are null parameters.
+ */
+ public static boolean isEmpty(String... obj)
+ {
+ for (int i = 0; i < obj.length; i++)
+ {
+ if (StringUtils.isEmpty(obj[i]))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+}
+{"only_self":true}
+##set log4j DEBUG < INFO < WARN < ERROR < FATAL
+log4j.logger.com.MRS=INFO,A1,A2_plus
+log4j.logger.org.apache.http=INFO,A1,A2_plus
+#print to the console?A1
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%t] %m %l%n
+
+#A2_plus the size of the rest.log < 10M, delete cyclicly
+log4j.appender.A2_plus=org.wcc.framework.log.SizeRollingZipFileATimeAppender
+log4j.appender.A2_plus.File=./conf/Demo.log
+log4j.appender.A2_plus.MaxFileSize=10MB
+log4j.appender.A2_plus.MaxBackupIndex=20
+log4j.appender.A2_plus.layout=org.apache.log4j.PatternLayout
+log4j.appender.A2_plus.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%t] %m %l%n
+This API is used to submit a CAS login request. This API can be used only by security clusters that support Kerberos authentication.
+POST /cas/login
+POST /cas/login HTTP/1.1 +Host: example.com +Content-Type: application/json +Accept:application/json +username: String +password: String +lt: String +_eventId: String +Submit: String+
Parameter + |
+Mandatory or Not + |
+Description + |
+
|---|---|---|
username + |
+Yes + |
+User name + |
+
password + |
+Yes + |
+Password + |
+
lt + |
+Yes + |
+Login ticket. Follow instructions in step 1 in the Obtaining Request Authentication Information part of the section API Calling Process to send a GET request to obtain loginTicket. + |
+
_eventId + |
+Yes + |
+Event type. The default value is submit. + |
+
submit + |
+Yes + |
+Submission type. The default value is Login. + |
+
Status Code + |
+Description + |
+
|---|---|
200 + |
+The login is successful. + |
+
For details about error status codes, see Status Codes.
+This API is used to destruct the CAS single sign-on (SSO) session of a client. This API can be used only by security clusters that support Kerberos authentication.
+POST /cas/logout
+POST /cas/logout HTTP/1.1 +Host: example.com +Content-Type: application/json +Accept:application/json+
Status Code + |
+Description + |
+
|---|---|
200 + |
+The logout is successful. + |
+
For details about error status codes, see Status Codes.
+This API is used to check the login after a login request is submitted.
+GET /web/v1/access/login_check
+HTTP/1.1 200 OK
+Data:Wed,02 May 2018 10:10:01 GMT
+Server: example-server
+Content-Type: application/json
+{
+ "id": 0,
+ "state": "NEW",
+ "error_code": 0,
+ "error_description": "string",
+ "total_progress": 0,
+ "modify_pwd": true,
+ "exist_cluster": true,
+ "remind_pwd": true,
+ "ref_URL": "string"
+ "token": "string"
+}
+Parameter + |
+Mandatory or Not + |
+Type + |
+Description + |
+
|---|---|---|---|
id + |
+No + |
+LONG + |
+Asynchronous task ID (meaningless in other scenarios). The default value is -1. + |
+
state + |
+No + |
+STRING + |
+Cluster status. The value FAILED indicates that the command fails to be executed. The value COMPLETE indicates that the command is successfully executed. + |
+
error_code + |
+No + |
+INTEGER + |
+Error code returned + |
+
error_description + |
+No + |
+STRING + |
+Error code description + |
+
total_progress + |
+No + |
+FLOAT + |
+Total progress + |
+
modify_pwd + |
+No + |
+BOOLEAN + |
+Whether to change the password. The password does not need to be changed by default. + |
+
exist_cluster + |
+No + |
+BOOLEAN + |
+Whether a cluster exists + |
+
remind_pwd + |
+No + |
+BOOLEAN + |
+Whether to remind the user to change the password + |
+
ref_URL + |
+No + |
+STRING + |
+URL to be redirected + |
+
token + |
+No + |
+STRING + |
+Token that is responded after login and check + |
+
Status Code + |
+Description + |
+
|---|---|
200 + |
+The operation is successful. + |
+
For details about error status codes, see Status Codes.
+This API is used to change the password of the current login user. This API can be used only by security clusters that support Kerberos authentication.
+POST /web/v1/access/modify_self_password
+Parameter + |
+Mandatory or Not + |
+Description + |
+
|---|---|---|
old_password + |
+Yes + |
+Old password + |
+
new_password + |
+Yes + |
+New password + |
+
confirm_password + |
+Yes + |
+Confirm password + |
+
POST /web/v1/access/modify_self_password?old_password=null&new_password=null& confirm_password=null HTTP/1.1 +Host: example.com +Content-Type: application/json +Accept:application/json+
HTTP/1.1 200 OK
+Data:Wed,02 May 2018 10:10:01 GMT
+Server: example-server
+Content-Type: application/json
+{
+ "int_result_code": 0,
+ "result_desc": "string"
+}
+Parameter + |
+Mandatory or Not + |
+Type + |
+Description + |
+
|---|---|---|---|
int_result_code + |
+No + |
+INTEGER + |
+Code of the return result + |
+
result_desc + |
+No + |
+STRING + |
+Description of the return result + |
+
Status Code + |
+Description + |
+
|---|---|
200 + |
+The operation is successful. + |
+
For details about error status codes, see Status Codes.
+This API is used to query the health status of a specified cluster. If any component is unavailable, the abnormal cluster health status is returned.
+GET /web/v1/cluster/{cluster_id}/status
+Parameter + |
+Mandatory or Not + |
+Description + |
+
|---|---|---|
cluster_id + |
+Yes + |
+Cluster ID that is displayed on MRS Manager. The default cluster ID is 1, because MRS Manager supports management of only one cluster currently. + |
+
HTTP/1.1 200 OK
+Data:Wed,02 May 2018 10:10:01 GMT
+Server: example-server
+Content-Type: application/json
+{
+ "id": 0,
+ "state": "COMPLETE",
+ "error_code": 0,
+ "error_description": "string",
+ "total_progress": 0,
+ "res_obj": {
+ "state": "GOOD"
+ }
+}
+Parameter + |
+Mandatory or Not + |
+Type + |
+Description + |
+
|---|---|---|---|
id + |
+No + |
+LONG + |
+Asynchronous task ID (meaningless in other scenarios). The default value is -1. + |
+
state + |
+No + |
+STRING + |
+Cluster status. The value FAILED indicates that the command fails to be executed. The value COMPLETE indicates that the command is successfully executed. + |
+
error_code + |
+No + |
+INTEGER + |
+Error code returned + |
+
error_description + |
+No + |
+STRING + |
+Error code description + |
+
total_progress + |
+No + |
+FLOAT + |
+Total progress + |
+
res_obj + |
+No + |
+REFERENCE + |
+Response object + |
+
Parameter + |
+Mandatory or Not + |
+Type + |
+Description + |
+
|---|---|---|---|
state + |
+Yes + |
+STRING + |
+Cluster health status +Good: The cluster is healthy. +Bad: The cluster is unhealthy. + |
+
Status Code + |
+Description + |
+
|---|---|
200 + |
+The operation is successful. + |
+
For details about error status codes, see Status Codes.
+This API is used to query basic information about a specified cluster.
+GET /web/v1/clusters
+HTTP/1.1 200 OK
+Data:Wed,02 May 2018 10:10:01 GMT
+Server: example-server
+Content-Type: application/json
+{
+ "id": 0,
+ "state": "COMPLETE",
+ "error_code": 0,
+ "error_description": "string",
+ "total_progress": 0,
+ "res_obj": {
+ "clusters": [
+ {
+ "stack": "string",
+ "id": 0,
+ "name": "string",
+ "description": "string",
+ "version": "string",
+ "cluster_state": "string",
+ "stack_model": "string",
+ "lic_state": "string"
+ }
+ ]
+ }
+}
+Parameter + |
+Mandatory or Not + |
+Type + |
+Description + |
+
|---|---|---|---|
id + |
+No + |
+LONG + |
+Asynchronous task ID (meaningless in other scenarios). The default value is -1. + |
+
state + |
+No + |
+STRING + |
+Cluster status. The value FAILED indicates that the command fails to be executed. The value COMPLETE indicates that the command is successfully executed. + |
+
error_code + |
+No + |
+INTEGER + |
+Error code returned + |
+
error_description + |
+No + |
+STRING + |
+Error code description + |
+
total_progress + |
+No + |
+FLOAT + |
+Total progress + |
+
res_obj + |
+No + |
+REFERENCE + |
+Response object + |
+
Parameter + |
+Mandatory or Not + |
+Type + |
+Description + |
+
|---|---|---|---|
clusters + |
+No + |
+ARRAY_REFERENCE + |
+Records all installed clusters in arrays. + |
+
Parameter + |
+Mandatory or Not + |
+Type + |
+Description + |
+
|---|---|---|---|
stack + |
+No + |
+STRING + |
+Cluster version information + |
+
id + |
+No + |
+INTEGER + |
+Cluster ID + |
+
name + |
+No + |
+STRING + |
+Cluster name + |
+
description + |
+No + |
+STRING + |
+Cluster description + |
+
version + |
+No + |
+STRING + |
+Cluster version + |
+
cluster_state + |
+No + |
+STRING + |
+Cluster status. Possible values are as follows: +Null: There is no special status. +installingPatch: The patch is being installed. + |
+
stack_model + |
+No + |
+STRING + |
+Security mode of a cluster. Possible values are as follows: +NoSec: Normal mode +Sec: Security mode + |
+
lic_state + |
+No + |
+STRING + |
+License status + |
+
Status Code + |
+Description + |
+
|---|---|
200 + |
+The operation is successful. + |
+
For details about error status codes, see Status Codes.
+This API is used to query the command execution progress by command ID, including the total progress and the detailed progress of each step.
+GET /web/v1/common/command/{command_id}/progress
+Parameter + |
+Mandatory or Not + |
+Description + |
+
|---|---|---|
command_id + |
+Yes + |
+Command ID, which can be obtained from the response of the asynchronous request +Asynchronous requests include requests for saving configurations and starting and stopping services. + |
+
HTTP/1.1 200 OK
+Data:Wed,02 May 2018 10:10:01 GMT
+Server: example-server
+Content-Type: application/json
+{
+ "id": 0,
+ "state": "COMPLETE",
+ "error_code": 0,
+ "error_description": "string",
+ "total_progress": 0,
+ "res_obj": {
+ "cluster_id": 0,
+ "step_list": [
+ {
+ "name": "string",
+ "description": "string"
+ }
+ ],
+ "fail_entity_list": [
+ {
+ "fail_entity": "string",
+ "operation_type": "string"
+ }
+ ],
+ "total_step_size": 0
+ }
+}
+Parameter + |
+Mandatory or Not + |
+Type + |
+Description + |
+
|---|---|---|---|
id + |
+No + |
+LONG + |
+Asynchronous task ID (meaningless in other scenarios). The default value is -1. + |
+
state + |
+No + |
+STRING + |
+Cluster status. The value FAILED indicates that the command fails to be executed. The value COMPLETE indicates that the command is successfully executed. + |
+
error_code + |
+No + |
+INTEGER + |
+Error code returned + |
+
error_description + |
+No + |
+STRING + |
+Error code description + |
+
total_progress + |
+No + |
+FLOAT + |
+Total progress + |
+
res_obj + |
+No + |
+REFERENCE + |
+Response object + |
+
Parameter + |
+Mandatory or Not + |
+Type + |
+Description + |
+
|---|---|---|---|
cluster_id + |
+No + |
+INTEGER + |
+Cluster ID + |
+
step_list + |
+Yes + |
+ARRAY_REFERENCE + |
+Records the progress of each step in an array. A command may be divided into multiple steps for execution. + |
+
fail_entity_list + |
+No + |
+ARRAY_REFERENCE + |
+List of failed operations. Currently, this function is supported for starting, stopping, and restarting the service. Other operations are not supported (an empty array is returned). + |
+
total_step_size + |
+Yes + |
+INTEGER + |
+Total command execution progress. The value ranges from 0 to 100. + |
+
Parameter + |
+Mandatory or Not + |
+Type + |
+Description + |
+
|---|---|---|---|
name + |
+No + |
+STRING + |
+Partition name + |
+
description + |
+No + |
+STRING + |
+Description + |
+
Parameter + |
+Mandatory or Not + |
+Type + |
+Description + |
+
|---|---|---|---|
fail_entity + |
+No + |
+STRING + |
+Failed instance + |
+
operation_type + |
+No + |
+STRING + |
+Operation type: STOP or START + |
+
Status Code + |
+Description + |
+
|---|---|
200 + |
+The operation is successful. + |
+
For details about error status codes, see Status Codes.
+This API is used to save configurations of services, roles, and instances. This API allows you to perform the following operations:
+POST /web/v1/config/cluster/{cluster_id}/save
+Parameter + |
+Mandatory or Not + |
+Description + |
+
|---|---|---|
cluster_id + |
+Yes + |
+Cluster ID that is displayed on MRS Manager. The default cluster ID is 1, because MRS Manager supports management of only one cluster currently. + |
+
POST /web/v1/config/cluster/{cluster_id}/save HTTP/1.1
+Host: example.com
+Content-Type: application/json
+Accept:application/json
+{
+ "id": 0,
+ "user_password": "string",
+ "configurations_summary": {
+ "restart_affected_components": true,
+ "components": [
+ {
+ "component_name": "string",
+ "configurations": [
+ {
+ "name": "string",
+ "value": "string",
+ "default_value": "string",
+ "description": "string",
+ "type": "string",
+ "config_group_type": "string",
+ "config_group": "string",
+ "item_type": "string",
+ "item_conf": "string",
+ "item_event": "string",
+ "weak_reference": "string"
+ }
+ ],
+ "children": [
+ {
+ "role_name": "string",
+ "configurations": [],
+ "children": [
+ {
+ "node": {
+ "id": 0,
+ "name": "string",
+ "description": "string",
+ "controller_id": "string",
+ "ip_address": "string",
+ "business_ip_address": "string",
+ "rack": "string",
+ "host_name": "string",
+ "total_memory": "string",
+ "available_memory": "string",
+ "total_hard_disk_space": "string",
+ "available_hard_disk_space": "string",
+ "no_of_CPUs": "string",
+ "available_swap_memory": "string",
+ "total_swap_memory": "string",
+ "cpu_usage": "string",
+ "disk_usage": "string",
+ "health_status": "GOOD",
+ "memory_usage": "string",
+ "swap_memory_usage": "string",
+ "files_info": [
+ {
+ "name": "string",
+ "description": "string"
+ }
+ ],
+ "operational_status": "STARTED",
+ "network_read": "string",
+ "network_write": "string",
+ "instances": [
+ {
+ "name": "string",
+ "id": "string",
+ "operational_status": "STARTED",
+ "health_status": "GOOD",
+ "ha_status": "ACTIVE",
+ "config_status": {
+ "level": "string",
+ "status": "UNKNOWN",
+ "description": "string"
+ },
+ "role_name": "string",
+ "service_name": "string",
+ "web_UI_address": "string",
+ "is_service_role": true,
+ "pair_name": "string",
+ "support_decom": true
+ }
+ ],
+ "is_OMS_node": true
+ },
+ "configurations": []
+ }
+ ],
+ "classification": [
+ {
+ "name": "string",
+ "description": "string"
+ }
+ ]
+ }
+ ],
+ "classification": [
+ {
+ "name": "string",
+ "description": "string"
+ }
+ ]
+ }
+ ]
+ }
+}
+Parameter + |
+Mandatory or Not + |
+Type + |
+Description + |
+
|---|---|---|---|
id + |
+No + |
+LONG + |
+Asynchronous task ID (meaningless in other scenarios). The default value is -1. + |
+
user_password + |
+No + |
+STRING + |
+User password + |
+
configurations_summary + |
+Yes + |
+REFERENCE + |
+Configures a description object. + |
+
Parameter + |
+Mandatory or Not + |
+Type + |
+Description + |
+
|---|---|---|---|
restart_affected_components + |
+No + |
+BOOLEAN + |
+Whether to restart the affected components +true: Restart +false: Do not restart + |
+
components + |
+No + |
+ARRAY_REFERENCE + |
+Service list + |
+
Parameter + |
+Mandatory or Not + |
+Type + |
+Description + |
+
|---|---|---|---|
component_name + |
+No + |
+STRING + |
+Service name + |
+
configurations + |
+No + |
+ARRAY_REFERENCE + |
+Description of the service, role, or instance level. + |
+
children + |
+No + |
+ARRAY_REFERENCE + |
+Sublevel description array. The sublevel of the service level is role. + |
+
classification + |
+No + |
+ARRAY_REFERENCE + |
+Configuration definition information + |
+
Parameter + |
+Mandatory or Not + |
+Type + |
+Description + |
+
|---|---|---|---|
role_name + |
+No + |
+STRING + |
+Role name + |
+
configurations + |
+No + |
+ARRAY_REFERENCE + |
+Configuration item description array: Service level/role level/instance level + |
+
children + |
+No + |
+ARRAY_REFERENCE + |
+Sublevel description array. The sublevel of the role level is instance. + |
+
classification + |
+No + |
+ARRAY_REFERENCE + |
+Configuration definition information + |
+
Parameter + |
+Mandatory or Not + |
+Type + |
+Description + |
+
|---|---|---|---|
name + |
+No + |
+STRING + |
+Name of the configuration item to be saved + |
+
value + |
+No + |
+STRING + |
+Value to be saved + |
+
default_value + |
+No + |
+STRING + |
+Default value + |
+
description + |
+No + |
+STRING + |
+Configuration item description + |
+
type + |
+No + |
+STRING + |
+Configuration item type + |
+
config_group_type + |
+No + |
+STRING + |
+Configuration group type + |
+
config_group + |
+No + |
+STRING + |
+Configuration group + |
+
item_type + |
+No + |
+STRING + |
+Type of the configuration item value to be saved + |
+
item_conf + |
+No + |
+STRING + |
+Configuration item value validity check + |
+
item_event + |
+No + |
+STRING + |
+Event type of a configuration item. Currently, only hide-show is supported. + |
+
weak_reference + |
+No + |
+STRING + |
+Whether a configuration item is a weak reference. If the configuration item is a weak reference, the configuration parsing is passed even though the configuration item name or role name does not exist, and the value will be set to an empty string. + |
+
Parameter + |
+Mandatory or Not + |
+Type + |
+Description + |
+
|---|---|---|---|
name + |
+No + |
+STRING + |
+Name + |
+
description + |
+No + |
+STRING + |
+Description + |
+
HTTP/1.1 200 OK
+Data:Wed,02 May 2018 10:10:01 GMT
+Server: example-server
+Content-Type: application/json
+{
+ "id": 0,
+ "state": "COMPLETE",
+ "error_code": 0,
+ "error_description": "string",
+ "total_progress": 0
+}
+Parameter + |
+Mandatory or Not + |
+Type + |
+Description + |
+
|---|---|---|---|
id + |
+No + |
+LONG + |
+Asynchronous task ID (meaningless in other scenarios). The default value is -1. + |
+
state + |
+No + |
+STRING + |
+Cluster status. The value FAILED indicates that the command fails to be executed. The value COMPLETE indicates that the command is successfully executed. + |
+
error_code + |
+No + |
+INTEGER + |
+Error code returned + |
+
error_description + |
+No + |
+STRING + |
+Error code description + |
+
total_progress + |
+No + |
+FLOAT + |
+Total progress + |
+
Status Code + |
+Description + |
+
|---|---|
200 + |
+The operation is successful. + |
+
For details about error status codes, see Status Codes.
+This API is used to return a temporary redirection, that is, a URL for logging out of the CAS, when you log out of the MapReduce Service system. This API can be used only by security clusters that support Kerberos authentication.
+GET /web/v1/logout_action
+Parameter + |
+Mandatory or Not + |
+Description + |
+
|---|---|---|
is_timeout_logout + |
+No + |
+Whether to exit due to page timeout. This parameter is optional. Different audit logs are recorded in the background when a user logs out manually or exits due to timeout. +Possible values are as follows: +true: Logout due to timeout +false: Manual logout +The default value is false. + |
+
Status Code + |
+Description + |
+
|---|---|
200 + |
+The operation is successful. + |
+
For details about error status codes, see Status Codes.
+This API is used to start a specified service.
+POST /web/v1/maintain/cluster/{cluster_id}/service/{service_name}/start
+Parameter + |
+Mandatory or Not + |
+Description + |
+
|---|---|---|
service_name + |
+Yes + |
+Name of the service to be started + |
+
cluster_id + |
+Yes + |
+Cluster ID that is displayed on MRS Manager. The default cluster ID is 1, because MRS Manager supports management of only one cluster currently. + |
+
POST /web/v1/maintain/cluster/{cluster_id}/service/{service_name}/start HTTP/1.1
+Host: example.com
+Content-Type: application/json
+Accept:application/json
+{
+ "user_password": "string",
+ "only_self": true
+}
+Parameter + |
+Mandatory or Not + |
+Description + |
+
|---|---|---|
user_password + |
+No + |
+Password of the login user. This parameter is used for secondary authentication. You do not need to enter a specific value when starting the service. The parameter value can be null. + |
+
only_self + |
+No + |
+Whether to operate only the specified service +false: The services on which the service depends are also started. +true: Only the specified service is started. + |
+
HTTP/1.1 200 OK
+Data:Wed,02 May 2018 10:10:01 GMT
+Server: example-server
+Content-Type: application/json
+{
+ "id": 0,
+ "state": "COMPLETE",
+ "error_code": 0,
+ "error_description": "string",
+ "total_progress": 0
+}
+Parameter + |
+Mandatory or Not + |
+Type + |
+Description + |
+
|---|---|---|---|
id + |
+No + |
+LONG + |
+Asynchronous task ID (meaningless in other scenarios). The default value is -1. + |
+
state + |
+No + |
+STRING + |
+Cluster status +
|
+
error_code + |
+No + |
+INTEGER + |
+Error code returned + |
+
error_description + |
+No + |
+STRING + |
+Error code description + |
+
total_progress + |
+No + |
+FLOAT + |
+Total progress + |
+
Status Code + |
+Description + |
+
|---|---|
200 + |
+The operation is successful. + |
+
For details about error status codes, see Status Codes.
+This API is used to stop a specified service.
+POST /web/v1/maintain/cluster/{cluster_id}/service/{service_name}/stop
+Parameter + |
+Mandatory or Not + |
+Description + |
+
|---|---|---|
service_name + |
+Yes + |
+Name of the service to be stopped + |
+
cluster_id + |
+Yes + |
+Cluster ID that is displayed on MRS Manager. The default cluster ID is 1, because MRS Manager supports management of only one cluster currently. + |
+
POST /web/v1/maintain/cluster/{cluster_id}/service/{service_name}/stop HTTP/1.1
+Host: example.com
+Content-Type: application/json
+Accept:application/json
+{
+ "user_password": "string",
+ "only_self": true
+}
+Parameter + |
+Mandatory or Not + |
+Type + |
+Description + |
+
|---|---|---|---|
user_password + |
+No + |
+STRING + |
+Password of the login user. This parameter is used for secondary authentication. If you call REST APIs, secondary authentication is not required and you do not need to set this parameter. + |
+
only_self + |
+No + |
+BOOLEAN + |
+Whether to operate only the specified service +false: The services depending on the service are also stopped. +true: Only the specified service is stopped. +If you call REST APIs, secondary authentication is not required and you do not need to set this parameter. + |
+
HTTP/1.1 200 OK
+Data:Wed,02 May 2018 10:10:01 GMT
+Server: example-server
+Content-Type: application/json
+{
+ "id": 0,
+ "state": "COMPLETE",
+ "error_code": 0,
+ "error_description": "string",
+ "total_progress": 0
+}
+Parameter + |
+Mandatory or Not + |
+Description + |
+
|---|---|---|
id + |
+No + |
+Asynchronous task ID (meaningless in other scenarios). The default value is -1. + |
+
state + |
+No + |
+Cluster status +
|
+
error_code + |
+No + |
+Error code returned + |
+
error_description + |
+No + |
+Error code description + |
+
total_progress + |
+No + |
+Total progress + |
+
Status Code + |
+Description + |
+
|---|---|
200 + |
+The operation is successful. + |
+
For details about error status codes, see Status Codes.
+This API is used to query performance monitoring items supported by a specified host.
+GET /web/v1/monitor/metrics_info
+Parameter + |
+Mandatory or Not + |
+Description + |
+
|---|---|---|
metric_names + |
+Yes + |
+Monitoring metric name. Use commas (,) to separate metric names. You can enter a maximum of 10 metric names at a time. +Example metric names are as follows: +
|
+
metric_period + |
+No + |
+Metric period, which can be real time, 5 minutes, 30 minutes, or 60 minutes + |
+
start_time + |
+No + |
+Start time, expressed in milliseconds. The data type is Long. The default value is the earliest system time. + |
+
end_time + |
+No + |
+End time, expressed in milliseconds. The data type is Long. The default value is the latest system time. + |
+
hosts + |
+No + |
+List of host names to be queried. Use commas (,) to separate host names. You can enter a maximum of 50 host names to meet the input length requirements of the browser. + |
+
host_group + |
+No + |
+Name of the host group created by a user. This function is not available in the current version. + |
+
metric_node_type + |
+No + |
+You can set this parameter to obtain the monitoring metrics of a node. The possible values are as follows: +
|
+
extend + |
+No + |
+Metric extended field, which records information about small metrics + |
+
HTTP/1.1 200 OK
+Data:Wed,02 May 2018 10:10:01 GMT
+Server: example-server
+Content-Type: application/json
+{
+ "id": 0,
+ "state": "COMPLETE",
+ "error_code": 0,
+ "error_description": "string",
+ "total_progress": 0,
+ "res_obj": {
+ "metric_datas": {
+ "additionalProp1": [
+ {
+ "time": 0,
+ "value": "string",
+ "node": "string"
+ }
+ ]
+ }
+ }
+}
+Parameter + |
+Mandatory or Not + |
+Type + |
+Description + |
+
|---|---|---|---|
id + |
+No + |
+LONG + |
+Asynchronous task ID (meaningless in other scenarios). The default value is -1. + |
+
state + |
+No + |
+STRING + |
+Cluster status. The value FAILED indicates that the command fails to be executed. The value COMPLETE indicates that the command is successfully executed. + |
+
error_code + |
+No + |
+INTEGER + |
+Error code returned + |
+
error_description + |
+No + |
+STRING + |
+Error code description + |
+
total_progress + |
+No + |
+FLOAT + |
+Total progress + |
+
res_obj + |
+No + |
+REFERENCE + |
+Response object + |
+
Parameter + |
+Mandatory or Not + |
+Type + |
+Description + |
+
|---|---|---|---|
metric_datas + |
+No + |
+MAP + |
+Monitoring data. +Key indicates the name of a monitoring item. +Value indicates a list of monitored metric parameters queried. + |
+
Parameter + |
+Mandatory or Not + |
+Type + |
+Description + |
+
|---|---|---|---|
time + |
+No + |
+BIGDECIMAL + |
+Time when monitoring metric value is collected + |
+
value + |
+No + |
+STRING + |
+Monitoring metric value + |
+
node + |
+No + |
+STRING + |
+Node where the monitoring metric is collected + |
+
extend + |
+No + |
+STRING + |
+Metric extended field, which records information about small metrics + |
+
Status Code + |
+Description + |
+
|---|---|
200 + |
+The operation is successful. + |
+
For details about error status codes, see Status Codes.
+This API is used to query summary of a specified service in a cluster.
+GET /web/v1/cluster/{cluster_id}/services/{service_name}
+Parameter + |
+Mandatory or Not + |
+Description + |
+
|---|---|---|
cluster_id + |
+Yes + |
+Cluster ID that is displayed on MRS Manager. The default cluster ID is 1, because MRS Manager supports management of only one cluster currently. + |
+
service_name + |
+Yes + |
+Name of the service to be queried. +For example, the service name is HBase, HDFS, or Spark. + |
+
HTTP/1.1 200 OK
+Data:Wed,02 May 2018 10:10:01 GMT
+Server: example-server
+Content-Type: application/json {
+ "id": 0,
+ "state": "NEW",
+ "error_code": 0,
+ "error_description": "string",
+ "total_progress": 0,
+ "res_obj": {
+ "key_property": [
+ {
+ "name": "string",
+ "value": {},
+ "type": "TEXT"
+ }
+ ]
+ }
+}
+Parameter + |
+Mandatory or Not + |
+Type + |
+Description + |
+
|---|---|---|---|
id + |
+No + |
+LONG + |
+Asynchronous task ID (meaningless in other scenarios). The default value is -1. + |
+
state + |
+No + |
+STRING + |
+Cluster status. The value FAILED indicates that the command fails to be executed. The value COMPLETE indicates that the command is successfully executed. + |
+
error_code + |
+No + |
+INTEGER + |
+Error code returned + |
+
error_description + |
+No + |
+STRING + |
+Error code description + |
+
total_progress + |
+No + |
+FLOAT + |
+Total progress + |
+
res_obj + |
+No + |
+REFERENCE + |
+Response object + |
+
Parameter + |
+Mandatory or Not + |
+Type + |
+Description + |
+
|---|---|---|---|
name + |
+No + |
+STRING + |
+Property name + |
+
value + |
+No + |
+<T> + |
+Property value + |
+
type + |
+No + |
+ENUM +<Enumeration> + |
+Property type +Possible values are: +STATUS +TEXT + |
+
Status Code + |
+Description + |
+
|---|---|
200 + |
+The operation is successful. + |
+
For details about error status codes, see Status Codes.
+Release Date + |
+What's New + |
+
|---|---|
2022-9-29 + |
+Modified the following content: +
|
+
2022-07-05 + |
+Modified the following content: +
|
+
2021-06-30 + |
+Modified the following content: +Added MRS 3.1.0-LTS.1. For details, see Creating Clusters and Creating a Cluster and Running a Job. + |
+
2020-10-19 + |
+Modified the following content: +
|
+
2020-09-25 + |
+Added the following APIs: + + |
+
2020-03-09 + |
+Modified the following content: +All components in MRS 2.1.0 are added. For details, see Querying a Cluster List and Querying Cluster Details. + |
+
2020-02-22 + |
+Modified the following content: +
|
+
2019-12-06 + |
+Modified the following content: + + |
+
2019-07-17 + |
+Modified the following content: + + |
+
2019-07-03 + |
+Modified the following content: + + |
+
2018-11-30 + |
+Accepted in OTC 3.2. + |
+
2018-10-26 + |
+Modified the following content: +
|
+
2018-09-10 + |
+Modified the following content: + + |
+
2018-08-30 + |
+Modified the following content: + + |
+
2018-05-29 + |
+
|
+
2018-03-16 + |
+
|
+
2017-11-08 + |
+
|
+
2017-06-09 + |
+
|
+
2017-04-06 + |
+
|
+
2017-02-20 + |
+This issue is the first official release. + |
+