Skip to content

Commit 717222b

Browse files
author
Parth Shandilya
committed
deposits: add docs for upload action
Signed-off-by: Parth Shandilya <[email protected]>
1 parent 83f8c92 commit 717222b

File tree

2 files changed

+72
-26
lines changed

2 files changed

+72
-26
lines changed

Diff for: spec/components/schemas/UploadRepositories.yaml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
description: Upload Resource
2+
type: object
3+
oneOf:
4+
- title: Create Repository as user and attach to deposit
5+
type: object
6+
properties:
7+
webhook:
8+
type: string
9+
enum:
10+
- repo_create
11+
url:
12+
type: string
13+
description: The git url that can point to a repository or specific file.
14+
required:
15+
- url
16+
- webhook
17+
- title: Attach Repository to deposit
18+
properties:
19+
webhook:
20+
type: string
21+
enum:
22+
- None
23+
- repo_download_attach
24+
url:
25+
type: string
26+
description: The git url that can point to a repository or specific file.
27+
required:
28+
- url
29+
- webhook
30+
- title: Create Repository from Schema configuration and attach to deposit
31+
type: object
32+
properties:
33+
webhook:
34+
type: string
35+
enum:
36+
- repo_create_default
37+
required:
38+
- url
39+
- webhook

Diff for: spec/paths/deposits@{depid}@[email protected]

+33-26
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,44 @@ parameters:
66
type: string
77
format: uuid
88
required: true
9-
- name: type
10-
in: query
11-
description: Url type (repo/url)
12-
schema:
13-
type: string
14-
enum: [url, repo]
15-
required: true
16-
- name: url
17-
in: query
18-
description: Url of repo/file to upload
19-
schema:
20-
type: string
21-
format: uuid
22-
required: true
239
post:
2410
tags:
2511
- Deposits
26-
summary: Upload files/data
27-
description: |
28-
Upload files/data to your analysis, in a specified deposit record.
29-
The following type of uploads are possible:
30-
* Local files
31-
* Git repos
32-
* URL linked files
12+
summary: Upload action for repositories
13+
description: >-
14+
15+
- **Download** a snapshot of repository, that you'd like to preserve with your analysis.
16+
You can point to the whole repo, specific branch or even a single file whatever your analysis needs.
17+
Some repositories are private or restricted for CERN users only (like all the repos in CERN Gitlab) -
18+
to download those you need to connect your Github/Gitlab account first.
19+
20+
- **Connect** repositories with analysis that are still in progress, to keep them in sync.
21+
We'll make a new snapshot on any changes pushed in this repository.
22+
This way your analysis will be always up to date with your code.
23+
Keep in mind that you cannot connect to public repositories (owner has to give you a specific access to do that).
24+
Upload files/data to your analysis, in a specified deposit record.
3325
34-
The API differentiates between whole repos (saved as .tar) and single files
35-
from repos, so the parameter "type" is necessary.
36-
operationId: uploadDeposit
26+
operationId: connectToDeposit
27+
requestBody:
28+
content:
29+
application/json:
30+
schema:
31+
$ref: '#/components/schemas/UploadRepositories'
32+
examples:
33+
Create Repository as user and attach to deposit:
34+
value:
35+
url: https://github.com/cernanalysispreservation/cap-api-docs
36+
webhook: repo_create
37+
Attach Repository to deposit:
38+
value:
39+
url: https://github.com/cernanalysispreservation/cap-api-docs/README.md
40+
webhook: repo_download_attach
41+
Create Repository from Schema configuration and attach to depoit:
42+
value:
43+
webhook: repo_create_default
3744
responses:
38-
'200':
39-
description: OK
45+
'201':
46+
description: Created
4047
headers:
4148
X-Rate-Limit:
4249
description: calls per hour allowed by the user

0 commit comments

Comments
 (0)