Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of the mode key. In all cases the server decides whether to #174

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions core/18-062.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ include::clause_6_overview.adoc[]

include::clause_7_core.adoc[]

include::clause_7d_asynchronous-execution.adoc[]

include::clause_7a_ogc-process-description.adoc[]

include::clause_7b_security-considerations.adoc[]
Expand Down
17 changes: 17 additions & 0 deletions core/abstract_tests/ATS_class_asynchronous-execution.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[[ats_asynchronous-execution]]
[cols="1,4",width="90%"]
|===
2+|*Conformance Class*
2+|http://www.opengis.net/spec/ogcapi-processes-1/1.0/conf/asynchronous-execution
|Target type |Web API
|Requirements class |<<rc_core,Requirements Class "Core">>
|===

==== Asynchronous Execution

include::asynchronous-execution/ATS_prefer-header.adoc[]

include::asynchronous-execution/ATS_job-creation-success-async.adoc[]

include::asynchronous-execution/ATS_job-creation-success-async-header.adoc[]

6 changes: 0 additions & 6 deletions core/abstract_tests/ATS_class_core.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ include::core/ATS_job-creation-op.adoc[]

include::core/ATS_job-creation-request.adoc[]

include::core/ATS_job-creation-mode.adoc[]

include::core/ATS_job-creation-success-async.adoc[]

include::core/ATS_job-creation-success-async-header.adoc[]

include::core/ATS_job-creation-success-sync.adoc[]

include::core/ATS_job-creation-success-sync-raw.adoc[]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[[ats_core_job-creation-success-header-async]]
[[ats_asynchronous-execution_job-creation-success-header-async]]
[width="90%",cols="2,6a"]
|===
^|*Abstract Test {counter:ats-id}* |*/conf/core/job-creation-success-header-async*
^|*Abstract Test {counter:ats-id}* |*/conf/asynchronous-execution/job-creation-success-header-async*
^|Test Purpose |Validate the HTTP header for an asynchronously executed job.
^|Requirement |<<req_core_job-creation-success-header-async,/req/core/job-creation-success-header-async>>
^|Test Method |. Validate that the response contains the 'Location' header.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[[ats_asynchronous-execution_job-creation-success-async]]
[width="90%",cols="2,6a"]
|===
^|*Abstract Test {counter:ats-id}* |*/conf/asynchronous-execution/job-creation-success-async*
^|Test Purpose |Validate the result of a job that has been created as a result of a process being execute asynchronously.
^|Requirement |<<req_core_job-creation-success-async,/req/core/job-creation-success-async>>
^|Test Method |. Validate that result of the job was returned with an HTTP status code 201.
. Validate the HTTP headers of the result using the test <<ats_asynchronous-execution_job-creation-success-header-async,/conf/asynchronous-execution/job-creation-success-header-async>>.
|===
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[[ats_asynchronous-execution_prefer-header]]
[width="90%",cols="2,6a"]
|===
^|*Abstract Test {counter:ats-id}* |*/conf/asynchronous-execution/prefer-header*
^|Test Purpose |Verify that the server correctly processes the HTTP `Prefer` header.
^|Requirement |<<req_core_prefer-header,/req/core/prefer-header>>
^|Test Method |. Create a job according to the test <<ats_core_job-creation-op,/req/core/job-creation-op>> and set the value of the HTTP `Prefer` header according to https://tools.ietf.org/html/rfc7240[RFC 7240] to prefer asynchronous execution.
. Verify that the server responds according to the test <<ats_asynchronous-execution_job-creation-success-header-async,/conf/asynchronous-execution/job-creation-success-async>>.
|===
21 changes: 0 additions & 21 deletions core/abstract_tests/core/ATS_job-creation-mode.adoc

This file was deleted.

