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

CCL-594 Extend the Conclave Cloud API OpenAPI specification to include and endpoint for managing files. #1

Open
wants to merge 35 commits into
base: dev
Choose a base branch
from
Open
Changes from 31 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
013ffc4
Add endpoints for storage.
davihillesheim Sep 9, 2022
41e7148
Fix indentations.
davihillesheim Sep 14, 2022
ed858a8
Add schema for the storage api calls.
davihillesheim Sep 29, 2022
b985b0b
Remove wrong parameter on FileData schema.
davihillesheim Sep 30, 2022
87807ad
Fix indentations.
davihillesheim Sep 30, 2022
9cd45fd
Fix syntax errors.
davihillesheim Sep 30, 2022
a3ba8cb
Change integer format for FileData properties.
davihillesheim Sep 30, 2022
cc188bf
Merge remote-tracking branch 'origin/dev' into davi/ccl-594
davihillesheim Sep 30, 2022
22b1fd4
Small merge fix.
davihillesheim Sep 30, 2022
698933a
Add storage back.
davihillesheim Sep 30, 2022
8ec56f4
Update error schemas for storage api.
davihillesheim Sep 30, 2022
c34ed22
Update schema.
davihillesheim Sep 30, 2022
d9eca1d
Fix parameters.
davihillesheim Sep 30, 2022
6517db2
Minor fix
davihillesheim Oct 3, 2022
061d134
Change regex pattern.
davihillesheim Oct 3, 2022
9e139d2
Double scape backslash as yml complains.
davihillesheim Oct 3, 2022
116cf41
Syntax errors.
davihillesheim Oct 3, 2022
fab2903
Change from projectID to projectUID in storage paths.
davihillesheim Oct 3, 2022
8068b77
Change file data schema and fix minor bug on getFile
davihillesheim Oct 10, 2022
f21dbea
Remove security param from storage calls.
davihillesheim Oct 10, 2022
869a577
Fix indentations.
davihillesheim Oct 10, 2022
c579479
Change storage response type.
davihillesheim Oct 10, 2022
b953eee
Change request body for file upload.
davihillesheim Oct 11, 2022
a454995
Syntax error
davihillesheim Oct 11, 2022
61fd435
Move FileData and FileMeta components to requestBodies and responses
davihillesheim Oct 11, 2022
c57028b
Move FileData and FileMeta components to requestBodies and responses
davihillesheim Oct 11, 2022
88de02b
Minor fixes
davihillesheim Oct 11, 2022
60898aa
Change getStorage return from array to list.
davihillesheim Oct 12, 2022
0b9a96c
Bug fix
davihillesheim Oct 12, 2022
1204ef0
Revert "Bug fix"
davihillesheim Oct 12, 2022
117f946
Revert "Change getStorage return from array to list."
davihillesheim Oct 12, 2022
1ea40e8
Use the fileName schema on schemas that use fileName.
davihillesheim Oct 24, 2022
a539e71
Adress comments.
davihillesheim Oct 24, 2022
f9227cd
Adress comments.
davihillesheim Oct 24, 2022
fd569fc
Specify that the date returned on lastModified is represented in millis
davihillesheim Oct 24, 2022
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
164 changes: 163 additions & 1 deletion conclave-cloud-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,110 @@ paths:
default:
$ref: "#/components/responses/GenericError"

/projects/{projectUID}/storage:
get:
description: Get the files stored in a project.
mivanovr3 marked this conversation as resolved.
Show resolved Hide resolved
operationId: getStorage
mivanovr3 marked this conversation as resolved.
Show resolved Hide resolved
tags:
- Storage
parameters:
- $ref: "#/components/parameters/projectUID"
- $ref: "#/components/parameters/Functions.List.Limit"
mivanovr3 marked this conversation as resolved.
Show resolved Hide resolved
- $ref: "#/components/parameters/Functions.List.Skip"
responses:
'200':
description: Successfully returned files stored.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/responses/Storage.FileMeta'
'400':
$ref: "#/components/responses/InvalidError"
'401':
$ref: "#/components/responses/UnauthorizedError"
'403':
$ref: "#/components/responses/ForbiddenError"
'404':
$ref: "#/components/responses/NotFoundError"
default:
$ref: "#/components/responses/GenericError"
post:
description: 'Upload a file to the cloud storage'
operationId: uploadFile
tags:
- Storage
parameters:
- $ref: "#/components/parameters/projectUID"
requestBody:
$ref: '#/components/requestBodies/Storage.FileData'
responses:
'200':
description: Successfully uploaded the file.
content:
application/json:
schema:
$ref: '#/components/responses/Storage.FileMeta'
'400':
$ref: "#/components/responses/InvalidError"
'401':
$ref: "#/components/responses/UnauthorizedError"
'403':
$ref: "#/components/responses/ForbiddenError"
'404':
$ref: "#/components/responses/NotFoundError"
default:
$ref: "#/components/responses/GenericError"

