diff --git a/LICENSE b/LICENSE index d41b8bd..4beddbf 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 Ivan Goncharov +Copyright (c) 2019-2022 CERN. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 3034f51..84b1cfd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,17 @@ -# CAP API Documentation OpenAPI Specification +# CERN Analysis Preservation REST API Documentation + +### About + +This is the documentation behind the REST API for [CERN Analysis Preservation](https://analysispreservation.cern.ch/). + +Other documentation: +- [CERN Analysis Preservation Docs](https://analysispreservation.cern.ch/docs/general/) +- [CERN Analysis Preservation Client](https://analysispreservation.cern.ch/docs/cli/) + +If you need help or have a question about the API Documentation, please contact us via our [email](analysis-preservation-support@cern.ch). + +# OpenAPI Specification -## Working on specification ### Install 1. Install [Node JS](https://nodejs.org/) @@ -18,4 +29,4 @@ Bundles the spec and prepares web_deploy folder with static assets. Validates the spec. #### `npm run gh-pages` -Deploys docs to GitHub Pages. You don't need to run it manually if you have Travis CI configured. +Deploys docs to GitHub Pages. \ No newline at end of file diff --git a/spec/code_samples/C#/records/post.cs b/spec/code_samples/C#/records/post.cs deleted file mode 100644 index a91d094..0000000 --- a/spec/code_samples/C#/records/post.cs +++ /dev/null @@ -1,12 +0,0 @@ -API.v1.Echo echo = new API.v1.Echo(); -echo.message = "Hello World!"); -EchoResponse response = echo.post(); -if (response.statusCode == HttpStatusCode.Created) -{ - // Success -} -else -{ - // Something wrong -- check response for errors - Console.WriteLine(response.getRawResponse()); -} diff --git a/spec/code_samples/PHP/records/post.php b/spec/code_samples/PHP/records/post.php deleted file mode 100644 index 72da145..0000000 --- a/spec/code_samples/PHP/records/post.php +++ /dev/null @@ -1,7 +0,0 @@ -$form = new \API\Entities\Echo(); -$form->setMessage("Hello World!"); -try { - $pet = $client->echo()->post($form); -} catch (UnprocessableEntityException $e) { - var_dump($e->getErrors()); -} diff --git a/spec/code_samples/Python/records/get.py b/spec/code_samples/Python/records/get.py deleted file mode 100644 index 303a0d7..0000000 --- a/spec/code_samples/Python/records/get.py +++ /dev/null @@ -1,3 +0,0 @@ -import requests - -requests.get('\API\Entities\Records') \ No newline at end of file diff --git a/spec/code_samples/README.md b/spec/code_samples/README.md deleted file mode 100644 index 16e8e0d..0000000 --- a/spec/code_samples/README.md +++ /dev/null @@ -1,9 +0,0 @@ -Code samples -===== - -[x-code-samples](https://github.com/Rebilly/ReDoc/blob/master/docs/redoc-vendor-extensions.md#x-code-samples) -Path `//.` where: - * `` - name of the language from [this](https://github.com/github/linguist/blob/master/lib/linguist/popular.yml) list. - * `` - path of the target method, where all `/` are replaced with `@`. - * `` - verb of target method. - * `` - ignored. diff --git a/spec/components/examples/FileLocalUploadResponse.yaml b/spec/components/examples/FileLocalUploadResponse.yaml new file mode 100644 index 0000000..8d2db8f --- /dev/null +++ b/spec/components/examples/FileLocalUploadResponse.yaml @@ -0,0 +1,12 @@ +value: + size: 442 + delete_marker: false + links: {} + created: "2022-04-20T13:13:01.105707+00:00" + updated: "2022-04-20T13:13:01.113000+00:00" + tags: {} + version_id: b5f224ef-efe2-4ea5-9b47-d13623dd47bb + is_head: true + key: testname + mimetype: text/plain + checksum: md5:c63fcd62028c636019556ee6a1f2f62c \ No newline at end of file diff --git a/spec/components/examples/JSONSchemaAllVersions.yaml b/spec/components/examples/JSONSchemaAllVersions.yaml new file mode 100644 index 0000000..1eb6a00 --- /dev/null +++ b/spec/components/examples/JSONSchemaAllVersions.yaml @@ -0,0 +1,9 @@ +value: + latest: + links: {} + version: 0.0.2 + versions: + - links: {} + version: 0.0.1 + - links: {} + version: 0.0.2 \ No newline at end of file diff --git a/spec/components/examples/JSONSchemaResource.yaml b/spec/components/examples/JSONSchemaResource.yaml index 48aece4..8c9eee3 100644 --- a/spec/components/examples/JSONSchemaResource.yaml +++ b/spec/components/examples/JSONSchemaResource.yaml @@ -6,10 +6,9 @@ value: fullname: MySchema Analysis is_indexed: true links: - deposit: >- - https://analysispreservation.cern.ch/schemas/deposits/records/myschema-v0.0.1.json - record: 'https://analysispreservation.cern.ch/schemas/records/myschema-v0.0.1.json' - self: 'http://localhost:5000/api/jsonschemas/myschema/0.0.1' + deposit: https://analysispreservation.cern.ch/api/schemas/deposits/records/myschema-v0.0.1.json + record: https://analysispreservation.cern.ch/api/schemas/records/myschema-v0.0.1.json + self: https://analysispreservation.cern/ch/api/jsonschemas/myschema/0.0.1 name: myschema record_mapping: {} record_options: {} diff --git a/spec/components/examples/bucketResponse.yaml b/spec/components/examples/bucketResponse.yaml new file mode 100644 index 0000000..fbfa6ab --- /dev/null +++ b/spec/components/examples/bucketResponse.yaml @@ -0,0 +1,32 @@ +value: + contents: + - mimetype: application/x-sh + delete_marker: false + tags: {} + links: + self: >- + https://analysispreservation.cern/ch/api/files/d0d4a30c-0d54-4ae3-ac0a-18fb982aad5f/hello/world/redirects.sh + version: >- + https://analysispreservation.cern/ch/api/files/d0d4a30c-0d54-4ae3-ac0a-18fb982aad5f/hello/world/redirects.sh?versionId=5d7e05ea-7c7c-48b9-913b-8ebadf26182e + uploads: >- + https://analysispreservation.cern/ch/api/files/d0d4a30c-0d54-4ae3-ac0a-18fb982aad5f/hello/world/redirects.sh?uploads + size: 163 + is_head: true + version_id: 5d7e05ea-7c7c-48b9-913b-8ebadf26182e + checksum: 'md5:b8c74d3430930c8ee0f1b53e525175ba' + updated: '2020-10-12T13:39:07.880982+00:00' + key: hello/world/redirects.sh + created: '2020-10-12T13:39:07.871349+00:00' + locked: false + links: + self: 'https://analysispreservation.cern/ch/api/files/d0d4a30c-0d54-4ae3-ac0a-18fb982aad5f' + versions: >- + https://analysispreservation.cern/ch/api/files/d0d4a30c-0d54-4ae3-ac0a-18fb982aad5f?versions + uploads: >- + https://analysispreservation.cern/ch/api/files/d0d4a30c-0d54-4ae3-ac0a-18fb982aad5f?uploads + size: 8425 + updated: '2020-10-12T13:39:07.894887+00:00' + id: d0d4a30c-0d54-4ae3-ac0a-18fb982aad5f + max_file_size: null + quota_size: null + created: '2020-10-12T13:21:40.302308+00:00' diff --git a/spec/components/examples/collectionResponse.yaml b/spec/components/examples/collectionResponse.yaml new file mode 100644 index 0000000..ba6b33f --- /dev/null +++ b/spec/components/examples/collectionResponse.yaml @@ -0,0 +1,6 @@ +value: + drafts: {} + published: {} + schema_data: {} + user_drafts: {} + user_published: {} diff --git a/spec/components/examples/dashboardResponse.yaml b/spec/components/examples/dashboardResponse.yaml new file mode 100644 index 0000000..d63cc41 --- /dev/null +++ b/spec/components/examples/dashboardResponse.yaml @@ -0,0 +1,8 @@ +value: + drafts: {} + published: {} + user_count: 1 + user_drafts: {} + user_draft_count: 10 + user_published: {} + user_published_count: 1 diff --git a/spec/components/examples/depositResponse.yaml b/spec/components/examples/depositResponse.yaml index f411e9b..3c62898 100644 --- a/spec/components/examples/depositResponse.yaml +++ b/spec/components/examples/depositResponse.yaml @@ -1,52 +1,50 @@ value: access: - - action: deposit-read - identity: cms_user@cern.ch - type: user - - action: deposit-update - identity: cms_user@cern.ch - type: user - - action: deposit-admin - identity: cms_user@cern.ch - type: user + - deposit-read: + - roles: [test_role_1] + - users: [{email: cms_user@cern.ch, profile: {}}] + - deposit-update: + - roles: [test_role_1] + - users: [{email: cms_user@cern.ch, profile: {}}] + - deposit-admin: + - roles: [test_role_1] + - users: [{email: cms_user@cern.ch, profile: {}}] + can_admin: true + can_update: true created: 2019-08-29T08:36:37.552Z + created_by: + - email: cms_user@cern.ch + - profile: {} + experiment: CMS files: - bucket: 1e72bd32-c2e3-403e-9c01-2faa0b149999 checksum: None key: test-user_test-repo_test-branch.tar.gz size: 0 - source_url: 'https://gitlab.cern.ch/test-user/test-repo/tree/test-branch' + source_url: https://gitlab.cern.ch/test-user/test-repo/tree/test-branch version_id: ffe05069-8f2a-49da-8617-957b05614723 id: 055c24bad4ee4d6fa44a9432b49fe77e - links: {} - metadata: null - $schema: >- - https://analysispreservation.cern.ch/schemas/deposits/records/test-analysis-v0.0.1.json - _deposit: - created_by: 1 - id": 055c24bad4ee4d6fa44a9432b49fe77e - owners: - - cms_user@cern.ch - pid: - revision_id: 0 - type: recid - value: CAP.xxx.xxx.xxxx - status: published - experiment: None - _files: - - bucket: 1e72bd32-c2e3-403e-9c01-2faa0b149999 - checksum: None - key: test-user_test-repo_test-branch.tar.gz - size: 0 - source_url: 'https://gitlab.cern.ch/test-user/test-repo/tree/test-branch' - version_id: ffe05069-8f2a-49da-8617-957b05614723 - control_number: CAP.xxx.xxx.xxxx - published: null - revision_id: 0 - type: recid - value: CAP.xxx.xxx.xxxx + is_owner: true + labels: [] + links: + bucket: https://analysispreservation.cern/ch/api/files/1e72bd32-c2e3-403e-9c01-2faa0b149999 + clone: https://analysispreservation.cern/ch/api/deposits/055c24bad4ee4d6fa44a9432b49fe77e/actions/clone + discard: https://analysispreservation.cern/ch/api/deposits/055c24bad4ee4d6fa44a9432b49fe77e/actions/discard + disconnect_webhook: https://analysispreservation.cern/ch/api/deposits/055c24bad4ee4d6fa44a9432b49fe77e/actions/disconnect_webhook + edit: https://analysispreservation.cern/ch/api/deposits/055c24bad4ee4d6fa44a9432b49fe77e/actions/edit + files: https://analysispreservation.cern/ch/api/deposits/055c24bad4ee4d6fa44a9432b49fe77e/files + html: https://analysispreservation.cern/ch/drafts/055c24bad4ee4d6fa44a9432b49fe77e + permissions: https://analysispreservation.cern/ch/api/deposits/055c24bad4ee4d6fa44a9432b49fe77e/actions/permissions + publish: https://analysispreservation.cern/ch/api/deposits/055c24bad4ee4d6fa44a9432b49fe77e/actions/publish + self: https://analysispreservation.cern/ch/api/deposits/055c24bad4ee4d6fa44a9432b49fe77e + upload: https://analysispreservation.cern/ch/api/deposits/055c24bad4ee4d6fa44a9432b49fe77e/actions/upload + metadata: {} + schema: + - fullname: CMS Analysis + name: cms-analysis + version: 0.0.1 + type: deposit revision: 2 - schema: >- - https://analysispreservation.cern.ch/schemas/deposits/records/test-analysis-v0.0.1.json - status: published + status: draft updated: 2019-08-29T08:36:38.114Z + webhooks: [] diff --git a/spec/components/examples/depositReviewResponse.yaml b/spec/components/examples/depositReviewResponse.yaml new file mode 100644 index 0000000..587dd0f --- /dev/null +++ b/spec/components/examples/depositReviewResponse.yaml @@ -0,0 +1,45 @@ +value: + access: + - deposit-read: + - roles: [test_role_1] + - users: [{email: cms_user@cern.ch, profile: {}}] + - deposit-update: + - roles: [test_role_1] + - users: [{email: cms_user@cern.ch, profile: {}}] + - deposit-admin: + - roles: [test_role_1] + - users: [{email: cms_user@cern.ch, profile: {}}] + can_admin: true + can_update: true + created: 2019-08-29T08:36:37.552Z + created_by: + - email: cms_user@cern.ch + - profile: {} + experiment: CMS + files: + - bucket: 1e72bd32-c2e3-403e-9c01-2faa0b149999 + checksum: None + key: test-user_test-repo_test-branch.tar.gz + size: 0 + source_url: https://gitlab.cern.ch/test-user/test-repo/tree/test-branch + version_id: ffe05069-8f2a-49da-8617-957b05614723 + id: 055c24bad4ee4d6fa44a9432b49fe77e + is_owner: true + labels: [] + links: {} + metadata: {} + review: + - body: Test + id: f35261fc-2173-41c0-a208-fe7c7edf9831 + resolved: false + reviewer: test_cms_reviewer@cern.ch + type: approved + schema: + - fullname: CMS Analysis + - name: cms-analysis + - version: 0.0.1 + type: deposit + revision: 2 + status: published + updated: 2019-08-29T08:36:38.114Z + webhooks: [] diff --git a/spec/components/examples/depositSearchResponse.yaml b/spec/components/examples/depositSearchResponse.yaml new file mode 100644 index 0000000..e69de29 diff --git a/spec/components/examples/meResponse.yaml b/spec/components/examples/meResponse.yaml new file mode 100644 index 0000000..3bea632 --- /dev/null +++ b/spec/components/examples/meResponse.yaml @@ -0,0 +1,5 @@ +value: + deposit_groups: {} + email: test@cern.ch + id: 1 + profile: {} diff --git a/spec/components/examples/permissionRequest.yaml b/spec/components/examples/permissionRequest.yaml new file mode 100644 index 0000000..422a58e --- /dev/null +++ b/spec/components/examples/permissionRequest.yaml @@ -0,0 +1,5 @@ +value: + email: test@cern.ch + type: user + op: add + action: deposit-read diff --git a/spec/components/examples/recordResponse.yaml b/spec/components/examples/recordResponse.yaml new file mode 100644 index 0000000..25bf1ab --- /dev/null +++ b/spec/components/examples/recordResponse.yaml @@ -0,0 +1,42 @@ +value: + access: + - record-read: + - roles: [test_role_1] + - users: [{email: cms_user@cern.ch, profile: {}}] + - record-update: + - roles: [test_role_1] + - users: [{email: cms_user@cern.ch, profile: {}}] + - record-admin: + - roles: [test_role_1] + - users: [{email: cms_user@cern.ch, profile: {}}] + can_review: true + can_update: true + created: 2019-08-29T08:36:37.552Z + created_by: + - email: cms_user@cern.ch + - profile: {} + experiment: CMS + files: + - bucket: 1e72bd32-c2e3-403e-9c01-2faa0b149999 + checksum: None + key: test-user_test-repo_test-branch.tar.gz + size: 0 + source_url: https://gitlab.cern.ch/test-user/test-repo/tree/test-branch + version_id: ffe05069-8f2a-49da-8617-957b05614723 + id: 055c24bad4ee4d6fa44a9432b49fe77f + draft_id: 055c24bad4ee4d6fa44a9432b49fe77e + is_owner: true + labels: [] + links: + html: https://analysispreservation.cern.ch/published/055c24bad4ee4d6fa44a9432b49fe77f + self: https://analysispreservation.cern.ch/api/records/055c24bad4ee4d6fa44a9432b49fe77f + metadata: {} + schema: + - fullname: CMS Analysis + name: cms-analysis + version: 0.0.1 + schemas: {} + type: record + revision: 2 + status: published + updated: 2019-08-29T08:36:38.114Z diff --git a/spec/components/examples/uploadRequest.yaml b/spec/components/examples/uploadRequest.yaml new file mode 100644 index 0000000..6618840 --- /dev/null +++ b/spec/components/examples/uploadRequest.yaml @@ -0,0 +1,5 @@ +value: + type: repo + url: https://github.com/user/test + webhook: true + event_type: push \ No newline at end of file diff --git a/spec/components/schemas/Access.yaml b/spec/components/schemas/Access.yaml new file mode 100644 index 0000000..721f2c8 --- /dev/null +++ b/spec/components/schemas/Access.yaml @@ -0,0 +1,15 @@ +type: object +properties: + roles: + type: array + description: Egroups with access + items: + $ref: '#/components/schemas/Email' + users: + type: array + description: Users with access + items: + email: + $ref: '#/components/schemas/Email' + profile: + $ref: '#/components/schemas/User' diff --git a/spec/components/schemas/Collection.yaml b/spec/components/schemas/Collection.yaml new file mode 100644 index 0000000..ddd0915 --- /dev/null +++ b/spec/components/schemas/Collection.yaml @@ -0,0 +1,14 @@ +title: A Collection data resource schema +type: object +properties: + drafts: + type: object + published: + type: object + schema_data: + type: object + user_drafts: + type: object + user_published: + type: object + diff --git a/spec/components/schemas/Dashboard.yaml b/spec/components/schemas/Dashboard.yaml new file mode 100644 index 0000000..a9003ae --- /dev/null +++ b/spec/components/schemas/Dashboard.yaml @@ -0,0 +1,19 @@ +title: Dasboard data resource schema +type: object +properties: + drafts: + type: object + published: + type: object + user_count: + type: integer + user_drafts: + type: object + user_draft_count: + type: integer + user_published: + type: object + user_published_count: + type: integer + user_workflows: + type: object diff --git a/spec/components/schemas/Deposit.yaml b/spec/components/schemas/Deposit.yaml index 6d2f1ce..96072d7 100644 --- a/spec/components/schemas/Deposit.yaml +++ b/spec/components/schemas/Deposit.yaml @@ -1,12 +1,12 @@ description: Record resource type: object oneOf: - - title: Empty draft with `ana_type` + - title: Empty draft with `$ana_type` type: object properties: $ana_type: title: Analysis Type - description: Analysis Type (schema type) of record to be create + description: Analysis Type (schema type) of record to be created type: string required: - $ana_type @@ -16,12 +16,12 @@ oneOf: $ref: '#/components/schemas/Schema' required: - $schema - - title: Deposit with some content + - title: Deposit with content type: object properties: $schema: $ref: '#/components/schemas/Schema' analysis_title: type: string - abstract: - type: string + required: + - $schema diff --git a/spec/components/schemas/DepositResponse.yaml b/spec/components/schemas/DepositResponse.yaml index 493e2ee..fc5bcd2 100644 --- a/spec/components/schemas/DepositResponse.yaml +++ b/spec/components/schemas/DepositResponse.yaml @@ -2,34 +2,61 @@ description: Deposit resource type: object properties: access: - type: array - items: - $ref: '#/components/schemas/Permission' + $ref: '#/components/schemas/Access' + can_admin: + type: boolean + can_update: + type: boolean created: type: string format: date-time description: Creation time of record + created_by: + type: object + properties: + email: + $ref: '#/components/schemas/Email' + profile: + $ref: '#/components/schemas/User' + experiment: + type: string + description: Associated experiment with the deposit + files: + $ref: '#/components/schemas/FileResponse' id: type: string format: uuid description: Deposit ID + is_owner: + type: boolean + description: True if current user is owner of the deposit + labels: + $ref: '#/components/schemas/Labels' links: type: object + description: The related links for this deposit metadata: $ref: '#/components/schemas/DepositMetadata' + review: + type: array revision: type: number description: Revision of current record schema: - type: string - format: uri - description: JSON Schema the record is verified against + $ref: '#/components/schemas/Schema' status: type: string enum: - draft - published + type: + type: string + enum: + - deposit + - record updated: type: string format: date-time description: Last updated time of record + webhooks: + type: array diff --git a/spec/components/schemas/Email.yaml b/spec/components/schemas/Email.yaml index 55801ff..296b65c 100644 --- a/spec/components/schemas/Email.yaml +++ b/spec/components/schemas/Email.yaml @@ -1,4 +1,3 @@ description: User email address type: string -format: test example: john.smith@example.com diff --git a/spec/components/schemas/FileLocalUploadResponse.yaml b/spec/components/schemas/FileLocalUploadResponse.yaml new file mode 100644 index 0000000..7315019 --- /dev/null +++ b/spec/components/schemas/FileLocalUploadResponse.yaml @@ -0,0 +1,35 @@ +description: Files associated with a deposit +type: object +properties: + delete_marker: + type: boolean + size: + type: string + description: The size of the file in bytes + links: + type: object + properties: + self: + type: string + version: + type: string + uploads: + type: string + created: + type: string + updated: + type: string + tags: + type: object + version_id: + type: string + is_head: + type: boolean + key: + type: string + decription: File name + checksum: + type: string + description: The SHA1 of the file + mimetype: + type: string diff --git a/spec/components/schemas/FileResponse.yaml b/spec/components/schemas/FileResponse.yaml index 0967ef4..53638d8 100644 --- a/spec/components/schemas/FileResponse.yaml +++ b/spec/components/schemas/FileResponse.yaml @@ -1 +1,17 @@ -{} +description: Files associated with a deposit +type: array +items: + type: object + properties: + filename: + type: string + description: The full name of the file + filesize: + type: string + description: The size of the file in bytes + checksum: + type: string + description: The SHA1 of the file + id: + type: string + description: The internal id of the file diff --git a/spec/components/schemas/JSONSchemaAllVersions.yaml b/spec/components/schemas/JSONSchemaAllVersions.yaml new file mode 100644 index 0000000..3e81fa2 --- /dev/null +++ b/spec/components/schemas/JSONSchemaAllVersions.yaml @@ -0,0 +1,19 @@ +title: JSON Schema All versions response +type: object +properties: + latest: + type: object + properties: + links: + type: object + version: + type: string + versions: + type: array + items: + type: object + properties: + links: + type: object + version: + type: string diff --git a/spec/components/schemas/Labels.yaml b/spec/components/schemas/Labels.yaml new file mode 100644 index 0000000..9bea861 --- /dev/null +++ b/spec/components/schemas/Labels.yaml @@ -0,0 +1,4 @@ +description: Labels associated with a deposit +type: array +items: + type: string diff --git a/spec/components/schemas/PermissionRequest.yaml b/spec/components/schemas/PermissionRequest.yaml new file mode 100644 index 0000000..0bbb411 --- /dev/null +++ b/spec/components/schemas/PermissionRequest.yaml @@ -0,0 +1,10 @@ +type: object +properties: + email: + type: string + type: + type: string + op: + type: string + action: + type: string diff --git a/spec/components/schemas/RecordResponse.yaml b/spec/components/schemas/RecordResponse.yaml new file mode 100644 index 0000000..acd44f8 --- /dev/null +++ b/spec/components/schemas/RecordResponse.yaml @@ -0,0 +1,73 @@ +description: Record resource +type: object +properties: + access: + $ref: '#/components/schemas/Access' + can_review: + type: boolean + can_update: + type: boolean + created: + type: string + format: date-time + description: Creation time of record + created_by: + type: object + properties: + email: + $ref: '#/components/schemas/Email' + profile: + $ref: '#/components/schemas/User' + experiment: + type: string + description: Associated experiment with the record + files: + $ref: '#/components/schemas/FileResponse' + id: + type: string + format: uuid + description: Record ID + draft_id: + type: string + format: uuid + description: ID of the deposit + is_owner: + type: boolean + description: True if current user is owner of the record + labels: + $ref: '#/components/schemas/Labels' + links: + type: object + properties: + html: + type: string + self: + type: string + metadata: + $ref: '#/components/schemas/DepositMetadata' + revision: + type: number + description: Revision of current record + schema: + $ref: '#/components/schemas/Schema' + schemas: + type: object + properties: + config_reviewable: + type: boolean + schema: + $ref: '#/components/schemas/Schema' + uiSchema: + type: object + status: + type: string + value: published + type: + type: string + value: record + updated: + type: string + format: date-time + description: Last updated time of record + webhooks: + type: array diff --git a/spec/components/schemas/Schema.yaml b/spec/components/schemas/Schema.yaml index d7a0521..95384ba 100644 --- a/spec/components/schemas/Schema.yaml +++ b/spec/components/schemas/Schema.yaml @@ -1,5 +1,16 @@ -title: JSON Schema URL that will validate the record -description: >- - JSON Schema URL of the record to be created. The metadata of the record will - validate against this schema -type: string +schema: + title: JSON Schema URL that will validate the record + type: object + description: >- + JSON Schema URL of the record to be created. The metadata of the record will + validated against this schema. + properties: + fullname: + type: string + description: The full name of the schema + name: + type: string + description: The short name (`$ana_type`) of the schema + version: + description: The version of the schema to be used + type: string diff --git a/spec/components/schemas/UploadRepositories.yaml b/spec/components/schemas/UploadRepositories.yaml new file mode 100644 index 0000000..c664395 --- /dev/null +++ b/spec/components/schemas/UploadRepositories.yaml @@ -0,0 +1,43 @@ +description: Upload Resource +type: object +oneOf: + - title: Upload snapshot of repository + type: object + properties: + event_type: + type: string + url: + type: string + description: The URL of the repository for the snapshot + webhook: + type: boolean + required: + - url + - title: Upload snapshot of a file from repository + properties: + event_type: + type: string + url: + type: string + description: The URL path of the file in repository + webhook: + type: boolean + required: + - url + - title: Create a webhook and upload a snapshot when the specified event happens + type: object + properties: + event_type: + type: string + enum: + - release + - push + url: + type: string + description: The URL of the repository + webhook: + type: boolean + required: + - url + - webhook + - event_type diff --git a/spec/components/schemas/me.yaml b/spec/components/schemas/me.yaml new file mode 100644 index 0000000..5f1cdde --- /dev/null +++ b/spec/components/schemas/me.yaml @@ -0,0 +1,11 @@ +title: Metadata of the logged in User +type: object + properties: + deposit_groups: + type: object + email: + $ref: '#/components/schemas/Email' + id: + type: integer + profile: + type: object diff --git a/spec/components/securitySchemes/Access Token.yaml b/spec/components/securitySchemes/Access Token.yaml index b3d43c5..d98b013 100644 --- a/spec/components/securitySchemes/Access Token.yaml +++ b/spec/components/securitySchemes/Access Token.yaml @@ -2,24 +2,22 @@ type: apiKey in: query name: access_token description: > - > Your access token will allow you to use the service in the same way in which - you may use it if you log in on the web portal. You will have the same - permissions unless specified otherwise creation of the token. This implies - that anyone who has this token can log in as yourself to the service. Do not - share your personal access token with anyone else, and only use it with HTTPS! + Your access token will allow you to use the service in the same way you would + use it through the web portal. It gives full access to your account and anyone who has this token can log in as yourself to the service. + + + _Do not share your personal access token with anyone else, and only use it with HTTPS._ To get an access token, you will need to log in on the web portal and [create - one](https://analysispreservation.cern.ch/settings), as shown below. + one](https://analysispreservation.cern.ch/settings) by clicking on `Add Token` as shown below. + - In this dialog, `scopes` lets you define permissions for the token which by - default only include read access to your drafts and records. + ![create_token](https://github.com/cernanalysispreservation/analysispreservation.cern.ch/raw/master/docs/_static/fig_token_new.png) - ![create_token](https://cernanalysispreservation.readthedocs.io/en/latest/_images/fig_token.png) + Once you have created your token, you can see the generated key in the settings page + where your list of tokens is stored. It is also possible to revoke a token. - Clicking "Submit" will generate and show your personal token in the browser. - Please copy it to a safe place on your computer, as it is not stored on the - portal and you will not be able to retrieve the same token again in the - future. + ![list_of_tokens](https://github.com/cernanalysispreservation/analysispreservation.cern.ch/raw/master/docs/_static/fig_token_new2.png) diff --git a/spec/openapi.yaml b/spec/openapi.yaml index 5ac49dd..777169b 100644 --- a/spec/openapi.yaml +++ b/spec/openapi.yaml @@ -2,10 +2,9 @@ openapi: 3.0.0 info: version: 1.0.0 title: CERN Analysis Preservation REST API - termsOfService: 'https://analysispreservation.cern.ch/terms/' contact: email: analysis-preservation-support@cern.ch - url: 'https://analysispreservation.cern.ch/about' + url: https://analysispreservation.cern.ch license: name: Apache 2.0 url: 'http://www.apache.org/licenses/LICENSE-2.0.html' @@ -13,6 +12,11 @@ info: url: >- https://github.com/cernanalysispreservation/cap-api-docs/raw/master/web/CAP_API_docs.png description: > + CERN Analysis Preservation (CAP) is a service developed at the European Organization for Nuclear Research (CERN) + to support researchers in preserving and documenting the various components of their physics analyses, so that + they are reusable and understandable in the future. + + CERN Analysis Preservation offers a REST API to access the service independently from the web interface. This allows users to automate specific tasks or create their own data interface, using simple HTTP calls. @@ -20,8 +24,8 @@ info: # Introduction - CERN Analysis Preservation provides a RESTful API, built on HTTP. It tries - to provide a predictable interface, that includes: + CERN Analysis Preservation provides a RESTful API, built on HTTP. + It provides a predictable interface, that includes: * resource URLs, @@ -33,8 +37,8 @@ info: You can use your favorite HTTP/REST library for your programming language to use CAP's API, or you can use one of our SDKs (CLI clients), currently available in Python. Every action from our app is implemented using REST - endpoints, all of which are documented and available, in order to bea easily - accessible for automations and integrations into specific workflowsor + endpoints, all of which are documented and available, in order to be easily + accessible for automations and integrations into specific workflows or data-related apps. @@ -54,34 +58,39 @@ info: externalDocs: - description: Click here if you are looking for our developement documentation. - url: 'https://cernanalysispreservation.readthedocs.io' + description: Click here if you are looking for our general documentation. + url: 'https://analysispreservation.cern.ch/docs/general' tags: - name: Deposits - description: The Deposit resource is used for uploading and editing records on CAP + description: The Deposit resource is used for creating and editing records on CAP. - name: Records description: > - The Record resource is used for fetching and searching published records - on CAP. Create deposit + The Record resource is used for retrieving and searching published records + on CAP. - name: Files description: > - The Files resource is used for uploading files and attach them to - records/deposits + The Files resource allows the user to upload files and attach them to + specific records/deposits. The following upload options are possible: - The following type of upload are possible: - * Local files - * Git repos - * URL linked files + * Files from a local location + * Files from a URL location + * Git repos available in **GitHub / GitLab** (in a `.tar` archive) - name: Search description: Search functionality - - name: Schemas - description: Operations about schemas - name: JSON Schemas - description: Operations about schemas + description: JSON Schema related operations - name: Services - description: Operations about services - - name: User - description: Operations about user + description: >- + The external services provided by the CAP API. + + The following services are available: + * [ADL parsing service](https://twiki.cern.ch/twiki/bin/view/LHCPhysics/ADL) + * [CDS service](https://cds.cern.ch/) + * [Indico service](https://indico.cern.ch/) + * LATEX service + * ORCID service + * ROR service + * Zenodo service security: - Access Token: [] servers: diff --git a/spec/paths/collection@{name}.yaml b/spec/paths/collection@{name}.yaml new file mode 100644 index 0000000..724c8d0 --- /dev/null +++ b/spec/paths/collection@{name}.yaml @@ -0,0 +1,19 @@ +get: + tags: + - User + summary: Get the data related to a collection by schema name + operationId: getCollectionByName + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Collection' + example: + $ref: '#/components/examples/collectionResponse' + '403': + description: Forbidden + '401': + $ref: '#/components/responses/NotAuthorized' + diff --git a/spec/paths/collection@{name}@{version}.yaml b/spec/paths/collection@{name}@{version}.yaml new file mode 100644 index 0000000..b911f99 --- /dev/null +++ b/spec/paths/collection@{name}@{version}.yaml @@ -0,0 +1,18 @@ +get: + tags: + - User + summary: Get the data related to a collection by schema name and version + operationId: getCollectionByName + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Collection' + example: + $ref: '#/components/examples/collectionResponse' + '403': + description: Forbidden + '401': + $ref: '#/components/responses/NotAuthorized' diff --git a/spec/paths/dashboard.yaml b/spec/paths/dashboard.yaml new file mode 100644 index 0000000..9347e17 --- /dev/null +++ b/spec/paths/dashboard.yaml @@ -0,0 +1,23 @@ +get: + tags: + - User + summary: Get the dashboard data + operationId: getDashboard + responses: + '200': + description: OK + headers: + X-Rate-Limit: + $ref: '#/components/headers/RateLimit' + X-Expires-After: + $ref: '#/components/headers/ExpiresAfter' + content: + application/json: + schema: + $ref: '#/components/schemas/Dashbaord' + example: + $ref: '#/components/examples/dashboardResponse' + '403': + description: Forbidden + '401': + $ref: '#/components/responses/NotAuthorized' diff --git a/spec/paths/deposits.yaml b/spec/paths/deposits.yaml index 59e4c47..d5091de 100644 --- a/spec/paths/deposits.yaml +++ b/spec/paths/deposits.yaml @@ -1,17 +1,14 @@ post: summary: Create a new draft description: > - To create a new draft you need to pass a correct analysis type (`$ana_type`) - OR a correct JSON Schema. + To create a new draft you need to pass a valid analysis type OR JSON Schema. + (`$ana_type`/`$schema`) - > JSON Schemas and analysis types (`$ana_type`) depend on the access rights - you have and mainly\ + > Analysis types (`$ana_type`) and JSON Schemas (`$schema`) depend on the access rights + of the logged in user and mainly correspond to the CERN collaboration you are part of + (***ALICE, ATLAS, CMS, LHCb***). - correspond to the CERN collaboration you are part of (***ALICE, ATLAS, CMS, - LHCb***).\ - - To get the list of available schemas you can call the tags: - Deposits requestBody: @@ -20,19 +17,21 @@ post: schema: $ref: '#/components/schemas/Deposit' examples: - simple: + simple_with_ana_type: value: - $ana_type: + $ana_type: cms-analysis simple_with_schema: value: - $schema: + $schema: >- + https://analysispreservation.cern.ch/api/schemas/deposits/records/cms-analysis-v0.0.1.json advanced: value: - $ana_type: + $schema: >- + https://analysispreservation.cern.ch/api/schemas/deposits/records/cms-analysis-v0.0.1.json analysis_title: This is a title that describes my analysis responses: - '200': - description: OK + '201': + description: Created headers: X-Rate-Limit: $ref: '#/components/headers/RateLimit' @@ -43,7 +42,7 @@ post: schema: $ref: '#/components/schemas/DepositResponse' examples: - depositCreated: + depositResponse: $ref: '#/components/examples/depositResponse' '400': description: Validation error @@ -57,10 +56,11 @@ post: '401': $ref: '#/components/responses/NotAuthorized' get: - summary: List all deposits/drafts + summary: List all drafts description: >- - List all deposits for the currently authenticated user. At least `read` - access is needed to query a record + List all deposits for the currently authenticated user. + + > You need to have at least `read` access to query the resource. tags: - Deposits parameters: diff --git a/spec/paths/deposits@{depid}.yaml b/spec/paths/deposits@{depid}.yaml index 1a8de93..401efaf 100644 --- a/spec/paths/deposits@{depid}.yaml +++ b/spec/paths/deposits@{depid}.yaml @@ -9,11 +9,12 @@ parameters: get: tags: - Deposits - summary: Get deposit by ID - description: | - Retrieve a deposit/draft resource by the `deposit_id` - > You need to have at least 'read' access - operationId: get_deposit + summary: Get a draft by ID + description: > + Retrieve a deposit/draft resource using `deposit_id`. + + > You need to have at least `read` access. + operationId: getDeposit responses: '200': description: OK @@ -26,27 +27,26 @@ get: application/json: schema: $ref: '#/components/schemas/DepositResponse' - example: - $ref: '#/components/examples/depositResponse' + examples: + depositResponse: + $ref: '#/components/examples/depositResponse' '401': $ref: '#/components/responses/NotAuthorized' put: tags: - Deposits - summary: Update a deposit - description: Update a deposit/draft resource + summary: Update a draft + description: Update a deposit/draft resource. operationId: depositUpdate requestBody: content: application/json: schema: $ref: '#/components/schemas/DepositMetadata' - example: - title: My new title - abstract: Already commited/saved abstract desciption - description: | - A JSON object that will replace the `metadata` field of the resource - > It should validate against the specified `$schema` of the resource + description: > + A JSON object that will replace the `metadata` field of the resource. + + > You need to have at least `update` access and the JSON object should validate against the specified `$schema` of the resource. required: true responses: '200': @@ -59,10 +59,10 @@ put: content: application/json: schema: - type: string + $ref: '#/components/schemas/DepositResponse' examples: - response: - value: Hello world! + depositResponse: + $ref: '#/components/examples/depositResponse' '401': $ref: '#/components/responses/NotAuthorized' patch: @@ -70,7 +70,7 @@ patch: - Deposits summary: Patch a deposit description: > - Update a deposit/draft resource with a [JSON Patch](http://jsonpatch.com/) + Update a deposit/draft resource with a [JSON Patch](http://jsonpatch.com/). ### What is JSON Patch? @@ -87,7 +87,7 @@ patch: JSON Patch is specified in [RFC 6902](http://tools.ietf.org/html/rfc6902) - from the IETF. + by the IETF. ### Simple example @@ -130,12 +130,12 @@ patch: schema: $ref: '#/components/schemas/DepositMetadata' example: - op: replace - path: /general_title - value: Gen Test + - op: replace + path: /general_title + value: Gen Test description: > A [JSON Patch](http://jsonpatch.com/) object that will update/patch on top - of the `metadata` of the resource + of the `metadata` of the resource. > It should validate against the specified `$schema` of the resource required: true @@ -149,10 +149,9 @@ patch: $ref: '#/components/headers/ExpiresAfter' content: application/json: - schema: - type: string + $ref: '#/components/schemas/DepositResponse' examples: - response: - value: Hello world! + depositResponse: + $ref: '#/components/examples/depositResponse' '401': $ref: '#/components/responses/NotAuthorized' diff --git a/spec/paths/deposits@{depid}@actions@clone.yaml b/spec/paths/deposits@{depid}@actions@clone.yaml index b622e78..62db519 100644 --- a/spec/paths/deposits@{depid}@actions@clone.yaml +++ b/spec/paths/deposits@{depid}@actions@clone.yaml @@ -11,8 +11,9 @@ post: - Deposits summary: Clone/duplicate a draft description: | - Retrieve a draft records by the `deposit_id` - > You need to have at least 'read' access + Clone a deposit and add snapshot of the files when resource is cloned. + + > You need to have at least `read` access. operationId: cloneDeposit responses: '200': diff --git a/spec/paths/deposits@{depid}@actions@disconnect_webhook.yaml b/spec/paths/deposits@{depid}@actions@disconnect_webhook.yaml new file mode 100644 index 0000000..71d8757 --- /dev/null +++ b/spec/paths/deposits@{depid}@actions@disconnect_webhook.yaml @@ -0,0 +1,47 @@ +parameters: + - name: depid + in: path + description: Deposit/Draft ID + schema: + type: string + format: uuid + required: true +post: + tags: + - Deposits + requestBody: + content: + application/json: + schema: + type: object + properties: + subscriber_id: + type: integer + required: + - subscriber_id + examples: + request: + value: + subscriber_id: 1 + summary: Disconnect a webhook + description: | + Disconnect webhook for repostiories. + + > You need to have at least `update` access. + operationId: disconnectWebhook + responses: + '201': + description: Created + headers: + X-Rate-Limit: + $ref: '#/components/headers/RateLimit' + X-Expires-After: + $ref: '#/components/headers/ExpiresAfter' + content: + application/json: + schema: + $ref: '#/components/schemas/DepositResponse' + example: + $ref: '#/components/examples/depositResponse' + '401': + $ref: '#/components/responses/NotAuthorized' \ No newline at end of file diff --git a/spec/paths/deposits@{depid}@actions@edit.yaml b/spec/paths/deposits@{depid}@actions@edit.yaml index 76b5f45..7500fc2 100644 --- a/spec/paths/deposits@{depid}@actions@edit.yaml +++ b/spec/paths/deposits@{depid}@actions@edit.yaml @@ -9,12 +9,12 @@ parameters: post: tags: - Deposits - summary: Edit published deposit + summary: Edit a published deposit description: > To be able to **edit** an already `published` deposit, you should first change it's status to `draft`. Only then you can [update](#operation/depositUpdate) or [patch](#operation/depositPatch) - depending on your needs + depending on your needs. operationId: editDeposit responses: '200': @@ -31,7 +31,8 @@ post: application/json: schema: $ref: '#/components/schemas/DepositResponse' - example: - $ref: '#/components/examples/depositResponse' + examples: + editDeposit: + $ref: '#/components/examples/depositResponse' '401': $ref: '#/components/responses/NotAuthorized' diff --git a/spec/paths/deposits@{depid}@actions@permissions.yaml b/spec/paths/deposits@{depid}@actions@permissions.yaml index fbf5608..7c9a9cd 100644 --- a/spec/paths/deposits@{depid}@actions@permissions.yaml +++ b/spec/paths/deposits@{depid}@actions@permissions.yaml @@ -11,12 +11,25 @@ post: - Deposits summary: Add/remove permissions description: | - Add or remove `user` and `e-group` access to the resource - > You need to have 'admin' rights for the deposit to change permissions + Add or remove `user` and `e-group` access for a resource. + + > You need to have admin rights for the deposit resource to be able to change permissions. operationId: permissionsDeposit + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PermissionRequest' + examples: + permissionRequest: + $ref: '#/components/examples/permissionRequest' + description: | + A JSON object that will replace the `metadata` field of the resource + > It should validate against the specified `$schema` of the resource + required: true responses: - '200': - description: OK + '201': + description: Created headers: X-Rate-Limit: description: calls per hour allowed by the user diff --git a/spec/paths/deposits@{depid}@actions@publish.yaml b/spec/paths/deposits@{depid}@actions@publish.yaml index 2c3cf38..f09b67c 100644 --- a/spec/paths/deposits@{depid}@actions@publish.yaml +++ b/spec/paths/deposits@{depid}@actions@publish.yaml @@ -12,11 +12,11 @@ post: summary: Publish to collaboration description: > Create a new version of the document and make it public to your - collaboration + collaboration. operationId: publishDeposit responses: - '200': - description: OK + '202': + description: Accepted headers: X-Rate-Limit: description: calls per hour allowed by the user @@ -28,8 +28,9 @@ post: content: application/json: schema: - $ref: '#/components/schemas/DepositResponse' - example: - $ref: '#/components/examples/depositResponse' + $ref: '#/components/schemas/RecordResponse' + examples: + depositSearchResponse: + $ref: '#/components/examples/recordResponse' '401': $ref: '#/components/responses/NotAuthorized' diff --git a/spec/paths/deposits@{depid}@actions@review.yaml b/spec/paths/deposits@{depid}@actions@review.yaml new file mode 100644 index 0000000..8ae4c6d --- /dev/null +++ b/spec/paths/deposits@{depid}@actions@review.yaml @@ -0,0 +1,52 @@ +parameters: + - name: depid + in: path + description: Deposit/Draft ID + schema: + type: string + format: uuid + required: true +post: + tags: + - Deposits + summary: Review a draft + description: | + Adds review and comments for a deposit. + + > You need to have at least 'read' access and 'review' permissions. + > Review field will show up in the response only if the record schema is `reviewable`. + operationId: reviewDeposit + requestBody: + content: + application/json: + schema: + type: object + properties: + type: + type: enum + enum: + - approved + - request_changes + - declined + body: + type: string + description: Review comments + example: + type: approved + body: Looks good! + responses: + '201': + description: Created + headers: + X-Rate-Limit: + $ref: '#/components/headers/RateLimit' + X-Expires-After: + $ref: '#/components/headers/ExpiresAfter' + content: + application/json: + schema: + $ref: '#/components/schemas/DepositResponse' + example: + $ref: '#/components/examples/depositReviewResponse' + '401': + $ref: '#/components/responses/NotAuthorized' diff --git a/spec/paths/deposits@{depid}@actions@reviewupdate.yaml b/spec/paths/deposits@{depid}@actions@reviewupdate.yaml new file mode 100644 index 0000000..114f130 --- /dev/null +++ b/spec/paths/deposits@{depid}@actions@reviewupdate.yaml @@ -0,0 +1,51 @@ +parameters: + - name: depid + in: path + description: Deposit/Draft ID + schema: + type: string + format: uuid + required: true +post: + tags: + - Deposits + summary: Update the review in a draft. + description: | + Adds review and comments for a deposit. + + > You need to have at least 'read' access and 'review' permissions. Review field will show up in the response only if the record schema is `reviewable`. + operationId: updateReviewDeposit + requestBody: + content: + application/json: + schema: + type: object + properties: + action: + type: enum + enum: + - resolve + - delete + - comment + id: + type: string + description: Unique uuid of the review + example: + action: resolve + id: f35261fc-2173-41c0-a208-fe7c7edf9831 + responses: + '200': + description: OK + headers: + X-Rate-Limit: + $ref: '#/components/headers/RateLimit' + X-Expires-After: + $ref: '#/components/headers/ExpiresAfter' + content: + application/json: + schema: + $ref: '#/components/schemas/DepositResponse' + example: + $ref: '#/components/examples/depositReviewResponse' + '401': + $ref: '#/components/responses/NotAuthorized' diff --git a/spec/paths/deposits@{depid}@actions@upload.yaml b/spec/paths/deposits@{depid}@actions@upload.yaml index 813fee6..815deb3 100644 --- a/spec/paths/deposits@{depid}@actions@upload.yaml +++ b/spec/paths/deposits@{depid}@actions@upload.yaml @@ -6,37 +6,48 @@ parameters: type: string format: uuid required: true - - name: type - in: query - description: Url type (repo/url) - schema: - type: string - enum: [url, repo] - required: true - - name: url - in: query - description: Url of repo/file to upload - schema: - type: string - format: uuid - required: true post: tags: - Deposits - summary: Upload files/data - description: | - Upload files/data to your analysis, in a specified deposit record. - The following type of uploads are possible: - * Local files - * Git repos - * URL linked files + summary: Download/Connect the repository/file in a deposit + description: >- + + - **Download** a snapshot of repository, that you'd like to preserve with your analysis. + You can point to the whole repo, specific branch or even a single file whatever your analysis needs. + Some repositories are private or restricted for CERN users only (like all the repos in CERN Gitlab) - + to download those you need to connect your Github/Gitlab account first. + + - **Connect** repositories with analysis that are still in progress, to keep them in sync. + We'll make a new snapshot on any changes pushed in this repository. + This way your analysis will be always up to date with your code. + Keep in mind that you cannot connect to public repositories (owner has to give you a specific access to do that). + Upload files/data to your analysis, in a specified deposit record. - The API differentiates between whole repos (saved as .tar) and single files - from repos, so the parameter "type" is necessary. - operationId: uploadDeposit + operationId: connectToDeposit + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UploadRepositories' + examples: + upload_snapshot_of_repository: + value: + event_type: null + url: https://github.com/cernanalysispreservation/cap-api-docs + webhook: false + upload_snapshot_of_repository_file: + value: + event_type: null + url: https://github.com/cernanalysispreservation/cap-api-docs/README.md + webhook: null + webhook_and_snapshot_on_event: + value: + event_type: push + url: https://github.com/cernanalysispreservation/cap-api-docs/tree/master + webhook: true responses: - '200': - description: OK + '201': + description: Created headers: X-Rate-Limit: description: calls per hour allowed by the user diff --git a/spec/paths/deposits@{depid}@files.yaml b/spec/paths/deposits@{depid}@files.yaml index 022f118..b64aac3 100644 --- a/spec/paths/deposits@{depid}@files.yaml +++ b/spec/paths/deposits@{depid}@files.yaml @@ -11,44 +11,16 @@ get: - Deposits summary: Get deposit files description: | - Retrieve all files that are associated with the draft record + Retrieve all files that are associated with the draft depsoit responses: '200': description: List of files content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/FileResponse' - example: - $ref: '#/components/examples/fileResponse' - '401': - $ref: '#/components/responses/NotAuthorized' -post: - tags: - - Deposits - summary: Upload local files - description: | - Retrieve a draft records by the `deposit_id` - > You need to have at least 'read' access - operationId: filesDeposit - responses: - '200': - description: OK - headers: - X-Rate-Limit: - description: calls per hour allowed by the user - schema: - type: integer - format: int32 - X-Expires-After: - $ref: '#/components/headers/ExpiresAfter' - content: - application/json: - schema: - $ref: '#/components/schemas/DepositResponse' - example: - $ref: '#/components/examples/depositResponse' + $ref: '#/components/schemas/FileResponse' + examples: + fileExample: + $ref: '#/components/examples/fileResponse' '401': $ref: '#/components/responses/NotAuthorized' diff --git a/spec/paths/files@{bucket_id}.yaml b/spec/paths/files@{bucket_id}.yaml index 9804f89..41e096c 100644 --- a/spec/paths/files@{bucket_id}.yaml +++ b/spec/paths/files@{bucket_id}.yaml @@ -6,6 +6,11 @@ parameters: type: string format: uuid required: true + - name: file_name + in: path + description: File name of the local file. Required for `PUT`. + schema: + type: string get: summary: Get bucket resource by ID tags: @@ -20,10 +25,43 @@ get: $ref: '#/components/headers/ExpiresAfter' content: application/json: - schema: - type: string + type: object examples: - response: - value: Hello world! + bucketResponse: + $ref: '#/components/examples/bucketResponse' '401': $ref: '#/components/responses/NotAuthorized' +put: + summary: Upload local files. + tags: + - Files + description: | + Upload files using `bucket_id` and `file name`. + + > You need to have at least `read` access. + requestBody: + content: + application/octet-stream: + schema: + type: object + format: binary + responses: + '200': + description: OK + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + $ref: '#/components/headers/ExpiresAfter' + content: + application/json: + schema: + $ref: '#/components/schemas/FileLocalUploadResponse' + examples: + uploadFileExample: + $ref: '#/components/examples/FileLocalUploadResponse' + '401': + $ref: '#/components/responses/NotAuthorized' \ No newline at end of file diff --git a/spec/paths/jsonschemas.yaml b/spec/paths/jsonschemas.yaml index f693361..efa541d 100644 --- a/spec/paths/jsonschemas.yaml +++ b/spec/paths/jsonschemas.yaml @@ -3,8 +3,9 @@ get: - JSON Schemas summary: Get a list of available JSON Schemas description: >- - List of the available JSON schemas. They can be used to create an analysis - record + List of the available JSON Schemas that current user has access to. They can be used to create an analysis + record. + operationId: getJSONSchemas responses: '200': @@ -22,15 +23,34 @@ get: $ref: '#/components/schemas/JSONSchemaResource' examples: response: - value: {} + value: + - deposit_mapping: {} + deposit_options: {} + deposit_schema: {} + fullname: '' + is_indexed: false + links: + deposit: >- + https://analysispreservation.cern/ch/api/schemas/deposits/records/access-v0.0.1.json + record: >- + https://analysispreservation.cern/ch/api/schemas/records/access-v0.0.1.json + self: 'https://analysispreservation.cern/ch/api/jsonschemas/access/0.0.1' + name: access + record_mapping: {} + record_options: {} + record_schema: {} + use_deposit_as_record: true + version: 0.0.1 + '401': + $ref: '#/components/responses/NotAuthorized' post: tags: - JSON Schemas - summary: Create a new JSON Schemas + summary: Create a new JSON Schema description: > - Create a new JSON schemas. Add your customized schemas for records and + Create a new JSON Schema. Add your customized schemas for records and deposits, your corresponding UI form options and ES search mapping for - better indexing + better indexing. operationId: createJSONSchemas requestBody: content: @@ -58,3 +78,21 @@ post: examples: response: $ref: '#/components/examples/JSONSchemaResource' + '400': + description: Bad Request + content: + application/json: + schema: + type: object + properties: + message: + type: object + status: + type: integer + examples: + response: + value: + - message: {} + status: 400 + '401': + $ref: '#/components/responses/NotAuthorized' diff --git a/spec/paths/jsonschemas@{name}.yaml b/spec/paths/jsonschemas@{name}.yaml index 9cce981..bcaa4db 100644 --- a/spec/paths/jsonschemas@{name}.yaml +++ b/spec/paths/jsonschemas@{name}.yaml @@ -9,7 +9,7 @@ get: tags: - JSON Schemas summary: Get latest version by name - description: Retrieve the latest JSON Schemas for the specified `name` + description: Retrieve the latest JSON Schema for a specified `name`. operationId: getLatestByName responses: '200': @@ -25,4 +25,6 @@ get: $ref: '#/components/schemas/JSONSchema' examples: response: - $ref: '#/components/schemas/JSONSchema' + $ref: '#/components/examples/JSONSchemaResource' + '401': + $ref: '#/components/responses/NotAuthorized' diff --git a/spec/paths/jsonschemas@{name}@versions.yaml b/spec/paths/jsonschemas@{name}@versions.yaml new file mode 100644 index 0000000..2c64229 --- /dev/null +++ b/spec/paths/jsonschemas@{name}@versions.yaml @@ -0,0 +1,30 @@ +parameters: + - name: name + in: path + description: Analysis/Resource type name + schema: + type: string + required: true +get: + tags: + - JSON Schemas + summary: Get all versions of a schema by name + description: Retrieve all versions of a schema that user has access to. + operationId: getallVersions + responses: + '200': + description: OK + headers: + X-Rate-Limit: + $ref: '#/components/headers/RateLimit' + X-Expires-After: + $ref: '#/components/headers/ExpiresAfter' + content: + application/json: + schema: + $ref: '#/components/schemas/JSONSchemaAllVersions' + examples: + response: + $ref: '#/components/examples/JSONSchemaAllVersions' + '401': + $ref: '#/components/responses/NotAuthorized' diff --git a/spec/paths/jsonschemas@{name}@{version}.yaml b/spec/paths/jsonschemas@{name}@{version}.yaml index 4bf01af..71213fc 100644 --- a/spec/paths/jsonschemas@{name}@{version}.yaml +++ b/spec/paths/jsonschemas@{name}@{version}.yaml @@ -15,7 +15,7 @@ get: tags: - JSON Schemas summary: Get schema by name and version - description: Retrieve the latest JSON Schemas for the specified `name` + description: Retrieve the latest JSON Schemas for a specified name and version. operationId: getSchemaByNameAndVersion responses: '200': @@ -31,15 +31,17 @@ get: $ref: '#/components/schemas/JSONSchema' examples: response: - $ref: '#/components/schemas/JSONSchema' + $ref: '#/components/examples/JSONSchemaResource' + '401': + $ref: '#/components/responses/NotAuthorized' put: tags: - JSON Schemas - summary: Update schemas for a specific name and version + summary: Update schemas for a specific name and version. description: > - Create a new JSON schemas. Add your customized schemas for records and + Create a new JSON Schema. Add your customized schemas for records and deposits, your corresponding UI form options and ES search mapping for - better indexing + better indexing. operationId: updateSchemaByNameAndVersion requestBody: content: @@ -50,8 +52,8 @@ put: title: My new title abstract: Already commited/saved abstract desciption description: | - A JSON object that will replace the `metadata` field of the resource - > It should validate against the specified `$schema` of the resource + A JSON object that will replace the `metadata` field of the resource. + > It should validate against the specified `$schema` of the resource. required: true responses: '200': @@ -67,16 +69,18 @@ put: $ref: '#/components/schemas/JSONSchema' examples: response: - $ref: '#/components/schemas/JSONSchema' + $ref: '#/components/examples/JSONSchemaResource' + '401': + $ref: '#/components/responses/NotAuthorized' delete: tags: - JSON Schemas summary: Remove schemas for a specific name and version - description: Remove schemas for a specific name and version + description: Remove schemas for a specific name and version. operationId: deleteSchemaByNameAndVersion responses: - '200': - description: OK + '204': + description: No Content headers: X-Rate-Limit: $ref: '#/components/headers/RateLimit' @@ -85,7 +89,6 @@ delete: content: application/json: schema: - $ref: '#/components/schemas/JSONSchema' - examples: - response: - $ref: '#/components/schemas/JSONSchema' + type: None + '401': + $ref: '#/components/responses/NotAuthorized' diff --git a/spec/paths/logout.yaml b/spec/paths/logout.yaml new file mode 100644 index 0000000..8395401 --- /dev/null +++ b/spec/paths/logout.yaml @@ -0,0 +1,17 @@ +get: + tags: + - User + summary: Logout user + operationId: logoutUser + responses: + '302': + description: Found + content: + application/json: + schema: + type: string + example: None + '403': + description: Forbidden + '401': + $ref: '#/components/responses/NotAuthorized' \ No newline at end of file diff --git a/spec/paths/me.yaml b/spec/paths/me.yaml new file mode 100644 index 0000000..88249ff --- /dev/null +++ b/spec/paths/me.yaml @@ -0,0 +1,18 @@ +get: + tags: + - User + summary: Get user metadata + operationId: getUserData + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/me' + example: + $ref: '#/components/examples/meResponse' + '403': + description: Forbidden + '401': + $ref: '#/components/responses/NotAuthorized' diff --git a/spec/paths/ping@db.yaml b/spec/paths/ping@db.yaml index 82a8bae..a022cb3 100644 --- a/spec/paths/ping@db.yaml +++ b/spec/paths/ping@db.yaml @@ -18,8 +18,7 @@ get: type: string examples: response: - value: - message: OK + value: OK! '400': description: Exception headers: @@ -30,4 +29,7 @@ get: content: application/json: schema: - $ref: '#/components/schemas/error_message' + type: string + examples: + response: + value: ERROR diff --git a/spec/paths/ping@files.yaml b/spec/paths/ping@files.yaml index 5296136..e73a618 100644 --- a/spec/paths/ping@files.yaml +++ b/spec/paths/ping@files.yaml @@ -18,8 +18,7 @@ get: type: string examples: response: - value: - message: OK + value: OK! '400': description: Exception headers: @@ -30,4 +29,7 @@ get: content: application/json: schema: - $ref: '#/components/schemas/error_message' + type: string + examples: + response: + value: ERROR diff --git a/spec/paths/records.yaml b/spec/paths/records.yaml index 766fc3f..86638ce 100644 --- a/spec/paths/records.yaml +++ b/spec/paths/records.yaml @@ -8,9 +8,9 @@ get: - Search summary: Retrieve a list of records description: >- - Query published records (You need to have at least 'read' access to query - them) - operationId: get_records + Query published records + + > You need to have at least `read` access to query them. parameters: - $ref: '#/components/parameters/query' - $ref: '#/components/parameters/sort' @@ -21,77 +21,58 @@ get: description: OK headers: X-Rate-Limit: - description: calls per hour allowed by the user - schema: - type: integer - format: int32 + $ref: '#/components/headers/RateLimit' X-Expires-After: $ref: '#/components/headers/ExpiresAfter' content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/Record' + type: object + properties: + aggregations: + type: object + description: Aggregations of returned results + hits: + type: object + properties: + hits: + $ref: '#/components/schemas/Record' + total: + type: number + description: Total number of results + links: + type: object + description: Links related with the deposits results (ex. prev/next page) example: - username: user1 - email: user@example.com + aggregations: {} + hits: + hits: + - can_admin: true + can_edit: true + created: '2018-11-05T09:16:31.496137+00:00' + id: CAP.ALICE.FPEE.8XTW + links: + self: >- + https://analysispreservation.cern.ch/records/CAP.ALICE.FPEE.8XTW + metadata: {} + published: + revision_id: 0 + type: recid + value: CAP.ALICE.FPEE.8XTW + revision: 0 + schema: >- + https://analysispreservation.cern.ch/schemas/records/alice-analysis-v0.0.1.json + status: published + updated: '2018-11-05T09:16:31.496146+00:00' + - {} + - {} + total: 130 + links: + next: >- + https://analysispreservation.cern.ch/api/deposits/?sort=mostrecent&page=3&size=10 + prev: >- + https://analysispreservation.cern.ch/api/deposits/?sort=mostrecent&page=1&size=10 + self: >- + https://analysispreservation.cern.ch/api/deposits/?sort=mostrecent&page=2&size=10 '401': - description: Unauthorized - headers: - X-Rate-Limit: - description: calls per hour allowed by the user - schema: - type: integer - format: int32 - X-Expires-After: - $ref: '#/components/headers/ExpiresAfter' - content: - application/json: - schema: - type: string - examples: - response: - value: Hello world! -post: - tags: - - Records - summary: Create a record - description: Create a record - operationId: create_record - responses: - '200': - description: OK - headers: - X-Rate-Limit: - description: calls per hour allowed by the user - schema: - type: integer - format: int32 - X-Expires-After: - $ref: '#/components/headers/ExpiresAfter' - content: - application/json: - schema: - type: string - examples: - response: - value: Hello world! - application/xml: - schema: - type: string - text/csv: - schema: - type: string - requestBody: - content: - application/json: - schema: - type: string - example: Hello world! - application/xml: - schema: - type: string - example: Hello world! - description: Echo payload - required: true + $ref: '#/components/responses/NotAuthorized' diff --git a/spec/paths/records@{recid}.yaml b/spec/paths/records@{recid}.yaml new file mode 100644 index 0000000..8651e96 --- /dev/null +++ b/spec/paths/records@{recid}.yaml @@ -0,0 +1,34 @@ +parameters: + - name: recid + in: path + description: Record ID + schema: + type: string + format: uuid + required: true +get: + tags: + - Records + summary: Get a record by ID + description: > + Retrieve a record resource using `record_id`. + + > You need to have at least `read` access. + operationId: getrecord + responses: + '200': + description: OK + headers: + X-Rate-Limit: + $ref: '#/components/headers/RateLimit' + X-Expires-After: + $ref: '#/components/headers/ExpiresAfter' + content: + application/json: + schema: + $ref: '#/components/schemas/RecordResponse' + examples: + depositResponse: + $ref: '#/components/examples/recordResponse' + '401': + $ref: '#/components/responses/NotAuthorized' \ No newline at end of file diff --git a/spec/paths/services.yaml b/spec/paths/services.yaml deleted file mode 100644 index bbda051..0000000 --- a/spec/paths/services.yaml +++ /dev/null @@ -1,19 +0,0 @@ -get: - summary: Get list of services - tags: - - Services - responses: - '200': - description: OK - headers: - X-Rate-Limit: - $ref: '#/components/headers/RateLimit' - X-Expires-After: - $ref: '#/components/headers/ExpiresAfter' - content: - application/json: - schema: - type: string - examples: - response: - value: Hello world! diff --git a/spec/paths/services@adl@upload.yaml b/spec/paths/services@adl@upload.yaml new file mode 100644 index 0000000..ee0eab3 --- /dev/null +++ b/spec/paths/services@adl@upload.yaml @@ -0,0 +1,25 @@ +post: + summary: Parse ADL file by uploading an ADL file + description: Ingest the ADL file and parse it to JSON. + tags: + - Services + requestBody: + content: + application/octet-stream: + schema: + type: object + format: binary + responses: + '200': + description: OK + headers: + X-Rate-Limit: + $ref: '#/components/headers/RateLimit' + X-Expires-After: + $ref: '#/components/headers/ExpiresAfter' + content: + application/json: + schema: + type: object + '401': + $ref: '#/components/responses/NotAuthorized' diff --git a/spec/paths/services@adl@{depid}@{filename}.yaml b/spec/paths/services@adl@{depid}@{filename}.yaml new file mode 100644 index 0000000..3ea7c74 --- /dev/null +++ b/spec/paths/services@adl@{depid}@{filename}.yaml @@ -0,0 +1,33 @@ +parameters: + - name: depid + in: path + description: Deposit ID + schema: + type: string + format: uuid + required: true + - name: file_name + in: path + description: Name of the **ADL** file already uploaded in the deposit + schema: + type: string + required: true +get: + summary: Parse ADL file present in the deposit + description: Ingest the ADL file and parse it to JSON. + tags: + - Services + responses: + '200': + description: OK + headers: + X-Rate-Limit: + $ref: '#/components/headers/RateLimit' + X-Expires-After: + $ref: '#/components/headers/ExpiresAfter' + content: + application/json: + schema: + type: object + '401': + $ref: '#/components/responses/NotAuthorized' diff --git a/spec/paths/services@cds@{record_id}.yaml b/spec/paths/services@cds@{record_id}.yaml new file mode 100644 index 0000000..fd2c03b --- /dev/null +++ b/spec/paths/services@cds@{record_id}.yaml @@ -0,0 +1,31 @@ +parameters: + - name: recid + in: path + description: Record ID of the CDS document + schema: + type: string + format: uuid + required: true +get: + tags: + - Services + summary: Get a CDS document + description: > + Retrieve a CDS resource using `record_id`. + + > The `record_id` is of CDS document. + operationId: getCDSrecord + responses: + '200': + description: OK + headers: + X-Rate-Limit: + $ref: '#/components/headers/RateLimit' + X-Expires-After: + $ref: '#/components/headers/ExpiresAfter' + content: + application/json: + schema: + type: object + '401': + $ref: '#/components/responses/NotAuthorized' \ No newline at end of file diff --git a/spec/paths/services@indico@{event_id}.yaml b/spec/paths/services@indico@{event_id}.yaml new file mode 100644 index 0000000..3d0af69 --- /dev/null +++ b/spec/paths/services@indico@{event_id}.yaml @@ -0,0 +1,28 @@ +parameters: + - name: event_id + in: path + description: Event ID of an Indico event + schema: + type: string + format: uuid + required: true +get: + tags: + - Services + summary: Get an Indico event data + description: Retrieve an Indico event data using `event_id`. + operationId: getIndicoEvent + responses: + '200': + description: OK + headers: + X-Rate-Limit: + $ref: '#/components/headers/RateLimit' + X-Expires-After: + $ref: '#/components/headers/ExpiresAfter' + content: + application/json: + schema: + type: object + '401': + $ref: '#/components/responses/NotAuthorized' \ No newline at end of file diff --git a/spec/paths/services@latex.yaml b/spec/paths/services@latex.yaml new file mode 100644 index 0000000..3a879fc --- /dev/null +++ b/spec/paths/services@latex.yaml @@ -0,0 +1,32 @@ +post: + summary: Create a Latex file + tags: + - Services + requestBody: + content: + application/json: + schema: + type: object + properties: + paths: + type: array + description: List of dataset paths + items: + type: string + title: + type: string + description: Title of Latex file + responses: + '200': + description: OK + headers: + X-Rate-Limit: + $ref: '#/components/headers/RateLimit' + X-Expires-After: + $ref: '#/components/headers/ExpiresAfter' + content: + application/json: + schema: + type: object + '401': + $ref: '#/components/responses/NotAuthorized' diff --git a/spec/paths/services@orcid.yaml b/spec/paths/services@orcid.yaml new file mode 100644 index 0000000..36398ec --- /dev/null +++ b/spec/paths/services@orcid.yaml @@ -0,0 +1,42 @@ +get: + summary: Get ORCID for given name + description: Take the name and give all the associated ORCIDs. + tags: + - Services + requestBody: + content: + application/json: + schema: + type: object + properties: + name: string + examples: + samplePayload: + value: + name: "First Second" + responses: + '200': + description: OK + headers: + X-Rate-Limit: + $ref: '#/components/headers/RateLimit' + X-Expires-After: + $ref: '#/components/headers/ExpiresAfter' + content: + application/json: + schema: + type: object + properties: + num-results: + type: integer + result: + type: array + items: + type: object + examples: + sampleResponse: + value: + num-results: 1 + result: [] + '401': + $ref: '#/components/responses/NotAuthorized' diff --git a/spec/paths/services@orcid@{orcid}.yaml b/spec/paths/services@orcid@{orcid}.yaml new file mode 100644 index 0000000..3d10487 --- /dev/null +++ b/spec/paths/services@orcid@{orcid}.yaml @@ -0,0 +1,48 @@ +parameters: + - name: orcid + in: path + description: ORCID identifier + schema: + type: string + format: uuid + required: true +post: + summary: Get ORCID data for a given identifier. + tags: + - Services + responses: + '200': + description: OK + headers: + X-Rate-Limit: + $ref: '#/components/headers/RateLimit' + X-Expires-After: + $ref: '#/components/headers/ExpiresAfter' + content: + application/json: + schema: + type: object + properties: + activities-summary: + type: object + history: + type: object + orcid-identifier: + type: object + path: + type: string + person: + type: object + preferences: + type: object + examples: + sampleResponse: + value: + activities-summary: {} + history: {} + orcid-identifier: {} + path: {} + person: {} + preferences: {} + '401': + $ref: '#/components/responses/NotAuthorized' diff --git a/spec/paths/services@ror.yaml b/spec/paths/services@ror.yaml new file mode 100644 index 0000000..82285d4 --- /dev/null +++ b/spec/paths/services@ror.yaml @@ -0,0 +1,42 @@ +get: + summary: Get ROR results by query + tags: + - Services + requestBody: + content: + application/json: + schema: + type: object + properties: + query: string + examples: + samplePayload: + value: + query: 'tilburg' + responses: + '200': + description: OK + headers: + X-Rate-Limit: + $ref: '#/components/headers/RateLimit' + X-Expires-After: + $ref: '#/components/headers/ExpiresAfter' + content: + application/json: + schema: + type: object + properties: + acronyms: + type: array + name: + type: string + ror_org_id: + type: string + examples: + sampleResponse: + value: + acronyms: ['TiU'] + name: Tilburg University + ror_org_id: 04b8v1s79 + '401': + $ref: '#/components/responses/NotAuthorized' diff --git a/spec/paths/services@ror@{org}.yaml b/spec/paths/services@ror@{org}.yaml new file mode 100644 index 0000000..4f23e4e --- /dev/null +++ b/spec/paths/services@ror@{org}.yaml @@ -0,0 +1,59 @@ +parameters: + - name: org_id + in: path + description: ORG ID + schema: + type: string + required: true +post: + summary: Get ROR info by providing the ROR ORG ID. + tags: + - Services + responses: + '200': + description: OK + headers: + X-Rate-Limit: + $ref: '#/components/headers/RateLimit' + X-Expires-After: + $ref: '#/components/headers/ExpiresAfter' + content: + application/json: + schema: + type: object + properties: + acronyms: + type: array + aliases: + type: array + country: + type: object + external_ids: + type: object + labels: + type: array + links: + type: array + name: + type: string + ror_org_id: + type: string + types: + type: array + wikipedia_url: + type: string + examples: + sampleResponse: + value: + acronyms: ['TiU'] + aliases: [] + country: {} + external_ids: {} + labels: [] + links: [] + name: Tilburg University + ror_org_id: 04b8v1s79 + types: [] + wikipedia_url: http://en.wikipedia.org/wiki/Tilburg_University + '401': + $ref: '#/components/responses/NotAuthorized' diff --git a/spec/paths/schemas@{schema_path}.yaml b/spec/paths/services@zenodo@record@{zenodo_id}.yaml similarity index 55% rename from spec/paths/schemas@{schema_path}.yaml rename to spec/paths/services@zenodo@record@{zenodo_id}.yaml index a28ac49..a24956b 100644 --- a/spec/paths/schemas@{schema_path}.yaml +++ b/spec/paths/services@zenodo@record@{zenodo_id}.yaml @@ -1,19 +1,20 @@ parameters: - - name: schema_path + - name: zenodo_id in: path - description: Name/Path for the JSON Schema resource + description: Zenodo ID of a zenodo record schema: type: string required: true get: - summary: Get a JSON Schema tags: - - Schemas + - Services + summary: Get a Zenodo record + operationId: getZenodoRecord responses: '200': description: OK headers: - RateLimit: + X-Rate-Limit: $ref: '#/components/headers/RateLimit' X-Expires-After: $ref: '#/components/headers/ExpiresAfter' @@ -21,8 +22,5 @@ get: application/json: schema: type: object - examples: - response: - value: - title: Hello world! - abstract: This is my abstract + '401': + $ref: '#/components/responses/NotAuthorized' \ No newline at end of file diff --git a/spec/paths/services@zenodo@{bucket_id}@{filename}.yaml b/spec/paths/services@zenodo@{bucket_id}@{filename}.yaml new file mode 100644 index 0000000..8e98c29 --- /dev/null +++ b/spec/paths/services@zenodo@{bucket_id}@{filename}.yaml @@ -0,0 +1,39 @@ +parameters: + - name: bucket_id + in: path + description: Bucket ID of a deposit resource. + schema: + type: string + required: true + - name: filename + in: path + description: Name of a file already uploaded in the deposit + schema: + type: string + required: true +get: + summary: Upload to Zenodo + tags: + - Services + responses: + '200': + description: OK + headers: + X-Rate-Limit: + $ref: '#/components/headers/RateLimit' + X-Expires-After: + $ref: '#/components/headers/ExpiresAfter' + content: + application/json: + schema: + type: object + properties: + status: + type: integer + description: Status of file upload + examples: + sampleResponse: + value: + status: 200 + '401': + $ref: '#/components/responses/NotAuthorized' diff --git a/spec/paths/users@{username}.yaml b/spec/paths/users@{username}.yaml deleted file mode 100644 index 63f8a0d..0000000 --- a/spec/paths/users@{username}.yaml +++ /dev/null @@ -1,67 +0,0 @@ -parameters: - - name: pretty_print - in: query - description: Pretty print response - schema: - type: boolean -get: - tags: - - User - summary: Get user by user name - description: | - Some description of the operation. - You can use `markdown` here. - operationId: getUserByName - parameters: - - name: username - in: path - description: The name that needs to be fetched - required: true - schema: - type: string - - name: with_email - in: query - description: Filter users without email - schema: - type: boolean - responses: - '200': - description: Success - content: - application/json: - schema: - $ref: '#/components/schemas/User' - example: - username: user1 - email: user@example.com - '403': - description: Forbidden - '404': - description: User not found -put: - tags: - - User - summary: Updated user - description: This can only be done by the logged in user. - operationId: updateUser - parameters: - - name: username - in: path - description: The name that needs to be updated - required: true - schema: - type: string - responses: - '200': - description: OK - '400': - description: Invalid user supplied - '404': - description: User not found - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: Updated user object - required: true diff --git a/spec/paths/workflows@reana@all@record@{pid}.yaml b/spec/paths/workflows@reana@all@record@{pid}.yaml index 08d09cc..d83159f 100644 --- a/spec/paths/workflows@reana@all@record@{pid}.yaml +++ b/spec/paths/workflows@reana@all@record@{pid}.yaml @@ -4,7 +4,7 @@ get: tags: - Workflows summary: Get all the workflows - description: Get all the workflows (created and deleted) from the user + description: Get all the workflows (created and deleted) from the user. operationId: reana_workflow_all responses: '200':