4 changes: 2 additions & 2 deletions core/abstract_tests/core/ATS_job-creation-op.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
^|*Abstract Test {counter:ats-id}* |*/conf/core/job-creation-op*
^|Test Purpose |Validate the creation of a new job.
^|Requirement |<<req_core_job-creation-op,/req/core/job-creation-op>>
^|Test Method |. Issue an HTTP POST request to the URL '/processes/{processID}/execution' for each execution mode according to the test <<ats_core_job-creation-mode, /conf/core/job-creation-mode>>.
^|Test Method |. Issue an HTTP POST request to the URL '/processes/{processID}/execution'.
. Validate the contents of the POST request using the test <<ats_core_job-creation-request,/conf/core/job-creation-request>>.
. Validate the creation of the job according to the execution mode using test <<ats_core_job-creation-mode,/conf/core/job-creation-mode>>.
. Validate the creation of the job according to the test <<ats_core_job-creation-success-sync,/conf/core/job-creation-success-sync>>.
|===
9 changes: 0 additions & 9 deletions core/abstract_tests/core/ATS_job-creation-success-async.adoc

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[width="90%",cols="2,6a"]
|===
^|*Abstract Test {counter:ats-id}* |*/conf/core/job-creation-success-sync*
^|Test Purpose |Validate the result of a job that has been created using the `sync` execution mode.
^|Test Purpose |Validate the result of creating a job.
^|Requirement |<<req_core_job-creation-success-sync,/req/core/job-creation-success-sync>>
^|Test Method |. Validate that result of the job was returned with a status code 200.
. Validate the content of the result using the resource and tests identified in <<sync-success-response>>.
Expand Down
4 changes: 4 additions & 0 deletions core/annex-ats.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ OGC Web APIs are not a Web Services in the traditional sense. Rather, they defin

include::abstract_tests/ATS_class_core.adoc[]

=== Conformance Class Asynchronous Execution

include::abstract_tests/ATS_class_asynchronous-execution.adoc[]

=== Conformance Class OGC Process Description

include::abstract_tests/ATS_class_ogc-process-description.adoc[]
Expand Down
4 changes: 4 additions & 0 deletions core/clause_2_conformance.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ The _Core_ does not mandate the use of any specific process description to
specify the interface of a process. Instead this standard defines and
recommends the use of the following conformance class:

* <<rc_asynchronous-execution,Asynchronous Execution>>

The default process execution mode is synchronous. This class defines requirements for requesting asynchronous execution of a process.

* <<rc_ogc-process-description,OGC Process Description>>

This class defines an information model, encoded in JSON, which may be used to
Expand Down
12 changes: 1 addition & 11 deletions core/clause_7_core.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,7 @@ Inputs can have a multiplicity greater than 1, which means multiple values can b

include::requirements/core/REQ_job-creation-input-cardinality.adoc[]

A process can be either synchronous or asynchronous.

include::requirements/core/REQ_job-creation-mode.adoc[]
include::requirements/core/REQ_default-execute-mode.adoc[]

.The following is an example of an execute request
[source, json]
Expand All @@ -341,14 +339,6 @@ include::examples/json/Execute.json[]

==== Response

In the case of asynchronous execution, the requirements below apply:

include::requirements/core/REQ_job-creation-success-async.adoc[]

include::requirements/core/REQ_job-creation-success-async-header.adoc[]

For a synchronous execution, the following requirement applies:

include::requirements/core/REQ_job-creation-success-sync.adoc[]

==== Error situations
Expand Down
44 changes: 44 additions & 0 deletions core/clause_7d_asynchronous-execution.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
== Requirements Class "Asynchronous Execution"

=== Overview

include::requirements/requirements_class_asynchronous-execution.adoc[]

This conformance class defines requirements for requesting asynchronous
execution of processes. A client signals its desire for asynchronous
execution by following the requirements of this conformance class but the
decision of whether the processes is executed asynchronously or not is left
to the discretion of the server.

=== Request

include::requirements/asynchronous-execution/REQ_prefer-header.adoc[]

include::recommendations/asynchronous-execution/REC_async.adoc[]

include::recommendations/asynchronous-execution/REC_auto.adoc[]

Requirement <<req_asynchronous-execution_prefer-header,/req/prefer/header>> specifies how the execution mode preference is indicated using standard HTTP methods. In some cases, however, it is desireable to support a mechanism to mint URIs that encode this preference into links that can, for example, be embeded into a web page. This document does not mandate any particular approach for how this is supported by a server.

Since clients simply need to dereference the URI of a link, the specific details of how the execution mode preference is encoded into the URI are not important. Developers interested in the approach of a particular implementation, for example, to manupliate ("hack") URIs in the browser address bar, can study the API definition.

[NOTE]
====
A common approach for encoding the execution mode preference in the URI of a link might be to define a `prefer` query parameter with the same syntax and semantics as the `Prefer` header.
====

include::requirements/asynchronous-execution/REQ_preference_precedence.adoc[]

=== Response

Based on the value of the `Prefer` header the server may choose to execute a
process synchronously or asynchronously. In the case where the server decides
to execute the process asynchronously, the following requirements apply:

include::requirements/asynchronous-execution/REQ_job-creation-success.adoc[]

include::requirements/asynchronous-execution/REQ_job-creation-success-header.adoc[]

