云服务器内容精选

  • 请求示例 批量删除作业请求示例 POST https://{endpoint}/v2/{project_id}/clusters/{cluster_id}/job-executions/batch-delete { "job_id_list" : [ "48c45725-b699-4aa9-9bfd-f7ff87eb6fe8", "af846665-dd32-4349-a8b5-561e109c383c" ] }
  • 请求示例 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"}
  • 响应示例 状态码: 200 新增作业成功。 { "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" : null, "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 }}