Skip to content

Latest commit

 

History

History
258 lines (157 loc) · 11.6 KB

clause_6_job_management.adoc

File metadata and controls

258 lines (157 loc) · 11.6 KB

Requirements Class "Job Management"

Overview

A server that implements the Job Management Requirements Class provides the ability to create, update and start jobs.

The HTTP POST method on the /jobs path is used on to create new jobs.

The HTTP PATCH method on the /jobs/{jobId} is used to update the definition of a previously created jobs that are accessible via the Processes API endpoint.

Finally, the HTTP POST method on the /job/{jobId}/results is used to start a job.

Creating or updating a job requires that a formal description of the new or updated jobs be provided by the client. This Standar does not mandate that a specific jobs schema be used. However, this extension defines the following conformance classe:

HTTP status codes

Clients implementing the Processes API Part 4 should be prepared to handle any legal HTTP or HTTPS status code.

The Status Codes listed in Typical HTTP status codes are of particular relevance to implementors of this Standard. Status codes 200, 201 and 404 are called out in API requirements. Therefore, support for these status codes is mandatory for all compliant implementations. The remainder of the status codes in Typical HTTP status codes are not mandatory, but are important for the implementation of a well functioning API implementation. Support for these status codes is strongly encouraged for both client and server implementations.

Table 1. Typical HTTP status codes
Status code Description

200

A successful request.

201

The server has successfully completed the operation and a new resource has been created.

202

The request was accepted for processing, but the processing was not completed. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place.

204

A successful request with no additional content to send in the response.

400

The server cannot or will not process the request due to an apparent client error. For example, a query parameter had an incorrect value.

401

The request requires user authentication. The response includes a WWW-Authenticate header field containing a challenge applicable to the requested resource.

403

The server understood the request, but is refusing to execute the request. While status code 401 indicates missing or bad authentication, status code 403 indicates that authentication is not the issue, but that the client is not authorized to perform the requested operation on the resource.

404

The requested resource does not exist on the server. For example, a path parameter had an incorrect value.

405

The request method is not supported. For example, a POST request was submitted, but the resource only supports GET requests.

406

Content negotiation failed. For example, the Accept header submitted in the request did not support any of the media types supported by the server for the requested resource.

412

The status code indicates that one or more conditions given in the request header fields evaluated to false when tested by the server.

413

The server is refusing to process the request because the request content is larger than the server is willing or able to process.

415

The server is refusing to service the request because the content is in a format not supported by this method on the target resource.

422

The server understands the content type of the request content and the syntax of the request content is correct, but was unable to process the contained instructions. For example, the submitted resource does not meet a semantic constraint, e.g. a mandatory property is missing.

500

An internal error occurred in the server.

Note
Status code 422 is not yet an official HTTP status code, but is expected to be added by the draft IETF RFC "HTTP Semantics".

More specific guidance is provided for each resource, where applicable.

The API Description Document describes the HTTP status codes generated by that API imeplementation instance. This should not be an exhaustive list of all possible status codes. It is not reasonable to expect an API designer to control the use of HTTP status codes which are not generated by their software. Therefore, it is recommended that the API Description Document be limited to describing HTTP status codes relevant to the proper operation of the API application logic. Client implementations should be prepared to receive HTTP status codes in addition to those described in the API Description Document.

Cross-origin requests

See OGC API - Features - Part 1: Core, section Support for cross-origin requests, about the importance of supporting cross-origin requests, typically via Cross-origin resource sharing (CORS).

Creating a new job

Sequence diagram

The following diagram illustrates the sequence diagram for deploying a new process to the API:

Client                                                        Server
  |                                                             |
  |  POST /jobs   HTTP/1.1                                      |
  |  Content-Type: application/json                             |
  |                                                             |
  |------------------------------------------------------------>|
  |                                                             |
  |  HTTP/1.1 201 Created                                       |
  |  Location: /jobs/{jobId}                                    |
  |<------------------------------------------------------------|

Exceptions

See HTTP status codes for general guidance.

If the request body’s media type is not supported by the server, see requirement /req/deploy-replace-undeploy/deploy/unsupported-media-type from [OAProc-2].

Updating an existing job

Sequence diagram

The following diagram illustrates the sequence diagram for updating a previously created job. The identifier of the job does not change.

Note
The new job definition replaces the old job definition. Version control is not discussed in this Standard.
Client                                                        Server
  |                                                             |
  |  PATCH /jobs/{jobId}   HTTP/1.1                             |
  |  Content-Type: application/json                             |
  |                                                             |
  |------------------------------------------------------------>|
  |                                                             |
  |  HTTP/1.1 200 OK                                            |
  |<------------------------------------------------------------|

Request body

Response

The status code depends on the server. If the server has replaced the job, the response is either 200 (if the response includes additional content) or 204 (if the response has no additional content).

Exceptions

See HTTP status codes for general guidance.

If the request body’s media type is not supported by the server, see requirement /req/deploy-replace-undeploy/deploy/unsupported-media-type from [OAProc-2].

If the job with the specified identifier does not exist on the server, see requirement /req/core/job-exception-no-such-job from [OAProc-1].

Staring a job

Sequence diagram

The following diagram illustrates the sequence diagram for starting the execution of a previously created jobs.

Client                                                        Server
  |                                                             |
  |  POST /jobs/{jobId}/results   HTTP/1.1                      |
  |------------------------------------------------------------>|
  |                                                             |
  |  HTTP/1.1 200 OK                                            |
  |<------------------------------------------------------------|

Exceptions

See HTTP status codes for general guidance.

If the job with the specified identifier does not exist on the server, see requirement /req/core/job-exception-no-such-job from [OAProc-1].

If the job with the specified identifier is locked, see requirement /req/job-management/update/response-locked from Updating an existing job.

Job definition

For every job, it is possible to retrieve its original definition. It corresponds to the request’s body used to create or update the jobs.

Exceptions

See HTTP status codes for general guidance.

If the job with the specified identifier does not exist on the server, see requirement /req/core/job-exception-no-such-job from [OAProc-1].