include::recommendations/asynchronous-execution/REC_response.adoc[]

In the case where the server decides to execute the process synchronously, see requirement <<req_core_job-creation-success-sync,/req/core/job-creation-success-sync>>.
3 changes: 1 addition & 2 deletions core/examples/json/Execute.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,5 @@
"transmissionMode": "value"
}
},
"response": "document",
"mode": "async"
"response": "document"
}
7 changes: 0 additions & 7 deletions core/openapi/schemas/execute.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
type: object
required:
- outputs
- mode
- response
properties:
inputs:
Expand All @@ -14,12 +13,6 @@ properties:
outputs:
additionalProperties:
$ref: "output.yaml"
mode:
type: string
enum:
- sync
- async
- auto
response:
type: string
enum:
Expand Down
7 changes: 7 additions & 0 deletions core/recommendations/asynchronous-execution/REC_async.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[[rec_prefer_async]]
[width="90%",cols="2,6a"]
|===
^|*Recommendation {counter:rec-id}* |*/rec/prefer/async*

If the client includes the `Prefer` header with a https://tools.ietf.org/html/rfc7240#section-4.1[`respond-async`] Preference, the server SHOULD honor the preference and respond asynchronously.
|===
7 changes: 7 additions & 0 deletions core/recommendations/asynchronous-execution/REC_auto.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[[rec_prefer_auto]]
[width="90%",cols="2,6a"]
|===
^|*Recommendation {counter:rec-id}* |*/rec/prefer/auto*

If the client includes the `Prefer` header with a https://tools.ietf.org/html/rfc7240#section-4.3[`wait`] Preference, the server SHOULD honor that preference in the decision to respond synchronously or asynchronously.
|===
7 changes: 7 additions & 0 deletions core/recommendations/asynchronous-execution/REC_response.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[[rec_prefer_response]]
[width="90%",cols="2,6a"]
|===
^|*Recommendation {counter:rec-id}* |*/rec/prefer/response*

Clients that specify a value for the `Prefer` HTTP header SHOULD be prepared to either receive a response from the process or a system message indicating that the job is being run asynchronously.
|===
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[[req_core_job-creation-success-header-async]]
[[req_asynchronous-execution_job-creation-success-header]]
[width="90%",cols="2,6a"]
|===
|*Requirement {counter:req-id}* |/req/core/job-creation-success-header-async +
|*Requirement {counter:req-id}* |/req/asynchronous-execution/job-creation-success-header +

The 201 response of the operation SHALL return a HTTP header named 'Location' which contains a link to the newly created job.
|===
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[[req_asynchronous-execution_job-creation-success-async]]
[width="90%",cols="2,6a"]
|===
|*Requirement {counter:req-id}* |/req/asynchronous-execution/job-creation-success-async +

A successful execution of the operation SHALL be reported as a response with a
HTTP status code 201.
|===
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[[req_asynchronous-execution_prefer-header]]
[width="90%",cols="2,6a"]
|===
|*Requirement {counter:req-id}* |/req/asynchronous-execution/prefer-header +

Servers that implement this conformance class SHALL support the HTTP `Prefer` header as defined in https://tools.ietf.org/html/rfc7240[RFC 7240].
|===
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[[req_asynchronous-execution_preference_precedencej]]
[width="90%",cols="2,6a"]
|===
|*Requirement {counter:req-id}* |/req/asynchronous-execution/preference_precedence +

In the case where the execution mode preference is encoded in the URI of a link and is also specified using the HTTP `Prefer` header, then the preference encoded in the link SHALL take precedence.
|===
7 changes: 7 additions & 0 deletions core/requirements/core/REQ_default-execute-mode.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[[req_core_default-execute-mode]]
[width="90%",cols="2,6a"]
|===
|*Requirement {counter:req-id}* |/req/core/default-execute-mode +

The default execution mode for a process SHALL be `synchronous` execution.
|===
8 changes: 0 additions & 8 deletions core/requirements/core/REQ_job-creation-mode.adoc

This file was deleted.

8 changes: 0 additions & 8 deletions core/requirements/core/REQ_job-creation-success-async.adoc

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[[rc_asynchronous-execution]]
[cols="1,4",width="90%"]
|===
2+|*Requirements Class*
2+|http://www.opengis.net/spec/ogcapi-processes-1/1.0/req/asynchronous-execution
|Target type |Web API
|Dependency |http://www.opengis.net/spec/ogcapi_common-1/1.0/req/core[API - Common Core]
|Dependency |<<rfc7240,RFC 7240 (Prefer Header for HTTP)>>
|===