Added: oozie/site/trunk/content/resources/docs/5.0.0/WebServicesAPI.html URL: http://svn.apache.org/viewvc/oozie/site/trunk/content/resources/docs/5.0.0/WebServicesAPI.html?rev=1828722&view=auto ============================================================================== --- oozie/site/trunk/content/resources/docs/5.0.0/WebServicesAPI.html (added) +++ oozie/site/trunk/content/resources/docs/5.0.0/WebServicesAPI.html Mon Apr 9 14:12:36 2018 @@ -0,0 +1,2476 @@ +<!DOCTYPE html> +<!-- + | Generated by Apache Maven Doxia at Apr 9, 2018 + | Rendered using Apache Maven Fluido Skin 1.4 +--> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <meta charset="UTF-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <meta http-equiv="Content-Language" content="en" /> + <title>Oozie - </title> + <link rel="stylesheet" href="./css/apache-maven-fluido-1.4.min.css" /> + <link rel="stylesheet" href="./css/site.css" /> + <link rel="stylesheet" href="./css/print.css" media="print" /> + + + <script type="text/javascript" src="./js/apache-maven-fluido-1.4.min.js"></script> + + + </head> + <body class="topBarDisabled"> + + + + <div class="container-fluid"> + <div id="banner"> + <div class="pull-left"> + <a href="https://oozie.apache.org/" id="bannerLeft"> + <img src="https://oozie.apache.org/images/oozie_200x.png" alt="Oozie"/> + </a> + </div> + <div class="pull-right"> </div> + <div class="clear"><hr/></div> + </div> + + <div id="breadcrumbs"> + <ul class="breadcrumb"> + + + <li class=""> + <a href="../../" title="Apache"> + Apache</a> + <span class="divider">/</span> + </li> + <li class=""> + <a href="../../" title="Oozie"> + Oozie</a> + <span class="divider">/</span> + </li> + <li class=""> + <a href="../" title="docs"> + docs</a> + <span class="divider">/</span> + </li> + <li class=""> + <a href="./" title="5.0.0"> + 5.0.0</a> + <span class="divider">/</span> + </li> + <li class="active ">Oozie - </li> + + + + <li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2018-04-09</li> + <li id="projectVersion" class="pull-right"> + Version: 5.0.0 + </li> + + </ul> + </div> + + + <div class="row-fluid"> + <div id="leftColumn" class="span2"> + <div class="well sidebar-nav"> + + + <ul class="nav nav-list"> + </ul> + + + + <hr /> + + <div id="poweredBy"> + <div class="clear"></div> + <div class="clear"></div> + <div class="clear"></div> + <div class="clear"></div> + <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"> + <img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /> + </a> + </div> + </div> + </div> + + + <div id="bodyColumn" class="span10" > + + <p></p> +<p><a href="./index.html">::Go back to Oozie Documentation Index::</a> +</p> +<hr /> +<p><ul><li><a href="#Oozie_Web_Services_API_V1_Workflow_Coordinator_And_Bundle">Oozie Web Services API, V1 (Workflow, Coordinator, And Bundle)</a> +<ul><li><a href="#Versions_End-Point">Versions End-Point</a> +</li> +<li><a href="#Admin_End-Point">Admin End-Point</a> +<ul><li><a href="#System_Status">System Status</a> +</li> +<li><a href="#OS_Environment">OS Environment</a> +</li> +<li><a href="#Java_System_Properties">Java System Properties</a> +</li> +<li><a href="#Oozie_Configuration">Oozie Configuration</a> +</li> +<li><a href="#Oozie_Instrumentation">Oozie Instrumentation</a> +</li> +<li><a href="#Oozie_Metrics">Oozie Metrics</a> +</li> +<li><a href="#Version">Version</a> +</li> +<li><a href="#Available_Time_Zones">Available Time Zones</a> +</li> +<li><a href="#Queue_Dump">Queue Dump</a> +</li> +<li><a href="#Available_Oozie_Servers">Available Oozie Servers</a> +</li> +<li><a href="#List_available_sharelib">List available sharelib</a> +</li> +<li><a href="#Update_system_sharelib">Update system sharelib</a> +</li> +<li><a href="#Purge_Command">Purge Command</a> +</li> +</ul> +</li> +<li><a href="#Job_and_Jobs_End-Points">Job and Jobs End-Points</a> +<ul><li><a href="#Job_Submission">Job Submission</a> +</li> +<li><a href="#Standard_Job_Submission">Standard Job Submission</a> +</li> +<li><a href="#Proxy_MapReduce_Job_Submission">Proxy MapReduce Job Submission</a> +</li> +<li><a href="#Proxy_Pig_Job_Submission">Proxy Pig Job Submission</a> +</li> +<li><a href="#Proxy_Hive_Job_Submission">Proxy Hive Job Submission</a> +</li> +<li><a href="#Proxy_Sqoop_Job_Submission">Proxy Sqoop Job Submission</a> +</li> +<li><a href="#Managing_a_Job">Managing a Job</a> +<ul><li><a href="#Re-Running_a_Workflow_Job">Re-Running a Workflow Job</a> +</li> +<li><a href="#Re-Running_a_coordinator_job">Re-Running a coordinator job</a> +</li> +<li><a href="#Re-Running_a_bundle_job">Re-Running a bundle job</a> +</li> +<li><a href="#Changing_endtimeconcurrencypausetime_of_a_Coordinator_Job">Changing endtime/concurrency/pausetime of a Coordinator Job</a> +</li> +<li><a href="#Updating_coordinator_definition_and_properties">Updating coordinator definition and properties</a> +</li> +</ul> +</li> +<li><a href="#Job_Information">Job Information</a> +</li> +<li><a href="#Job_Application_Definition">Job Application Definition</a> +</li> +<li><a href="#Job_Log">Job Log</a> +</li> +<li><a href="#Job_Error_Log">Job Error Log</a> +</li> +<li><a href="#Job_Audit_Log">Job Audit Log</a> +</li> +<li><a href="#Filtering_the_server_logs_with_logfilter_options">Filtering the server logs with logfilter options</a> +</li> +<li><a href="#Job_graph">Job graph</a> +</li> +<li><a href="#Job_Status">Job Status</a> +</li> +<li><a href="#Changing_job_SLA_definition_and_alerting">Changing job SLA definition and alerting</a> +</li> +</ul> +</li> +<li><a href="#Getting_missing_dependencies_of_coordinator_actions">Getting missing dependencies of coordinator action(s)</a> +<ul><li><a href="#Bulk_modify_jobs">Bulk modify jobs</a> +</li> +<li><a href="#Jobs_information_using_Bulk_API">Jobs information using Bulk API</a> +</li> +</ul> +</li> +</ul> +</li> +<li><a href="#Oozie_Web_Services_API_V2_Workflow__Coordinator_And_Bundle">Oozie Web Services API, V2 (Workflow , Coordinator And Bundle)</a> +<ul><li><a href="#Job_and_Jobs_End-Points_">Job and Jobs End-Points</a> +<ul><li><a href="#Job_Information_">Job Information</a> +</li> +<li><a href="#Managing_a_Job_">Managing a Job</a> +<ul><li><a href="#Ignore_a_Coordinator_Job_or_Action">Ignore a Coordinator Job or Action</a> +</li> +</ul> +</li> +</ul> +</li> +<li><a href="#Validate_End-Point">Validate End-Point</a> +<ul><li><a href="#Validate_a_local_file">Validate a local file</a> +</li> +<li><a href="#Validate_a_file_in_HDFS">Validate a file in HDFS</a> +</li> +</ul> +</li> +</ul> +</li> +</ul> +</p> +<a name="Oozie_Web_Services_API_V1_Workflow_Coordinator_And_Bundle"></a> +<div class="section"><h3>Oozie Web Services API, V1 (Workflow, Coordinator, And Bundle)</h3> +<p>The Oozie Web Services API is a HTTP REST JSON API.</p> +<p>All responses are in <tt>UTF-8</tt> +.</p> +<p>Assuming Oozie is running at <tt>OOZIE_URL</tt> +, the following web services end points are supported:</p> +<p><ul><li><OOZIE_URL>/versions</li> +<li><OOZIE_URL>/v1/admin</li> +<li><OOZIE_URL>/v1/job</li> +<li><OOZIE_URL>/v1/jobs</li> +<li><OOZIE_URL>/v2/job</li> +<li><OOZIE_URL>/v2/jobs</li> +<li><OOZIE_URL>/v2/admin</li> +<li><OOZIE_URL>/v2/sla</li> +</ul> +</p> +<p>Documentation on the API is below; in some cases, looking at the corresponding command in the +<a href="./DG_CommandLineTool.html">Command Line Documentation</a> + page will provide additional details and examples. Most of the functionality +offered by the Oozie CLI is using the WS API. If you export <tt>OOZIE_DEBUG</tt> + then the Oozie CLI will output the WS API +details used by any commands you execute. This is useful for debugging purposes to or see how the Oozie CLI works with the WS API.</p> +<a name="Versions_End-Point"></a> +<div class="section"><h4>Versions End-Point</h4> +<p><i>Identical to the corresponding Oozie v0 WS API</i> +</p> +<p>This endpoint is for clients to perform protocol negotiation.</p> +<p>It support only HTTP GET request and not sub-resources.</p> +<p>It returns the supported Oozie protocol versions by the server.</p> +<p>Current returned values are <tt>0, 1, 2</tt> +.</p> +<p><b>Request:</b> +</p> +<p><pre> +GET /oozie/versions +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +. +[0,1] +</pre></p> +<a name="Admin_End-Point"></a> +</div> +<div class="section"><h4>Admin End-Point</h4> +<p>This endpoint is for obtaining Oozie system status and configuration information.</p> +<p>It supports the following sub-resources: <tt>status, os-env, sys-props, configuration, instrumentation, systems, available-timezones</tt> +.</p> +<a name="System_Status"></a> +<div class="section"><h5>System Status</h5> +<p><i>Identical to the corresponding Oozie v0 WS API</i> +</p> +<p>A HTTP GET request returns the system status.</p> +<p><b>Request:</b> +</p> +<p><pre> +GET /oozie/v1/admin/status +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +. +{"systemMode":NORMAL} +</pre></p> +<p>With a HTTP PUT request it is possible to change the system status between <tt>NORMAL</tt> +, <tt>NOWEBSERVICE</tt> +, and <tt>SAFEMODE</tt> +.</p> +<p><b>Request:</b> +</p> +<p><pre> +PUT /oozie/v1/admin/status?systemmode=SAFEMODE +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +</pre></p> +<a name="OS_Environment"></a> +</div> +<div class="section"><h5>OS Environment</h5> +<p><i>Identical to the corresponding Oozie v0 WS API</i> +</p> +<p>A HTTP GET request returns the Oozie system OS environment.</p> +<p><b>Request:</b> +</p> +<p><pre> +GET /oozie/v1/admin/os-env +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +. +{ + TERM: "xterm", + JAVA_HOME: "/usr/java/latest", + XCURSOR_SIZE: "", + SSH_CLIENT: "::ffff:127.0.0.1 49082 22", + XCURSOR_THEME: "default", + INPUTRC: "/etc/inputrc", + HISTSIZE: "1000", + PATH: "/usr/java/latest/bin" + KDE_FULL_SESSION: "true", + LANG: "en_US.UTF-8", + ... +} +</pre></p> +<a name="Java_System_Properties"></a> +</div> +<div class="section"><h5>Java System Properties</h5> +<p><i>Identical to the corresponding Oozie v0 WS API</i> +</p> +<p>A HTTP GET request returns the Oozie Java system properties.</p> +<p><b>Request:</b> +</p> +<p><pre> +GET /oozie/v1/admin/java-sys-properties +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +. +{ + java.vm.version: "11.0-b15", + sun.jnu.encoding: "UTF-8", + java.vendor.url: "http://java.sun.com/", + java.vm.info: "mixed mode", + ... +} +</pre></p> +<a name="Oozie_Configuration"></a> +</div> +<div class="section"><h5>Oozie Configuration</h5> +<p><i>Identical to the corresponding Oozie v0 WS API</i> +</p> +<p>A HTTP GET request returns the Oozie system configuration.</p> +<p><b>Request:</b> +</p> +<p><pre> +GET /oozie/v1/admin/configuration +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +. +{ + oozie.service.SchedulerService.threads: "5", + oozie.service.ActionService.executor.classes: " + org.apache.oozie.dag.action.decision.DecisionActionExecutor, + org.apache.oozie.dag.action.hadoop.HadoopActionExecutor, + org.apache.oozie.dag.action.hadoop.FsActionExecutor + ", + oozie.service.CallableQueueService.threads.min: "10", + oozie.service.DBLiteWorkflowStoreService.oozie.autoinstall: "true", + ... +} +</pre></p> +<a name="Oozie_Instrumentation"></a> +</div> +<div class="section"><h5>Oozie Instrumentation</h5> +<p><i>Identical to the corresponding Oozie v0 WS API</i> +</p> +<p>Deprecated and by default disabled since 5.0.0.</p> +<p>A HTTP GET request returns the Oozie instrumentation information. Keep in mind that timers and counters that the Oozie server +hasn't incremented yet will not show up.</p> +<p><b>Note:</b> + If Instrumentation is enabled, then Metrics is unavailable.</p> +<p><b>Request:</b> +</p> +<p><pre> +GET /oozie/v1/admin/instrumentation +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +. +{ + timers: [ + { + group: "db", + data: [ + { + ownMinTime: 2, + ownTimeStdDev: 0, + totalTimeStdDev: 0, + ownTimeAvg: 3, + ticks: 117, + name: "update-workflow", + ownMaxTime: 32, + totalMinTime: 2, + totalMaxTime: 32, + totalTimeAvg: 3 + }, + ... + ] + }, + ... + ], + samplers: [ + { + group: "callablequeue", + data: [ + { + name: "threads.active", + value: 1.8333333333333333 + }, + { + name: "delayed.queue.size", + value: 0 + }, + { + name: "queue.size", + value: 0 + } + ] + }, + ... + ], + variables: [ + { + group: "jvm", + data: [ + { + name: "max.memory", + value: 506920960 + }, + { + name: "total.memory", + value: 56492032 + }, + { + name: "free.memory", + value: 45776800 + } + ] + }, + ... + ] +} +</pre></p> +<a name="Oozie_Metrics"></a> +</div> +<div class="section"><h5>Oozie Metrics</h5> +<p><i>Available in the Oozie v2 WS API and later</i> +</p> +<p>A HTTP GET request returns the Oozie metrics information. Keep in mind that timers and counters that the Oozie server +hasn't incremented yet will not show up.</p> +<p><b>Note:</b> + If Metrics is enabled, then Instrumentation is unavailable.</p> +<p><b>Note:</b> + by default enabled since 5.0.0.</p> +<p><b>Request:</b> +</p> +<p><pre> +GET /oozie/v2/admin/metrics +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +. +{ + "gauges" : { + "jvm.memory.non-heap.committed" : { + "value" : 62590976 + }, + "oozie.mode" : { + "value" : "NORMAL" + }, + ... + }, + "timers" : { + "commands.action.end.call.timer" : { + "mean" : 108.5, + "p50" : 111.5, + "p75" : 165.5, + "p999" : 169, + "count" : 4, + "p95" : 169, + "max" : 169, + "mean_rate" : 0, + "duration_units" : "milliseconds", + "p98" : 169, + "m1_rate" : 0, + "rate_units" : "calls/millisecond", + "m15_rate" : 0, + "stddev" : 62.9417720330995, + "m5_rate" : 0, + "p99" : 169, + "min" : 42 + }, + ... + }, + "histograms" : { + "callablequeue.threads.active.histogram" : { + "p999" : 1, + "mean" : 0.0625, + "min" : 0, + "p75" : 0, + "p95" : 1, + "count" : 48, + "p98" : 1, + "stddev" : 0.24462302739504083, + "max" : 1, + "p99" : 1, + "p50" : 0 + }, + ... + }, + "counters" : { + "commands.job.info.executions" : { + "count" : 9 + }, + "jpa.CoordJobsGetPendingJPAExecutor" : { + "count" : 1 + }, + "jpa.GET_WORKFLOW" : { + "count" : 10 + }, + ... + } +} +</pre></p> +<a name="Version"></a> +</div> +<div class="section"><h5>Version</h5> +<p><i>Identical to the corresponding Oozie v0 WS API</i> +</p> +<p>A HTTP GET request returns the Oozie build version.</p> +<p><b>Request:</b> +</p> +<p><pre> +GET /oozie/v1/admin/build-version +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +. +{buildVersion: "3.0.0-SNAPSHOT" } +</pre></p> +<a name="Available_Time_Zones"></a> +</div> +<div class="section"><h5>Available Time Zones</h5> +<p>A HTTP GET request returns the available time zones.</p> +<p><b>Request:</b> +</p> +<p><pre> +GET /oozie/v1/admin/available-timezones +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +. +{ + "available-timezones":[ + { + "timezoneDisplayName":"SST (Pacific\/Midway)", + "timezoneId":"Pacific\/Midway" + }, + { + "timezoneDisplayName":"NUT (Pacific\/Niue)", + "timezoneId":"Pacific\/Niue" + }, + { + "timezoneDisplayName":"SST (Pacific\/Pago_Pago)", + "timezoneId":"Pacific\/Pago_Pago" + }, + { + "timezoneDisplayName":"SST (Pacific\/Samoa)", + "timezoneId":"Pacific\/Samoa" + }, + { + "timezoneDisplayName":"SST (US\/Samoa)", + "timezoneId":"US\/Samoa" + }, + { + "timezoneDisplayName":"HAST (America\/Adak)", + "timezoneId":"America\/Adak" + }, + { + "timezoneDisplayName":"HAST (America\/Atka)", + "timezoneId":"America\/Atka" + }, + { + "timezoneDisplayName":"HST (HST)", + "timezoneId":"HST" + }, + ... + ] +} +</pre></p> +<a name="Queue_Dump"></a> +</div> +<div class="section"><h5>Queue Dump</h5> +<p>A HTTP GET request returns the queue dump of the Oozie system. This is an administrator debugging feature.</p> +<p><b>Request:</b> +</p> +<p><pre>GET /oozie/v1/admin/queue-dump +</pre> +</p> +<a name="Available_Oozie_Servers"></a> +</div> +<div class="section"><h5>Available Oozie Servers</h5> +<p>A HTTP GET request returns the list of available Oozie Servers. This is useful when Oozie is configured +for <a href="./AG_Install.html#HA">High Availability</a> +; if not, it will simply return the one Oozie Server.</p> +<p><b>Request:</b> +</p> +<p><pre> +GET /oozie/v2/admin/available-oozie-servers +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +. +{ + "hostA": "http://hostA:11000/oozie", + "hostB": "http://hostB:11000/oozie", + "hostC": "http://hostC:11000/oozie", +} +</pre></p> +<a name="List_available_sharelib"></a> +</div> +<div class="section"><h5>List available sharelib</h5> +<p>A HTTP GET request to get list of available sharelib. +If the name of the sharelib is passed as an argument (regex supported) then all corresponding files are also listed.</p> +<p><b>Request:</b> +</p> +<p><pre> +GET /oozie/v2/admin/list_sharelib +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +{ + "sharelib": + [ + "oozie", + "hive", + "distcp", + "hcatalog", + "sqoop", + "mapreduce-streaming", + "pig" + ] +} +</pre></p> +<p><b>Request:</b> +</p> +<p><pre> +GET /oozie/v2/admin/list_sharelib?lib=pig* +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8{ + "sharelib": + [ + { + "pig": + { + "sharelibFiles": + [ + hdfs://localhost:9000/user/purushah/share/lib/lib_20131114095729/pig/pig.jar + hdfs://localhost:9000/user/purushah/share/lib/lib_20131114095729/pig/piggybank.jar + ] + } + } + ] +} +</pre> +</p> +<a name="Update_system_sharelib"></a> +</div> +<div class="section"><h5>Update system sharelib</h5> +<p>This webservice call makes the oozie server(s) to pick up the latest version of sharelib present +under oozie.service.WorkflowAppService.system.libpath directory based on the sharelib directory timestamp or reloads +the sharelib metafile if one is configured. The main purpose is to update the sharelib on the oozie server without restarting.</p> +<p><b>Request:</b> +</p> +<p><pre> +GET /oozie/v2/admin/update_sharelib +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +[ + { + "sharelibUpdate":{ + "host":"server1", + "status":"Server not found" + } + }, + { + "sharelibUpdate":{ + "host":"server2", + "status":"Successful", + "sharelibDirOld":"hdfs://localhost:51951/user/purushah/share/lib/lib_20140107181218", + "sharelibDirNew":"hdfs://localhost:51951/user/purushah/share/lib/lib_20140107181218" + } + }, + { + "sharelibUpdate":{ + "host":"server3", + "status":"Successful", + "sharelibDirOld":"hdfs://localhost:51951/user/purushah/share/lib/lib_20140107181218", + "sharelibDirNew":"hdfs://localhost:51951/user/purushah/share/lib/lib_20140107181218" + } + } +] +</pre></p> +<a name="Purge_Command"></a> +</div> +<div class="section"><h5>Purge Command</h5> +<p>Oozie admin purge command cleans up the Oozie Workflow/Coordinator/Bundle records based on the parameters. +The unit for parameters is day.</p> +<p>Purge command will delete the workflow records (wf=30) older than 30 days, coordinator records (coord=7) older than 7 days and +bundle records (bundle=7) older than 7 days. The limit (limit=10) defines, number of records to be fetch at a time. Turn +(oldCoordAction=true/false) <tt>on/off</tt> + coordinator action record purging for long running coordinators. If any of the parameter is +not provided, then it will be taken from the <tt>oozie-default/oozie-site</tt> + configuration.</p> +<p><b>Request:</b> +</p> +<p><pre>GET /oozie/v2/admin/purge?wf=30&coord=7&bundle=7&limit=10&oldCoordAction=true +</pre> +</p> +<p><b>Response:</b> +</p> +<p><pre>{ + "purge": "Purge command executed successfully" +} +</pre> +</p> +<a name="Job_and_Jobs_End-Points"></a> +</div> +</div> +<div class="section"><h4>Job and Jobs End-Points</h4> +<p><i>Modified in Oozie v1 WS API</i> +</p> +<p>These endpoints are for submitting, managing and retrieving information of workflow, coordinator, and bundle jobs.</p> +<a name="Job_Submission"></a> +<div class="section"><h5>Job Submission</h5> +<a name="Standard_Job_Submission"></a> +</div> +<div class="section"><h5>Standard Job Submission</h5> +<p>An HTTP POST request with an XML configuration as payload creates a job.</p> +<p>The type of job is determined by the presence of one of the following 3 properties:</p> +<p><ul><li><tt>oozie.wf.application.path</tt> + : path to a workflow application directory, creates a workflow job</li> +<li><tt>oozie.coord.application.path</tt> + : path to a coordinator application file, creates a coordinator job</li> +<li><tt>oozie.bundle.application.path</tt> + : path to a bundle application file, creates a bundle job</li> +</ul> +</p> +<p>Or, if none of those are present, the jobtype parameter determines the type of job to run. It can either be mapreduce or pig.</p> +<p><b>Request:</b> +</p> +<p><pre> +POST /oozie/v1/jobs +Content-Type: application/xml;charset=UTF-8 +. +<?xml version="1.0" encoding="UTF-8"?> +<configuration> + <property> + <name>user.name</name> + <value>bansalm</value> + </property> + <property> + <name>oozie.wf.application.path</name> + <value>hdfs://foo:8020/user/bansalm/myapp/</value> + </property> + ... +</configuration> +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 201 CREATED +Content-Type: application/json;charset=UTF-8 +. +{ + id: "job-3" +} +</pre></p> +<p>A created job will be in <tt>PREP</tt> + status. If the query string parameter 'action=start' is provided in +the POST URL, the job will be started immediately and its status will be <tt>RUNNING</tt> +.</p> +<p>Coordinator jobs with start time in the future they will not create any action until the start time +happens.</p> +<p>A coordinator job will remain in <tt>PREP</tt> + status until it's triggered, in which case it will change to <tt>RUNNING</tt> + status. +The 'action=start' parameter is not valid for coordinator jobs.</p> +<a name="Proxy_MapReduce_Job_Submission"></a> +</div> +<div class="section"><h5>Proxy MapReduce Job Submission</h5> +<p>You can submit a Workflow that contains a single MapReduce action without writing a workflow.xml. Any required Jars or other files +must already exist in HDFS.</p> +<p>The following properties are required; any additional parameters needed by the MapReduce job can also be specified here:<ul><li><tt>fs.default.name</tt> +: The NameNode</li> +<li><tt>mapred.job.tracker</tt> +: The JobTracker</li> +<li><tt>mapred.mapper.class</tt> +: The map-task classname</li> +<li><tt>mapred.reducer.class</tt> +: The reducer-task classname</li> +<li><tt>mapred.input.dir</tt> +: The map-task input directory</li> +<li><tt>mapred.output.dir</tt> +: The reduce-task output directory</li> +<li><tt>user.name</tt> +: The username of the user submitting the job</li> +<li><tt>oozie.libpath</tt> +: A directory in HDFS that contains necessary Jars for your job</li> +<li><tt>oozie.proxysubmission</tt> +: Must be set to <tt>true</tt> +</li> +</ul> +</p> +<p><b>Request:</b> +</p> +<p><pre> +POST /oozie/v1/jobs?jobtype=mapreduce +Content-Type: application/xml;charset=UTF-8 +. +<?xml version="1.0" encoding="UTF-8"?> +<configuration> + <property> + <name>fs.default.name</name> + <value>hdfs://localhost:8020</value> + </property> + <property> + <name>mapred.job.tracker</name> + <value>localhost:8021</value> + </property> + <property> + <name>mapred.mapper.class</name> + <value>org.apache.oozie.example.SampleMapper</value> + </property> + <property> + <name>mapred.reducer.class</name> + <value>org.apache.oozie.example.SampleReducer</value> + </property> + <property> + <name>mapred.input.dir</name> + <value>hdfs://localhost:8020/user/rkanter/examples/input-data/text</value> + </property> + <property> + <name>mapred.output.dir</name> + <value>hdfs://localhost:8020/user/rkanter/examples/output-data/map-reduce</value> + </property> + <property> + <name>user.name</name> + <value>rkanter</value> + </property> + <property> + <name>oozie.libpath</name> + <value>hdfs://localhost:8020/user/rkanter/examples/apps/map-reduce/lib</value> + </property> + <property> + <name>oozie.proxysubmission</name> + <value>true</value> + </property> +</configuration> +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 201 CREATED +Content-Type: application/json;charset=UTF-8 +. +{ + id: "job-3" +} +</pre></p> +<a name="Proxy_Pig_Job_Submission"></a> +</div> +<div class="section"><h5>Proxy Pig Job Submission</h5> +<p>You can submit a Workflow that contains a single Pig action without writing a workflow.xml. Any required Jars or other files must +already exist in HDFS.</p> +<p>The following properties are required:<ul><li><tt>fs.default.name</tt> +: The NameNode</li> +<li><tt>mapred.job.tracker</tt> +: The JobTracker</li> +<li><tt>user.name</tt> +: The username of the user submitting the job</li> +<li><tt>oozie.pig.script</tt> +: Contains the pig script you want to run (the actual script, not a file path)</li> +<li><tt>oozie.libpath</tt> +: A directory in HDFS that contains necessary Jars for your job</li> +<li><tt>oozie.proxysubmission</tt> +: Must be set to <tt>true</tt> +</li> +</ul> +</p> +<p>The following properties are optional:<ul><li><tt>oozie.pig.script.params.size</tt> +: The number of parameters you'll be passing to Pig</li> +</ul> +required <tt>oozie.pig.script.params.n</tt> +: A parameter (variable definition for the script) in 'key=value' format, the 'n' should be an integer starting with 0 to indicate the parameter number<ul><li><tt>oozie.pig.options.size</tt> +: The number of options you'll be passing to Pig</li> +<li><tt>oozie.pig.options.n</tt> +: An argument to pass to Pig, the 'n' should be an integer starting with 0 to indicate the option number</li> +</ul> +</p> +<p>The <tt>oozie.pig.options.n</tt> + parameters are sent directly to Pig without any modification unless they start with <tt>-D</tt> +, in which case +they are put into the <tt><configuration></tt> + element of the action.</p> +<p>In addition to passing parameters to Pig with <tt>oozie.pig.script.params.n</tt> +, you can also create a properties file on HDFS and +reference it with the <tt>-param_file</tt> + option in <tt>oozie.pig.script.options.n</tt> +; both are shown in the following example.</p> +<p><pre> +$ hadoop fs -cat /user/rkanter/pig_params.properties +INPUT=/user/rkanter/examples/input-data/text +</pre></p> +<p><b>Request:</b> +</p> +<p><pre> +POST /oozie/v1/jobs?jobtype=pig +Content-Type: application/xml;charset=UTF-8 +. +<?xml version="1.0" encoding="UTF-8"?> +<configuration> + <property> + <name>fs.default.name</name> + <value>hdfs://localhost:8020</value> + </property> + <property> + <name>mapred.job.tracker</name> + <value>localhost:8021</value> + </property> + <property> + <name>user.name</name> + <value>rkanter</value> + </property> + <property> + <name>oozie.pig.script</name> + <value> + A <tt> load '$INPUT' using PigStorage(':'); + B = foreach A generate $0 as id; + store B into '$OUTPUT' USING PigStorage(); + </value> + </property> + <property> + <name>oozie.pig.script.params.size</name> + <value>1</value> + </property> + <property> + <name>oozie.pig.script.params.0</name> + <value>OUTPUT</tt> +/user/rkanter/examples/output-data/pig</value> + </property> + <property> + <name>oozie.pig.options.size</name> + <value>2</value> + </property> + <property> + <name>oozie.pig.options.0</name> + <value>-param_file</value> + </property> + <property> + <name>oozie.pig.options.1</name> + <value>hdfs://localhost:8020/user/rkanter/pig_params.properties</value> + </property> + <property> + <name>oozie.libpath</name> + <value>hdfs://localhost:8020/user/rkanter/share/lib/pig</value> + </property> + <property> + <name>oozie.proxysubmission</name> + <value>true</value> + </property> +</configuration> +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 201 CREATED +Content-Type: application/json;charset=UTF-8 +. +{ + id: "job-3" +} +</pre></p> +<a name="Proxy_Hive_Job_Submission"></a> +</div> +<div class="section"><h5>Proxy Hive Job Submission</h5> +<p>You can submit a Workflow that contains a single Hive action without writing a workflow.xml. Any required Jars or other files must +already exist in HDFS.</p> +<p>The following properties are required:<ul><li><tt>fs.default.name</tt> +: The NameNode</li> +<li><tt>mapred.job.tracker</tt> +: The JobTracker</li> +<li><tt>user.name</tt> +: The username of the user submitting the job</li> +<li><tt>oozie.hive.script</tt> +: Contains the hive script you want to run (the actual script, not a file path)</li> +<li><tt>oozie.libpath</tt> +: A directory in HDFS that contains necessary Jars for your job</li> +<li><tt>oozie.proxysubmission</tt> +: Must be set to <tt>true</tt> +</li> +</ul> +</p> +<p>The following properties are optional:<ul><li><tt>oozie.hive.script.params.size</tt> +: The number of parameters you'll be passing to Hive</li> +<li><tt>oozie.hive.script.params.n</tt> +: A parameter (variable definition for the script) in 'key=value' format, the 'n' should be an integer starting with 0 to indicate the parameter number</li> +<li><tt>oozie.hive.options.size</tt> +: The number of options you'll be passing to Hive</li> +<li><tt>oozie.hive.options.n</tt> +: An argument to pass to Hive, the 'n' should be an integer starting with 0 to indicate the option number</li> +</ul> +</p> +<p>The <tt>oozie.hive.options.n</tt> + parameters are sent directly to Hive without any modification unless they start with <tt>-D</tt> +, in which case +they are put into the <tt><configuration></tt> + element of the action.</p> +<p><b>Request:</b> +</p> +<p><pre> +POST /oozie/v1/jobs?jobtype=hive +Content-Type: application/xml;charset=UTF-8 +. +<?xml version="1.0" encoding="UTF-8"?> +<configuration> + <property> + <name>fs.default.name</name> + <value>hdfs://localhost:8020</value> + </property> + <property> + <name>mapred.job.tracker</name> + <value>localhost:8021</value> + </property> + <property> + <name>user.name</name> + <value>rkanter</value> + </property> + <property> + <name>oozie.hive.script</name> + <value> + CREATE EXTERNAL TABLE test (a INT) STORED AS TEXTFILE LOCATION '${INPUT}'; + INSERT OVERWRITE DIRECTORY '${OUTPUT}' SELECT * FROM test; + </value> + </property> + <property> + <name>oozie.hive.script.params.size</name> + <value>2</value> + </property> + <property> + <name>oozie.hive.script.params.0</name> + <value>OUTPUT=/user/rkanter/examples/output-data/hive</value> + </property> + <property> + <name>oozie.hive.script.params.1</name> + <value>INPUT=/user/rkanter/examples/input-data/table</value> + </property> + <property> + <name>oozie.libpath</name> + <value>hdfs://localhost:8020/user/rkanter/share/lib/hive</value> + </property> + <property> + <name>oozie.proxysubmission</name> + <value>true</value> + </property> +</configuration> +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 201 CREATED +Content-Type: application/json;charset=UTF-8 +. +{ + id: "job-3" +} +</pre></p> +<a name="Proxy_Sqoop_Job_Submission"></a> +</div> +<div class="section"><h5>Proxy Sqoop Job Submission</h5> +<p>You can submit a Workflow that contains a single Sqoop command without writing a workflow.xml. Any required Jars or other + files must already exist in HDFS.</p> +<p>The following properties are required:<ul><li><tt>fs.default.name</tt> +: The NameNode</li> +<li><tt>mapred.job.tracker</tt> +: The JobTracker</li> +<li><tt>user.name</tt> +: The username of the user submitting the job</li> +<li><tt>oozie.sqoop.command</tt> +: The sqoop command you want to run where each argument occupies one line or separated by "\n"</li> +<li><tt>oozie.libpath</tt> +: A directory in HDFS that contains necessary Jars for your job</li> +<li><tt>oozie.proxysubmission</tt> +: Must be set to <tt>true</tt> +</li> +</ul> +</p> +<p>The following properties are optional:<ul><li><tt>oozie.sqoop.options.size</tt> +: The number of options you'll be passing to Sqoop Hadoop job</li> +<li><tt>oozie.sqoop.options.n</tt> +: An argument to pass to Sqoop hadoop job conf, the 'n' should be an integer starting with 0 to indicate the option number</li> +</ul> +</p> +<p><b>Request:</b> +</p> +<p><pre> +POST /oozie/v1/jobs?jobtype=sqoop +Content-Type: application/xml;charset=UTF-8 +. +<?xml version="1.0" encoding="UTF-8"?> +<configuration> + <property> + <name>fs.default.name</name> + <value>hdfs://localhost:8020</value> + </property> + <property> + <name>mapred.job.tracker</name> + <value>localhost:8021</value> + </property> + <property> + <name>user.name</name> + <value>bzhang</value> + </property> + <property> + <name>oozie.sqoop.command</name> + <value> + import + --connect + jdbc:mysql://localhost:3306/oozie + --username + oozie + --password + oozie + --table + WF_JOBS + --target-dir + /user/${wf:user()}/${examplesRoot}/output-data/sqoop + </value> + </property> + <name>oozie.libpath</name> + <value>hdfs://localhost:8020/user/bzhang/share/lib/sqoop</value> + </property> + <property> + <name>oozie.proxysubmission</name> + <value>true</value> + </property> +</configuration> +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 201 CREATED +Content-Type: application/json;charset=UTF-8 +. +{ + id: "job-3" +} +</pre></p> +<a name="Managing_a_Job"></a> +</div> +<div class="section"><h5>Managing a Job</h5> +<p>A HTTP PUT request starts, suspends, resumes, kills, update or dryruns a job.</p> +<p><b>Request:</b> +</p> +<p><pre> +PUT /oozie/v1/job/job-3?action=start +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +</pre></p> +<p>Valid values for the 'action' parameter are 'start', 'suspend', 'resume', 'kill', 'dryrun', 'rerun', and 'change'.</p> +<p>Rerunning and changing a job require additional parameters, and are described below:</p> +<a name="Re-Running_a_Workflow_Job"></a> +<div class="section"><h6>Re-Running a Workflow Job</h6> +<p>A workflow job in <tt>SUCCEEDED</tt> +, <tt>KILLED</tt> + or <tt>FAILED</tt> + status can be partially rerun specifying a list +of workflow nodes to skip during the rerun. All the nodes in the skip list must have complete its +execution.</p> +<p>The rerun job will have the same job ID.</p> +<p>A rerun request is done with a HTTP PUT request with a <tt>rerun</tt> + action.</p> +<p><b>Request:</b> +</p> +<p><pre> +PUT /oozie/v1/job/job-3?action=rerun +Content-Type: application/xml;charset=UTF-8 +. +<?xml version="1.0" encoding="UTF-8"?> +<configuration> + <property> + <name>user.name</name> + <value>tucu</value> + </property> + <property> + <name>oozie.wf.application.path</name> + <value>hdfs://foo:8020/user/tucu/myapp/</value> + </property> + <property> + <name>oozie.wf.rerun.skip.nodes</name> + <value>firstAction,secondAction</value> + </property> + ... +</configuration> +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +</pre></p> +<a name="Re-Running_a_coordinator_job"></a> +</div> +<div class="section"><h6>Re-Running a coordinator job</h6> +<p>A coordinator job in <tt>RUNNING</tt> + <tt>SUCCEEDED</tt> +, <tt>KILLED</tt> + or <tt>FAILED</tt> + status can be partially rerun by specifying the coordinator actions +to re-execute.</p> +<p>A rerun request is done with an HTTP PUT request with a <tt>coord-rerun</tt> + <tt>action</tt> +.</p> +<p>The <tt>type</tt> + of the rerun can be <tt>date</tt> + or <tt>action</tt> +.</p> +<p>The <tt>scope</tt> + of the rerun depends on the type: +* <tt>date</tt> +: a comma-separated list of date ranges. Each date range element is specified with dates separated by <tt>::</tt> + +* <tt>action</tt> +: a comma-separated list of action ranges. Each action range is specified with two action numbers separated by <tt>-</tt> +</p> +<p>The <tt>refresh</tt> + parameter can be <tt>true</tt> + or <tt>false</tt> + to specify if the user wants to refresh an action's input and output events.</p> +<p>The <tt>nocleanup</tt> + parameter can be <tt>true</tt> + or <tt>false</tt> + to specify is the user wants to cleanup output events for the rerun actions.</p> +<p><b>Request:</b> +</p> +<p><pre> +PUT /oozie/v1/job/job-3?action=coord-rerun&type=action&scope=1-2&refresh=false&nocleanup=false +. +</pre></p> +<p>or</p> +<p><pre> +PUT /oozie/v1/job/job-3?action=coord-rerun&type=date2009-02-01T00:10Z::2009-03-01T00:10Z&scope=&refresh=false&nocleanup=false +. +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +</pre></p> +<a name="Re-Running_a_bundle_job"></a> +</div> +<div class="section"><h6>Re-Running a bundle job</h6> +<p>A coordinator job in <tt>RUNNING</tt> + <tt>SUCCEEDED</tt> +, <tt>KILLED</tt> + or <tt>FAILED</tt> + status can be partially rerun by specifying the coordinators to +re-execute.</p> +<p>A rerun request is done with an HTTP PUT request with a <tt>bundle-rerun</tt> + <tt>action</tt> +.</p> +<p>A comma separated list of coordinator job names (not IDs) can be specified in the <tt>coord-scope</tt> + parameter.</p> +<p>The <tt>date-scope</tt> + parameter is a comma-separated list of date ranges. Each date range element is specified with dates separated +by <tt>::</tt> +. If empty or not included, Oozie will figure this out for you</p> +<p>The <tt>refresh</tt> + parameter can be <tt>true</tt> + or <tt>false</tt> + to specify if the user wants to refresh the coordinator's input and output events.</p> +<p>The <tt>nocleanup</tt> + parameter can be <tt>true</tt> + or <tt>false</tt> + to specify is the user wants to cleanup output events for the rerun coordinators.</p> +<p><b>Request:</b> +</p> +<p><pre> +PUT /oozie/v1/job/job-3?action=bundle-rerun&coord-scope=coord-1&refresh=false&nocleanup=false +. +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +</pre></p> +<a name="Changing_endtimeconcurrencypausetime_of_a_Coordinator_Job"></a> +</div> +<div class="section"><h6>Changing endtime/concurrency/pausetime of a Coordinator Job</h6> +<p>A coordinator job not in <tt>KILLED</tt> + status can have it's endtime, concurrency, or pausetime changed.</p> +<p>A change request is done with an HTTP PUT request with a <tt>change</tt> + <tt>action</tt> +.</p> +<p>The <tt>value</tt> + parameter can contain any of the following: +* endtime: the end time of the coordinator job. +* concurrency: the concurrency of the coordinator job. +* pausetime: the pause time of the coordinator job.</p> +<p>Multiple arguments can be passed to the <tt>value</tt> + parameter by separating them with a ';' character.</p> +<p>If an already-succeeded job changes its end time, its status will become running.</p> +<p><b>Request:</b> +</p> +<p><pre> +PUT /oozie/v1/job/job-3?action=change&value=endtime=2011-12-01T05:00Z +. +</pre></p> +<p>or</p> +<p><pre> +PUT /oozie/v1/job/job-3?action=change&value=concurrency=100 +. +</pre></p> +<p>or</p> +<p><pre> +PUT /oozie/v1/job/job-3?action=change&value=pausetime=2011-12-01T05:00Z +. +</pre></p> +<p>or</p> +<p><pre> +PUT /oozie/v1/job/job-3?action=change&value=endtime=2011-12-01T05:00Z;concurrency=100;pausetime=2011-12-01T05:00Z +. +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +</pre></p> +<a name="Updating_coordinator_definition_and_properties"></a> +</div> +<div class="section"><h6>Updating coordinator definition and properties</h6> +<p>Existing coordinator definition and properties will be replaced by new definition and properties. Refer <a href="./DG_CommandLineTool.html#Updating_coordinator_definition_and_properties">Updating coordinator definition and properties</a> +</p> +<p><pre> +PUT oozie/v2/job/0000000-140414102048137-oozie-puru-C?action=update +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +{"update": + {"diff":"**********Job definition changes**********\n******************************************\n**********Job conf changes****************\n@@ -8,16 +8,12 @@\n + <value>hdfs:\/\/localhost:9000\/user\/purushah\/examples\/apps\/aggregator\/coordinator.xml<\/value>\r\n <\/property>\r\n <property>\r\n + - <name>user.name<\/name>\r\n + - <value>purushah<\/value>\r\n + - <\/property>\r\n + - <property>\r\n <name>start<\/name>\r\n + <value>2010-01-01T01:00Z<\/value>\r\n <\/property>\r\n <property>\r\n + - <name>newproperty<\/name>\r\n + - <value>new<\/value>\r\n + + <name>user.name<\/name>\r\n + + <value>purushah<\/value>\r\n <\/property>\r\n <property>\r\n + <name>queueName<\/name>\r\n******************************************\n" + } +} +</pre></p> +<a name="Job_Information"></a> +</div> +</div> +<div class="section"><h5>Job Information</h5> +<p>A HTTP GET request retrieves the job information.</p> +<p><b>Request:</b> +</p> +<p><pre> +GET /oozie/v1/job/job-3?show=info&timezone=GMT +</pre></p> +<p><b>Response for a workflow job:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +. +{ + id: "0-200905191240-oozie-W", + appName: "indexer-workflow", + appPath: "hdfs://user/bansalm/indexer.wf", + externalId: "0-200905191230-oozie-pepe", + user: "bansalm", + status: "RUNNING", + conf: "<configuration> ... </configuration>", + createdTime: "Thu, 01 Jan 2009 00:00:00 GMT", + startTime: "Fri, 02 Jan 2009 00:00:00 GMT", + endTime: null, + run: 0, + actions: [ + { + id: "0-200905191240-oozie-W@indexer", + name: "indexer", + type: "map-reduce", + conf: "<configuration> ...</configuration>", + startTime: "Thu, 01 Jan 2009 00:00:00 GMT", + endTime: "Fri, 02 Jan 2009 00:00:00 GMT", + status: "OK", + externalId: "job-123-200903101010", + externalStatus: "SUCCEEDED", + trackerUri: "foo:8021", + consoleUrl: "http://foo:50040/jobdetailshistory.jsp?jobId=...", + transition: "reporter", + data: null, + errorCode: null, + errorMessage: null, + retries: 0 + }, + ... + ] +} +</pre></p> +<p><b>Response for a coordinator job:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +. +{ + id: "0-200905191240-oozie-C", + appName: "indexer-Coord", + appPath: "hdfs://user/bansalm/myapp/logprocessor-coord.xml", + externalId: "0-200905191230-oozie-pepe", + user: "bansalm", + status: "RUNNING", + conf: "<configuration> ... </configuration>", + createdTime: "Thu, 01 Jan 2009 00:00:00 GMT", + startTime: "Fri, 02 Jan 2009 00:00:00 GMT", + endTime: "Fri, 31 Dec 2009 00:00:00 GMT", + frequency: "${days(1)}" + actions: [ + { + id: "0000010-130426111815091-oozie-bansalm-C@1", + createdTime: "Fri, 26 Apr 2013 20:57:07 GMT", + externalId: "", + missingDependencies: "", + runConf: null, + createdConf: null, + consoleUrl: null, + nominalTime: "Fri, 01 Jan 2010 01:00:00 GMT", + ... +} +</pre></p> +<p><b>Response for a bundle job:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +. +{ + jobType: "bundle", + id: "0-200905191240-oozie-B", + appName: "new-bundle", + appPath: "hdfs://user/bansalm/myapp/logprocessor-bundle.xml", + externalId: "0-200905191230-oozie-pepe", + user: "bansalm", + status: "RUNNING", + conf: "<configuration> ... </configuration>", + createdTime: "Thu, 01 Jan 2009 00:00:00 GMT", + startTime: "Fri, 02 Jan 2009 00:00:00 GMT", + endTime: "Fri, 31 Dec 2009 00:00:00 GMT" + bundleCoordJobs: [ + { + status: "RUNNING", + concurrency: 1, + conf: "<configuration> ... </configuration>", + executionPolicy: "FIFO", + toString: "Coordinator application id[0000010-130426111815091-oozie-bansalm-C] status[RUNNING]", + coordJobName: "coord-1", + endTime: "Fri, 01 Jan 2010 03:00:00 GMT", + ... + } + ... +} +</pre></p> +<p><b>Getting all the Workflows corresponding to a Coordinator Action:</b> +</p> +<p>A coordinator action kicks off different workflows for its original run and all subsequent reruns. +Getting a list of those workflow ids is a useful tool to keep track of your actions' runs and +to go debug the workflow job logs if required. Along with ids, it also lists their statuses, +and start and end times for quick reference.</p> +<p>Both v1 and v2 API are supported. v0 is not supported.</p> +<p><pre> +GET /oozie/v2/job/0000001-111219170928042-oozie-joe-C@1?show=allruns +</pre></p> +<p><b>Response</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +. +{"workflows":[ + { + "startTime":"Mon, 24 Mar 2014 23:40:53 GMT", + "id":"0000001-140324163709596-oozie-chit-W", + "status":"SUCCEEDED", + "endTime":"Mon, 24 Mar 2014 23:40:54 GMT" + }, + { + "startTime":"Mon, 24 Mar 2014 23:44:01 GMT", + "id":"0000000-140324164318985-oozie-chit-W", + "status":"SUCCEEDED", + "endTime":"Mon, 24 Mar 2014 23:44:01 GMT" + }, + { + "startTime":"Mon, 24 Mar 2014 23:44:24 GMT", + "id":"0000001-140324164318985-oozie-chit-W", + "status":"SUCCEEDED", + "endTime":"Mon, 24 Mar 2014 23:44:24 GMT" + } +]} +</pre></p> +<p>An alternate API is also available for the same output. With this API, one can pass the coordinator <b>JOB</b> + Id +followed by query params - type=action and scope=<action-number>. One single action number can be passed at a time.</p> +<p><pre> +GET /oozie/v2/job/0000001-111219170928042-oozie-joe-C?show=allruns&type=action&scope=1 +</pre></p> +<p><b>Retrieve a subset of actions</b> +</p> +<p>Query parameters, <tt>offset</tt> + and <tt>length</tt> + can be specified with a workflow job to retrieve specific actions. Default is offset=0, len=1000 +<pre> +GET /oozie/v1/job/0000002-130507145349661-oozie-joe-W?show=info&offset=5&len=10 +</pre> +Query parameters, <tt>offset</tt> +, <tt>length</tt> +, <tt>filter</tt> + can be specified with a coordinator job to retrieve specific actions. +Query parameter, <tt>order</tt> + with value "desc" can be used to retrieve the latest coordinator actions materialized instead of actions from @1. +Query parameters <tt>filter</tt> + can be used to retrieve coordinator actions matching specific status. +Default is offset=0, len=0 for v2/job (i.e., does not return any coordinator actions) and offset=0, len=1000 with v1/job and v0/job. +So if you need actions to be returned with v2 API, specifying <tt>len</tt> + parameter is necessary. +Default <tt>order</tt> + is "asc". +<pre> +GET /oozie/v1/job/0000001-111219170928042-oozie-joe-C?show=info&offset=5&len=10&filter=status%3DKILLED&order=desc +</pre> +Note that the filter is URL encoded, its decoded value is <tt>status=KILLED</tt> +. +<pre> +GET /oozie/v1/job/0000001-111219170928042-oozie-joe-C?show=info&filter=status%21%3DSUCCEEDED&order=desc +</pre> +This retrieves coordinator actions except for SUCCEEDED status, which is useful for debugging.</p> +<p><b>Retrieve information of the retry attempts of the workflow action:</b> +</p> +<p><pre> +GET oozie/v2/job/0000000-161212175234862-oozie-puru-W@pig-node?show=retries +</pre></p> +<p><b>Response</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +. +{ + "retries": + [ + { + "startTime": "Tue, 13 Dec 2016 01:54:13 GMT", + "consoleUrl": "http://localhost:50030/jobdetails.jsp?jobid=job_201612051339_2648", + "endTime": "Tue, 13 Dec 2016 01:54:20 GMT", + "attempt": "1" + }, + { + "startTime": "Tue, 13 Dec 2016 01:55:20 GMT", + "consoleUrl": "http://localhost:50030/jobdetails.jsp?jobid=job_201612051339_2649", + "endTime": "Tue, 13 Dec 2016 01:55:24 GMT", + "attempt": "2" + } + ] +} +</pre></p> +<a name="Job_Application_Definition"></a> +</div> +<div class="section"><h5>Job Application Definition</h5> +<p>A HTTP GET request retrieves the workflow or a coordinator job definition file.</p> +<p><b>Request:</b> +</p> +<p><pre> +GET /oozie/v1/job/job-3?show=definition +</pre></p> +<p><b>Response for a workflow job:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/xml;charset=UTF-8 +. +<?xml version="1.0" encoding="UTF-8"?> +<workflow-app name='xyz-app' xmlns="uri:oozie:workflow:0.1"> + <start to='firstaction' /> + ... + <end name='end' /> +</workflow-app> +</pre></p> +<p><b>Response for a coordinator job:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/xml;charset=UTF-8 +. +<?xml version="1.0" encoding="UTF-8"?> +<coordinator-app name='abc-app' xmlns="uri:oozie:coordinator:0.1" frequency="${days(1)} + start="2009-01-01T00:00Z" end="2009-12-31T00:00Z" timezone="America/Los_Angeles"> + <datasets> + ... + </datasets> + ... +</coordinator-app> +</pre></p> +<p><b>Response for a bundle job:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/xml;charset=UTF-8 +. +<?xml version="1.0" encoding="UTF-8"?> +<bundle-app name='abc-app' xmlns="uri:oozie:coordinator:0.1" + start="2009-01-01T00:00Z" end="2009-12-31T00:00Z""> + <datasets> + ... + </datasets> + ... +</bundle-app> +</pre></p> +<a name="Job_Log"></a> +</div> +<div class="section"><h5>Job Log</h5> +<p>An HTTP GET request retrieves the job log.</p> +<p><b>Request:</b> +</p> +<p><pre> +GET /oozie/v1/job/job-3?show=log +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: text/plain;charset=UTF-8 +. +... +23:21:31,272 TRACE oozieapp:526 - USER[bansalm] GROUP[other] TOKEN[-] APP[test-wf] JOB[0-20090518232130-oozie-tucu] ACTION[mr-1] Start +23:21:31,305 TRACE oozieapp:526 - USER[bansalm] GROUP[other] TOKEN[-] APP[test-wf] JOB[0-20090518232130-oozie-tucu] ACTION[mr-1] End +... +</pre></p> +<a name="Job_Error_Log"></a> +</div> +<div class="section"><h5>Job Error Log</h5> +<p>An HTTP GET request retrieves the job error log.</p> +<p><b>Request:</b> +</p> +<p><pre> +GET /oozie/v2/job/0000000-150121110331712-oozie-puru-B?show=errorlog +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: text/plain;charset=UTF-8 +2015-01-21 11:33:29,090 WARN CoordSubmitXCommand:523 - SERVER[-] USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0000000-150121110331712-oozie-puru-B] ACTION[] SAXException : +org.xml.sax.SAXParseException; lineNumber: 20; columnNumber: 22; cvc-complex-type.2.4.a: Invalid content was found starting with element 'concurrency'. One of '{"uri:oozie:coordinator:0.2":controls, "uri:oozie:coordinator:0.2":datasets, "uri:oozie:coordinator:0.2":input-events, "uri:oozie:coordinator:0.2":output-events, "uri:oozie:coordinator:0.2":action}' is expected. + at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) + at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) +... +</pre></p> +<a name="Job_Audit_Log"></a> +</div> +<div class="section"><h5>Job Audit Log</h5> +<p>An HTTP GET request retrieves the job audit log.</p> +<p><b>Request:</b> +</p> +<p><pre> +GET /oozie/v2/job/0000000-150322000230582-oozie-puru-C?show=auditlog +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: text/plain;charset=UTF-8 +2015-03-22 00:04:35,494 INFO oozieaudit:520 - IP [-], USER [purushah], GROUP [null], APP [-], JOBID [0000000-150322000230582-oozie-puru-C], OPERATION [start], PARAMETER [null], STATUS [SUCCESS], HTTPCODE [200], ERRORCODE [null], ERRORMESSAGE [null] +2015-03-22 00:05:13,823 INFO oozieaudit:520 - IP [-], USER [purushah], GROUP [null], APP [-], JOBID [0000000-150322000230582-oozie-puru-C], OPERATION [suspend], PARAMETER [0000000-150322000230582-oozie-puru-C], STATUS [SUCCESS], HTTPCODE [200], ERRORCODE [null], ERRORMESSAGE [null] +2015-03-22 00:06:59,561 INFO oozieaudit:520 - IP [-], USER [purushah], GROUP [null], APP [-], JOBID [0000000-150322000230582-oozie-puru-C], OPERATION [suspend], PARAMETER [0000000-150322000230582-oozie-puru-C], STATUS [SUCCESS], HTTPCODE [200], ERRORCODE [null], ERRORMESSAGE [null] +2015-03-22 23:22:20,012 INFO oozieaudit:520 - IP [-], USER [purushah], GROUP [null], APP [-], JOBID [0000000-150322000230582-oozie-puru-C], OPERATION [suspend], PARAMETER [0000000-150322000230582-oozie-puru-C], STATUS [SUCCESS], HTTPCODE [200], ERRORCODE [null], ERRORMESSAGE [null] +2015-03-22 23:28:48,218 INFO oozieaudit:520 - IP [-], USER [purushah], GROUP [null], APP [-], JOBID [0000000-150322000230582-oozie-puru-C], OPERATION [resume], PARAMETER [0000000-150322000230582-oozie-puru-C], STATUS [SUCCESS], HTTPCODE [200], ERRORCODE [null], ERRORMESSAGE [null]</pre> +</pre></p> +<a name="Filtering_the_server_logs_with_logfilter_options"></a> +</div> +<div class="section"><h5>Filtering the server logs with logfilter options</h5> +<p>User can provide multiple option to filter logs using -logfilter opt1=val1;opt2=val1;opt3=val1. This can be used to fetch only just logs of interest faster as fetching Oozie server logs is slow due to the overhead of pattern matching.</p> +<p><pre> +GET /oozie/v1/job/0000003-140319184715726-oozie-puru-C?show=log&logfilter=limit=3;loglevel=WARN +</pre></p> +<p>Refer to the <a href="./DG_CommandLineTool.html#Filtering_the_server_logs_with_logfilter_options">Filtering the server logs with logfilter options</a> + for more details.</p> +<a name="Job_graph"></a> +</div> +<div class="section"><h5>Job graph</h5> +<p>An <tt>HTTP GET</tt> + request returns the image of the workflow DAG (rendered as a PNG or SVG image, or as a DOT string).<ul><li>The nodes that are being executed are painted yellow</li> +<li>The nodes that have successfully executed are painted green</li> +<li>The nodes that have failed execution are painted red</li> +<li>The nodes that are yet to be executed are pained gray</li> +<li>An arc painted green marks the successful path taken so far</li> +<li>An arc painted red marks the failure of the node and highlights the <i>error</i> + action</li> +<li>An arc painted gray marks a path not taken yet</li> +</ul> +</p> +<p><b>PNG request:</b> + +<pre> +GET /oozie/v1/job/job-3?show=graph[&show-kill=true][&format=png] +</pre></p> +<p><b>PNG response:</b> + +<pre> +HTTP/1.1 200 OK +Content-Type: image/png +Content-Length: {image_size_in_bytes}{image_bits} +*SVG request:* +<verbatim> +GET /oozie/v1/job/job-3?show=graph[&show-kill=true]&format=svg +</pre> +</p> +<p><b>SVG response:</b> + +<pre> +HTTP/1.1 200 OK +Content-Type: image/svg+xml +Content-Length: {image_size_in_bytes}{image_bits} +*DOT request:* +<verbatim> +GET /oozie/v1/job/job-3?show=graph[&show-kill=true]&format=dot +</pre> +</p> +<p><b>DOT response:</b> + +<pre> +HTTP/1.1 200 OK +Content-Type: text/plain +Content-Length: {dot_size_in_bytes}{dot_bytes} +</pre> +</p> +<p>The optional <tt>show-kill</tt> + parameter shows <tt>kill</tt> + node in the graph. Valid values for this parameter are <tt>1</tt> +, <tt>yes</tt> +, and <tt>true</tt> +. +This parameter has no effect when workflow fails and the failure node leads to the <tt>kill</tt> + node; in that case <tt>kill</tt> + node is shown +always.</p> +<p>The optional <tt>format</tt> + parameter describes whether the response has to be rendered as a PNG image, or an SVG image, or a DOT string. +When omitted, <tt>format</tt> + is considered as <tt>png</tt> + for backwards compatibility. Oozie Web UI uses the <tt>svg</tt> + <tt>format</tt> +.</p> +<p>The node labels are the node names provided in the workflow XML.</p> +<p>This API returns <tt>HTTP 400</tt> + when run on a resource other than a workflow, viz. bundle and coordinator.</p> +<a name="Job_Status"></a> +</div> +<div class="section"><h5>Job Status</h5> +<p>An <tt>HTTP GET</tt> + request that returns the current status (e.g. <tt>SUCCEEDED</tt> +, <tt>KILLED</tt> +, etc) of a given job. If you are only interested +in the status, and don't want the rest of the information that the <tt>info</tt> + query provides, it is recommended to use this call +as it is more efficient.</p> +<p><b>Request</b> + +<pre> +GET /oozie/v2/job/0000000-140908152307821-oozie-rkan-C?show=status +</pre></p> +<p><b>Response</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +. +{ + "status" : "SUCCEEDED" +} +</pre></p> +<p>It accepts any valid Workflow Job ID, Coordinator Job ID, Coordinator Action ID, or Bundle Job ID.</p> +<a name="Changing_job_SLA_definition_and_alerting"></a> +</div> +<div class="section"><h5>Changing job SLA definition and alerting</h5> +<p>An <tt>HTTP PUT</tt> + request to change job SLA alert status/SLA definition.</p> +<p><ul><li>All sla commands takes actions-list or date parameter.</li> +<li><tt>date</tt> +: a comma-separated list of date ranges. Each date range element is specified with dates separated by <tt>::</tt> +</li> +<li><tt>action-list</tt> +: a comma-separated list of action ranges. Each action range is specified with two action numbers separated by <tt>-</tt> +</li> +<li>For bundle jobs additional <tt>coordinators</tt> + (coord_name/id) parameter can be passed.</li> +<li>Sla change command need extra parameter <tt>value</tt> + to specify new sla definition.</li> +</ul> +</p> +<p><ul><li>Changing SLA definition</li> +</ul> +SLA definition of should-start, should-end, nominal-time and max-duration can be changed.</p> +<p><pre> +PUT /oozie/v2/job/0000003-140319184715726-oozie-puru-C?action=sla-change&value=<key>=<value>;...;<key>=<value> +</pre></p> +<p><ul><li>Disabling SLA alert</li> +</ul> +</p> +<p><pre> +PUT /oozie/v2/job/0000003-140319184715726-oozie-puru-C?action=sla-disable&action-list=3-4 +</pre> +Will disable SLA alert for actions 3 and 4.</p> +<p><pre> +PUT /oozie/v1/job/0000003-140319184715726-oozie-puru-C?action=sla-disable&date=2009-02-01T00:10Z::2009-03-01T00:10Z +</pre> +Will disable SLA alert for actions whose nominal time is in-between 2009-02-01T00:10Z 2009-03-01T00:10Z (inclusive).</p> +<p><pre> +PUT /oozie/v1/job/0000004-140319184715726-oozie-puru-B?action=sla-disable&date=2009-02-01T00:10Z::2009-03-01T00:10Z&coordinators=abc +</pre> +For bundle jobs additional coordinators (list of comma separated coord_name/id) parameter can be passed.</p> +<p><ul><li>Enabling SLA alert</li> +</ul> +</p> +<p><pre> +PUT /oozie/v2/job/0000003-140319184715726-oozie-puru-C?action=sla-enable&action-list=1,14,17-20 +</pre> +Will enable SLA alert for actions 1,14,17,18,19,20.</p> +<a name="Getting_missing_dependencies_of_coordinator_actions"></a> +</div> +</div> +<div class="section"><h4>Getting missing dependencies of coordinator action(s)</h4> +<p><pre> +GET oozie/v2/job/0000000-170104115137443-oozie-puru-C?show=missing-dependencies&action-list=1,20 +</pre></p> +<p><b>Response</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8{ +"missingDependencies": +[{ + "blockedOn": "hdfs://localhost:9000/user/purushah/examples/input-data/rawLogs/2010/01/01/00/00/_SUCCESS", + "dataSets": + [ + { + "missingDependencies": + [ + "hdfs://localhost:9000/user/purushah/examples/input-data/rawLogs/2010/01/01/00/00/_SUCCESS" + ], + "dataSet": "input-2" + } + ], + "id": 1 + }, + { + "blockedOn": "hdfs://localhost:9000/user/purushah/examples/input-data/rawLogs/2010/01/01/20/00/_SUCCESS", + "dataSets": + [ + { + "missingDependencies": + [ + "hdfs://localhost:9000/user/purushah/examples/input-data/rawLogs/2010/01/01/20/00/_SUCCESS", + "hdfs://localhost:9000/user/purushah/examples/input-data/rawLogs/2010/01/01/19/40/_SUCCESS", + "hdfs://localhost:9000/user/purushah/examples/input-data/rawLogs/2010/01/01/19/20/_SUCCESS", + "hdfs://localhost:9000/user/purushah/examples/input-data/rawLogs/2010/01/01/19/00/_SUCCESS", + "hdfs://localhost:9000/user/purushah/examples/input-data/rawLogs/2010/01/01/18/40/_SUCCESS", + "hdfs://localhost:9000/user/purushah/examples/input-data/rawLogs/2010/01/01/18/20/_SUCCESS" + ], + "dataSet": "input-2" + } + ], + "id": 20 + }] +} +</pre> +---++++ Jobs Information +</p> +<p>A HTTP GET request retrieves workflow and coordinator jobs information.</p> +<p><b>Request:</b> +</p> +<p><pre> +GET /oozie/v1/jobs?filter=user%3Dbansalm&offset=1&len=50&timezone=GMT +</pre></p> +<p>Note that the filter is URL encoded, its decoded value is <tt>user=bansalm</tt> +.</p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +. +{ + offset: 1, + len: 50, + total: 1002, +**jobs: [ + { +** jobType: "workflow" + id: "0-200905191240-oozie-W", + appName: "indexer-workflow", + appPath: "hdfs://user/tucu/indexer-wf", + user: "bansalm", + group: "other", + status: "RUNNING", + createdTime: "Thu, 01 Jan 2009 00:00:00 GMT", + startTime: "Fri, 02 Jan 2009 00:00:00 GMT", + endTime: null, + info: "run=0", + }, + { +** jobType: "coordinator" + id: "0-200905191240-oozie-C", + appName: "logprocessor-coord", + appPath: "hdfs://user/bansalm/myapp/logprocessor-coord.xml", + user: "bansalm", + group: "other", + status: "RUNNING", + createdTime: "Thu, 01 Jan 2009 00:00:00 GMT", + startTime: "Fri, 02 Jan 2009 00:00:00 GMT", + endTime: "Fri, 31 Dec 2009 00:00:00 GMT", + info: "nextAction=5", + }, + { +** jobType: "bundle" + id: "0-200905191240-oozie-B", + appName: "logprocessor-bundle", + appPath: "hdfs://user/bansalm/myapp/logprocessor-bundle.xml", + user: "bansalm", + group: "other", + status: "RUNNING", + createdTime: "Thu, 01 Jan 2009 00:00:00 GMT", + startTime: "Fri, 02 Jan 2009 00:00:00 GMT", + endTime: "Fri, 31 Dec 2009 00:00:00 GMT", + }, + ... + ] +} +</pre></p> +<p>No action information is returned when querying for multiple jobs.</p> +<p>The syntax for the filter is <pre>[NAME=VALUE][;NAME=VALUE]*</pre></p> +<p>Valid filter names are:</p> +<p><ul><li>text: any text that might be a part of application name or a part of user name or a complete job ID</li> +<li>name: the application name from the workflow/coordinator/bundle definition</li> +<li>user: the user who submitted the job</li> +<li>group: the group for the job (support for the group filter is discontinued. version: 3.2.0 OOZIE-228).</li> +<li>id: the id of the workflow/coordinator/bundle job</li> +<li>status: the status of the job</li> +<li>startCreatedTime : the start of the window about workflow job's created time</li> +<li>endCreatedTime : the end of above window</li> +<li>sortby: order the results. Supported values for <tt>sortby</tt> + are: <tt>createdTime</tt> + and <tt>lastModifiedTime</tt> +</li> +</ul> +</p> +<p>The query will do an AND among all the filter names.</p> +<p>The query will do an OR among all the filter values for the same name. Multiple values must be specified as different +name value pairs.</p> +<p>Additionally the <tt>offset</tt> + and <tt>len</tt> + parameters can be used for pagination. The start parameter is base 1.</p> +<p>Moreover, the <tt>jobtype</tt> + parameter could be used to determine what type of job is looking for. +The valid values of job type are: <tt>wf</tt> +, <tt>coordinator</tt> + or <tt>bundle</tt> +.</p> +<p>startCreatedTime and endCreatedTime should be specified either in <b>ISO8601 (UTC)</b> + format <b>(yyyy-MM-dd'T'HH:mm'Z')</b> + or +a offset value in days or hours or minutes from the current time. For example, -2d means the (current time - 2 days), +-3h means the (current time - 3 hours), -5m means the (current time - 5 minutes).</p> +<a name="Bulk_modify_jobs"></a> +<div class="section"><h5>Bulk modify jobs</h5> +<p>A HTTP PUT request can kill, suspend, or resume all jobs that satisfy the url encoded parameters.</p> +<p><b>Request:</b> +</p> +<p><pre> +PUT /oozie/v1/jobs?action=kill&filter=name%3Dcron-coord&offset=1&len=50&jobtype=coordinator +</pre></p> +<p>This request will kill all the coordinators with name=cron-coord up to 50 of them.</p> +<p>Note that the filter is URL encoded, its decoded value is <tt>name=cron-coord</tt> +. +The syntax for the filter is <pre>[NAME=VALUE][;NAME=VALUE]*</pre></p> +<p>Valid filter names are:</p> +<p><ul><li>name: the application name from the workflow/coordinator/bundle definition</li> +<li>user: the user that submitted the job</li> +<li>group: the group for the job</li> +<li>status: the status of the job</li> +</ul> +</p> +<p>The query will do an AND among all the filter names.</p> +<p>The query will do an OR among all the filter values for the same name. Multiple values must be specified as different +name value pairs.</p> +<p>Additionally the <tt>offset</tt> + and <tt>len</tt> + parameters can be used for pagination. The start parameter is base 1.</p> +<p>Moreover, the <tt>jobtype</tt> + parameter could be used to determine what type of job is looking for. +The valid values of job type are: <tt>wf</tt> +, <tt>coordinator</tt> + or <tt>bundle</tt> +</p> +<p><b>Response:</b> + +<pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +. +{ + offset: 1, + len: 50, + total: 2, +**jobs: [ + { +** jobType: "coordinator" + id: "0-200905191240-oozie-C", + appName: "cron-coord", + appPath: "hdfs://user/bansalm/app/cron-coord.xml", + user: "bansalm", + group: "other", + status: "KILLED", + createdTime: "Thu, 01 Jan 2009 00:00:00 GMT", + startTime: "Fri, 02 Jan 2009 00:00:00 GMT", + endTime: "Fri, 31 Dec 2009 00:00:00 GMT", + info: "nextAction=5", + }, + { +** jobType: "coordinator" + id: "0-200905191240-oozie-C", + appName: "cron-coord", + appPath: "hdfs://user/bansalm/myapp/cron-coord.xml", + user: "bansalm", + group: "other", + status: "KILLED", + createdTime: "Thu, 01 Jan 2009 00:00:00 GMT", + startTime: "Fri, 02 Jan 2009 00:00:00 GMT", + endTime: "Fri, 31 Dec 2009 00:00:00 GMT", + }, + ... + ] +} +</pre></p> +<p><pre> +PUT /oozie/v1/jobs?action=suspend&filter=status%3Drunning&offset=1&len=50&jobtype=wf +</pre></p> +<p>This request will suspend all the workflows with status=running up to 50 of them. +Note that the filter is URL encoded, its decoded value is <tt>status=running</tt> +.</p> +<p><b>Response:</b> + +<pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +. +{ + offset: 1, + len: 50, + total: 50, +**jobs: [ + { +** jobType: "workflow" + id: "0-200905191240-oozie-W", + appName: "indexer-workflow", + appPath: "hdfs://user/tucu/indexer-wf", + user: "bansalm", + group: "other", + status: "SUSPENDED", + createdTime: "Thu, 01 Jan 2009 00:00:00 GMT", + startTime: "Fri, 02 Jan 2009 00:00:00 GMT", + endTime: null, + info: "run=0", + }, + { +** jobType: "workflow" + id: "0-200905191240-oozie-W", + appName: "logprocessor-wf", + appPath: "hdfs://user/bansalm/myapp/workflow.xml", + user: "bansalm", + group: "other", + status: "SUSPENDED", + createdTime: "Thu, 01 Jan 2009 00:00:00 GMT", + startTime: "Fri, 02 Jan 2009 00:00:00 GMT", + endTime: null, + info: "run=0", + }, + ... + ] +} +</pre></p> +<a name="Jobs_information_using_Bulk_API"></a> +</div> +<div class="section"><h5>Jobs information using Bulk API</h5> +<p>A HTTP GET request retrieves a bulk response for all actions, corresponding to a particular bundle, that satisfy user specified criteria. +This is useful for monitoring purposes, where user can find out about the status of downstream jobs with a single bulk request. +The criteria are used for filtering the actions returned. Valid options (_case insensitive_) for these request criteria are:</p> +<p><ul><li><b>bundle</b> +: the application name from the bundle definition</li> +<li><b>coordinators</b> +: the application name(s) from the coordinator definition.</li> +<li><b>actionStatus</b> +: the status of coordinator action (Valid values are WAITING, READY, SUBMITTED, RUNNING, SUSPENDED, TIMEDOUT, SUCCEEDED, KILLED, FAILED)</li> +<li><b>startCreatedTime</b> +: the start of the window you want to look at, of the actions' created time</li> +<li><b>endCreatedTime</b> +: the end of above window</li> +<li><b>startScheduledTime</b> +: the start of the window you want to look at, of the actions' scheduled i.e. nominal time.</li> +<li><b>endScheduledTime</b> +: the end of above window</li> +</ul> +</p> +<p>Specifying 'bundle' is REQUIRED. All the rest are OPTIONAL but that might result in thousands of results depending on the size of your job. (pagination comes into play then)</p> +<p>If no 'actionStatus' values provided, by default KILLED,FAILED will be used. +For e.g if the query string is only "bundle=MyBundle", the response will have all actions (across all coordinators) whose status is KILLED or FAILED</p> +<p>The query will do an AND among all the filter names, and OR among each filter name's values.</p> +<p>The syntax for the request criteria is <pre>[NAME=VALUE][;NAME=VALUE]*</pre></p> +<p>For 'coordinators' and 'actionStatus', if user wants to check for multiple values, they can be passed in a comma-separated manner. +*Note*: The query will do an OR among them. Hence no need to repeat the criteria name</p> +<p>All the time values should be specified in <b>ISO8601 (UTC)</b> + format i.e. <b>yyyy-MM-dd'T'HH:mm'Z'</b> +</p> +<p>Additionally the <tt>offset</tt> + and <tt>len</tt> + parameters can be used as usual for pagination. The start parameter is base 1.</p> +<p>If you specify a coordinator in the list, that does not exist, no error is thrown; simply the response will be empty or pertaining to the other valid coordinators. +However, if bundle name provided does not exist, an error is thrown.</p> +<p><b>Request:</b> +</p> +<p><pre> +GET /oozie/v1/jobs?bulk=bundle%3Dmy-bundle-app;coordinators%3Dmy-coord-1,my-coord-5;actionStatus%3DKILLED&offset=1&len=50 +</pre></p> +<p>Note that the filter is URL encoded, its decoded value is <tt>user=chitnis</tt> +. If typing in browser URL, one can type decoded value itself i.e. using '='</p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +. +{ + offset: 1, + len: 50, + total: 1002, +** bulkresponses: [ +** { + bulkbundle: + { + bundleJobName: "my-bundle-app", + bundleJobId: "0-200905191240-oozie-B", + status: "SUSPENDED", + }, + bulkcoord: + { + coordJobName: "my-coord-1", + status: "SUSPENDED", + }, + bulkaction: + { + id: "0-200905191240-oozie-C@21", + coordJobId: "0-200905191240-oozie-C", + actionNumber: 21, + externalId: "job_00076_0009", + status: "KILLED", + externalStatus: "FAILED", + errorCode: "E0902", + errorMessage: "Input file corrupt", + createdTime: "Fri, 02 Jan 2009 00:00:00 GMT", + nominalTime: "Thu, 01 Jan 2009 00:00:00 GMT", + missingDependencies: "hdfs://nn:port/user/joe/file.txt" + }, + }, +** { + bulkbundle: + { + bundleJobName: "my-bundle-app", + bundleJobId: "0-200905191240-oozie-B", + status: "SUSPENDED", + } + bulkcoord: + { + coordJobName: "my-coord-5", + status: "SUSPENDED", + } + bulkaction: + { + id: "0-200905191245-oozie-C@114", + coordJobId: "0-200905191245-oozie-C", + actionNumber: 114, + externalId: "job_00076_0265", + status: "KILLED", + externalStatus: "KILLED", + errorCode: "E0603", + errorMessage: "SQL error in operation ...", + createdTime: "Fri, 02 Jan 2009 00:00:00 GMT", + nominalTime: "Thu, 01 Jan 2009 00:00:00 GMT", + missingDependencies: + } + } + ... + ] +} +</pre></p> +<a name="Oozie_Web_Services_API_V2_Workflow__Coordinator_And_Bundle"></a> +</div> +</div> +</div> +<div class="section"><h3>Oozie Web Services API, V2 (Workflow , Coordinator And Bundle)</h3> +<p>The Oozie Web Services API is a HTTP REST JSON API.</p> +<p>All responses are in <tt>UTF-8</tt> +.</p> +<p>Assuming Oozie is running at <tt>OOZIE_URL</tt> +, the following web services end points are supported:</p> +<p><ul><li><OOZIE_URL>/versions</li> +<li><OOZIE_URL>/v2/admin</li> +<li><OOZIE_URL>/v2/job</li> +<li><OOZIE_URL>/v2/jobs</li> +</ul> +</p> +<p><b>Changes in v2 job API:</b> +</p> +<p>There is a difference in the JSON format of Job Information API (*/job) particularly for map-reduce action. +No change for other actions. +In v1, externalId and consoleUrl point to spawned child job ID, and externalChildIDs is null in map-reduce action. +In v2, externalId and consoleUrl point to launcher job ID, and externalChildIDs is spawned child job ID in map-reduce action.</p> +<p>v2 supports retrieving of JMS topic on which job notifications are sent</p> +<p><b>REST API URL:</b> +</p> +<p><pre> +GET http://localhost:11000/oozie/v2/job/0000002-130507145349661-oozie-vira-W?show=jmstopic +</pre></p> +<p><b>Changes in v2 admin API:</b> +</p> +<p>v2 adds support for retrieving JMS connection information related to JMS notifications.</p> +<p><b>REST API URL:</b> +</p> +<p><pre> +GET http://localhost:11000/oozie/v2/admin/jmsinfo +</pre></p> +<p>v2/jobs remain the same as v1/jobs</p> +<a name="Job_and_Jobs_End-Points_"></a> +<div class="section"><h4>Job and Jobs End-Points</h4> +<a name="Job_Information_"></a> +<div class="section"><h5>Job Information</h5> +<p>A HTTP GET request retrieves the job information.</p> +<p><b>Request:</b> +</p> +<p><pre> +GET /oozie/v2/job/job-3?show=info&timezone=GMT +</pre></p> +<p><b>Response for a workflow job:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +. +{ +**jobType: "workflow", + id: "0-200905191240-oozie-W", + appName: "indexer-workflow", + appPath: "hdfs://user/bansalm/indexer.wf", + externalId: "0-200905191230-oozie-pepe", + user: "bansalm", + group: "other", + status: "RUNNING", + conf: "<configuration> ... </configuration>", + createdTime: "Thu, 01 Jan 2009 00:00:00 GMT", + startTime: "Fri, 02 Jan 2009 00:00:00 GMT", + endTime: null, + run: 0, + actions: [ + { + id: "0-200905191240-oozie-W@indexer", + name: "indexer", + type: "map-reduce", + conf: "<configuration> ...</configuration>", + startTime: "Thu, 01 Jan 2009 00:00:00 GMT", + endTime: "Fri, 02 Jan 2009 00:00:00 GMT", + status: "OK", + externalId: "job-123-200903101010", + externalStatus: "SUCCEEDED", + trackerUri: "foo:8021", + consoleUrl: "http://foo:50040/jobdetailshistory.jsp?jobId=job-123-200903101010", + transition: "reporter", + data: null, + stats: null, + externalChildIDs: "job-123-200903101011" + errorCode: null, + errorMessage: null, + retries: 0 + }, + ... + ] +} +</pre></p> +<a name="Managing_a_Job_"></a> +</div> +<div class="section"><h5>Managing a Job</h5> +<a name="Ignore_a_Coordinator_Job_or_Action"></a> +<div class="section"><h6>Ignore a Coordinator Job or Action</h6> +<p>A ignore request is done with an HTTP PUT request with a <tt>ignore</tt> +</p> +<p>The <tt>type</tt> + parameter supports <tt>action</tt> + only. +The <tt>scope</tt> + parameter can contain coordinator action id(s) to be ignored. +Multiple action ids can be passed to the <tt>scope</tt> + parameter</p> +<p><b>Request:</b> +</p> +<p>Ignore a coordinator job +<pre> +PUT /oozie/v2/job/job-3?action=ignore +</pre></p> +<p>Ignore coordinator actions +<pre> +PUT /oozie/v2/job/job-3?action=ignore&type=action&scope=3-4 +</pre></p> +<a name="Validate_End-Point"></a> +</div> +</div> +</div> +<div class="section"><h4>Validate End-Point</h4> +<p>This endpoint is to validate a workflow, coordinator, bundle XML file.</p> +<a name="Validate_a_local_file"></a> +<div class="section"><h5>Validate a local file</h5> +<p><b>Request:</b> +</p> +<p><pre> +POST /oozie/v2/validate?file=/home/test/myApp/workflow.xml +Content-Type: application/xml;charset=UTF-8 +. +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<workflow-app xmlns="uri:oozie:workflow:0.3" name="test"> + <start to="shell"/> + <action name="shell"> + <shell xmlns="uri:oozie:shell-action:0.3"> + <job-tracker>${jobTracker}</job-tracker> + <name-node>${nameNode}</name-node> + <exec>script.sh</exec> + <argument></argument> + <file>script.sh</file> + <capture-output/> + </shell> + <ok to="end"/> + <error to="fail"/> + </action> + <kill name="fail"> + <message>failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message> + </kill> + <end name="end"/> +</workflow-app> +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +. +{ + validate: "Valid workflow-app" +} +</pre></p> +<a name="Validate_a_file_in_HDFS"></a> +</div> +<div class="section"><h5>Validate a file in HDFS</h5> +<p>You can validate a workflow, coordinator, bundle XML file in HDFS. The XML file must already exist in HDFS.</p> +<p><b>Request:</b> +</p> +<p><pre> +POST /oozie/v2/validate?file=hdfs://localhost:8020/user/test/myApp/workflow.xml +Content-Type: application/xml;charset=UTF-8 +. +</pre></p> +<p><b>Response:</b> +</p> +<p><pre> +HTTP/1.1 200 OK +Content-Type: application/json;charset=UTF-8 +. +{ + validate: "Valid workflow-app" +} +</pre></p> +<p></p> +</div> +</div> +</div> + + </div> + </div> + </div> + + <hr/> + + <footer> + <div class="container-fluid"> + <div class="row-fluid"> + <p >Copyright © 2018 + <a href="http://www.apache.org">Apache Software Foundation</a>. + All rights reserved. + + </p> + </div> + + + </div> + </footer> + </body> +</html>