MapReduce服务 MRS-新增作业并执行(废弃):请求示例

时间:2023-11-01 16:25:03

请求示例

  • MapReduce作业请求示例
    POST https://{endpoint}/v1.1/{project_id}/jobs/submit-job{  "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" : ""}
  • Spark作业请求示例
    POST https://{endpoint}/v1.1/{project_id}/jobs/submit-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" : ""}
  • Hive Script作业请求示例
    POST https://{endpoint}/v1.1/{project_id}/jobs/submit-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"}
  • DistCp导入作业请求示例
    POST https://{endpoint}/v1.1/{project_id}/jobs/submit-job{  "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"}
  • DistCp导出作业请求示例
    POST https://{endpoint}/v1.1/{project_id}/jobs/submit-job{  "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"}
  • Spark Script作业请求示例
    POST https://{endpoint}/v1.1/{project_id}/jobs/submit-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"}
support.huaweicloud.com/api-mrs/CreateAndExecuteJob.html