|
38 | 38 | gitlab_token_scheme = {"type": "apiKey", "name": "Authorization", "in": "header"}
|
39 | 39 |
|
40 | 40 | TOP_LEVEL_DESCRIPTION = """
|
41 |
| -This is the API specification of the renku core service. The API follows |
42 |
| -JSON-RPC conventions that mirrors the functionality of the renku CLI. |
| 41 | +This is the API specification of the renku core service. The API follows the |
| 42 | +[JSON-RPC 2.0](https://www.jsonrpc.org/specification) specifications and mirrors |
| 43 | +the functionality of the renku CLI. |
43 | 44 |
|
44 | 45 | The basic API is low-level and requires that the client handles project
|
45 | 46 | (repository) state in the service cache by invoking the `cache.project_clone`
|
|
51 | 52 | ## Higher-level interface
|
52 | 53 |
|
53 | 54 | Some API methods allow the client to defer repository management to the service.
|
54 |
| -In these cases, the API documentation will include `project_id` _and_ `git_url` |
55 |
| -+ `ref` in the spec. Note that for such methods, _either_ `project_id` _or_ |
56 |
| -`git_url` (and optionally `ref`) should be passed in the request body. |
| 55 | +In these cases, the API documentation will include `project_id` _and_ |
| 56 | +`git_url`+`ref` in the spec. Note that for such methods, _either_ `project_id` |
| 57 | +_or_ `git_url` (and optionally `ref`) should be passed in the request body. |
| 58 | +
|
| 59 | +## Responses |
| 60 | +
|
| 61 | +Following the JSON-RPC 2.0 Specification, the methods all return with HTTP code |
| 62 | +200 and include a [response |
| 63 | +object](https://www.jsonrpc.org/specification#response_object) may contain |
| 64 | +either a `result` or an `error` object. If the call succeeds, the returned |
| 65 | +`result` follows the schema documented in the individual methods. In the case of |
| 66 | +an error, the [`error` |
| 67 | +object](https://www.jsonrpc.org/specification#error_object), contains a code and |
| 68 | +a message describing the nature of the error. In addition to the [standard JSON-RPC |
| 69 | +response codes](https://www.jsonrpc.org/specification#error_object), we define application-specific |
| 70 | +codes: |
| 71 | +
|
| 72 | +``` |
| 73 | +GIT_ACCESS_DENIED_ERROR_CODE = -32000 |
| 74 | +GIT_UNKNOWN_ERROR_CODE = -32001 |
| 75 | +
|
| 76 | +RENKU_EXCEPTION_ERROR_CODE = -32100 |
| 77 | +REDIS_EXCEPTION_ERROR_CODE = -32200 |
| 78 | +
|
| 79 | +INVALID_HEADERS_ERROR_CODE = -32601 |
| 80 | +INVALID_PARAMS_ERROR_CODE = -32602 |
| 81 | +INTERNAL_FAILURE_ERROR_CODE = -32603 |
| 82 | +
|
| 83 | +HTTP_SERVER_ERROR = -32000 |
| 84 | +``` |
| 85 | +
|
57 | 86 | """
|
58 | 87 |
|
59 | 88 | spec = APISpec(
|
|
0 commit comments