/projects/{projectUID}/storage/{fileName}:
get:
description: Get details for a particular file.
operationId: getFile
davihillesheim marked this conversation as resolved.
Show resolved Hide resolved
tags:
- Storage
parameters:
- $ref: "#/components/parameters/projectUID"
- $ref: "#/components/parameters/fileName"
responses:
'200':
description: Successfully returned the file details.
content:
application/json:
schema:
$ref: '#/components/responses/Storage.FileMeta'
'400':
$ref: "#/components/responses/InvalidError"
'401':
$ref: "#/components/responses/UnauthorizedError"
'403':
$ref: "#/components/responses/ForbiddenError"
'404':
$ref: "#/components/responses/NotFoundError"
default:
$ref: "#/components/responses/GenericError"
delete:
description: Delete a file from storage.
tags:
- Storage
operationId: deleteFile
parameters:
- $ref: "#/components/parameters/projectUID"
- $ref: "#/components/parameters/fileName"
responses:
'200':
description: The file was deleted successfully.
'400':
$ref: "#/components/responses/InvalidError"
'401':
$ref: "#/components/responses/UnauthorizedError"
'403':
$ref: "#/components/responses/ForbiddenError"
'404':
$ref: "#/components/responses/NotFoundError"
default:
$ref: "#/components/responses/GenericError"

/projects/{projectUID}/functions:
get:
description: Get the list of functions in a project.
Expand Down Expand Up @@ -554,7 +658,19 @@ components:
application/json:
schema:
$ref: "#/components/schemas/Invocations.Invoke"
Storage.FileData:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Storage.FileData'
responses:
Storage.FileMeta:
description: The file metadata.
content:
application/json:
schema:
$ref: '#/components/schemas/Storage.FileMeta'
ApiKeys.Create:
description: An API key that you can use to execute operations against a specific project.
content:
Expand Down Expand Up @@ -854,6 +970,14 @@ components:
required: true
schema:
$ref: "#/components/schemas/Functions.Name"
fileName:
name: fileName
description: Name of a file.
example: filename.txt
in: path
required: true
schema:
$ref: "#/components/schemas/Storage.FileName"
schemas:
ApiKeys.ApiKey:
type: object
Expand Down Expand Up @@ -994,6 +1118,43 @@ components:
default: 256
minimum: 1
maximum: 512
Storage.FileName:
type: string
pattern: "^[a-zA-Z0-9_]+\\.[A-Za-z]{3}$"
example: myFile.txt
Storage.FileData:
required:
- fileName
- fileData
properties:
fileName:
davihillesheim marked this conversation as resolved.
Show resolved Hide resolved
type: string
description: Name of the file
minLength: 1
example: filename.txt
fileData:
type: string
description: Contents of the file
minLength: 1
Storage.FileMeta:
required:
- fileName
- size
- lastModified
properties:
fileName:
davihillesheim marked this conversation as resolved.
Show resolved Hide resolved
type: string
description: Name of the file
minLength: 1
example: filename.txt
size:
type: integer
format: int64
description: Size of the file
lastModified:
type: integer
format: int64
description: Date of when the file was last modified
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please elaborate on whether it's unix time in seconds or milliseconds.

Invocations.Invocation:
description: Full invocation details
type: object
Expand Down Expand Up @@ -1341,4 +1502,5 @@ components:
type: number
format: int64
description: Execution time in MB-ms.
example: 312
example: 312