From 7726208d0cb11511ca7171ff9718a5845d5786d9 Mon Sep 17 00:00:00 2001 From: Mads Bisgaard Date: Wed, 20 Sep 2023 16:52:43 +0200 Subject: [PATCH] update openapi.yaml --- api/specs/storage/openapi.yaml | 715 +++++++++--------- .../src/simcore_service_storage/models.py | 2 +- 2 files changed, 375 insertions(+), 342 deletions(-) diff --git a/api/specs/storage/openapi.yaml b/api/specs/storage/openapi.yaml index 17a8ed12109..b4278ce48c7 100644 --- a/api/specs/storage/openapi.yaml +++ b/api/specs/storage/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.2 +openapi: 3.1.0 info: title: simcore-service-storage API description: API definition for simcore-service-storage service @@ -10,7 +10,9 @@ info: url: https://github.com/ITISFoundation/osparc-simcore/blob/master/LICENSE version: 0.3.0 servers: -- url: http://{host}:{port} +- url: /v0 + description: 'Default server: requests directed to serving url' +- url: http://{host}:{port}/v0 description: 'Development server: can configure any base url' variables: host: @@ -28,15 +30,15 @@ paths: parameters: - required: true schema: - title: Location Id type: integer + title: Location Id name: location_id in: path - required: true schema: - title: User Id - exclusiveMinimum: true type: integer + exclusiveMinimum: true + title: User Id minimum: 0 name: user_id in: query @@ -57,21 +59,21 @@ paths: parameters: - required: true schema: - title: Location Id type: integer + title: Location Id name: location_id in: path - required: true schema: - title: Dataset Id type: string + title: Dataset Id name: dataset_id in: path - required: true schema: - title: User Id - exclusiveMinimum: true type: integer + exclusiveMinimum: true + title: User Id minimum: 0 name: user_id in: query @@ -79,8 +81,8 @@ paths: the future required: false schema: - title: Expand Dirs type: boolean + title: Expand Dirs description: Automatic directory expansion. This will be replaced by pagination the future default: true @@ -103,9 +105,9 @@ paths: parameters: - required: true schema: - title: User Id - exclusiveMinimum: true type: integer + exclusiveMinimum: true + title: User Id minimum: 0 name: user_id in: query @@ -115,10 +117,10 @@ paths: content: application/json: schema: - title: Response Get Storage Locations - type: array items: $ref: '#/components/schemas/DatasetMetaData' + type: array + title: Response Get Storage Locations /v0/locations/{location_id}:sync: post: tags: @@ -130,21 +132,21 @@ paths: parameters: - required: true schema: - title: Location Id type: integer + title: Location Id name: location_id in: path - required: false schema: - title: Dry Run type: boolean + title: Dry Run default: false name: dry_run in: query - required: false schema: - title: Fire And Forget type: boolean + title: Fire And Forget default: false name: fire_and_forget in: query @@ -166,14 +168,14 @@ paths: parameters: - required: true schema: - title: Location Id type: integer + title: Location Id name: location_id in: path - required: false schema: - title: Uuid Filter type: string + title: Uuid Filter default: '' name: uuid_filter in: query @@ -181,8 +183,8 @@ paths: the future required: false schema: - title: Expand Dirs type: boolean + title: Expand Dirs description: Automatic directory expansion. This will be replaced by pagination the future default: true @@ -206,25 +208,25 @@ paths: parameters: - required: true schema: - title: Location Id type: integer + title: Location Id name: location_id in: path - required: true schema: - title: File Id anyOf: - - pattern: ^(api|([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}))\/([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12})\/(.+)$ - type: string - - pattern: ^N:package:[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}$ - type: string + - type: string + pattern: ^(api|([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}))\/([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12})\/(.+)$ + - type: string + pattern: ^N:package:[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}$ + title: File Id name: file_id in: path - required: true schema: - title: User Id - exclusiveMinimum: true type: integer + exclusiveMinimum: true + title: User Id minimum: 0 name: user_id in: query @@ -234,10 +236,10 @@ paths: content: application/json: schema: - title: Response Get File Metadata anyOf: - $ref: '#/components/schemas/FileMetaData' - $ref: '#/components/schemas/Envelope_FileMetaDataGet_' + title: Response Get File Metadata /v0/locations/{location_id}/files/{file_id}: get: tags: @@ -248,25 +250,25 @@ paths: parameters: - required: true schema: - title: Location Id type: integer + title: Location Id name: location_id in: path - required: true schema: - title: File Id anyOf: - - pattern: ^(api|([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}))\/([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12})\/(.+)$ - type: string - - pattern: ^N:package:[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}$ - type: string + - type: string + pattern: ^(api|([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}))\/([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12})\/(.+)$ + - type: string + pattern: ^N:package:[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}$ + title: File Id name: file_id in: path - required: true schema: - title: User Id - exclusiveMinimum: true type: integer + exclusiveMinimum: true + title: User Id minimum: 0 name: user_id in: query @@ -294,24 +296,24 @@ paths: parameters: - required: true schema: - title: Location Id type: integer + title: Location Id name: location_id in: path - required: true schema: - title: File Id anyOf: - - pattern: ^(api|([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}))\/([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12})\/(.+)$ - type: string - - pattern: ^N:package:[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}$ - type: string + - type: string + pattern: ^(api|([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}))\/([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12})\/(.+)$ + - type: string + pattern: ^N:package:[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}$ + title: File Id name: file_id in: path - required: true schema: - title: File Size type: integer + title: File Size name: file_size in: query - required: false @@ -323,8 +325,8 @@ paths: in: query - required: false schema: - title: Is Directory type: boolean + title: Is Directory default: false name: is_directory in: query @@ -334,10 +336,10 @@ paths: content: application/json: schema: - title: Response Upload File anyOf: - $ref: '#/components/schemas/Envelope_FileUploadSchema_' - $ref: '#/components/schemas/Envelope_AnyUrl_' + title: Response Upload File delete: tags: - files @@ -347,25 +349,25 @@ paths: parameters: - required: true schema: - title: Location Id type: integer + title: Location Id name: location_id in: path - required: true schema: - title: File Id anyOf: - - pattern: ^(api|([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}))\/([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12})\/(.+)$ - type: string - - pattern: ^N:package:[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}$ - type: string + - type: string + pattern: ^(api|([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}))\/([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12})\/(.+)$ + - type: string + pattern: ^N:package:[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}$ + title: File Id name: file_id in: path - required: true schema: - title: User Id - exclusiveMinimum: true type: integer + exclusiveMinimum: true + title: User Id minimum: 0 name: user_id in: query @@ -384,25 +386,25 @@ paths: parameters: - required: true schema: - title: Location Id type: integer + title: Location Id name: location_id in: path - required: true schema: - title: File Id anyOf: - - pattern: ^(api|([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}))\/([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12})\/(.+)$ - type: string - - pattern: ^N:package:[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}$ - type: string + - type: string + pattern: ^(api|([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}))\/([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12})\/(.+)$ + - type: string + pattern: ^N:package:[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}$ + title: File Id name: file_id in: path - required: true schema: - title: User Id - exclusiveMinimum: true type: integer + exclusiveMinimum: true + title: User Id minimum: 0 name: user_id in: query @@ -419,25 +421,25 @@ paths: parameters: - required: true schema: - title: Location Id type: integer + title: Location Id name: location_id in: path - required: true schema: - title: File Id anyOf: - - pattern: ^(api|([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}))\/([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12})\/(.+)$ - type: string - - pattern: ^N:package:[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}$ - type: string + - type: string + pattern: ^(api|([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}))\/([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12})\/(.+)$ + - type: string + pattern: ^N:package:[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}$ + title: File Id name: file_id in: path - required: true schema: - title: User Id - exclusiveMinimum: true type: integer + exclusiveMinimum: true + title: User Id minimum: 0 name: user_id in: query @@ -464,31 +466,31 @@ paths: parameters: - required: true schema: - title: Location Id type: integer + title: Location Id name: location_id in: path - required: true schema: - title: File Id anyOf: - - pattern: ^(api|([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}))\/([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12})\/(.+)$ - type: string - - pattern: ^N:package:[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}$ - type: string + - type: string + pattern: ^(api|([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}))\/([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12})\/(.+)$ + - type: string + pattern: ^N:package:[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}$ + title: File Id name: file_id in: path - required: true schema: - title: Future Id type: string + title: Future Id name: future_id in: path - required: true schema: - title: User Id - exclusiveMinimum: true type: integer + exclusiveMinimum: true + title: User Id minimum: 0 name: user_id in: query @@ -537,19 +539,19 @@ paths: parameters: - required: true schema: - title: File Id anyOf: - - pattern: ^(api|([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}))\/([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12})\/(.+)$ - type: string - - pattern: ^N:package:[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}$ - type: string + - type: string + pattern: ^(api|([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}))\/([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12})\/(.+)$ + - type: string + pattern: ^N:package:[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}$ + title: File Id name: file_id in: path - required: true schema: - title: User Id - exclusiveMinimum: true type: integer + exclusiveMinimum: true + title: User Id minimum: 0 name: user_id in: query @@ -576,9 +578,9 @@ paths: parameters: - required: true schema: - title: User Id - exclusiveMinimum: true type: integer + exclusiveMinimum: true + title: User Id minimum: 0 name: user_id in: query @@ -599,9 +601,9 @@ paths: parameters: - required: true schema: - title: User Id - exclusiveMinimum: true type: integer + exclusiveMinimum: true + title: User Id minimum: 0 name: user_id in: query @@ -628,23 +630,23 @@ paths: parameters: - required: true schema: - title: Folder Id type: string + title: Folder Id name: folder_id in: path - required: true schema: - title: User Id - exclusiveMinimum: true type: integer + exclusiveMinimum: true + title: User Id minimum: 0 name: user_id in: query - required: false schema: - title: Node Id type: string format: uuid + title: Node Id name: node_id in: query responses: @@ -655,25 +657,42 @@ paths: tags: - simcore-s3 summary: search for files starting with - description: search for files starting with `startswith` in the file_meta_data - table - operationId: search_files_starting_with + description: search for files starting with `startswith` and/or matching a sha256_checksum + in the file_meta_data table + operationId: search_files parameters: - required: true schema: - title: User Id - exclusiveMinimum: true type: integer + exclusiveMinimum: true + title: User Id minimum: 0 name: user_id in: query - required: false schema: - title: Startswith type: string + title: Startswith default: '' name: startswith in: query + - required: false + schema: + type: string + pattern: ^[a-fA-F0-9]{64}$ + title: Sha256 Checksum + name: sha256_checksum + in: query + - required: false + schema: + type: string + enum: + - read + - write + title: Access Right + default: read + name: access_right + in: query responses: '200': description: Successful Response @@ -705,8 +724,8 @@ paths: parameters: - required: true schema: - title: Task Id type: string + title: Task Id name: task_id in: path responses: @@ -725,8 +744,8 @@ paths: parameters: - required: true schema: - title: Task Id type: string + title: Task Id name: task_id in: path responses: @@ -742,8 +761,8 @@ paths: parameters: - required: true schema: - title: Task Id type: string + title: Task Id name: task_id in: path responses: @@ -756,299 +775,292 @@ paths: components: schemas: AppStatusCheck: - title: AppStatusCheck - required: - - app_name - - version - type: object properties: app_name: - title: App Name type: string + title: App Name description: Application name version: - title: Version type: string + title: Version description: Application's version services: - title: Services type: object + title: Services description: Other backend services connected from this service default: {} sessions: - title: Sessions type: object + title: Sessions description: Client sessions info. If single session per app, then is denoted as main default: {} url: - title: Url + type: string maxLength: 65536 minLength: 1 - type: string - description: Link to current resource format: uri + title: Url + description: Link to current resource diagnostics_url: - title: Diagnostics Url + type: string maxLength: 65536 minLength: 1 - type: string + format: uri + title: Diagnostics Url description: Link to diagnostics report sub-resource. This MIGHT take some time to compute - format: uri - DatasetMetaData: - title: DatasetMetaData - required: - - dataset_id - - display_name type: object + required: + - app_name + - version + title: AppStatusCheck + DatasetMetaData: properties: dataset_id: - title: Dataset Id anyOf: - type: string format: uuid - - pattern: ^N:dataset:[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}$ - type: string + - type: string + pattern: ^N:dataset:[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}$ + title: Dataset Id display_name: - title: Display Name type: string + title: Display Name additionalProperties: false - Envelope_AnyUrl_: - title: Envelope[AnyUrl] type: object + required: + - dataset_id + - display_name + title: DatasetMetaData + Envelope_AnyUrl_: properties: data: - title: Data + type: string maxLength: 65536 minLength: 1 - type: string format: uri + title: Data error: title: Error - Envelope_AppStatusCheck_: - title: Envelope[AppStatusCheck] type: object + title: Envelope[AnyUrl] + Envelope_AppStatusCheck_: properties: data: $ref: '#/components/schemas/AppStatusCheck' error: title: Error - Envelope_FileMetaDataGet_: - title: Envelope[FileMetaDataGet] type: object + title: Envelope[AppStatusCheck] + Envelope_FileMetaDataGet_: properties: data: $ref: '#/components/schemas/FileMetaDataGet' error: title: Error - Envelope_FileUploadCompleteFutureResponse_: - title: Envelope[FileUploadCompleteFutureResponse] type: object + title: Envelope[FileMetaDataGet] + Envelope_FileUploadCompleteFutureResponse_: properties: data: $ref: '#/components/schemas/FileUploadCompleteFutureResponse' error: title: Error - Envelope_FileUploadCompleteResponse_: - title: Envelope[FileUploadCompleteResponse] type: object + title: Envelope[FileUploadCompleteFutureResponse] + Envelope_FileUploadCompleteResponse_: properties: data: $ref: '#/components/schemas/FileUploadCompleteResponse' error: title: Error - Envelope_FileUploadCompletionBody_: - title: Envelope[FileUploadCompletionBody] type: object + title: Envelope[FileUploadCompleteResponse] + Envelope_FileUploadCompletionBody_: properties: data: $ref: '#/components/schemas/FileUploadCompletionBody' error: title: Error - Envelope_FileUploadSchema_: - title: Envelope[FileUploadSchema] type: object + title: Envelope[FileUploadCompletionBody] + Envelope_FileUploadSchema_: properties: data: $ref: '#/components/schemas/FileUploadSchema' error: title: Error - Envelope_HealthCheck_: - title: Envelope[HealthCheck] type: object + title: Envelope[FileUploadSchema] + Envelope_HealthCheck_: properties: data: $ref: '#/components/schemas/HealthCheck' error: title: Error - Envelope_PresignedLink_: - title: Envelope[PresignedLink] type: object + title: Envelope[HealthCheck] + Envelope_PresignedLink_: properties: data: $ref: '#/components/schemas/PresignedLink' error: title: Error - Envelope_S3Settings_: - title: Envelope[S3Settings] type: object + title: Envelope[PresignedLink] + Envelope_S3Settings_: properties: data: $ref: '#/components/schemas/S3Settings' error: title: Error - Envelope_TableSynchronisation_: - title: Envelope[TableSynchronisation] type: object + title: Envelope[S3Settings] + Envelope_TableSynchronisation_: properties: data: $ref: '#/components/schemas/TableSynchronisation' error: title: Error - Envelope_TaskGet_: - title: Envelope[TaskGet] type: object + title: Envelope[TableSynchronisation] + Envelope_TaskGet_: properties: data: $ref: '#/components/schemas/TaskGet' error: title: Error - Envelope_TaskStatus_: - title: Envelope[TaskStatus] type: object + title: Envelope[TaskGet] + Envelope_TaskStatus_: properties: data: $ref: '#/components/schemas/TaskStatus' error: title: Error - Envelope_list_models_library.api_schemas_storage.FileMetaDataGet__: - title: Envelope[list[models_library.api_schemas_storage.FileMetaDataGet]] type: object + title: Envelope[TaskStatus] + Envelope_list_models_library.api_schemas_storage.FileMetaDataGet__: properties: data: - title: Data - type: array items: $ref: '#/components/schemas/FileMetaDataGet' + type: array + title: Data error: title: Error - Envelope_list_simcore_service_storage.models.DatasetMetaData__: - title: Envelope[list[simcore_service_storage.models.DatasetMetaData]] type: object + title: Envelope[list[models_library.api_schemas_storage.FileMetaDataGet]] + Envelope_list_simcore_service_storage.models.DatasetMetaData__: properties: data: - title: Data - type: array items: $ref: '#/components/schemas/DatasetMetaData' + type: array + title: Data error: title: Error - FileMetaData: - title: FileMetaData - required: - - file_uuid - - location_id - - file_name - - file_id - - created_at - - last_modified - - location - - bucket_name - - object_name type: object + title: Envelope[list[simcore_service_storage.models.DatasetMetaData]] + FileMetaData: properties: file_uuid: - title: File Uuid type: string + title: File Uuid description: NOT a unique ID, like (api|uuid)/uuid/file_name or DATCORE folder structure location_id: - title: Location Id type: integer + title: Location Id description: Storage location project_name: - title: Project Name type: string + title: Project Name description: optional project name, used by frontend to display path node_name: - title: Node Name type: string + title: Node Name description: optional node name, used by frontend to display path file_name: - title: File Name type: string + title: File Name description: Display name for a file file_id: - title: File Id anyOf: - - pattern: ^(api|([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}))\/([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12})\/(.+)$ - type: string - - pattern: ^N:package:[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}$ - type: string + - type: string + pattern: ^(api|([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}))\/([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12})\/(.+)$ + - type: string + pattern: ^N:package:[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}$ + title: File Id description: THIS IS the unique ID for the file. either (api|project_id)/node_id/file_name.ext for S3 and N:package:UUID for datcore created_at: - title: Created At type: string format: date-time + title: Created At last_modified: - title: Last Modified type: string format: date-time + title: Last Modified file_size: + anyOf: + - type: integer + - type: integer title: File Size - type: integer description: File size in bytes (-1 means invalid) default: -1 entity_tag: - title: Entity Tag type: string + title: Entity Tag description: Entity tag (or ETag), represents a specific version of the file, None if invalid upload or datcore is_soft_link: - title: Is Soft Link type: boolean + title: Is Soft Link description: If true, this file is a soft link.i.e. is another entry with the same object_name default: false is_directory: - title: Is Directory type: boolean + title: Is Directory description: if True this is a directory default: false + sha256_checksum: + type: string + pattern: ^[a-fA-F0-9]{64}$ + title: Sha256 Checksum upload_id: - title: Upload Id type: string + title: Upload Id upload_expires_at: - title: Upload Expires At type: string format: date-time + title: Upload Expires At location: - title: Location type: string + title: Location bucket_name: - title: Bucket Name type: string + title: Bucket Name object_name: - title: Object Name type: string + title: Object Name project_id: - title: Project Id type: string format: uuid + title: Project Id node_id: - title: Node Id type: string format: uuid + title: Node Id user_id: - title: User Id - exclusiveMinimum: true type: integer + exclusiveMinimum: true + title: User Id minimum: 0 additionalProperties: false - FileMetaDataGet: - title: FileMetaDataGet + type: object required: - file_uuid - location_id @@ -1056,346 +1068,367 @@ components: - file_id - created_at - last_modified - type: object + - location + - bucket_name + - object_name + title: FileMetaData + FileMetaDataGet: properties: file_uuid: - title: File Uuid type: string + title: File Uuid description: NOT a unique ID, like (api|uuid)/uuid/file_name or DATCORE folder structure location_id: - title: Location Id type: integer + title: Location Id description: Storage location project_name: - title: Project Name type: string + title: Project Name description: optional project name, used by frontend to display path node_name: - title: Node Name type: string + title: Node Name description: optional node name, used by frontend to display path file_name: - title: File Name type: string + title: File Name description: Display name for a file file_id: - title: File Id anyOf: - - pattern: ^(api|([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}))\/([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12})\/(.+)$ - type: string - - pattern: ^N:package:[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}$ - type: string + - type: string + pattern: ^(api|([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}))\/([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12})\/(.+)$ + - type: string + pattern: ^N:package:[0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}$ + title: File Id description: THIS IS the unique ID for the file. either (api|project_id)/node_id/file_name.ext for S3 and N:package:UUID for datcore created_at: - title: Created At type: string format: date-time + title: Created At last_modified: - title: Last Modified type: string format: date-time + title: Last Modified file_size: + anyOf: + - type: integer + - type: integer title: File Size - type: integer description: File size in bytes (-1 means invalid) default: -1 entity_tag: - title: Entity Tag type: string + title: Entity Tag description: Entity tag (or ETag), represents a specific version of the file, None if invalid upload or datcore is_soft_link: - title: Is Soft Link type: boolean + title: Is Soft Link description: If true, this file is a soft link.i.e. is another entry with the same object_name default: false is_directory: - title: Is Directory type: boolean + title: Is Directory description: if True this is a directory default: false + sha256_checksum: + type: string + pattern: ^[a-fA-F0-9]{64}$ + title: Sha256 Checksum + description: 'SHA256 message digest of the file content. Main purpose: cheap + lookup.' additionalProperties: false - FileUploadCompleteFutureResponse: - title: FileUploadCompleteFutureResponse - required: - - state type: object + required: + - file_uuid + - location_id + - file_name + - file_id + - created_at + - last_modified + title: FileMetaDataGet + FileUploadCompleteFutureResponse: properties: state: $ref: '#/components/schemas/FileUploadCompleteState' e_tag: - title: E Tag type: string - FileUploadCompleteLinks: - title: FileUploadCompleteLinks + title: E Tag + type: object required: - state - type: object + title: FileUploadCompleteFutureResponse + FileUploadCompleteLinks: properties: state: - title: State + type: string maxLength: 65536 minLength: 1 - type: string format: uri - FileUploadCompleteResponse: - title: FileUploadCompleteResponse - required: - - links + title: State type: object + required: + - state + title: FileUploadCompleteLinks + FileUploadCompleteResponse: properties: links: $ref: '#/components/schemas/FileUploadCompleteLinks' + type: object + required: + - links + title: FileUploadCompleteResponse FileUploadCompleteState: - title: FileUploadCompleteState enum: - ok - nok + title: FileUploadCompleteState description: An enumeration. FileUploadCompletionBody: - title: FileUploadCompletionBody - required: - - parts - type: object properties: parts: - title: Parts - type: array items: $ref: '#/components/schemas/UploadedPart' - FileUploadLinks: - title: FileUploadLinks - required: - - abort_upload - - complete_upload + type: array + title: Parts type: object + required: + - parts + title: FileUploadCompletionBody + FileUploadLinks: properties: abort_upload: - title: Abort Upload + type: string maxLength: 65536 minLength: 1 - type: string format: uri + title: Abort Upload complete_upload: - title: Complete Upload + type: string maxLength: 65536 minLength: 1 - type: string format: uri - FileUploadSchema: - title: FileUploadSchema - required: - - chunk_size - - urls - - links + title: Complete Upload type: object + required: + - abort_upload + - complete_upload + title: FileUploadLinks + FileUploadSchema: properties: chunk_size: - title: Chunk Size type: integer + title: Chunk Size urls: - title: Urls - type: array items: + type: string maxLength: 65536 minLength: 1 - type: string format: uri + type: array + title: Urls links: $ref: '#/components/schemas/FileUploadLinks' - FoldersBody: - title: FoldersBody type: object + required: + - chunk_size + - urls + - links + title: FileUploadSchema + FoldersBody: properties: source: - title: Source type: object + title: Source destination: - title: Destination type: object + title: Destination nodes_map: - title: Nodes Map - type: object additionalProperties: type: string format: uuid - HealthCheck: - title: HealthCheck + type: object + title: Nodes Map type: object + title: FoldersBody + HealthCheck: properties: name: - title: Name type: string + title: Name status: - title: Status type: string + title: Status api_version: - title: Api Version type: string + title: Api Version version: - title: Version type: string + title: Version + type: object + title: HealthCheck LinkType: - title: LinkType + type: string enum: - PRESIGNED - S3 - type: string + title: LinkType description: An enumeration. PresignedLink: - title: PresignedLink - required: - - link - type: object properties: link: - title: Link + type: string maxLength: 65536 minLength: 1 - type: string format: uri - S3Settings: - title: S3Settings - required: - - S3_ENDPOINT - - S3_ACCESS_KEY - - S3_SECRET_KEY - - S3_BUCKET_NAME + title: Link type: object + required: + - link + title: PresignedLink + S3Settings: properties: S3_SECURE: - title: S3 Secure type: boolean + title: S3 Secure default: false S3_ENDPOINT: - title: S3 Endpoint type: string + title: S3 Endpoint S3_ACCESS_KEY: - title: S3 Access Key type: string + title: S3 Access Key S3_SECRET_KEY: - title: S3 Secret Key type: string + title: S3 Secret Key S3_ACCESS_TOKEN: - title: S3 Access Token type: string + title: S3 Access Token S3_BUCKET_NAME: - title: S3 Bucket Name type: string + title: S3 Bucket Name S3_REGION: - title: S3 Region type: string + title: S3 Region default: us-east-1 additionalProperties: false + type: object + required: + - S3_ENDPOINT + - S3_ACCESS_KEY + - S3_SECRET_KEY + - S3_BUCKET_NAME + title: S3Settings description: "- Customized configuration for all settings\n- If a field is a\ \ BaseCustomSettings subclass, it allows creating a default from env vars\ \ setting the Field\n option 'auto_default_from_env=True'.\n\nSEE tests for\ \ details." SoftCopyBody: - title: SoftCopyBody - required: - - link_id - type: object properties: link_id: - title: Link Id - pattern: ^(api|([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}))\/([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12})\/(.+)$ type: string - TableSynchronisation: - title: TableSynchronisation - required: - - removed + pattern: ^(api|([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12}))\/([0-9a-fA-F]{8}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{4}-?[0-9a-fA-F]{12})\/(.+)$ + title: Link Id type: object + required: + - link_id + title: SoftCopyBody + TableSynchronisation: properties: dry_run: - title: Dry Run type: boolean + title: Dry Run fire_and_forget: - title: Fire And Forget type: boolean + title: Fire And Forget removed: - title: Removed - type: array items: type: string - TaskGet: - title: TaskGet - required: - - task_id - - task_name - - status_href - - result_href - - abort_href + type: array + title: Removed type: object + required: + - removed + title: TableSynchronisation + TaskGet: properties: task_id: - title: Task Id type: string + title: Task Id task_name: - title: Task Name type: string + title: Task Name status_href: - title: Status Href type: string + title: Status Href result_href: - title: Result Href type: string + title: Result Href abort_href: - title: Abort Href type: string - TaskProgress: - title: TaskProgress + title: Abort Href type: object + required: + - task_id + - task_name + - status_href + - result_href + - abort_href + title: TaskGet + TaskProgress: properties: message: - title: Message type: string + title: Message default: '' percent: - title: Percent + type: number maximum: 1.0 minimum: 0.0 - type: number + title: Percent default: 0.0 + type: object + title: TaskProgress description: 'Helps the user to keep track of the progress. Progress is expected to be defined as a float bound between 0.0 and 1.0' TaskStatus: - title: TaskStatus - required: - - task_progress - - done - - started - type: object properties: task_progress: $ref: '#/components/schemas/TaskProgress' done: - title: Done type: boolean + title: Done started: - title: Started type: string format: date-time - UploadedPart: - title: UploadedPart - required: - - number - - e_tag + title: Started type: object + required: + - task_progress + - done + - started + title: TaskStatus + UploadedPart: properties: number: - title: Number - exclusiveMinimum: true type: integer + exclusiveMinimum: true + title: Number minimum: 0 e_tag: - title: E Tag type: string + title: E Tag + type: object + required: + - number + - e_tag + title: UploadedPart tags: - name: datasets - name: files diff --git a/services/storage/src/simcore_service_storage/models.py b/services/storage/src/simcore_service_storage/models.py index 69bb9960d4b..8444863d3e8 100644 --- a/services/storage/src/simcore_service_storage/models.py +++ b/services/storage/src/simcore_service_storage/models.py @@ -201,7 +201,7 @@ class DeleteFolderQueryParams(StorageQueryParamsBase): class SearchFilesQueryParams(StorageQueryParamsBase): startswith: str = "" - sha256_checksum: SHA256Str | None + sha256_checksum: SHA256Str | None = None access_right: Literal["read", "write"] = "read"