Skip to content

Commit

Permalink
Implemented batch job errors: #165
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Feb 15, 2019
1 parent 7818d2c commit 7d7b14c
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 25 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [0.4.0] - Unreleased
### Added
- `GET /jobs/{job_id}/estimate` can return the estimated required storage capacity. [#122](https://github.com/Open-EO/openeo-api/issues/122)
- `GET /jobs/{job_id}` has a property `progress` to indicate the progress. [#82](https://github.com/Open-EO/openeo-api/issues/82)
- `GET /jobs/{job_id}` has two new properties:
- `progress` indicates the batch job progress when running. [#82](https://github.com/Open-EO/openeo-api/issues/82)
- `error` states the error message when a job errored out.
`GET /jobs/{job_id}/result` mirrors this error message in a response with HTTP status code 424. [#165](https://github.com/Open-EO/openeo-api/issues/165)
- `GET /.well-known/openeo` allows clients to choose between versions. [#148](https://github.com/Open-EO/openeo-api/issues/148)
- `GET /` (Capabilities):
- Requires to return a title (`title`), a description (`description`) and the back-end version (`backend_version`). [#154](https://github.com/Open-EO/openeo-api/issues/154)
Expand Down
95 changes: 71 additions & 24 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1584,7 +1584,7 @@
],
"responses": {
"200": {
"description": "Returns the validation result.",
"description": "Returns the validation result as a list of errors. An empty list indicates a successful validation.",
"content": {
"application/json": {
"schema": {
Expand All @@ -1594,7 +1594,7 @@
],
"properties": {
"errors": {
"description": "List of errors. An empty list indicates a successful validation.",
"description": "A list of validation errors.",
"type": "array",
"items": {
"$ref": "#/components/schemas/error"
Expand Down Expand Up @@ -2619,11 +2619,14 @@
},
"progress": {
"type": "number",
"description": "Indicates the process of a running batch job in percent.\nCan also be set for a job whiched errored out or was canceled by the user. In this case, the value indicates the progress at which the job stopped.\nSubmitted and queued jobs only allow the value `0`, finished jobs only allow the value `100`.",
"description": "Indicates the process of a running batch job in percent.\nCan also be set for a job whiched errored out or was canceled by the user. In this case, the value indicates the progress at which the job stopped. Property may not be available for the status codes `submitted` and `queued`.\nSubmitted and queued jobs only allow the value `0`, finished jobs only allow the value `100`.",
"minimum": 0,
"maximum": 100,
"example": 75.5
},
"error": {
"$ref": "#/components/schemas/job_error"
},
"submitted": {
"$ref": "#/components/schemas/submitted"
},
Expand Down Expand Up @@ -2732,6 +2735,16 @@
}
}
},
"424": {
"description": "The request can't be fulfilled as the batch job failed. This request will deliver the error message that was produced by the batch job.\n\nThis HTTP code MUST be sent only when the job `status` is `error`. The response to this error mirrors the `error` field in the `GET /jobs/{job_id}` repoonse.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/job_error"
}
}
}
},
"4XX": {
"$ref": "#/components/responses/client_error_auth"
},
Expand Down Expand Up @@ -4329,44 +4342,78 @@
}
}
},
"job_error": {
"description": "An error message that describes the problem during the batch job execution. May only be available if the `status` is `error`. The error MUST be cleared if the job is started again (i.e. the status changes to `queue`).",
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"id": {
"$ref": "#/components/schemas/error_id"
},
"code": {
"$ref": "#/components/schemas/error_code"
},
"message": {
"$ref": "#/components/schemas/error_message"
},
"links": {
"$ref": "#/components/schemas/error_links"
}
}
},
"error": {
"description": "An error object declares addtional information about a client-side or server-side error. The [openEO documentation](https://open-eo.github.io/openeo-api/v/0.4.0/errors/index.html) provides additional information regarding error handling and a list of error codes.",
"description": "An error object declares addtional information about a client-side or server-side error. The [openEO documentation](https://open-eo.github.io/openeo-api/v/0.4.0/errors/index.html) provides additional information regarding error handling and a list of potential error codes.",
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"id": {
"type": "string",
"description": "A back-end may add a unique identifier to the error response to be able to log and track errors with further non-disclosable details.",
"example": "550e8400-e29b-11d4-a716-446655440000"
"$ref": "#/components/schemas/error_id"
},
"code": {
"type": "string",
"description": "The code is either one of the standardized error codes or a custom error code.",
"example": "SampleError"
"$ref": "#/components/schemas/error_code"
},
"message": {
"type": "string",
"description": "A message explaining what the client may need to change or what difficulties the server is facing. By default the message must be sent in English language. Content Negotiation is used to localize the error messages: If an Accept-Language header is sent by the client and a translation is available, the message should be translated accordingly and the Content-Language header must be present in the response.",
"example": "A sample error message."
"$ref": "#/components/schemas/error_message"
},
"links": {
"description": "Additional links related to this error, e.g. a resource that is explaining the error and potential solutions in-depth or a contact e-mail address.",
"type": "array",
"items": {
"$ref": "#/components/schemas/link"
},
"example": [
{
"href": "http://www.openeo.org/docs/errors/SampleError",
"rel": "about"
}
]
"$ref": "#/components/schemas/error_links"
}
}
},
"error_id": {
"type": "string",
"description": "A back-end may add a unique identifier to the error response to be able to log and track errors with further non-disclosable details. A client could communicate this id to a back-end provider to get further information.",
"example": "550e8400-e29b-11d4-a716-446655440000"
},
"error_code": {
"type": "string",
"description": "The code is either one of the standardized error codes or a custom error code.",
"example": "SampleError"
},
"error_message": {
"type": "string",
"description": "A message explaining what the client may need to change or what difficulties the server is facing. By default the message must be sent in English language. Content Negotiation is used to localize the error messages: If an Accept-Language header is sent by the client and a translation is available, the message should be translated accordingly and the Content-Language header must be present in the response.",
"example": "A sample error message."
},
"error_links": {
"description": "Additional links related to this error, e.g. a resource that is explaining the error and potential solutions in-depth or a contact e-mail address.",
"type": "array",
"items": {
"$ref": "#/components/schemas/link"
},
"example": [
{
"href": "http://www.openeo.org/docs/errors/SampleError",
"rel": "about"
}
]
},
"json_schema": {
"type": "object",
"description": "A schema object according to the specification of [JSON Schema draft-07](http://json-schema.org/). Additional values for `format` are defined [centrally in the API documentation](https://open-eo.github.io/openeo-api/v/0.4.0/processes/index.html), e.g. bbox or crs."
Expand Down

0 comments on commit 7d7b14c

Please sign in to comment.