diff --git a/api/specs/web-server/_catalog_tags.py b/api/specs/web-server/_catalog_tags.py new file mode 100644 index 00000000000..26e90d952a4 --- /dev/null +++ b/api/specs/web-server/_catalog_tags.py @@ -0,0 +1,55 @@ +# pylint: disable=redefined-outer-name +# pylint: disable=unused-argument +# pylint: disable=unused-variable +# pylint: disable=too-many-arguments + + +from typing import Annotated + +from fastapi import APIRouter, Depends +from models_library.api_schemas_webserver.catalog import CatalogServiceGet +from models_library.generics import Envelope +from simcore_service_webserver._meta import API_VTAG +from simcore_service_webserver.catalog._tags_handlers import ( + ServicePathParams, + ServiceTagPathParams, +) +from simcore_service_webserver.tags.schemas import TagGet + +router = APIRouter( + prefix=f"/{API_VTAG}", + tags=[ + "catalog", + "tags", + ], +) + + +@router.get( + "/catalog/services/{service_key}/{service_version}/tags", + response_model=Envelope[list[TagGet]], +) +def list_service_tags( + _path_params: Annotated[ServicePathParams, Depends()], +): + ... + + +@router.post( + "/catalog/services/{service_key}/{service_version}/tags/{tag_id}:add", + response_model=Envelope[CatalogServiceGet], +) +def add_service_tag( + _path_params: Annotated[ServiceTagPathParams, Depends()], +): + ... + + +@router.post( + "/catalog/services/{service_key}/{service_version}/tags/{tag_id}:remove", + response_model=Envelope[CatalogServiceGet], +) +def remove_service_tag( + _path_params: Annotated[ServiceTagPathParams, Depends()], +): + ... diff --git a/api/specs/web-server/_projects_groups.py b/api/specs/web-server/_projects_groups.py index 2f6d300496d..88432bb3cfa 100644 --- a/api/specs/web-server/_projects_groups.py +++ b/api/specs/web-server/_projects_groups.py @@ -18,9 +18,7 @@ router = APIRouter( prefix=f"/{API_VTAG}", - tags=[ - "projects", - ], + tags=["projects", "groups"], ) diff --git a/api/specs/web-server/_projects_tags.py b/api/specs/web-server/_projects_tags.py index 4c8e26b924e..71e71237ccd 100644 --- a/api/specs/web-server/_projects_tags.py +++ b/api/specs/web-server/_projects_tags.py @@ -19,27 +19,31 @@ ) -@router.put( - "/projects/{project_uuid}/tags/{tag_id}", +@router.post( + "/projects/{project_uuid}/tags/{tag_id}:add", response_model=Envelope[ProjectGet], ) -def add_tag( +def add_project_tag( project_uuid: ProjectID, tag_id: int, ): """ Links an existing label with an existing study + + NOTE: that the tag is not created here """ -@router.delete( - "/projects/{project_uuid}/tags/{tag_id}", +@router.post( + "/projects/{project_uuid}/tags/{tag_id}:remove", response_model=Envelope[ProjectGet], ) -def remove_tag( +def remove_project_tag( project_uuid: ProjectID, tag_id: int, ): """ Removes an existing link between a label and a study + + NOTE: that the tag is not deleted here """ diff --git a/api/specs/web-server/_tags.py b/api/specs/web-server/_tags.py index b4b1639dee4..2cea934a788 100644 --- a/api/specs/web-server/_tags.py +++ b/api/specs/web-server/_tags.py @@ -9,7 +9,7 @@ from fastapi import APIRouter, Depends, status from models_library.generics import Envelope from simcore_service_webserver._meta import API_VTAG -from simcore_service_webserver.tags._handlers import ( +from simcore_service_webserver.tags.schemas import ( TagCreate, TagGet, TagPathParams, diff --git a/api/specs/web-server/_tags_groups.py b/api/specs/web-server/_tags_groups.py new file mode 100644 index 00000000000..832e553ad70 --- /dev/null +++ b/api/specs/web-server/_tags_groups.py @@ -0,0 +1,63 @@ +# pylint: disable=redefined-outer-name +# pylint: disable=unused-argument +# pylint: disable=unused-variable +# pylint: disable=too-many-arguments + + +from typing import Annotated + +from fastapi import APIRouter, Depends, status +from models_library.generics import Envelope +from simcore_service_webserver._meta import API_VTAG +from simcore_service_webserver.tags.schemas import ( + TagGet, + TagGroupCreate, + TagGroupGet, + TagGroupPathParams, + TagPathParams, +) + +router = APIRouter( + prefix=f"/{API_VTAG}", + tags=[ + "tags", + "groups", + ], +) + + +@router.get( + "/tags/{tag_id}/groups", + response_model=Envelope[list[TagGroupGet]], +) +async def list_tag_groups(_path_params: Annotated[TagPathParams, Depends()]): + ... + + +@router.post( + "/tags/{tag_id}/groups/{group_id}", + response_model=Envelope[TagGet], + status_code=status.HTTP_201_CREATED, +) +async def create_tag_group( + _path_params: Annotated[TagGroupPathParams, Depends()], _body: TagGroupCreate +): + ... + + +@router.put( + "/tags/{tag_id}/groups/{group_id}", + response_model=Envelope[list[TagGroupGet]], +) +async def replace_tag_groups( + _path_params: Annotated[TagGroupPathParams, Depends()], _body: TagGroupCreate +): + ... + + +@router.delete( + "/tags/{tag_id}/groups/{group_id}", + status_code=status.HTTP_204_NO_CONTENT, +) +async def delete_tag_group(_path_params: Annotated[TagGroupPathParams, Depends()]): + ... diff --git a/api/specs/web-server/_wallets.py b/api/specs/web-server/_wallets.py index cb745acc00b..06ff8d7fc10 100644 --- a/api/specs/web-server/_wallets.py +++ b/api/specs/web-server/_wallets.py @@ -7,6 +7,7 @@ # pylint: disable=too-many-arguments +from enum import Enum from typing import Annotated from fastapi import APIRouter, Depends, status @@ -214,12 +215,14 @@ async def replace_wallet_autorecharge( ### Wallets groups +_extra_tags: list[str | Enum] = ["groups"] @router.post( "/wallets/{wallet_id}/groups/{group_id}", response_model=Envelope[WalletGroupGet], status_code=status.HTTP_201_CREATED, + tags=_extra_tags, ) async def create_wallet_group( wallet_id: WalletID, group_id: GroupID, body: _WalletsGroupsBodyParams @@ -230,6 +233,7 @@ async def create_wallet_group( @router.get( "/wallets/{wallet_id}/groups", response_model=Envelope[list[WalletGroupGet]], + tags=_extra_tags, ) async def list_wallet_groups(wallet_id: WalletID): ... @@ -238,6 +242,7 @@ async def list_wallet_groups(wallet_id: WalletID): @router.put( "/wallets/{wallet_id}/groups/{group_id}", response_model=Envelope[WalletGroupGet], + tags=_extra_tags, ) async def update_wallet_group( wallet_id: WalletID, group_id: GroupID, body: _WalletsGroupsBodyParams @@ -248,6 +253,7 @@ async def update_wallet_group( @router.delete( "/wallets/{wallet_id}/groups/{group_id}", status_code=status.HTTP_204_NO_CONTENT, + tags=_extra_tags, ) async def delete_wallet_group(wallet_id: WalletID, group_id: GroupID): ... diff --git a/api/specs/web-server/_workspaces.py b/api/specs/web-server/_workspaces.py index 1341fce5025..e3f1b4ebc5c 100644 --- a/api/specs/web-server/_workspaces.py +++ b/api/specs/web-server/_workspaces.py @@ -7,19 +7,22 @@ # pylint: disable=too-many-arguments -from fastapi import APIRouter, status +from enum import Enum +from typing import Annotated + +from fastapi import APIRouter, Depends, status from models_library.api_schemas_webserver.workspaces import ( CreateWorkspaceBodyParams, PutWorkspaceBodyParams, WorkspaceGet, ) from models_library.generics import Envelope -from models_library.users import GroupID from models_library.workspaces import WorkspaceID from simcore_service_webserver._meta import API_VTAG from simcore_service_webserver.workspaces._groups_api import WorkspaceGroupGet from simcore_service_webserver.workspaces._groups_handlers import ( _WorkspacesGroupsBodyParams, + _WorkspacesGroupsPathParams, ) router = APIRouter( @@ -37,7 +40,7 @@ response_model=Envelope[WorkspaceGet], status_code=status.HTTP_201_CREATED, ) -async def create_workspace(body: CreateWorkspaceBodyParams): +async def create_workspace(_body: CreateWorkspaceBodyParams): ... @@ -61,7 +64,7 @@ async def get_workspace(workspace_id: WorkspaceID): "/workspaces/{workspace_id}", response_model=Envelope[WorkspaceGet], ) -async def replace_workspace(workspace_id: WorkspaceID, body: PutWorkspaceBodyParams): +async def replace_workspace(workspace_id: WorkspaceID, _body: PutWorkspaceBodyParams): ... @@ -74,15 +77,18 @@ async def delete_workspace(workspace_id: WorkspaceID): ### Workspaces groups +_extra_tags: list[str | Enum] = ["groups"] @router.post( "/workspaces/{workspace_id}/groups/{group_id}", response_model=Envelope[WorkspaceGroupGet], status_code=status.HTTP_201_CREATED, + tags=_extra_tags, ) async def create_workspace_group( - workspace_id: WorkspaceID, group_id: GroupID, body: _WorkspacesGroupsBodyParams + _path_parms: Annotated[_WorkspacesGroupsPathParams, Depends()], + _body: _WorkspacesGroupsBodyParams, ): ... @@ -90,6 +96,7 @@ async def create_workspace_group( @router.get( "/workspaces/{workspace_id}/groups", response_model=Envelope[list[WorkspaceGroupGet]], + tags=_extra_tags, ) async def list_workspace_groups(workspace_id: WorkspaceID): ... @@ -98,9 +105,11 @@ async def list_workspace_groups(workspace_id: WorkspaceID): @router.put( "/workspaces/{workspace_id}/groups/{group_id}", response_model=Envelope[WorkspaceGroupGet], + tags=_extra_tags, ) async def replace_workspace_group( - workspace_id: WorkspaceID, group_id: GroupID, body: _WorkspacesGroupsBodyParams + _path_parms: Annotated[_WorkspacesGroupsPathParams, Depends()], + _body: _WorkspacesGroupsBodyParams, ): ... @@ -108,6 +117,9 @@ async def replace_workspace_group( @router.delete( "/workspaces/{workspace_id}/groups/{group_id}", status_code=status.HTTP_204_NO_CONTENT, + tags=_extra_tags, ) -async def delete_workspace_group(workspace_id: WorkspaceID, group_id: GroupID): +async def delete_workspace_group( + _path_parms: Annotated[_WorkspacesGroupsPathParams, Depends()] +): ... diff --git a/api/specs/web-server/openapi.py b/api/specs/web-server/openapi.py index ab97f2a9eb4..da372d3c7c9 100644 --- a/api/specs/web-server/openapi.py +++ b/api/specs/web-server/openapi.py @@ -15,29 +15,37 @@ openapi_modules = [ importlib.import_module(name) for name in ( + # NOTE: order matters on how the paths are displayed in the OAS! + # It does not have to be alphabetical + # + # core --- + "_auth", + "_groups", + "_tags", + "_tags_groups", # after _tags + "_products", + "_users", + "_wallets", + # add-ons --- "_activity", - "_admin", "_announcements", - "_auth", "_catalog", + "_catalog_tags", # after _catalog "_cluster", "_computations", - "_diagnostics", "_exporter", "_folders", - "_groups", "_long_running_tasks", "_metamodeling", - "_nih_sparc_redirections", "_nih_sparc", - "_products", - "_projects_nodes_pricing_unit", - "_projects_comments", + "_nih_sparc_redirections", "_projects_crud", - "_projects_groups", + "_projects_comments", "_projects_folders", + "_projects_groups", "_projects_metadata", "_projects_nodes", + "_projects_nodes_pricing_unit", # after _projects_nodes "_projects_ports", "_projects_states", "_projects_tags", @@ -47,11 +55,11 @@ "_resource_usage", "_statics", "_storage", - "_tags", - "_users", "_version_control", - "_wallets", "_workspaces", + # maintenance ---- + "_admin", + "_diagnostics", ) ] diff --git a/services/static-webserver/client/source/class/osparc/data/Resources.js b/services/static-webserver/client/source/class/osparc/data/Resources.js index 4516598e2dd..6197d6c92c6 100644 --- a/services/static-webserver/client/source/class/osparc/data/Resources.js +++ b/services/static-webserver/client/source/class/osparc/data/Resources.js @@ -260,13 +260,13 @@ qx.Class.define("osparc.data.Resources", { }, addTag: { useCache: false, - method: "PUT", - url: statics.API + "/projects/{studyId}/tags/{tagId}" + method: "POST", + url: statics.API + "/projects/{studyId}/tags/{tagId}:add" }, removeTag: { useCache: false, - method: "DELETE", - url: statics.API + "/projects/{studyId}/tags/{tagId}" + method: "POST", + url: statics.API + "/projects/{studyId}/tags/{tagId}:remove" }, getInactivity: { useCache: false, diff --git a/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml b/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml index eca683cd040..f427ec28d46 100644 --- a/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml +++ b/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml @@ -14,58 +14,6 @@ servers: port: default: '8001' paths: - /v0/activity/status: - get: - tags: - - tasks - summary: Get Activity Status - operationId: get_activity_status - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_dict_uuid.UUID__models_library.api_schemas_webserver.activity.Activity__' - /v0/email:test: - post: - tags: - - admin - summary: Test Email - operationId: test_email - parameters: - - required: false - schema: - title: X-Simcore-Products-Name - type: string - name: x-simcore-products-name - in: header - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/TestEmail' - required: true - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_Union_EmailTestFailed__EmailTestPassed__' - /v0/announcements: - get: - tags: - - announcements - summary: List Announcements - operationId: list_announcements - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.announcements._models.Announcement__' /v0/auth/request-account: post: tags: @@ -485,58 +433,45 @@ paths: application/json: schema: {} image/png: {} - /v0/catalog/services/-/latest: + /v0/groups: get: tags: - - catalog - summary: List Services Latest - operationId: list_services_latest - parameters: - - required: false - schema: - title: Limit - exclusiveMaximum: true - minimum: 1 - type: integer - default: 20 - maximum: 50 - name: limit - in: query - - required: false - schema: - title: Offset - minimum: 0 - type: integer - default: 0 - name: offset - in: query + - groups + summary: List Groups + operationId: list_groups responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Page_CatalogServiceGet_' - /v0/catalog/services/{service_key}/{service_version}: + $ref: '#/components/schemas/Envelope_AllUsersGroups_' + post: + tags: + - groups + summary: Create Group + operationId: create_group + responses: + '201': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_UsersGroup_' + /v0/groups/{gid}: get: tags: - - catalog - summary: Get Service - operationId: get_service + - groups + summary: Get Group + operationId: get_group parameters: - required: true schema: - title: Service Key - pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ - type: string - name: service_key - in: path - - required: true - schema: - title: Service Version - pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ - type: string - name: service_version + title: Gid + exclusiveMinimum: true + type: integer + minimum: 0 + name: gid in: path responses: '200': @@ -544,32 +479,43 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_CatalogServiceGet_' - patch: + $ref: '#/components/schemas/Envelope_UsersGroup_' + delete: tags: - - catalog - summary: Update Service - operationId: update_service + - groups + summary: Delete Group + operationId: delete_group parameters: - required: true schema: - title: Service Key - pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ - type: string - name: service_key + title: Gid + exclusiveMinimum: true + type: integer + minimum: 0 + name: gid in: path + responses: + '204': + description: Successful Response + patch: + tags: + - groups + summary: Update Group + operationId: update_group + parameters: - required: true schema: - title: Service Version - pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ - type: string - name: service_version + title: Gid + exclusiveMinimum: true + type: integer + minimum: 0 + name: gid in: path requestBody: content: application/json: schema: - $ref: '#/components/schemas/CatalogServiceUpdate' + $ref: '#/components/schemas/UsersGroup' required: true responses: '200': @@ -577,27 +523,21 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_CatalogServiceGet_' - /v0/catalog/services/{service_key}/{service_version}/inputs: + $ref: '#/components/schemas/Envelope_UsersGroup_' + /v0/groups/{gid}/users: get: tags: - - catalog - summary: List Service Inputs - operationId: list_service_inputs + - groups + summary: Get Group Users + operationId: get_group_users parameters: - required: true schema: - title: Service Key - pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ - type: string - name: service_key - in: path - - required: true - schema: - title: Service Version - pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ - type: string - name: service_version + title: Gid + exclusiveMinimum: true + type: integer + minimum: 0 + name: gid in: path responses: '200': @@ -605,34 +545,52 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_webserver.catalog.ServiceInputGet__' - /v0/catalog/services/{service_key}/{service_version}/inputs/{input_key}: - get: + $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_webserver.groups.GroupUserGet__' + post: tags: - - catalog - summary: Get Service Input - operationId: get_service_input + - groups + summary: Add Group User + operationId: add_group_user parameters: - required: true schema: - title: Service Key - pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ - type: string - name: service_key + title: Gid + exclusiveMinimum: true + type: integer + minimum: 0 + name: gid in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GroupUserGet' + required: true + responses: + '204': + description: Successful Response + /v0/groups/{gid}/users/{uid}: + get: + tags: + - groups + summary: Get Group User + operationId: get_group_user + parameters: - required: true schema: - title: Service Version - pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ - type: string - name: service_version + title: Gid + exclusiveMinimum: true + type: integer + minimum: 0 + name: gid in: path - required: true schema: - title: Input Key - pattern: ^[-_a-zA-Z0-9]+$ - type: string - name: input_key + title: Uid + exclusiveMinimum: true + type: integer + minimum: 0 + name: uid in: path responses: '200': @@ -640,188 +598,129 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_ServiceInputGet_' - /v0/catalog/services/{service_key}/{service_version}/inputs:match: - get: + $ref: '#/components/schemas/Envelope_GroupUserGet_' + delete: tags: - - catalog - summary: Get Compatible Inputs Given Source Output - operationId: get_compatible_inputs_given_source_output + - groups + summary: Delete Group User + operationId: delete_group_user parameters: - required: true schema: - title: Service Key - pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ - type: string - name: service_key + title: Gid + exclusiveMinimum: true + type: integer + minimum: 0 + name: gid in: path - required: true schema: - title: Service Version - pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ - type: string - name: service_version + title: Uid + exclusiveMinimum: true + type: integer + minimum: 0 + name: uid in: path - - required: true - schema: - title: Fromservice - pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ - type: string - name: fromService - in: query - - required: true - schema: - title: Fromversion - pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ - type: string - name: fromVersion - in: query - - required: true - schema: - title: Fromoutput - pattern: ^[-_a-zA-Z0-9]+$ - type: string - name: fromOutput - in: query responses: - '200': + '204': description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_list_models_library.services_types.ServicePortKey__' - /v0/catalog/services/{service_key}/{service_version}/outputs: - get: + patch: tags: - - catalog - summary: List Service Outputs - operationId: list_service_outputs + - groups + summary: Update Group User + operationId: update_group_user parameters: - required: true schema: - title: Service Key - pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ - type: string - name: service_key + title: Gid + exclusiveMinimum: true + type: integer + minimum: 0 + name: gid in: path - required: true schema: - title: Service Version - pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ - type: string - name: service_version + title: Uid + exclusiveMinimum: true + type: integer + minimum: 0 + name: uid in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GroupUserGet' + required: true responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_models_library.services_types.ServicePortKey__' - /v0/catalog/services/{service_key}/{service_version}/outputs/{output_key}: + $ref: '#/components/schemas/Envelope_GroupUserGet_' + /v0/groups/{gid}/classifiers: get: tags: - - catalog - summary: Get Service Output - operationId: get_service_output + - groups + summary: Get Group Classifiers + operationId: get_group_classifiers parameters: - required: true schema: - title: Service Key - pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ - type: string - name: service_key - in: path - - required: true - schema: - title: Service Version - pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ - type: string - name: service_version + title: Gid + exclusiveMinimum: true + type: integer + minimum: 0 + name: gid in: path - - required: true + - required: false schema: - title: Output Key - pattern: ^[-_a-zA-Z0-9]+$ + title: Tree View + enum: + - std type: string - name: output_key - in: path + default: std + name: tree_view + in: query responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_webserver.catalog.ServiceOutputGet__' - /v0/catalog/services/{service_key}/{service_version}/outputs:match: + $ref: '#/components/schemas/Envelope_dict_str__Any__' + /v0/groups/sparc/classifiers/scicrunch-resources/{rrid}: get: tags: - - catalog - summary: Get Compatible Outputs Given Target Input - operationId: get_compatible_outputs_given_target_input + - groups + summary: Get Scicrunch Resource + operationId: get_scicrunch_resource parameters: - required: true schema: - title: Service Key - pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ - type: string - name: service_key - in: path - - required: true - schema: - title: Service Version - pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ + title: Rrid type: string - name: service_version + name: rrid in: path - - required: true - schema: - title: Toservice - pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ - type: string - name: toService - in: query - - required: true - schema: - title: Toversion - pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ - type: string - name: toVersion - in: query - - required: true - schema: - title: Toinput - pattern: ^[-_a-zA-Z0-9]+$ - type: string - name: toInput - in: query responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_models_library.services_types.ServicePortKey__' - /v0/catalog/services/{service_key}/{service_version}/resources: - get: + $ref: '#/components/schemas/Envelope_ResearchResource_' + post: tags: - - catalog - summary: Get Service Resources - operationId: get_service_resources + - groups + summary: Add Scicrunch Resource + operationId: add_scicrunch_resource parameters: - required: true schema: - title: Service Key - pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ - type: string - name: service_key - in: path - - required: true - schema: - title: Service Version - pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ + title: Rrid type: string - name: service_version + name: rrid in: path responses: '200': @@ -829,139 +728,95 @@ paths: content: application/json: schema: - title: Response Get Service Resources - type: object - /v0/catalog/services/{service_key}/{service_version}/pricing-plan: + $ref: '#/components/schemas/Envelope_ResearchResource_' + /v0/groups/sparc/classifiers/scicrunch-resources:search: get: tags: - - catalog - - pricing-plans - summary: Retrieve default pricing plan for provided service - operationId: get_service_pricing_plan + - groups + summary: Search Scicrunch Resources + operationId: search_scicrunch_resources parameters: - required: true schema: - title: Service Key - pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ - type: string - name: service_key - in: path - - required: true - schema: - title: Service Version - pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ + title: Guess Name type: string - name: service_version - in: path + name: guess_name + in: query responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_ServicePricingPlanGet_' - /v0/clusters: + $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.scicrunch.models.ResourceHit__' + /v0/tags: get: tags: - - clusters - summary: List Clusters - operationId: list_clusters + - tags + summary: List Tags + operationId: list_tags responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_webserver.clusters.ClusterGet__' + $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.tags.schemas.TagGet__' post: tags: - - clusters - summary: Create Cluster - operationId: create_cluster + - tags + summary: Create Tag + operationId: create_tag requestBody: content: application/json: schema: - $ref: '#/components/schemas/ClusterCreate' + $ref: '#/components/schemas/TagCreate' required: true responses: - '201': + '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_ClusterGet_' - /v0/clusters:ping: - post: - tags: - - clusters - summary: Ping Cluster - description: Test connectivity with cluster - operationId: ping_cluster - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ClusterPing' - required: true - responses: - '204': - description: Successful Response - /v0/clusters/{cluster_id}: - get: + $ref: '#/components/schemas/Envelope_TagGet_' + /v0/tags/{tag_id}: + delete: tags: - - clusters - summary: Get Cluster - operationId: get_cluster + - tags + summary: Delete Tag + operationId: delete_tag parameters: - required: true schema: - title: Cluster Id - minimum: 0 + title: Tag Id + exclusiveMinimum: true type: integer - name: cluster_id - in: path - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_ClusterGet_' - delete: - tags: - - clusters - summary: Delete Cluster - operationId: delete_cluster - parameters: - - required: true - schema: - title: Cluster Id - minimum: 0 - type: integer - name: cluster_id + minimum: 0 + name: tag_id in: path responses: '204': description: Successful Response patch: tags: - - clusters - summary: Update Cluster - operationId: update_cluster + - tags + summary: Update Tag + operationId: update_tag parameters: - required: true schema: - title: Cluster Id - minimum: 0 + title: Tag Id + exclusiveMinimum: true type: integer - name: cluster_id + minimum: 0 + name: tag_id in: path requestBody: content: application/json: schema: - $ref: '#/components/schemas/ClusterPatch' + $ref: '#/components/schemas/TagUpdate' required: true responses: '200': @@ -969,20 +824,22 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_ClusterGet_' - /v0/clusters/{cluster_id}/details: + $ref: '#/components/schemas/Envelope_TagGet_' + /v0/tags/{tag_id}/groups: get: tags: - - clusters - summary: Get Cluster Details - operationId: get_cluster_details + - tags + - groups + summary: List Tag Groups + operationId: list_tag_groups parameters: - required: true schema: - title: Cluster Id - minimum: 0 + title: Tag Id + exclusiveMinimum: true type: integer - name: cluster_id + minimum: 0 + name: tag_id in: path responses: '200': @@ -990,300 +847,275 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_ClusterDetails_' - /v0/clusters/{cluster_id}:ping: - post: + $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.tags.schemas.TagGroupGet__' + /v0/tags/{tag_id}/groups/{group_id}: + put: tags: - - clusters - summary: Ping Cluster Cluster Id - description: Tests connectivity with cluster - operationId: ping_cluster_cluster_id + - tags + - groups + summary: Replace Tag Groups + operationId: replace_tag_groups parameters: - required: true schema: - title: Cluster Id - minimum: 0 + title: Tag Id + exclusiveMinimum: true type: integer - name: cluster_id + minimum: 0 + name: tag_id in: path - responses: - '204': - description: Successful Response - /v0/computations/{project_id}: - get: - tags: - - computations - - projects - summary: Get Computation - operationId: get_computation - parameters: - required: true schema: - title: Project Id - type: string - format: uuid - name: project_id + title: Group Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: group_id in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TagGroupCreate' + required: true responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_ComputationTaskGet_' - /v0/computations/{project_id}:start: + $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.tags.schemas.TagGroupGet__' post: tags: - - computations - - projects - summary: Start Computation - operationId: start_computation + - tags + - groups + summary: Create Tag Group + operationId: create_tag_group parameters: - required: true schema: - title: Project Id - type: string - format: uuid - name: project_id + title: Tag Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: tag_id + in: path + - required: true + schema: + title: Group Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: group_id in: path requestBody: content: application/json: schema: - $ref: '#/components/schemas/ComputationStart' + $ref: '#/components/schemas/TagGroupCreate' required: true responses: - '200': + '201': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope__ComputationStarted_' - '402': - description: Insufficient credits to run computation - '404': - description: Project/wallet/pricing details were not found - '406': - description: Cluster not found - '409': - description: Project already started - '422': - description: Configuration error - '503': - description: Service not available - /v0/computations/{project_id}:stop: - post: + $ref: '#/components/schemas/Envelope_TagGet_' + delete: tags: - - computations - - projects - summary: Stop Computation - operationId: stop_computation + - tags + - groups + summary: Delete Tag Group + operationId: delete_tag_group parameters: - required: true schema: - title: Project Id - type: string - format: uuid - name: project_id + title: Tag Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: tag_id + in: path + - required: true + schema: + title: Group Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: group_id in: path responses: '204': description: Successful Response - /v0/: + /v0/credits-price: get: tags: - - maintenance - summary: Healthcheck Readiness Probe - description: 'Readiness probe: check if the container is ready to receive traffic' - operationId: healthcheck_readiness_probe + - products + summary: Get Current Product Price + operationId: get_current_product_price responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_HealthInfoDict_' - /v0/health: + $ref: '#/components/schemas/Envelope_GetCreditPrice_' + /v0/products/{product_name}: get: tags: - - maintenance - summary: Healthcheck Liveness Probe - description: 'Liveness probe: check if the container is alive' - operationId: healthcheck_liveness_probe + - products + - po + summary: Get Product + operationId: get_product + parameters: + - required: true + schema: + title: Product Name + anyOf: + - maxLength: 100 + minLength: 1 + type: string + - enum: + - current + type: string + name: product_name + in: path responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_dict_str__Any__' - /v0/config: - get: + $ref: '#/components/schemas/Envelope_GetProduct_' + /v0/products/{product_name}/templates/{template_id}: + put: tags: - - maintenance - summary: Front end runtime configuration - description: Returns app and products configs - operationId: get_config + - products + - po + summary: Update Product Template + operationId: update_product_template + parameters: + - required: true + schema: + title: Product Name + anyOf: + - maxLength: 100 + minLength: 1 + type: string + - enum: + - current + type: string + name: product_name + in: path + - required: true + schema: + title: Template Id + maxLength: 100 + minLength: 1 + type: string + name: template_id + in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateProductTemplate' + required: true + responses: + '204': + description: Successful Response + /v0/invitation:generate: + post: + tags: + - products + - po + summary: Generate Invitation + operationId: generate_invitation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GenerateInvitation' + required: true responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_dict_str__Any__' - /v0/scheduled_maintenance: + $ref: '#/components/schemas/Envelope_InvitationGenerated_' + /v0/me: get: tags: - - maintenance - summary: Get Scheduled Maintenance - operationId: get_scheduled_maintenance + - user + summary: Get My Profile + operationId: get_my_profile responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_str_' - /v0/status: - get: - tags: - - maintenance - summary: checks status of self and connected services - operationId: get_app_status - responses: - '200': - description: Returns app status check - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_AppStatusCheck_' - /v0/status/diagnostics: - get: - tags: - - maintenance - summary: Get App Diagnostics - operationId: get_app_diagnostics - parameters: - - required: false - schema: - title: Top Tracemalloc - type: integer - name: top_tracemalloc - in: query - responses: - '200': - description: Returns app diagnostics report - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_StatusDiagnosticsGet_' - /v0/status/{service_name}: - get: + $ref: '#/components/schemas/Envelope_ProfileGet_' + put: tags: - - maintenance - summary: Get Service Status - operationId: get_service_status - parameters: - - required: true - schema: - title: Service Name - type: string - name: service_name - in: path + - user + summary: Update My Profile + operationId: update_my_profile + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileUpdate' + required: true responses: - '200': - description: Returns app status check - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_AppStatusCheck_' - /v0/projects/{project_id}:xport: - post: + '204': + description: Successful Response + /v0/me/preferences/{preference_id}: + patch: tags: - - projects - - exporter - summary: Export Project - description: creates an archive of the project and downloads it - operationId: export_project + - user + summary: Set Frontend Preference + operationId: set_frontend_preference parameters: - required: true schema: - title: Project Id + title: Preference Id type: string - name: project_id + name: preference_id in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PatchRequestBody' + required: true responses: - '200': + '204': description: Successful Response - /v0/folders: + /v0/me/tokens: get: tags: - - folders - summary: List Folders - operationId: list_folders - parameters: - - required: false - schema: - title: Folder Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: folder_id - in: query - - required: false - schema: - title: Workspace Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: workspace_id - in: query - - description: Order by field (modified_at|name|description) and direction (asc|desc). - The default sorting order is ascending. - required: false - schema: - title: Order By - description: Order by field (modified_at|name|description) and direction - (asc|desc). The default sorting order is ascending. - default: '{"field": "modified_at", "direction": "desc"}' - example: '{"field": "name", "direction": "desc"}' - name: order_by - in: query - - required: false - schema: - title: Limit - exclusiveMaximum: true - minimum: 1 - type: integer - default: 20 - maximum: 50 - name: limit - in: query - - required: false - schema: - title: Offset - minimum: 0 - type: integer - default: 0 - name: offset - in: query + - user + summary: List Tokens + operationId: list_tokens responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_webserver.folders_v2.FolderGet__' + $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.users.schemas.ThirdPartyToken__' post: tags: - - folders - summary: Create Folder - operationId: create_folder + - user + summary: Create Token + operationId: create_token requestBody: content: application/json: schema: - $ref: '#/components/schemas/CreateFolderBodyParams' + $ref: '#/components/schemas/TokenCreate' required: true responses: '201': @@ -1291,21 +1123,19 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_FolderGet_' - /v0/folders/{folder_id}: + $ref: '#/components/schemas/Envelope_ThirdPartyToken_' + /v0/me/tokens/{service}: get: tags: - - folders - summary: Get Folder - operationId: get_folder + - user + summary: Get Token + operationId: get_token parameters: - required: true schema: - title: Folder Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: folder_id + title: Service + type: string + name: service in: path responses: '200': @@ -1313,134 +1143,119 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_FolderGet_' - put: + $ref: '#/components/schemas/Envelope_ThirdPartyToken_' + delete: tags: - - folders - summary: Replace Folder - operationId: replace_folder + - user + summary: Delete Token + operationId: delete_token parameters: - required: true schema: - title: Folder Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: folder_id + title: Service + type: string + name: service in: path + responses: + '204': + description: Successful Response + /v0/me/notifications: + get: + tags: + - user + summary: List User Notifications + operationId: list_user_notifications + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.users._notifications.UserNotification__' + post: + tags: + - user + summary: Create User Notification + operationId: create_user_notification requestBody: content: application/json: schema: - $ref: '#/components/schemas/PutFolderBodyParams' + $ref: '#/components/schemas/UserNotificationCreate' required: true responses: - '200': + '204': description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_FolderGet_' - delete: + /v0/me/notifications/{notification_id}: + patch: tags: - - folders - summary: Delete Folder - operationId: delete_folder + - user + summary: Mark Notification As Read + operationId: mark_notification_as_read parameters: - required: true schema: - title: Folder Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: folder_id + title: Notification Id + type: string + name: notification_id in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserNotificationPatch' + required: true responses: '204': description: Successful Response - /v0/groups: + /v0/me/permissions: get: tags: - - groups - summary: List Groups - operationId: list_groups + - user + summary: List User Permissions + operationId: list_user_permissions responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_AllUsersGroups_' - post: - tags: - - groups - summary: Create Group - operationId: create_group - responses: - '201': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_UsersGroup_' - /v0/groups/{gid}: + $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.users.schemas.PermissionGet__' + /v0/users:search: get: tags: - - groups - summary: Get Group - operationId: get_group + - user + - po + summary: Search Users + operationId: search_users parameters: - required: true schema: - title: Gid - exclusiveMinimum: true - type: integer - minimum: 0 - name: gid - in: path + title: Email + maxLength: 200 + minLength: 3 + type: string + name: email + in: query responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_UsersGroup_' - delete: - tags: - - groups - summary: Delete Group - operationId: delete_group - parameters: - - required: true - schema: - title: Gid - exclusiveMinimum: true - type: integer - minimum: 0 - name: gid - in: path - responses: - '204': - description: Successful Response - patch: + $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.users._schemas.UserProfile__' + /v0/users:pre-register: + post: tags: - - groups - summary: Update Group - operationId: update_group - parameters: - - required: true - schema: - title: Gid - exclusiveMinimum: true - type: integer - minimum: 0 - name: gid - in: path + - user + - po + summary: Pre Register User + operationId: pre_register_user requestBody: content: application/json: schema: - $ref: '#/components/schemas/UsersGroup' + $ref: '#/components/schemas/PreUserProfile' required: true responses: '200': @@ -1448,74 +1263,65 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_UsersGroup_' - /v0/groups/{gid}/users: + $ref: '#/components/schemas/Envelope_UserProfile_' + /v0/wallets: get: tags: - - groups - summary: Get Group Users - operationId: get_group_users - parameters: - - required: true - schema: - title: Gid - exclusiveMinimum: true - type: integer - minimum: 0 - name: gid - in: path + - wallets + summary: List Wallets + operationId: list_wallets responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_webserver.groups.GroupUserGet__' + $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_webserver.wallets.WalletGetWithAvailableCredits__' post: tags: - - groups - summary: Add Group User - operationId: add_group_user - parameters: - - required: true - schema: - title: Gid - exclusiveMinimum: true - type: integer - minimum: 0 - name: gid - in: path + - wallets + summary: Create Wallet + operationId: create_wallet requestBody: content: application/json: schema: - $ref: '#/components/schemas/GroupUserGet' + $ref: '#/components/schemas/CreateWalletBodyParams' required: true responses: - '204': + '201': description: Successful Response - /v0/groups/{gid}/users/{uid}: + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_WalletGet_' + /v0/wallets/default: get: tags: - - groups - summary: Get Group User - operationId: get_group_user + - wallets + summary: Get Default Wallet + operationId: get_default_wallet + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_WalletGetWithAvailableCredits_' + /v0/wallets/{wallet_id}: + get: + tags: + - wallets + summary: Get Wallet + operationId: get_wallet parameters: - required: true schema: - title: Gid - exclusiveMinimum: true - type: integer - minimum: 0 - name: gid - in: path - - required: true - schema: - title: Uid + title: Wallet Id exclusiveMinimum: true type: integer minimum: 0 - name: uid + name: wallet_id in: path responses: '200': @@ -1523,90 +1329,89 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_GroupUserGet_' - delete: + $ref: '#/components/schemas/Envelope_WalletGetWithAvailableCredits_' + put: tags: - - groups - summary: Delete Group User - operationId: delete_group_user + - wallets + summary: Update Wallet + operationId: update_wallet parameters: - required: true schema: - title: Gid - exclusiveMinimum: true - type: integer - minimum: 0 - name: gid - in: path - - required: true - schema: - title: Uid + title: Wallet Id exclusiveMinimum: true type: integer minimum: 0 - name: uid + name: wallet_id in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PutWalletBodyParams' + required: true responses: - '204': + '200': description: Successful Response - patch: + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_WalletGet_' + /v0/wallets/{wallet_id}/payments: + post: tags: - - groups - summary: Update Group User - operationId: update_group_user + - wallets + summary: Create Payment + description: Creates payment to wallet `wallet_id` + operationId: create_payment parameters: - required: true schema: - title: Gid - exclusiveMinimum: true - type: integer - minimum: 0 - name: gid - in: path - - required: true - schema: - title: Uid + title: Wallet Id exclusiveMinimum: true type: integer minimum: 0 - name: uid + name: wallet_id in: path requestBody: content: application/json: schema: - $ref: '#/components/schemas/GroupUserGet' + $ref: '#/components/schemas/CreateWalletPayment' required: true responses: - '200': - description: Successful Response + '202': + description: Payment initialized content: application/json: schema: - $ref: '#/components/schemas/Envelope_GroupUserGet_' - /v0/groups/{gid}/classifiers: + $ref: '#/components/schemas/Envelope_WalletPaymentInitiated_' + /v0/wallets/-/payments: get: tags: - - groups - summary: Get Group Classifiers - operationId: get_group_classifiers + - wallets + summary: List All Payments + description: Lists all user payments to his/her wallets (only the ones he/she + created) + operationId: list_all_payments parameters: - - required: true + - required: false schema: - title: Gid - exclusiveMinimum: true + title: Limit + exclusiveMaximum: true + minimum: 1 type: integer - minimum: 0 - name: gid - in: path + default: 20 + maximum: 50 + name: limit + in: query - required: false schema: - title: Tree View - enum: - - std - type: string - default: std - name: tree_view + title: Offset + minimum: 0 + type: integer + default: 0 + name: offset in: query responses: '200': @@ -1614,91 +1419,155 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_dict_str__Any__' - /v0/groups/sparc/classifiers/scicrunch-resources/{rrid}: + $ref: '#/components/schemas/Page_PaymentTransaction_' + /v0/wallets/{wallet_id}/payments/{payment_id}/invoice-link: get: tags: - - groups - summary: Get Scicrunch Resource - operationId: get_scicrunch_resource - parameters: + - wallets + summary: Get Payment Invoice Link + operationId: get_payment_invoice_link + parameters: - required: true schema: - title: Rrid + title: Wallet Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: wallet_id + in: path + - required: true + schema: + title: Payment Id + maxLength: 100 + minLength: 1 type: string - name: rrid + name: payment_id in: path responses: - '200': - description: Successful Response + '302': + description: redirection to invoice download link content: application/json: - schema: - $ref: '#/components/schemas/Envelope_ResearchResource_' + schema: {} + /v0/wallets/{wallet_id}/payments/{payment_id}:cancel: post: tags: - - groups - summary: Add Scicrunch Resource - operationId: add_scicrunch_resource + - wallets + summary: Cancel Payment + operationId: cancel_payment parameters: - required: true schema: - title: Rrid + title: Wallet Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: wallet_id + in: path + - required: true + schema: + title: Payment Id + maxLength: 100 + minLength: 1 type: string - name: rrid + name: payment_id in: path responses: - '200': - description: Successful Response + '204': + description: Successfully cancelled + /v0/wallets/{wallet_id}/payments-methods:init: + post: + tags: + - wallets + summary: Init Creation Of Payment Method + operationId: init_creation_of_payment_method + parameters: + - required: true + schema: + title: Wallet Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: wallet_id + in: path + responses: + '202': + description: Successfully initialized content: application/json: schema: - $ref: '#/components/schemas/Envelope_ResearchResource_' - /v0/groups/sparc/classifiers/scicrunch-resources:search: - get: + $ref: '#/components/schemas/Envelope_PaymentMethodInitiated_' + /v0/wallets/{wallet_id}/payments-methods/{payment_method_id}:cancel: + post: tags: - - groups - summary: Search Scicrunch Resources - operationId: search_scicrunch_resources + - wallets + summary: Cancel Creation Of Payment Method + operationId: cancel_creation_of_payment_method parameters: - required: true schema: - title: Guess Name + title: Wallet Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: wallet_id + in: path + - required: true + schema: + title: Payment Method Id + maxLength: 100 + minLength: 1 type: string - name: guess_name - in: query + name: payment_method_id + in: path responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.scicrunch.models.ResourceHit__' - /v0/tasks: + '204': + description: Successfully cancelled + /v0/wallets/{wallet_id}/payments-methods: get: tags: - - long-running-tasks - summary: List Tasks - operationId: list_tasks + - wallets + summary: List Payments Methods + description: Lists all payments method associated to `wallet_id` + operationId: list_payments_methods + parameters: + - required: true + schema: + title: Wallet Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: wallet_id + in: path responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_long_running_tasks.tasks.TaskGet__' - /v0/tasks/{task_id}: + $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_webserver.wallets.PaymentMethodGet__' + /v0/wallets/{wallet_id}/payments-methods/{payment_method_id}: get: tags: - - long-running-tasks - summary: Get Task Status - operationId: get_task_status + - wallets + summary: Get Payment Method + operationId: get_payment_method parameters: - required: true schema: - title: Task Id + title: Wallet Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: wallet_id + in: path + - required: true + schema: + title: Payment Method Id + maxLength: 100 + minLength: 1 type: string - name: task_id + name: payment_method_id in: path responses: '200': @@ -1706,366 +1575,350 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_TaskStatus_' + $ref: '#/components/schemas/Envelope_PaymentMethodGet_' delete: tags: - - long-running-tasks - summary: Cancel And Delete Task - operationId: cancel_and_delete_task + - wallets + summary: Delete Payment Method + operationId: delete_payment_method parameters: - required: true schema: - title: Task Id + title: Wallet Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: wallet_id + in: path + - required: true + schema: + title: Payment Method Id + maxLength: 100 + minLength: 1 type: string - name: task_id + name: payment_method_id in: path responses: '204': - description: Successful Response - /v0/tasks/{task_id}/result: - get: + description: Successfully deleted + /v0/wallets/{wallet_id}/payments-methods/{payment_method_id}:pay: + post: tags: - - long-running-tasks - summary: Get Task Result - operationId: get_task_result + - wallets + summary: Pay With Payment Method + operationId: pay_with_payment_method parameters: - required: true schema: - title: Task Id + title: Wallet Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: wallet_id + in: path + - required: true + schema: + title: Payment Method Id + maxLength: 100 + minLength: 1 type: string - name: task_id + name: payment_method_id in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateWalletPayment' + required: true responses: - '200': - description: Successful Response + '202': + description: Pay with payment-method content: application/json: - schema: {} - /v0/projects/{project_uuid}/checkpoint/{ref_id}/iterations: + schema: + $ref: '#/components/schemas/Envelope_WalletPaymentInitiated_' + /v0/wallets/{wallet_id}/auto-recharge: get: tags: - - projects - - metamodeling - summary: List Project Iterations - operationId: list_project_iterations + - wallets + summary: Get Wallet Autorecharge + operationId: get_wallet_autorecharge parameters: - required: true schema: - title: Project Uuid - type: string - format: uuid - name: project_uuid - in: path - - required: true - schema: - title: Ref Id - type: integer - name: ref_id - in: path - - required: false - schema: - title: Limit - exclusiveMaximum: true - minimum: 1 + title: Wallet Id + exclusiveMinimum: true type: integer - default: 20 - maximum: 50 - name: limit - in: query - - required: false - schema: - title: Offset minimum: 0 - type: integer - default: 0 - name: offset - in: query + name: wallet_id + in: path responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Page_ProjectIterationItem_' - /v0/projects/{project_uuid}/checkpoint/{ref_id}/iterations/-/results: - get: + $ref: '#/components/schemas/Envelope_GetWalletAutoRecharge_' + put: tags: - - projects - - metamodeling - summary: List Project Iterations Results - operationId: list_project_iterations_results + - wallets + summary: Replace Wallet Autorecharge + operationId: replace_wallet_autorecharge parameters: - required: true schema: - title: Project Uuid - type: string - format: uuid - name: project_uuid + title: Wallet Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: wallet_id in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ReplaceWalletAutoRecharge' + required: true + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_GetWalletAutoRecharge_' + /v0/wallets/{wallet_id}/groups/{group_id}: + put: + tags: + - wallets + - groups + summary: Update Wallet Group + operationId: update_wallet_group + parameters: - required: true schema: - title: Ref Id + title: Wallet Id + exclusiveMinimum: true type: integer - name: ref_id + minimum: 0 + name: wallet_id in: path - - required: false + - required: true schema: - title: Limit - exclusiveMaximum: true - minimum: 1 + title: Group Id + exclusiveMinimum: true type: integer - default: 20 - maximum: 50 - name: limit - in: query - - required: false - schema: - title: Offset minimum: 0 - type: integer - default: 0 - name: offset - in: query + name: group_id + in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_WalletsGroupsBodyParams' + required: true responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Page_ProjectIterationResultItem_' - /view: - get: + $ref: '#/components/schemas/Envelope_WalletGroupGet_' + post: tags: - - nih-sparc - summary: Get Redirection To Viewer - description: Opens a viewer in osparc for data in the NIH-sparc portal - operationId: get_redirection_to_viewer + - wallets + - groups + summary: Create Wallet Group + operationId: create_wallet_group parameters: - required: true schema: - title: File Type - type: string - name: file_type - in: query - - required: true - schema: - title: Viewer Key - pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ - type: string - name: viewer_key - in: query - - required: true - schema: - title: File Size + title: Wallet Id exclusiveMinimum: true type: integer minimum: 0 - name: file_size - in: query + name: wallet_id + in: path - required: true schema: - title: Download Link - maxLength: 2083 - minLength: 1 - type: string - format: uri - name: download_link - in: query - - required: false - schema: - title: File Name - type: string - default: unknown - name: file_name - in: query + title: Group Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: group_id + in: path requestBody: content: application/json: schema: - $ref: '#/components/schemas/ServiceKeyVersion' + $ref: '#/components/schemas/_WalletsGroupsBodyParams' required: true responses: - '302': - description: Opens osparc and starts viewer for selected data - /study/{id}: - get: + '201': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_WalletGroupGet_' + delete: tags: - - nih-sparc - summary: Get Redirection To Study Page - description: Opens a study published in osparc - operationId: get_redirection_to_study_page + - wallets + - groups + summary: Delete Wallet Group + operationId: delete_wallet_group parameters: - required: true schema: - title: Id - type: string - format: uuid - name: id + title: Wallet Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: wallet_id + in: path + - required: true + schema: + title: Group Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: group_id in: path responses: - '302': - description: Opens osparc and opens a copy of publised study - /v0/services: - get: - tags: - - nih-sparc - summary: List Latest Services - description: Returns a list latest version of services - operationId: list_latest_services - responses: - '200': + '204': description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.studies_dispatcher._rest_handlers.ServiceGet__' - /v0/viewers: + /v0/wallets/{wallet_id}/groups: get: tags: - - nih-sparc - summary: List Viewers - description: 'Lists all publically available viewers - - - Notice that this might contain multiple services for the same filetype - - - If file_type is provided, then it filters viewer for that filetype' - operationId: list_viewers + - wallets + - groups + summary: List Wallet Groups + operationId: list_wallet_groups parameters: - - required: false + - required: true schema: - title: File Type - type: string - name: file_type - in: query + title: Wallet Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: wallet_id + in: path responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.studies_dispatcher._rest_handlers.Viewer__' - /v0/viewers/default: + $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.wallets._groups_api.WalletGroupGet__' + /v0/activity/status: get: tags: - - nih-sparc - summary: List Default Viewers - description: 'Lists the default viewer for each supported filetype - - - This was interfaced as a subcollection of viewers because it is a very common - use-case - - - Only publicaly available viewers - - - If file_type is provided, then it filters viewer for that filetype' - operationId: list_default_viewers - parameters: - - required: false - schema: - title: File Type - type: string - name: file_type - in: query + - tasks + summary: Get Activity Status + operationId: get_activity_status responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.studies_dispatcher._rest_handlers.Viewer__' - /v0/credits-price: + $ref: '#/components/schemas/Envelope_dict_uuid.UUID__models_library.api_schemas_webserver.activity.Activity__' + /v0/announcements: get: tags: - - products - summary: Get Current Product Price - operationId: get_current_product_price + - announcements + summary: List Announcements + operationId: list_announcements responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_GetCreditPrice_' - /v0/products/{product_name}: + $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.announcements._models.Announcement__' + /v0/catalog/services/-/latest: get: tags: - - products - - po - summary: Get Product - operationId: get_product + - catalog + summary: List Services Latest + operationId: list_services_latest parameters: - - required: true + - required: false schema: - title: Product Name - anyOf: - - maxLength: 100 - minLength: 1 - type: string - - enum: - - current - type: string - name: product_name - in: path + title: Limit + exclusiveMaximum: true + minimum: 1 + type: integer + default: 20 + maximum: 50 + name: limit + in: query + - required: false + schema: + title: Offset + minimum: 0 + type: integer + default: 0 + name: offset + in: query responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_GetProduct_' - /v0/products/{product_name}/templates/{template_id}: - put: + $ref: '#/components/schemas/Page_CatalogServiceGet_' + /v0/catalog/services/{service_key}/{service_version}: + get: tags: - - products - - po - summary: Update Product Template - operationId: update_product_template + - catalog + summary: Get Service + operationId: get_service parameters: - required: true schema: - title: Product Name - anyOf: - - maxLength: 100 - minLength: 1 - type: string - - enum: - - current - type: string - name: product_name + title: Service Key + pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ + type: string + name: service_key in: path - required: true schema: - title: Template Id - maxLength: 100 - minLength: 1 + title: Service Version + pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ type: string - name: template_id + name: service_version in: path - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateProductTemplate' - required: true responses: - '204': + '200': description: Successful Response - /v0/invitation:generate: - post: + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_CatalogServiceGet_' + patch: tags: - - products - - po - summary: Generate Invitation - operationId: generate_invitation + - catalog + summary: Update Service + operationId: update_service + parameters: + - required: true + schema: + title: Service Key + pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ + type: string + name: service_key + in: path + - required: true + schema: + title: Service Version + pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ + type: string + name: service_version + in: path requestBody: content: application/json: schema: - $ref: '#/components/schemas/GenerateInvitation' + $ref: '#/components/schemas/CatalogServiceUpdate' required: true responses: '200': @@ -2073,27 +1926,27 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_InvitationGenerated_' - /v0/projects/{project_id}/nodes/{node_id}/pricing-unit: + $ref: '#/components/schemas/Envelope_CatalogServiceGet_' + /v0/catalog/services/{service_key}/{service_version}/inputs: get: tags: - - projects - summary: Get currently connected pricing unit to the project node. - operationId: get_project_node_pricing_unit + - catalog + summary: List Service Inputs + operationId: list_service_inputs parameters: - required: true schema: - title: Project Id + title: Service Key + pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ type: string - format: uuid - name: project_id + name: service_key in: path - required: true schema: - title: Node Id + title: Service Version + pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ type: string - format: uuid - name: node_id + name: service_version in: path responses: '200': @@ -2101,77 +1954,83 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_Union_PricingUnitGet__NoneType__' - /v0/projects/{project_id}/nodes/{node_id}/pricing-plan/{pricing_plan_id}/pricing-unit/{pricing_unit_id}: - put: + $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_webserver.catalog.ServiceInputGet__' + /v0/catalog/services/{service_key}/{service_version}/inputs/{input_key}: + get: tags: - - projects - summary: Connect pricing unit to the project node (Project node can have only - one pricing unit) - operationId: connect_pricing_unit_to_project_node + - catalog + summary: Get Service Input + operationId: get_service_input parameters: - required: true schema: - title: Project Id + title: Service Key + pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ type: string - format: uuid - name: project_id + name: service_key in: path - required: true schema: - title: Node Id + title: Service Version + pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ type: string - format: uuid - name: node_id - in: path - - required: true - schema: - title: Pricing Plan Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: pricing_plan_id + name: service_version in: path - required: true schema: - title: Pricing Unit Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: pricing_unit_id + title: Input Key + pattern: ^[-_a-zA-Z0-9]+$ + type: string + name: input_key in: path responses: - '204': + '200': description: Successful Response - /v0/projects/{project_uuid}/comments: + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_ServiceInputGet_' + /v0/catalog/services/{service_key}/{service_version}/inputs:match: get: tags: - - projects - - comments - summary: Retrieve all comments for a specific project. - operationId: list_project_comments + - catalog + summary: Get Compatible Inputs Given Source Output + operationId: get_compatible_inputs_given_source_output parameters: - required: true schema: - title: Project Uuid + title: Service Key + pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ type: string - format: uuid - name: project_uuid + name: service_key in: path - - required: false + - required: true schema: - title: Limit - type: integer - default: 20 - name: limit + title: Service Version + pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ + type: string + name: service_version + in: path + - required: true + schema: + title: Fromservice + pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ + type: string + name: fromService in: query - - required: false + - required: true schema: - title: Offset - minimum: 0 - type: integer - default: 0 - name: offset + title: Fromversion + pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ + type: string + name: fromVersion + in: query + - required: true + schema: + title: Fromoutput + pattern: ^[-_a-zA-Z0-9]+$ + type: string + name: fromOutput in: query responses: '200': @@ -2179,57 +2038,62 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_models_library.projects_comments.ProjectsCommentsAPI__' - post: + $ref: '#/components/schemas/Envelope_list_models_library.services_types.ServicePortKey__' + /v0/catalog/services/{service_key}/{service_version}/outputs: + get: tags: - - projects - - comments - summary: Create a new comment for a specific project. The request body should - contain the comment contents and user information. - operationId: create_project_comment + - catalog + summary: List Service Outputs + operationId: list_service_outputs parameters: - required: true schema: - title: Project Uuid + title: Service Key + pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ type: string - format: uuid - name: project_uuid + name: service_key + in: path + - required: true + schema: + title: Service Version + pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ + type: string + name: service_version in: path - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/_ProjectCommentsBodyParams' - required: true responses: - '201': + '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_dict_Literal__comment_id____pydantic.types.PositiveInt__' - /v0/projects/{project_uuid}/comments/{comment_id}: + $ref: '#/components/schemas/Envelope_list_models_library.services_types.ServicePortKey__' + /v0/catalog/services/{service_key}/{service_version}/outputs/{output_key}: get: tags: - - projects - - comments - summary: Retrieve a specific comment by its ID within a project. - operationId: get_project_comment - parameters: - - required: true + - catalog + summary: Get Service Output + operationId: get_service_output + parameters: + - required: true schema: - title: Project Uuid + title: Service Key + pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ type: string - format: uuid - name: project_uuid + name: service_key in: path - required: true schema: - title: Comment Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: comment_id + title: Service Version + pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ + type: string + name: service_version + in: path + - required: true + schema: + title: Output Key + pattern: ^[-_a-zA-Z0-9]+$ + type: string + name: output_key in: path responses: '200': @@ -2237,219 +2101,240 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_ProjectsCommentsAPI_' - put: + $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_webserver.catalog.ServiceOutputGet__' + /v0/catalog/services/{service_key}/{service_version}/outputs:match: + get: tags: - - projects - - comments - summary: Update the contents of a specific comment for a project. The request - body should contain the updated comment contents. - operationId: update_project_comment + - catalog + summary: Get Compatible Outputs Given Target Input + operationId: get_compatible_outputs_given_target_input parameters: - required: true schema: - title: Project Uuid + title: Service Key + pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ type: string - format: uuid - name: project_uuid + name: service_key in: path - required: true schema: - title: Comment Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: comment_id + title: Service Version + pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ + type: string + name: service_version in: path - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/_ProjectCommentsBodyParams' - required: true + - required: true + schema: + title: Toservice + pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ + type: string + name: toService + in: query + - required: true + schema: + title: Toversion + pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ + type: string + name: toVersion + in: query + - required: true + schema: + title: Toinput + pattern: ^[-_a-zA-Z0-9]+$ + type: string + name: toInput + in: query responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_ProjectsCommentsAPI_' - delete: + $ref: '#/components/schemas/Envelope_list_models_library.services_types.ServicePortKey__' + /v0/catalog/services/{service_key}/{service_version}/resources: + get: tags: - - projects - - comments - summary: Delete a specific comment associated with a project. - operationId: delete_project_comment + - catalog + summary: Get Service Resources + operationId: get_service_resources parameters: - required: true schema: - title: Project Uuid + title: Service Key + pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ type: string - format: uuid - name: project_uuid + name: service_key in: path - required: true schema: - title: Comment Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: comment_id + title: Service Version + pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ + type: string + name: service_version in: path responses: - '204': + '200': description: Successful Response - /v0/projects: + content: + application/json: + schema: + title: Response Get Service Resources + type: object + /v0/catalog/services/{service_key}/{service_version}/pricing-plan: get: tags: - - projects - summary: List Projects - operationId: list_projects + - catalog + - pricing-plans + summary: Retrieve default pricing plan for provided service + operationId: get_service_pricing_plan parameters: - - description: Order by field (type|uuid|name|description|prj_owner|creation_date|last_change_date) - and direction (asc|desc). The default sorting order is ascending. - required: false - schema: - title: Order By - description: Order by field (type|uuid|name|description|prj_owner|creation_date|last_change_date) - and direction (asc|desc). The default sorting order is ascending. - default: '{"field": "last_change_date", "direction": "desc"}' - example: '{"field": "last_change_date", "direction": "desc"}' - name: order_by - in: query - - required: false + - required: true schema: - title: Limit - exclusiveMaximum: true - minimum: 1 - type: integer - default: 20 - maximum: 50 - name: limit - in: query - - required: false + title: Service Key + pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ + type: string + name: service_key + in: path + - required: true schema: - title: Offset - minimum: 0 - type: integer - default: 0 - name: offset - in: query - - required: false + title: Service Version + pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ + type: string + name: service_version + in: path + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_ServicePricingPlanGet_' + /v0/catalog/services/{service_key}/{service_version}/tags: + get: + tags: + - catalog + - tags + summary: List Service Tags + operationId: list_service_tags + parameters: + - required: true schema: - allOf: - - $ref: '#/components/schemas/ProjectTypeAPI' - default: all - name: type - in: query - - required: false + title: Service Key + pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ + type: string + name: service_key + in: path + - required: true schema: - title: Show Hidden - type: boolean - default: false - name: show_hidden - in: query - - required: false + title: Service Version + pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ + type: string + name: service_version + in: path + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.tags.schemas.TagGet__' + /v0/catalog/services/{service_key}/{service_version}/tags/{tag_id}:add: + post: + tags: + - catalog + - tags + summary: Add Service Tag + operationId: add_service_tag + parameters: + - required: true schema: - title: Search - maxLength: 100 + title: Service Key + pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ type: string - name: search - in: query - - required: false + name: service_key + in: path + - required: true schema: - title: Folder Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: folder_id - in: query - - required: false + title: Service Version + pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ + type: string + name: service_version + in: path + - required: true schema: - title: Workspace Id + title: Tag Id exclusiveMinimum: true type: integer minimum: 0 - name: workspace_id - in: query + name: tag_id + in: path responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Page_ProjectListItem_' + $ref: '#/components/schemas/Envelope_CatalogServiceGet_' + /v0/catalog/services/{service_key}/{service_version}/tags/{tag_id}:remove: post: tags: - - projects - summary: Creates a new project or copies an existing one - operationId: create_project + - catalog + - tags + summary: Remove Service Tag + operationId: remove_service_tag parameters: - - required: false + - required: true schema: - title: From Study + title: Service Key + pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ type: string - format: uuid - name: from_study - in: query - - required: false - schema: - title: As Template - type: boolean - default: false - name: as_template - in: query - - required: false - schema: - title: Copy Data - type: boolean - default: true - name: copy_data - in: query - - required: false - schema: - title: Hidden - type: boolean - default: false - name: hidden - in: query - - required: false - schema: - title: X-Simcore-User-Agent - type: string - default: undefined - name: x-simcore-user-agent - in: header - - description: Optionally sets a parent project UUID (both project and node - must be set) - required: false + name: service_key + in: path + - required: true schema: - title: X-Simcore-Parent-Project-Uuid + title: Service Version + pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$ type: string - description: Optionally sets a parent project UUID (both project and node - must be set) - format: uuid - name: x-simcore-parent-project-uuid - in: header - - description: Optionally sets a parent node ID (both project and node must - be set) - required: false + name: service_version + in: path + - required: true schema: - title: X-Simcore-Parent-Node-Id - type: string - description: Optionally sets a parent node ID (both project and node must - be set) - format: uuid - name: x-simcore-parent-node-id - in: header + title: Tag Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: tag_id + in: path + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_CatalogServiceGet_' + /v0/clusters: + get: + tags: + - clusters + summary: List Clusters + operationId: list_clusters + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_webserver.clusters.ClusterGet__' + post: + tags: + - clusters + summary: Create Cluster + operationId: create_cluster requestBody: content: application/json: schema: - title: ' Create' - anyOf: - - $ref: '#/components/schemas/ProjectCreateNew' - - $ref: '#/components/schemas/ProjectCopyOverride' + $ref: '#/components/schemas/ClusterCreate' required: true responses: '201': @@ -2457,67 +2342,78 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_TaskGet_' - /v0/projects/active: + $ref: '#/components/schemas/Envelope_ClusterGet_' + /v0/clusters:ping: + post: + tags: + - clusters + summary: Ping Cluster + description: Test connectivity with cluster + operationId: ping_cluster + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ClusterPing' + required: true + responses: + '204': + description: Successful Response + /v0/clusters/{cluster_id}: get: tags: - - projects - summary: Get Active Project - operationId: get_active_project + - clusters + summary: Get Cluster + operationId: get_cluster parameters: - required: true schema: - title: Client Session Id - type: string - name: client_session_id - in: query + title: Cluster Id + minimum: 0 + type: integer + name: cluster_id + in: path responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_ProjectGet_' - /v0/projects/{project_id}: - get: + $ref: '#/components/schemas/Envelope_ClusterGet_' + delete: tags: - - projects - summary: Get Project - operationId: get_project + - clusters + summary: Delete Cluster + operationId: delete_cluster parameters: - required: true schema: - title: Project Id - type: string - format: uuid - name: project_id + title: Cluster Id + minimum: 0 + type: integer + name: cluster_id in: path responses: - '200': + '204': description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_ProjectGet_' - put: + patch: tags: - - projects - summary: Replace Project - description: Replaces (i.e. full update) a project resource - operationId: replace_project + - clusters + summary: Update Cluster + operationId: update_cluster parameters: - required: true schema: - title: Project Id - type: string - format: uuid - name: project_id + title: Cluster Id + minimum: 0 + type: integer + name: cluster_id in: path requestBody: content: application/json: schema: - $ref: '#/components/schemas/ProjectReplace' + $ref: '#/components/schemas/ClusterPatch' required: true responses: '200': @@ -2525,51 +2421,53 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_ProjectGet_' - delete: + $ref: '#/components/schemas/Envelope_ClusterGet_' + /v0/clusters/{cluster_id}/details: + get: tags: - - projects - summary: Delete Project - operationId: delete_project + - clusters + summary: Get Cluster Details + operationId: get_cluster_details parameters: - required: true schema: - title: Project Id - type: string - format: uuid - name: project_id + title: Cluster Id + minimum: 0 + type: integer + name: cluster_id in: path responses: - '204': + '200': description: Successful Response - patch: + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_ClusterDetails_' + /v0/clusters/{cluster_id}:ping: + post: tags: - - projects - summary: Patch Project - operationId: patch_project + - clusters + summary: Ping Cluster Cluster Id + description: Tests connectivity with cluster + operationId: ping_cluster_cluster_id parameters: - required: true schema: - title: Project Id - type: string - format: uuid - name: project_id + title: Cluster Id + minimum: 0 + type: integer + name: cluster_id in: path - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ProjectPatch' - required: true responses: '204': description: Successful Response - /v0/projects/{project_id}:clone: - post: + /v0/computations/{project_id}: + get: tags: + - computations - projects - summary: Clone Project - operationId: clone_project + summary: Get Computation + operationId: get_computation parameters: - required: true schema: @@ -2579,18 +2477,19 @@ paths: name: project_id in: path responses: - '201': + '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_TaskGet_' - /v0/projects/{project_id}/inactivity: - get: + $ref: '#/components/schemas/Envelope_ComputationTaskGet_' + /v0/computations/{project_id}:start: + post: tags: + - computations - projects - summary: Get Project Inactivity - operationId: get_project_inactivity + summary: Start Computation + operationId: start_computation parameters: - required: true schema: @@ -2599,20 +2498,39 @@ paths: format: uuid name: project_id in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ComputationStart' + required: true responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_GetProjectInactivityResponse_' - /v0/projects/{project_id}/groups/{group_id}: - put: - tags: - - projects - summary: Replace Project Group - operationId: replace_project_group - parameters: + $ref: '#/components/schemas/Envelope__ComputationStarted_' + '402': + description: Insufficient credits to run computation + '404': + description: Project/wallet/pricing details were not found + '406': + description: Cluster not found + '409': + description: Project already started + '422': + description: Configuration error + '503': + description: Service not available + /v0/computations/{project_id}:stop: + post: + tags: + - computations + - projects + summary: Stop Computation + operationId: stop_computation + parameters: - required: true schema: title: Project Id @@ -2620,53 +2538,96 @@ paths: format: uuid name: project_id in: path - - required: true - schema: - title: Group Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: group_id - in: path - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/_ProjectsGroupsBodyParams' - required: true responses: - '200': + '204': description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_ProjectGroupGet_' + /v0/projects/{project_id}:xport: post: tags: - projects - summary: Create Project Group - operationId: create_project_group + - exporter + summary: Export Project + description: creates an archive of the project and downloads it + operationId: export_project parameters: - required: true schema: title: Project Id type: string - format: uuid name: project_id in: path - - required: true + responses: + '200': + description: Successful Response + /v0/folders: + get: + tags: + - folders + summary: List Folders + operationId: list_folders + parameters: + - required: false schema: - title: Group Id + title: Folder Id exclusiveMinimum: true type: integer minimum: 0 - name: group_id - in: path + name: folder_id + in: query + - required: false + schema: + title: Workspace Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: workspace_id + in: query + - description: Order by field (modified_at|name|description) and direction (asc|desc). + The default sorting order is ascending. + required: false + schema: + title: Order By + description: Order by field (modified_at|name|description) and direction + (asc|desc). The default sorting order is ascending. + default: '{"field": "modified_at", "direction": "desc"}' + example: '{"field": "name", "direction": "desc"}' + name: order_by + in: query + - required: false + schema: + title: Limit + exclusiveMaximum: true + minimum: 1 + type: integer + default: 20 + maximum: 50 + name: limit + in: query + - required: false + schema: + title: Offset + minimum: 0 + type: integer + default: 0 + name: offset + in: query + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_webserver.folders_v2.FolderGet__' + post: + tags: + - folders + summary: Create Folder + operationId: create_folder requestBody: content: application/json: schema: - $ref: '#/components/schemas/_ProjectsGroupsBodyParams' + $ref: '#/components/schemas/CreateFolderBodyParams' required: true responses: '201': @@ -2674,67 +2635,62 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_ProjectGroupGet_' - delete: + $ref: '#/components/schemas/Envelope_FolderGet_' + /v0/folders/{folder_id}: + get: tags: - - projects - summary: Delete Project Group - operationId: delete_project_group + - folders + summary: Get Folder + operationId: get_folder parameters: - required: true schema: - title: Project Id - type: string - format: uuid - name: project_id - in: path - - required: true - schema: - title: Group Id + title: Folder Id exclusiveMinimum: true type: integer minimum: 0 - name: group_id + name: folder_id in: path responses: - '204': + '200': description: Successful Response - /v0/projects/{project_id}/groups: - get: + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_FolderGet_' + put: tags: - - projects - summary: List Project Groups - operationId: list_project_groups + - folders + summary: Replace Folder + operationId: replace_folder parameters: - required: true schema: - title: Project Id - type: string - format: uuid - name: project_id + title: Folder Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: folder_id in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PutFolderBodyParams' + required: true responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.projects._groups_api.ProjectGroupGet__' - /v0/projects/{project_id}/folders/{folder_id}: - put: + $ref: '#/components/schemas/Envelope_FolderGet_' + delete: tags: - - projects - folders - summary: Move project to the folder - operationId: replace_project_folder + summary: Delete Folder + operationId: delete_folder parameters: - - required: true - schema: - title: Project Id - type: string - format: uuid - name: project_id - in: path - required: true schema: title: Folder Id @@ -2746,526 +2702,494 @@ paths: responses: '204': description: Successful Response - /v0/projects/{project_id}/metadata: + /v0/tasks: get: tags: - - projects - - metadata - summary: Get Project Metadata - operationId: get_project_metadata - parameters: - - required: true - schema: - title: Project Id - type: string - format: uuid - name: project_id - in: path + - long-running-tasks + summary: List Tasks + operationId: list_tasks responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_ProjectMetadataGet_' - patch: + $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_long_running_tasks.tasks.TaskGet__' + /v0/tasks/{task_id}: + get: tags: - - projects - - metadata - summary: Update Project Metadata - operationId: update_project_metadata + - long-running-tasks + summary: Get Task Status + operationId: get_task_status parameters: - required: true schema: - title: Project Id + title: Task Id type: string - format: uuid - name: project_id + name: task_id in: path - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ProjectMetadataUpdate' - required: true responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_ProjectMetadataGet_' - /v0/projects/{project_id}/nodes: - post: + $ref: '#/components/schemas/Envelope_TaskStatus_' + delete: tags: - - projects - - nodes - summary: Create Node - operationId: create_node + - long-running-tasks + summary: Cancel And Delete Task + operationId: cancel_and_delete_task parameters: - required: true schema: - title: Project Id + title: Task Id type: string - name: project_id + name: task_id in: path - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/NodeCreate' - required: true responses: - '201': + '204': description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_NodeCreated_' - /v0/projects/{project_id}/nodes/{node_id}: + /v0/tasks/{task_id}/result: get: tags: - - projects - - nodes - summary: Get Node - operationId: get_node + - long-running-tasks + summary: Get Task Result + operationId: get_task_result parameters: - required: true schema: - title: Project Id - type: string - name: project_id - in: path - - required: true - schema: - title: Node Id + title: Task Id type: string - name: node_id + name: task_id in: path responses: '200': description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/Envelope_Union_NodeGetIdle__NodeGetUnknown__RunningDynamicServiceDetails__NodeGet__' - delete: + schema: {} + /v0/projects/{project_uuid}/checkpoint/{ref_id}/iterations: + get: tags: - projects - - nodes - summary: Delete Node - operationId: delete_node + - metamodeling + summary: List Project Iterations + operationId: list_project_iterations parameters: - required: true schema: - title: Project Id + title: Project Uuid type: string - name: project_id + format: uuid + name: project_uuid in: path - required: true schema: - title: Node Id - type: string - name: node_id + title: Ref Id + type: integer + name: ref_id in: path + - required: false + schema: + title: Limit + exclusiveMaximum: true + minimum: 1 + type: integer + default: 20 + maximum: 50 + name: limit + in: query + - required: false + schema: + title: Offset + minimum: 0 + type: integer + default: 0 + name: offset + in: query responses: - '204': + '200': description: Successful Response - patch: + content: + application/json: + schema: + $ref: '#/components/schemas/Page_ProjectIterationItem_' + /v0/projects/{project_uuid}/checkpoint/{ref_id}/iterations/-/results: + get: tags: - projects - - nodes - summary: Patch Project Node - operationId: patch_project_node + - metamodeling + summary: List Project Iterations Results + operationId: list_project_iterations_results parameters: - required: true schema: - title: Project Id + title: Project Uuid type: string format: uuid - name: project_id + name: project_uuid in: path - required: true schema: - title: Node Id - type: string - name: node_id + title: Ref Id + type: integer + name: ref_id in: path - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/NodePatch' - required: true + - required: false + schema: + title: Limit + exclusiveMaximum: true + minimum: 1 + type: integer + default: 20 + maximum: 50 + name: limit + in: query + - required: false + schema: + title: Offset + minimum: 0 + type: integer + default: 0 + name: offset + in: query responses: - '204': + '200': description: Successful Response - /v0/projects/{project_id}/nodes/{node_id}:retrieve: - post: + content: + application/json: + schema: + $ref: '#/components/schemas/Page_ProjectIterationResultItem_' + /v0/services: + get: tags: - - projects - - nodes - summary: Retrieve Node - operationId: retrieve_node - parameters: - - required: true - schema: - title: Project Id - type: string - name: project_id - in: path - - required: true - schema: - title: Node Id - type: string - name: node_id - in: path - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/NodeRetrieve' - required: true + - nih-sparc + summary: List Latest Services + description: Returns a list latest version of services + operationId: list_latest_services responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_NodeRetrieved_' - /v0/projects/{project_id}/nodes/{node_id}:start: - post: + $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.studies_dispatcher._rest_handlers.ServiceGet__' + /v0/viewers: + get: tags: - - projects - - nodes - summary: Start Node - operationId: start_node + - nih-sparc + summary: List Viewers + description: 'Lists all publically available viewers + + + Notice that this might contain multiple services for the same filetype + + + If file_type is provided, then it filters viewer for that filetype' + operationId: list_viewers parameters: - - required: true - schema: - title: Project Id - type: string - name: project_id - in: path - - required: true + - required: false schema: - title: Node Id + title: File Type type: string - name: node_id - in: path + name: file_type + in: query responses: - '204': + '200': description: Successful Response - /v0/projects/{project_id}/nodes/{node_id}:stop: - post: + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.studies_dispatcher._rest_handlers.Viewer__' + /v0/viewers/default: + get: tags: - - projects - - nodes - summary: Stop Node - operationId: stop_node + - nih-sparc + summary: List Default Viewers + description: 'Lists the default viewer for each supported filetype + + + This was interfaced as a subcollection of viewers because it is a very common + use-case + + + Only publicaly available viewers + + + If file_type is provided, then it filters viewer for that filetype' + operationId: list_default_viewers parameters: - - required: true - schema: - title: Project Id - type: string - name: project_id - in: path - - required: true + - required: false schema: - title: Node Id + title: File Type type: string - name: node_id - in: path + name: file_type + in: query responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_TaskGet_' - /v0/projects/{project_id}/nodes/{node_id}:restart: - post: + $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.studies_dispatcher._rest_handlers.Viewer__' + /view: + get: tags: - - projects - - nodes - summary: Restart Node - description: Note that it has only effect on nodes associated to dynamic services - operationId: restart_node + - nih-sparc + summary: Get Redirection To Viewer + description: Opens a viewer in osparc for data in the NIH-sparc portal + operationId: get_redirection_to_viewer parameters: - required: true schema: - title: Project Id + title: File Type type: string - name: project_id - in: path + name: file_type + in: query - required: true schema: - title: Node Id + title: Viewer Key + pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$ type: string - name: node_id - in: path - responses: - '204': - description: Successful Response - /v0/projects/{project_id}/nodes/{node_id}/outputs: - patch: - tags: - - projects - - nodes - summary: Update Node Outputs - operationId: update_node_outputs - parameters: + name: viewer_key + in: query - required: true schema: - title: Project Id - type: string - name: project_id - in: path + title: File Size + exclusiveMinimum: true + type: integer + minimum: 0 + name: file_size + in: query - required: true schema: - title: Node Id + title: Download Link + maxLength: 2083 + minLength: 1 type: string - name: node_id - in: path + format: uri + name: download_link + in: query + - required: false + schema: + title: File Name + type: string + default: unknown + name: file_name + in: query requestBody: content: application/json: schema: - $ref: '#/components/schemas/NodeOutputs' + $ref: '#/components/schemas/ServiceKeyVersion' required: true responses: - '204': - description: Successful Response - /v0/projects/{project_id}/nodes/{node_id}/resources: + '302': + description: Opens osparc and starts viewer for selected data + /study/{id}: get: tags: - - projects - - nodes - summary: Get Node Resources - operationId: get_node_resources + - nih-sparc + summary: Get Redirection To Study Page + description: Opens a study published in osparc + operationId: get_redirection_to_study_page parameters: - required: true schema: - title: Project Id - type: string - name: project_id - in: path - - required: true - schema: - title: Node Id + title: Id type: string - name: node_id + format: uuid + name: id in: path responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_dict_models_library.docker.DockerGenericTag__models_library.services_resources.ImageResources__' - put: + '302': + description: Opens osparc and opens a copy of publised study + /v0/projects: + get: tags: - projects - - nodes - summary: Replace Node Resources - operationId: replace_node_resources + summary: List Projects + operationId: list_projects parameters: - - required: true + - description: Order by field (type|uuid|name|description|prj_owner|creation_date|last_change_date) + and direction (asc|desc). The default sorting order is ascending. + required: false schema: - title: Project Id - type: string - name: project_id - in: path - - required: true + title: Order By + description: Order by field (type|uuid|name|description|prj_owner|creation_date|last_change_date) + and direction (asc|desc). The default sorting order is ascending. + default: '{"field": "last_change_date", "direction": "desc"}' + example: '{"field": "last_change_date", "direction": "desc"}' + name: order_by + in: query + - required: false schema: - title: Node Id - type: string - name: node_id - in: path - requestBody: - content: - application/json: - schema: - title: ' New' - type: object - additionalProperties: - $ref: '#/components/schemas/ImageResources' - required: true - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_dict_models_library.docker.DockerGenericTag__models_library.services_resources.ImageResources__' - /v0/projects/{project_id}/nodes/-/services:access: - get: - tags: - - projects - - nodes - summary: Check whether provided group has access to the project services - operationId: get_project_services_access_for_gid - parameters: - - required: true + title: Limit + exclusiveMaximum: true + minimum: 1 + type: integer + default: 20 + maximum: 50 + name: limit + in: query + - required: false schema: - title: Project Id + title: Offset + minimum: 0 + type: integer + default: 0 + name: offset + in: query + - required: false + schema: + allOf: + - $ref: '#/components/schemas/ProjectTypeAPI' + default: all + name: type + in: query + - required: false + schema: + title: Show Hidden + type: boolean + default: false + name: show_hidden + in: query + - required: false + schema: + title: Search + maxLength: 100 type: string - format: uuid - name: project_id - in: path - - required: true + name: search + in: query + - required: false schema: - title: For Gid + title: Folder Id exclusiveMinimum: true type: integer minimum: 0 - name: for_gid + name: folder_id in: query - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope__ProjectGroupAccess_' - /v0/projects/{project_id}/nodes/-/preview: - get: - tags: - - projects - - nodes - summary: Lists all previews in the node's project - operationId: list_project_nodes_previews - parameters: - - required: true + - required: false schema: - title: Project Id - type: string - format: uuid - name: project_id - in: path + title: Workspace Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: workspace_id + in: query responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.projects._nodes_handlers._ProjectNodePreview__' - /v0/projects/{project_id}/nodes/{node_id}/preview: - get: + $ref: '#/components/schemas/Page_ProjectListItem_' + post: tags: - projects - - nodes - summary: Gets a give node's preview - operationId: get_project_node_preview + summary: Creates a new project or copies an existing one + operationId: create_project parameters: - - required: true + - required: false schema: - title: Project Id + title: From Study type: string format: uuid - name: project_id - in: path - - required: true + name: from_study + in: query + - required: false schema: - title: Node Id + title: As Template + type: boolean + default: false + name: as_template + in: query + - required: false + schema: + title: Copy Data + type: boolean + default: true + name: copy_data + in: query + - required: false + schema: + title: Hidden + type: boolean + default: false + name: hidden + in: query + - required: false + schema: + title: X-Simcore-User-Agent type: string - format: uuid - name: node_id - in: path - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope__ProjectNodePreview_' - '404': - description: Node has no preview - /v0/projects/{project_id}/inputs: - get: - tags: - - projects - - ports - summary: Get Project Inputs - description: New in version *0.10* - operationId: get_project_inputs - parameters: - - required: true + default: undefined + name: x-simcore-user-agent + in: header + - description: Optionally sets a parent project UUID (both project and node + must be set) + required: false schema: - title: Project Id + title: X-Simcore-Parent-Project-Uuid type: string + description: Optionally sets a parent project UUID (both project and node + must be set) format: uuid - name: project_id - in: path - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_dict_uuid.UUID__models_library.api_schemas_webserver.projects_ports.ProjectInputGet__' - patch: - tags: - - projects - - ports - summary: Update Project Inputs - description: New in version *0.10* - operationId: update_project_inputs - parameters: - - required: true + name: x-simcore-parent-project-uuid + in: header + - description: Optionally sets a parent node ID (both project and node must + be set) + required: false schema: - title: Project Id + title: X-Simcore-Parent-Node-Id type: string + description: Optionally sets a parent node ID (both project and node must + be set) format: uuid - name: project_id - in: path + name: x-simcore-parent-node-id + in: header requestBody: content: application/json: schema: - title: ' Updates' - type: array - items: - $ref: '#/components/schemas/ProjectInputUpdate' + title: ' Create' + anyOf: + - $ref: '#/components/schemas/ProjectCreateNew' + - $ref: '#/components/schemas/ProjectCopyOverride' required: true responses: - '200': + '201': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_dict_uuid.UUID__models_library.api_schemas_webserver.projects_ports.ProjectInputGet__' - /v0/projects/{project_id}/outputs: + $ref: '#/components/schemas/Envelope_TaskGet_' + /v0/projects/active: get: tags: - projects - - ports - summary: Get Project Outputs - description: New in version *0.10* - operationId: get_project_outputs + summary: Get Active Project + operationId: get_active_project parameters: - required: true schema: - title: Project Id + title: Client Session Id type: string - format: uuid - name: project_id - in: path + name: client_session_id + in: query responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_dict_uuid.UUID__models_library.api_schemas_webserver.projects_ports.ProjectOutputGet__' - /v0/projects/{project_id}/metadata/ports: + $ref: '#/components/schemas/Envelope_ProjectGet_' + /v0/projects/{project_id}: get: tags: - projects - - ports - summary: List Project Metadata Ports - description: New in version *0.12* - operationId: list_project_metadata_ports + summary: Get Project + operationId: get_project parameters: - required: true schema: @@ -3280,13 +3204,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.projects._ports_handlers.ProjectMetadataPortGet__' - /v0/projects/{project_id}:open: - post: + $ref: '#/components/schemas/Envelope_ProjectGet_' + put: tags: - projects - summary: Open Project - operationId: open_project + summary: Replace Project + description: Replaces (i.e. full update) a project resource + operationId: replace_project parameters: - required: true schema: @@ -3295,19 +3219,11 @@ paths: format: uuid name: project_id in: path - - required: false - schema: - title: Disable Service Auto Start - type: boolean - default: false - name: disable_service_auto_start - in: query requestBody: content: application/json: schema: - title: Client Session Id - type: string + $ref: '#/components/schemas/ProjectReplace' required: true responses: '200': @@ -3316,26 +3232,27 @@ paths: application/json: schema: $ref: '#/components/schemas/Envelope_ProjectGet_' - '400': - description: ValidationError - '402': - description: WalletNotEnoughCreditsError - '403': - description: ProjectInvalidRightsError - '404': - description: UserDefaultWalletNotFoundError, ProjectNotFoundError - '409': - description: ProjectTooManyProjectOpenedError - '422': - description: ValidationError - '503': - description: DirectorServiceError - /v0/projects/{project_id}:close: - post: + delete: tags: - projects - summary: Close Project - operationId: close_project + summary: Delete Project + operationId: delete_project + parameters: + - required: true + schema: + title: Project Id + type: string + format: uuid + name: project_id + in: path + responses: + '204': + description: Successful Response + patch: + tags: + - projects + summary: Patch Project + operationId: patch_project parameters: - required: true schema: @@ -3348,18 +3265,17 @@ paths: content: application/json: schema: - title: Client Session Id - type: string + $ref: '#/components/schemas/ProjectPatch' required: true responses: '204': description: Successful Response - /v0/projects/{project_id}/state: - get: + /v0/projects/{project_id}:clone: + post: tags: - projects - summary: Get Project State - operationId: get_project_state + summary: Clone Project + operationId: clone_project parameters: - required: true schema: @@ -3369,33 +3285,25 @@ paths: name: project_id in: path responses: - '200': + '201': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_ProjectState_' - /v0/projects/{project_uuid}/tags/{tag_id}: - put: + $ref: '#/components/schemas/Envelope_TaskGet_' + /v0/projects/{project_id}/inactivity: + get: tags: - projects - - tags - summary: Add Tag - description: Links an existing label with an existing study - operationId: add_tag + summary: Get Project Inactivity + operationId: get_project_inactivity parameters: - required: true schema: - title: Project Uuid + title: Project Id type: string format: uuid - name: project_uuid - in: path - - required: true - schema: - title: Tag Id - type: integer - name: tag_id + name: project_id in: path responses: '200': @@ -3403,14 +3311,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_ProjectGet_' - delete: + $ref: '#/components/schemas/Envelope_GetProjectInactivityResponse_' + /v0/projects/{project_uuid}/comments: + get: tags: - projects - - tags - summary: Remove Tag - description: Removes an existing link between a label and a study - operationId: remove_tag + - comments + summary: Retrieve all comments for a specific project. + operationId: list_project_comments parameters: - required: true schema: @@ -3419,61 +3327,78 @@ paths: format: uuid name: project_uuid in: path - - required: true + - required: false schema: - title: Tag Id + title: Limit type: integer - name: tag_id - in: path + default: 20 + name: limit + in: query + - required: false + schema: + title: Offset + minimum: 0 + type: integer + default: 0 + name: offset + in: query responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_ProjectGet_' - /v0/projects/{project_id}/wallet: - get: + $ref: '#/components/schemas/Envelope_list_models_library.projects_comments.ProjectsCommentsAPI__' + post: tags: - projects - summary: Get current connected wallet to the project. - operationId: get_project_wallet + - comments + summary: Create a new comment for a specific project. The request body should + contain the comment contents and user information. + operationId: create_project_comment parameters: - required: true schema: - title: Project Id + title: Project Uuid type: string format: uuid - name: project_id + name: project_uuid in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_ProjectCommentsBodyParams' + required: true responses: - '200': + '201': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_Union_WalletGet__NoneType__' - /v0/projects/{project_id}/wallet/{wallet_id}: - put: + $ref: '#/components/schemas/Envelope_dict_Literal__comment_id____pydantic.types.PositiveInt__' + /v0/projects/{project_uuid}/comments/{comment_id}: + get: tags: - projects - summary: Connect wallet to the project (Project can have only one wallet) - operationId: connect_wallet_to_project + - comments + summary: Retrieve a specific comment by its ID within a project. + operationId: get_project_comment parameters: - required: true schema: - title: Project Id + title: Project Uuid type: string format: uuid - name: project_id + name: project_uuid in: path - required: true schema: - title: Wallet Id + title: Comment Id exclusiveMinimum: true type: integer minimum: 0 - name: wallet_id + name: comment_id in: path responses: '200': @@ -3481,338 +3406,307 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_WalletGet_' - /v0/projects/{project_id}/workspaces/{workspace_id}: + $ref: '#/components/schemas/Envelope_ProjectsCommentsAPI_' put: tags: - projects - - workspaces - summary: Move project to the workspace - operationId: replace_project_workspace + - comments + summary: Update the contents of a specific comment for a project. The request + body should contain the updated comment contents. + operationId: update_project_comment parameters: - required: true schema: - title: Project Id + title: Project Uuid type: string format: uuid - name: project_id - in: path - - required: true - schema: - title: Workspace Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: workspace_id + name: project_uuid in: path - responses: - '204': - description: Successful Response - /v0/publications/service-submission: - post: - tags: - - publication - summary: Service Submission - description: Submits files with new service candidate - operationId: service_submission - requestBody: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/Body_service_submission' - required: true - responses: - '204': - description: Successful Response - /v0/services/-/resource-usages: - get: - tags: - - usage - summary: Retrieve finished and currently running user services (user and product - are taken from context, optionally wallet_id parameter might be provided). - operationId: list_resource_usage_services - parameters: - - description: Order by field (wallet_id|wallet_name|user_id|project_id|project_name|node_id|node_name|service_key|service_version|service_type|started_at|stopped_at|service_run_status|credit_cost|transaction_status) - and direction (asc|desc). The default sorting order is ascending. - required: false - schema: - title: Order By - description: Order by field (wallet_id|wallet_name|user_id|project_id|project_name|node_id|node_name|service_key|service_version|service_type|started_at|stopped_at|service_run_status|credit_cost|transaction_status) - and direction (asc|desc). The default sorting order is ascending. - default: '{"field": "started_at", "direction": "desc"}' - example: '{"field": "started_at", "direction": "desc"}' - name: order_by - in: query - - description: Filters to process on the resource usages list, encoded as JSON. - Currently supports the filtering of 'started_at' field with 'from' and 'until' - parameters in ISO 8601 format. The date range specified is - inclusive. - required: false - schema: - title: Filters - type: string - description: Filters to process on the resource usages list, encoded as - JSON. Currently supports the filtering of 'started_at' field with 'from' - and 'until' parameters in ISO 8601 format. The date range - specified is inclusive. - format: json-string - example: '{"started_at": {"from": "yyyy-mm-dd", "until": "yyyy-mm-dd"}}' - name: filters - in: query - - required: false - schema: - title: Wallet Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: wallet_id - in: query - - required: false + - required: true schema: - title: Limit + title: Comment Id + exclusiveMinimum: true type: integer - default: 20 - name: limit - in: query - - required: false - schema: - title: Offset minimum: 0 - type: integer - default: 0 - name: offset - in: query + name: comment_id + in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_ProjectCommentsBodyParams' + required: true responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_webserver.resource_usage.ServiceRunGet__' - /v0/services/-/aggregated-usages: - get: + $ref: '#/components/schemas/Envelope_ProjectsCommentsAPI_' + delete: tags: - - usage - summary: Used credits based on aggregate by type, currently supported `services`. - (user and product are taken from context, optionally wallet_id parameter might - be provided). - operationId: list_osparc_credits_aggregated_usages + - projects + - comments + summary: Delete a specific comment associated with a project. + operationId: delete_project_comment parameters: - required: true schema: - $ref: '#/components/schemas/ServicesAggregatedUsagesType' - name: aggregated_by - in: query + title: Project Uuid + type: string + format: uuid + name: project_uuid + in: path - required: true schema: - $ref: '#/components/schemas/ServicesAggregatedUsagesTimePeriod' - name: time_period - in: query + title: Comment Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: comment_id + in: path + responses: + '204': + description: Successful Response + /v0/projects/{project_id}/folders/{folder_id}: + put: + tags: + - projects + - folders + summary: Move project to the folder + operationId: replace_project_folder + parameters: - required: true schema: - title: Wallet Id + title: Project Id + type: string + format: uuid + name: project_id + in: path + - required: true + schema: + title: Folder Id exclusiveMinimum: true type: integer minimum: 0 - name: wallet_id - in: query - - required: false + name: folder_id + in: path + responses: + '204': + description: Successful Response + /v0/projects/{project_id}/groups/{group_id}: + put: + tags: + - projects + - groups + summary: Replace Project Group + operationId: replace_project_group + parameters: + - required: true schema: - title: Limit - type: integer - default: 20 - name: limit - in: query - - required: false + title: Project Id + type: string + format: uuid + name: project_id + in: path + - required: true schema: - title: Offset - minimum: 0 + title: Group Id + exclusiveMinimum: true type: integer - default: 0 - name: offset - in: query + minimum: 0 + name: group_id + in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_ProjectsGroupsBodyParams' + required: true responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_webserver.resource_usage.ServiceRunGet__' - /v0/services/-/usage-report: - get: + $ref: '#/components/schemas/Envelope_ProjectGroupGet_' + post: tags: - - usage - summary: Redirects to download CSV link. CSV obtains finished and currently - running user services (user and product are taken from context, optionally - wallet_id parameter might be provided). - operationId: export_resource_usage_services + - projects + - groups + summary: Create Project Group + operationId: create_project_group parameters: - - required: false - schema: - title: Order By - default: '{"field": "started_at", "direction": "desc"}' - example: '{"field": "started_at", "direction": "desc"}' - name: order_by - in: query - - description: Order by field (wallet_id|wallet_name|user_id|project_id|project_name|node_id|node_name|service_key|service_version|service_type|started_at|stopped_at|service_run_status|credit_cost|transaction_status) - and direction (asc|desc). The default sorting order is ascending. - required: false + - required: true schema: - title: Filters + title: Project Id type: string - description: Order by field (wallet_id|wallet_name|user_id|project_id|project_name|node_id|node_name|service_key|service_version|service_type|started_at|stopped_at|service_run_status|credit_cost|transaction_status) - and direction (asc|desc). The default sorting order is ascending. - format: json-string - example: '{"started_at": {"from": "yyyy-mm-dd", "until": "yyyy-mm-dd"}}' - name: filters - in: query - - required: false + format: uuid + name: project_id + in: path + - required: true schema: - title: Wallet Id + title: Group Id exclusiveMinimum: true type: integer minimum: 0 - name: wallet_id - in: query + name: group_id + in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/_ProjectsGroupsBodyParams' + required: true responses: - '302': - description: redirection to download link + '201': + description: Successful Response content: application/json: - schema: {} - /v0/pricing-plans/{pricing_plan_id}/pricing-units/{pricing_unit_id}: - get: + schema: + $ref: '#/components/schemas/Envelope_ProjectGroupGet_' + delete: tags: - - pricing-plans - summary: Retrieve detail information about pricing unit - operationId: get_pricing_plan_unit + - projects + - groups + summary: Delete Project Group + operationId: delete_project_group parameters: - required: true schema: - title: Pricing Plan Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: pricing_plan_id + title: Project Id + type: string + format: uuid + name: project_id in: path - required: true schema: - title: Pricing Unit Id + title: Group Id exclusiveMinimum: true type: integer minimum: 0 - name: pricing_unit_id + name: group_id in: path responses: - '200': + '204': description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_PricingUnitGet_' - /v0/admin/pricing-plans: + /v0/projects/{project_id}/groups: get: tags: - - admin - summary: List pricing plans - description: To keep the listing lightweight, the pricingUnits field is None. - operationId: list_pricing_plans + - projects + - groups + summary: List Project Groups + operationId: list_project_groups + parameters: + - required: true + schema: + title: Project Id + type: string + format: uuid + name: project_id + in: path responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_webserver.resource_usage.PricingPlanAdminGet__' - post: + $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.projects._groups_api.ProjectGroupGet__' + /v0/projects/{project_id}/metadata: + get: tags: - - admin - summary: Create pricing plan - operationId: create_pricing_plan - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreatePricingPlanBodyParams' - required: true + - projects + - metadata + summary: Get Project Metadata + operationId: get_project_metadata + parameters: + - required: true + schema: + title: Project Id + type: string + format: uuid + name: project_id + in: path responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_PricingPlanAdminGet_' - /v0/admin/pricing-plans/{pricing_plan_id}: - get: - tags: - - admin - summary: Retrieve detail information about pricing plan - operationId: get_pricing_plan + $ref: '#/components/schemas/Envelope_ProjectMetadataGet_' + patch: + tags: + - projects + - metadata + summary: Update Project Metadata + operationId: update_project_metadata parameters: - required: true schema: - title: Pricing Plan Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: pricing_plan_id + title: Project Id + type: string + format: uuid + name: project_id in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectMetadataUpdate' + required: true responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_PricingPlanAdminGet_' - put: + $ref: '#/components/schemas/Envelope_ProjectMetadataGet_' + /v0/projects/{project_id}/nodes: + post: tags: - - admin - summary: Update detail information about pricing plan - operationId: update_pricing_plan + - projects + - nodes + summary: Create Node + operationId: create_node parameters: - required: true schema: - title: Pricing Plan Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: pricing_plan_id + title: Project Id + type: string + name: project_id in: path requestBody: content: application/json: schema: - $ref: '#/components/schemas/UpdatePricingPlanBodyParams' + $ref: '#/components/schemas/NodeCreate' required: true responses: - '200': + '201': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_PricingPlanAdminGet_' - /v0/admin/pricing-plans/{pricing_plan_id}/pricing-units/{pricing_unit_id}: + $ref: '#/components/schemas/Envelope_NodeCreated_' + /v0/projects/{project_id}/nodes/{node_id}: get: tags: - - admin - summary: Retrieve detail information about pricing unit - operationId: get_pricing_unit + - projects + - nodes + summary: Get Node + operationId: get_node parameters: - required: true schema: - title: Pricing Plan Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: pricing_plan_id + title: Project Id + type: string + name: project_id in: path - required: true schema: - title: Pricing Unit Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: pricing_unit_id + title: Node Id + type: string + name: node_id in: path responses: '200': @@ -3820,111 +3714,83 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_PricingUnitAdminGet_' - put: + $ref: '#/components/schemas/Envelope_Union_NodeGetIdle__NodeGetUnknown__RunningDynamicServiceDetails__NodeGet__' + delete: tags: - - admin - summary: Update detail information about pricing plan - operationId: update_pricing_unit + - projects + - nodes + summary: Delete Node + operationId: delete_node parameters: - required: true schema: - title: Pricing Plan Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: pricing_plan_id + title: Project Id + type: string + name: project_id in: path - required: true schema: - title: Pricing Unit Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: pricing_unit_id + title: Node Id + type: string + name: node_id in: path - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdatePricingUnitBodyParams' - required: true responses: - '200': + '204': description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_PricingUnitAdminGet_' - /v0/admin/pricing-plans/{pricing_plan_id}/pricing-units: - post: + patch: tags: - - admin - summary: Create pricing unit - operationId: create_pricing_unit + - projects + - nodes + summary: Patch Project Node + operationId: patch_project_node parameters: - required: true schema: - title: Pricing Plan Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: pricing_plan_id + title: Project Id + type: string + format: uuid + name: project_id + in: path + - required: true + schema: + title: Node Id + type: string + name: node_id in: path requestBody: content: application/json: schema: - $ref: '#/components/schemas/CreatePricingUnitBodyParams' + $ref: '#/components/schemas/NodePatch' required: true responses: - '200': + '204': description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_PricingUnitAdminGet_' - /v0/admin/pricing-plans/{pricing_plan_id}/billable-services: - get: + /v0/projects/{project_id}/nodes/{node_id}:retrieve: + post: tags: - - admin - summary: List services that are connected to the provided pricing plan - operationId: list_connected_services_to_pricing_plan + - projects + - nodes + summary: Retrieve Node + operationId: retrieve_node parameters: - required: true schema: - title: Pricing Plan Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: pricing_plan_id + title: Project Id + type: string + name: project_id in: path - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_webserver.resource_usage.PricingPlanToServiceAdminGet__' - post: - tags: - - admin - summary: Connect service with pricing plan - operationId: connect_service_to_pricing_plan - parameters: - required: true schema: - title: Pricing Plan Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: pricing_plan_id + title: Node Id + type: string + name: node_id in: path requestBody: content: application/json: schema: - $ref: '#/components/schemas/ConnectServiceToPricingPlanBodyParams' + $ref: '#/components/schemas/NodeRetrieve' required: true responses: '200': @@ -3932,100 +3798,129 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_PricingPlanToServiceAdminGet_' - /: - get: - tags: - - statics - summary: Get Cached Frontend Index - operationId: get_cached_frontend_index - responses: - '200': - description: Successful Response - content: - text/html: - schema: - type: string - /static-frontend-data.json: - get: + $ref: '#/components/schemas/Envelope_NodeRetrieved_' + /v0/projects/{project_id}/nodes/{node_id}:start: + post: tags: - - statics - summary: Static Frontend Data - description: Generic static info on the product's app - operationId: static_frontend_data + - projects + - nodes + summary: Start Node + operationId: start_node + parameters: + - required: true + schema: + title: Project Id + type: string + name: project_id + in: path + - required: true + schema: + title: Node Id + type: string + name: node_id + in: path responses: - '200': + '204': description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/StaticFrontEndDict' - /v0/storage/locations: - get: + /v0/projects/{project_id}/nodes/{node_id}:stop: + post: tags: - - storage - summary: Get available storage locations - description: Returns the list of available storage locations - operationId: get_storage_locations + - projects + - nodes + summary: Stop Node + operationId: stop_node + parameters: + - required: true + schema: + title: Project Id + type: string + name: project_id + in: path + - required: true + schema: + title: Node Id + type: string + name: node_id + in: path responses: '200': description: Successful Response content: application/json: schema: - title: Response Get Storage Locations - type: array - items: - $ref: '#/components/schemas/DatasetMetaData' - /v0/storage/locations/{location_id}:sync: + $ref: '#/components/schemas/Envelope_TaskGet_' + /v0/projects/{project_id}/nodes/{node_id}:restart: post: tags: - - storage - summary: Manually triggers the synchronisation of the file meta data table in - the database - description: Returns an object containing added, changed and removed paths - operationId: synchronise_meta_data_table + - projects + - nodes + summary: Restart Node + description: Note that it has only effect on nodes associated to dynamic services + operationId: restart_node parameters: - required: true schema: - title: Location Id - type: integer - name: location_id + title: Project Id + type: string + name: project_id in: path - - required: false + - required: true schema: - title: Dry Run - type: boolean - default: false - name: dry_run - in: query - - required: false + title: Node Id + type: string + name: node_id + in: path + responses: + '204': + description: Successful Response + /v0/projects/{project_id}/nodes/{node_id}/outputs: + patch: + tags: + - projects + - nodes + summary: Update Node Outputs + operationId: update_node_outputs + parameters: + - required: true schema: - title: Fire And Forget - type: boolean - default: false - name: fire_and_forget - in: query + title: Project Id + type: string + name: project_id + in: path + - required: true + schema: + title: Node Id + type: string + name: node_id + in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NodeOutputs' + required: true responses: - '200': + '204': description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_TableSynchronisation_' - /v0/storage/locations/{location_id}/datasets: + /v0/projects/{project_id}/nodes/{node_id}/resources: get: tags: - - storage - summary: Get datasets metadata - description: returns all the top level datasets a user has access to - operationId: get_datasets_metadata + - projects + - nodes + summary: Get Node Resources + operationId: get_node_resources parameters: - required: true schema: - title: Location Id - type: integer - name: location_id + title: Project Id + type: string + name: project_id + in: path + - required: true + schema: + title: Node Id + type: string + name: node_id in: path responses: '200': @@ -4033,77 +3928,64 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.storage.schemas.DatasetMetaData__' - /v0/storage/locations/{location_id}/files/metadata: - get: + $ref: '#/components/schemas/Envelope_dict_models_library.docker.DockerGenericTag__models_library.services_resources.ImageResources__' + put: tags: - - storage - summary: Get datasets metadata - description: returns all the file meta data a user has access to (uuid_filter - may be used) - operationId: get_files_metadata + - projects + - nodes + summary: Replace Node Resources + operationId: replace_node_resources parameters: - required: true schema: - title: Location Id - type: integer - name: location_id + title: Project Id + type: string + name: project_id in: path - - required: false + - required: true schema: - title: Uuid Filter + title: Node Id type: string - default: '' - name: uuid_filter - in: query - - description: Automatic directory expansion. This will be replaced by pagination - the future - required: false - schema: - title: Expand Dirs - type: boolean - description: Automatic directory expansion. This will be replaced by pagination - the future - default: true - name: expand_dirs - in: query + name: node_id + in: path + requestBody: + content: + application/json: + schema: + title: ' New' + type: object + additionalProperties: + $ref: '#/components/schemas/ImageResources' + required: true responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.storage.schemas.DatasetMetaData__' - /v0/storage/locations/{location_id}/datasets/{dataset_id}/metadata: + $ref: '#/components/schemas/Envelope_dict_models_library.docker.DockerGenericTag__models_library.services_resources.ImageResources__' + /v0/projects/{project_id}/nodes/-/services:access: get: tags: - - storage - summary: Get Files Metadata - description: returns all the file meta data inside dataset with dataset_id - operationId: get_files_metadata_dataset + - projects + - nodes + summary: Check whether provided group has access to the project services + operationId: get_project_services_access_for_gid parameters: - required: true schema: - title: Location Id - type: integer - name: location_id - in: path - - required: true - schema: - title: Dataset Id + title: Project Id type: string - name: dataset_id + format: uuid + name: project_id in: path - - description: Automatic directory expansion. This will be replaced by pagination - the future - required: false + - required: true schema: - title: Expand Dirs - type: boolean - description: Automatic directory expansion. This will be replaced by pagination - the future - default: true - name: expand_dirs + title: For Gid + exclusiveMinimum: true + type: integer + minimum: 0 + name: for_gid in: query responses: '200': @@ -4111,27 +3993,21 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_storage.FileMetaDataGet__' - /v0/storage/locations/{location_id}/files/{file_id}/metadata: + $ref: '#/components/schemas/Envelope__ProjectGroupAccess_' + /v0/projects/{project_id}/nodes/-/preview: get: tags: - - storage - summary: Get File Metadata - description: returns the file meta data of file_id if user_id has the rights - to - operationId: get_file_metadata + - projects + - nodes + summary: Lists all previews in the node's project + operationId: list_project_nodes_previews parameters: - required: true schema: - title: Location Id - type: integer - name: location_id - in: path - - required: true - schema: - title: File Id + title: Project Id type: string - name: file_id + format: uuid + name: project_id in: path responses: '200': @@ -4139,199 +4015,199 @@ paths: content: application/json: schema: - title: Response Get File Metadata - anyOf: - - $ref: '#/components/schemas/FileMetaData' - - $ref: '#/components/schemas/Envelope_FileMetaDataGet_' - /v0/storage/locations/{location_id}/files/{file_id}: + $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.projects._nodes_handlers._ProjectNodePreview__' + /v0/projects/{project_id}/nodes/{node_id}/preview: get: tags: - - storage - summary: Returns download link for requested file - description: creates a download file link if user has the rights to - operationId: download_file + - projects + - nodes + summary: Gets a give node's preview + operationId: get_project_node_preview parameters: - required: true schema: - title: Location Id - type: integer - name: location_id + title: Project Id + type: string + format: uuid + name: project_id in: path - required: true schema: - title: File Id + title: Node Id type: string - name: file_id + format: uuid + name: node_id in: path - - required: false - schema: - allOf: - - $ref: '#/components/schemas/LinkType' - default: PRESIGNED - name: link_type - in: query responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_PresignedLink_' - put: + $ref: '#/components/schemas/Envelope__ProjectNodePreview_' + '404': + description: Node has no preview + /v0/projects/{project_id}/nodes/{node_id}/pricing-unit: + get: tags: - - storage - summary: Returns upload link - description: creates one or more upload file links if user has the rights to, - expects the client to complete/abort upload - operationId: upload_file + - projects + summary: Get currently connected pricing unit to the project node. + operationId: get_project_node_pricing_unit parameters: - required: true schema: - title: Location Id - type: integer - name: location_id + title: Project Id + type: string + format: uuid + name: project_id in: path - required: true schema: - title: File Id + title: Node Id type: string - name: file_id + format: uuid + name: node_id in: path - - required: true - schema: - title: File Size - type: integer - name: file_size - in: query - - required: false - schema: - allOf: - - $ref: '#/components/schemas/LinkType' - default: PRESIGNED - name: link_type - in: query - - required: false - schema: - title: Is Directory - type: boolean - default: false - name: is_directory - in: query responses: '200': description: Successful Response content: application/json: schema: - title: Response Upload File - anyOf: - - $ref: '#/components/schemas/Envelope_FileUploadSchema_' - - $ref: '#/components/schemas/Envelope_AnyUrl_' - delete: + $ref: '#/components/schemas/Envelope_Union_PricingUnitGet__NoneType__' + /v0/projects/{project_id}/nodes/{node_id}/pricing-plan/{pricing_plan_id}/pricing-unit/{pricing_unit_id}: + put: tags: - - storage - summary: Deletes File - description: deletes file if user has the rights to - operationId: delete_file + - projects + summary: Connect pricing unit to the project node (Project node can have only + one pricing unit) + operationId: connect_pricing_unit_to_project_node parameters: - required: true schema: - title: Location Id - type: integer - name: location_id + title: Project Id + type: string + format: uuid + name: project_id in: path - required: true schema: - title: File Id + title: Node Id type: string - name: file_id + format: uuid + name: node_id in: path - responses: - '204': - description: Successful Response - /v0/storage/locations/{location_id}/files/{file_id}:abort: - post: - tags: - - storage - summary: Abort Upload File - description: 'aborts an upload if user has the rights to, and reverts - - to the latest version if available, else will delete the file' - operationId: abort_upload_file - parameters: - required: true schema: - title: Location Id + title: Pricing Plan Id + exclusiveMinimum: true type: integer - name: location_id + minimum: 0 + name: pricing_plan_id in: path - required: true schema: - title: File Id - type: string - name: file_id + title: Pricing Unit Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: pricing_unit_id in: path responses: '204': description: Successful Response - /v0/storage/locations/{location_id}/files/{file_id}:complete: - post: + /v0/projects/{project_id}/inputs: + get: tags: - - storage - summary: Complete Upload File - description: completes an upload if the user has the rights to - operationId: complete_upload_file + - projects + - ports + summary: Get Project Inputs + description: New in version *0.10* + operationId: get_project_inputs parameters: - required: true schema: - title: Location Id - type: integer - name: location_id + title: Project Id + type: string + format: uuid + name: project_id in: path + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_dict_uuid.UUID__models_library.api_schemas_webserver.projects_ports.ProjectInputGet__' + patch: + tags: + - projects + - ports + summary: Update Project Inputs + description: New in version *0.10* + operationId: update_project_inputs + parameters: - required: true schema: - title: File Id + title: Project Id type: string - name: file_id + format: uuid + name: project_id in: path requestBody: content: application/json: schema: - $ref: '#/components/schemas/Envelope_FileUploadCompletionBody_' + title: ' Updates' + type: array + items: + $ref: '#/components/schemas/ProjectInputUpdate' required: true responses: - '202': + '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_FileUploadCompleteResponse_' - /v0/storage/locations/{location_id}/files/{file_id}:complete/futures/{future_id}: - post: + $ref: '#/components/schemas/Envelope_dict_uuid.UUID__models_library.api_schemas_webserver.projects_ports.ProjectInputGet__' + /v0/projects/{project_id}/outputs: + get: tags: - - storage - summary: Check for upload completion - description: Returns state of upload completion - operationId: is_completed_upload_file + - projects + - ports + summary: Get Project Outputs + description: New in version *0.10* + operationId: get_project_outputs parameters: - required: true schema: - title: Location Id - type: integer - name: location_id - in: path - - required: true - schema: - title: File Id + title: Project Id type: string - name: file_id + format: uuid + name: project_id in: path + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_dict_uuid.UUID__models_library.api_schemas_webserver.projects_ports.ProjectOutputGet__' + /v0/projects/{project_id}/metadata/ports: + get: + tags: + - projects + - ports + summary: List Project Metadata Ports + description: New in version *0.12* + operationId: list_project_metadata_ports + parameters: - required: true schema: - title: Future Id + title: Project Id type: string - name: future_id + format: uuid + name: project_id in: path responses: '200': @@ -4339,295 +4215,467 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_FileUploadCompleteFutureResponse_' - /v0/tags: - get: + $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.projects._ports_handlers.ProjectMetadataPortGet__' + /v0/projects/{project_id}:open: + post: tags: - - tags - summary: List Tags - operationId: list_tags + - projects + summary: Open Project + operationId: open_project + parameters: + - required: true + schema: + title: Project Id + type: string + format: uuid + name: project_id + in: path + - required: false + schema: + title: Disable Service Auto Start + type: boolean + default: false + name: disable_service_auto_start + in: query + requestBody: + content: + application/json: + schema: + title: Client Session Id + type: string + required: true responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.tags._handlers.TagGet__' + $ref: '#/components/schemas/Envelope_ProjectGet_' + '400': + description: ValidationError + '402': + description: WalletNotEnoughCreditsError + '403': + description: ProjectInvalidRightsError + '404': + description: ProjectNotFoundError, UserDefaultWalletNotFoundError + '409': + description: ProjectTooManyProjectOpenedError + '422': + description: ValidationError + '503': + description: DirectorServiceError + /v0/projects/{project_id}:close: post: tags: - - tags - summary: Create Tag - operationId: create_tag + - projects + summary: Close Project + operationId: close_project + parameters: + - required: true + schema: + title: Project Id + type: string + format: uuid + name: project_id + in: path requestBody: content: application/json: schema: - $ref: '#/components/schemas/TagCreate' + title: Client Session Id + type: string required: true + responses: + '204': + description: Successful Response + /v0/projects/{project_id}/state: + get: + tags: + - projects + summary: Get Project State + operationId: get_project_state + parameters: + - required: true + schema: + title: Project Id + type: string + format: uuid + name: project_id + in: path responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_TagGet_' - /v0/tags/{tag_id}: - delete: + $ref: '#/components/schemas/Envelope_ProjectState_' + /v0/projects/{project_uuid}/tags/{tag_id}:add: + post: tags: + - projects - tags - summary: Delete Tag - operationId: delete_tag + summary: Add Project Tag + description: 'Links an existing label with an existing study + + + NOTE: that the tag is not created here' + operationId: add_project_tag parameters: + - required: true + schema: + title: Project Uuid + type: string + format: uuid + name: project_uuid + in: path - required: true schema: title: Tag Id - exclusiveMinimum: true type: integer - minimum: 0 name: tag_id in: path responses: - '204': + '200': description: Successful Response - patch: + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_ProjectGet_' + /v0/projects/{project_uuid}/tags/{tag_id}:remove: + post: tags: + - projects - tags - summary: Update Tag - operationId: update_tag + summary: Remove Project Tag + description: 'Removes an existing link between a label and a study + + + NOTE: that the tag is not deleted here' + operationId: remove_project_tag parameters: + - required: true + schema: + title: Project Uuid + type: string + format: uuid + name: project_uuid + in: path - required: true schema: title: Tag Id - exclusiveMinimum: true type: integer - minimum: 0 name: tag_id in: path - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/TagUpdate' - required: true responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_TagGet_' - /v0/me: + $ref: '#/components/schemas/Envelope_ProjectGet_' + /v0/projects/{project_id}/wallet: get: tags: - - user - summary: Get My Profile - operationId: get_my_profile + - projects + summary: Get current connected wallet to the project. + operationId: get_project_wallet + parameters: + - required: true + schema: + title: Project Id + type: string + format: uuid + name: project_id + in: path responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_ProfileGet_' + $ref: '#/components/schemas/Envelope_Union_WalletGet__NoneType__' + /v0/projects/{project_id}/wallet/{wallet_id}: put: tags: - - user - summary: Update My Profile - operationId: update_my_profile - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ProfileUpdate' - required: true + - projects + summary: Connect wallet to the project (Project can have only one wallet) + operationId: connect_wallet_to_project + parameters: + - required: true + schema: + title: Project Id + type: string + format: uuid + name: project_id + in: path + - required: true + schema: + title: Wallet Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: wallet_id + in: path responses: - '204': + '200': description: Successful Response - /v0/me/preferences/{preference_id}: - patch: + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_WalletGet_' + /v0/projects/{project_id}/workspaces/{workspace_id}: + put: tags: - - user - summary: Set Frontend Preference - operationId: set_frontend_preference + - projects + - workspaces + summary: Move project to the workspace + operationId: replace_project_workspace parameters: - required: true schema: - title: Preference Id + title: Project Id type: string - name: preference_id + format: uuid + name: project_id + in: path + - required: true + schema: + title: Workspace Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: workspace_id in: path + responses: + '204': + description: Successful Response + /v0/publications/service-submission: + post: + tags: + - publication + summary: Service Submission + description: Submits files with new service candidate + operationId: service_submission requestBody: content: - application/json: + multipart/form-data: schema: - $ref: '#/components/schemas/PatchRequestBody' + $ref: '#/components/schemas/Body_service_submission' required: true responses: '204': description: Successful Response - /v0/me/tokens: + /v0/services/-/resource-usages: get: tags: - - user - summary: List Tokens - operationId: list_tokens + - usage + summary: Retrieve finished and currently running user services (user and product + are taken from context, optionally wallet_id parameter might be provided). + operationId: list_resource_usage_services + parameters: + - description: Order by field (wallet_id|wallet_name|user_id|project_id|project_name|node_id|node_name|service_key|service_version|service_type|started_at|stopped_at|service_run_status|credit_cost|transaction_status) + and direction (asc|desc). The default sorting order is ascending. + required: false + schema: + title: Order By + description: Order by field (wallet_id|wallet_name|user_id|project_id|project_name|node_id|node_name|service_key|service_version|service_type|started_at|stopped_at|service_run_status|credit_cost|transaction_status) + and direction (asc|desc). The default sorting order is ascending. + default: '{"field": "started_at", "direction": "desc"}' + example: '{"field": "started_at", "direction": "desc"}' + name: order_by + in: query + - description: Filters to process on the resource usages list, encoded as JSON. + Currently supports the filtering of 'started_at' field with 'from' and 'until' + parameters in ISO 8601 format. The date range specified is + inclusive. + required: false + schema: + title: Filters + type: string + description: Filters to process on the resource usages list, encoded as + JSON. Currently supports the filtering of 'started_at' field with 'from' + and 'until' parameters in ISO 8601 format. The date range + specified is inclusive. + format: json-string + example: '{"started_at": {"from": "yyyy-mm-dd", "until": "yyyy-mm-dd"}}' + name: filters + in: query + - required: false + schema: + title: Wallet Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: wallet_id + in: query + - required: false + schema: + title: Limit + type: integer + default: 20 + name: limit + in: query + - required: false + schema: + title: Offset + minimum: 0 + type: integer + default: 0 + name: offset + in: query responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.users.schemas.ThirdPartyToken__' - post: + $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_webserver.resource_usage.ServiceRunGet__' + /v0/services/-/aggregated-usages: + get: tags: - - user - summary: Create Token - operationId: create_token - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/TokenCreate' - required: true + - usage + summary: Used credits based on aggregate by type, currently supported `services`. + (user and product are taken from context, optionally wallet_id parameter might + be provided). + operationId: list_osparc_credits_aggregated_usages + parameters: + - required: true + schema: + $ref: '#/components/schemas/ServicesAggregatedUsagesType' + name: aggregated_by + in: query + - required: true + schema: + $ref: '#/components/schemas/ServicesAggregatedUsagesTimePeriod' + name: time_period + in: query + - required: true + schema: + title: Wallet Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: wallet_id + in: query + - required: false + schema: + title: Limit + type: integer + default: 20 + name: limit + in: query + - required: false + schema: + title: Offset + minimum: 0 + type: integer + default: 0 + name: offset + in: query responses: - '201': + '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_ThirdPartyToken_' - /v0/me/tokens/{service}: + $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_webserver.resource_usage.ServiceRunGet__' + /v0/services/-/usage-report: get: tags: - - user - summary: Get Token - operationId: get_token + - usage + summary: Redirects to download CSV link. CSV obtains finished and currently + running user services (user and product are taken from context, optionally + wallet_id parameter might be provided). + operationId: export_resource_usage_services parameters: - - required: true + - required: false schema: - title: Service + title: Order By + default: '{"field": "started_at", "direction": "desc"}' + example: '{"field": "started_at", "direction": "desc"}' + name: order_by + in: query + - description: Order by field (wallet_id|wallet_name|user_id|project_id|project_name|node_id|node_name|service_key|service_version|service_type|started_at|stopped_at|service_run_status|credit_cost|transaction_status) + and direction (asc|desc). The default sorting order is ascending. + required: false + schema: + title: Filters type: string - name: service - in: path + description: Order by field (wallet_id|wallet_name|user_id|project_id|project_name|node_id|node_name|service_key|service_version|service_type|started_at|stopped_at|service_run_status|credit_cost|transaction_status) + and direction (asc|desc). The default sorting order is ascending. + format: json-string + example: '{"started_at": {"from": "yyyy-mm-dd", "until": "yyyy-mm-dd"}}' + name: filters + in: query + - required: false + schema: + title: Wallet Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: wallet_id + in: query responses: - '200': - description: Successful Response + '302': + description: redirection to download link content: application/json: - schema: - $ref: '#/components/schemas/Envelope_ThirdPartyToken_' - delete: + schema: {} + /v0/pricing-plans/{pricing_plan_id}/pricing-units/{pricing_unit_id}: + get: tags: - - user - summary: Delete Token - operationId: delete_token + - pricing-plans + summary: Retrieve detail information about pricing unit + operationId: get_pricing_plan_unit parameters: - required: true schema: - title: Service - type: string - name: service + title: Pricing Plan Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: pricing_plan_id in: path - responses: - '204': - description: Successful Response - /v0/me/notifications: - get: - tags: - - user - summary: List User Notifications - operationId: list_user_notifications - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.users._notifications.UserNotification__' - post: - tags: - - user - summary: Create User Notification - operationId: create_user_notification - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UserNotificationCreate' - required: true - responses: - '204': - description: Successful Response - /v0/me/notifications/{notification_id}: - patch: - tags: - - user - summary: Mark Notification As Read - operationId: mark_notification_as_read - parameters: - required: true schema: - title: Notification Id - type: string - name: notification_id + title: Pricing Unit Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: pricing_unit_id in: path - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UserNotificationPatch' - required: true - responses: - '204': - description: Successful Response - /v0/me/permissions: - get: - tags: - - user - summary: List User Permissions - operationId: list_user_permissions responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.users.schemas.PermissionGet__' - /v0/users:search: + $ref: '#/components/schemas/Envelope_PricingUnitGet_' + /v0/admin/pricing-plans: get: tags: - - user - - po - summary: Search Users - operationId: search_users - parameters: - - required: true - schema: - title: Email - maxLength: 200 - minLength: 3 - type: string - name: email - in: query + - admin + summary: List pricing plans + description: To keep the listing lightweight, the pricingUnits field is None. + operationId: list_pricing_plans responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.users._schemas.UserProfile__' - /v0/users:pre-register: + $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_webserver.resource_usage.PricingPlanAdminGet__' post: tags: - - user - - po - summary: Pre Register User - operationId: pre_register_user + - admin + summary: Create pricing plan + operationId: create_pricing_plan requestBody: content: application/json: schema: - $ref: '#/components/schemas/PreUserProfile' + $ref: '#/components/schemas/CreatePricingPlanBodyParams' required: true responses: '200': @@ -4635,96 +4683,48 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_UserProfile_' - /v0/repos/projects: + $ref: '#/components/schemas/Envelope_PricingPlanAdminGet_' + /v0/admin/pricing-plans/{pricing_plan_id}: get: tags: - - repository - summary: List Repos - operationId: list_repos + - admin + summary: Retrieve detail information about pricing plan + operationId: get_pricing_plan parameters: - - required: false + - required: true schema: - title: Limit - exclusiveMaximum: true - minimum: 1 + title: Pricing Plan Id + exclusiveMinimum: true type: integer - default: 20 - maximum: 50 - name: limit - in: query - - required: false - schema: - title: Offset minimum: 0 - type: integer - default: 0 - name: offset - in: query + name: pricing_plan_id + in: path responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Page_RepoApiModel_' - /v0/repos/projects/{project_uuid}/checkpoints: - get: + $ref: '#/components/schemas/Envelope_PricingPlanAdminGet_' + put: tags: - - repository - summary: List Checkpoints - operationId: list_checkpoints + - admin + summary: Update detail information about pricing plan + operationId: update_pricing_plan parameters: - required: true schema: - title: Project Uuid - type: string - format: uuid - name: project_uuid - in: path - - required: false - schema: - title: Limit - exclusiveMaximum: true - minimum: 1 + title: Pricing Plan Id + exclusiveMinimum: true type: integer - default: 20 - maximum: 50 - name: limit - in: query - - required: false - schema: - title: Offset minimum: 0 - type: integer - default: 0 - name: offset - in: query - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Page_CheckpointApiModel_' - post: - tags: - - repository - summary: Create Checkpoint - operationId: create_checkpoint - parameters: - - required: true - schema: - title: Project Uuid - type: string - format: uuid - name: project_uuid + name: pricing_plan_id in: path requestBody: content: application/json: schema: - $ref: '#/components/schemas/CheckpointNew' + $ref: '#/components/schemas/UpdatePricingPlanBodyParams' required: true responses: '200': @@ -4732,31 +4732,29 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_CheckpointApiModel_' - /v0/repos/projects/{project_uuid}/checkpoints/{ref_id}: + $ref: '#/components/schemas/Envelope_PricingPlanAdminGet_' + /v0/admin/pricing-plans/{pricing_plan_id}/pricing-units/{pricing_unit_id}: get: tags: - - repository - summary: Get Checkpoint - operationId: get_checkpoint + - admin + summary: Retrieve detail information about pricing unit + operationId: get_pricing_unit parameters: - required: true schema: - title: Ref Id - anyOf: - - type: integer - - type: string - - enum: - - HEAD - type: string - name: ref_id + title: Pricing Plan Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: pricing_plan_id in: path - required: true schema: - title: Project Uuid - type: string - format: uuid - name: project_uuid + title: Pricing Unit Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: pricing_unit_id in: path responses: '200': @@ -4764,34 +4762,34 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_CheckpointApiModel_' - patch: + $ref: '#/components/schemas/Envelope_PricingUnitAdminGet_' + put: tags: - - repository - summary: Update Checkpoint - description: Update Checkpoint Annotations - operationId: update_checkpoint + - admin + summary: Update detail information about pricing plan + operationId: update_pricing_unit parameters: - required: true schema: - title: Ref Id - anyOf: - - type: integer - - type: string - name: ref_id + title: Pricing Plan Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: pricing_plan_id in: path - required: true schema: - title: Project Uuid - type: string - format: uuid - name: project_uuid + title: Pricing Unit Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: pricing_unit_id in: path requestBody: content: application/json: schema: - $ref: '#/components/schemas/CheckpointAnnotations' + $ref: '#/components/schemas/UpdatePricingUnitBodyParams' required: true responses: '200': @@ -4799,57 +4797,49 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_CheckpointApiModel_' - /v0/repos/projects/{project_uuid}/checkpoints/{ref_id}/workbench/view: - get: + $ref: '#/components/schemas/Envelope_PricingUnitAdminGet_' + /v0/admin/pricing-plans/{pricing_plan_id}/pricing-units: + post: tags: - - repository - summary: View Project Workbench - operationId: view_project_workbench + - admin + summary: Create pricing unit + operationId: create_pricing_unit parameters: - required: true schema: - title: Ref Id - anyOf: - - type: integer - - type: string - name: ref_id - in: path - - required: true - schema: - title: Project Uuid - type: string - format: uuid - name: project_uuid + title: Pricing Plan Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: pricing_plan_id in: path + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreatePricingUnitBodyParams' + required: true responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_WorkbenchViewApiModel_' - /v0/repos/projects/{project_uuid}/checkpoints/{ref_id}:checkout: - post: + $ref: '#/components/schemas/Envelope_PricingUnitAdminGet_' + /v0/admin/pricing-plans/{pricing_plan_id}/billable-services: + get: tags: - - repository - summary: Checkout - operationId: checkout + - admin + summary: List services that are connected to the provided pricing plan + operationId: list_connected_services_to_pricing_plan parameters: - required: true schema: - title: Ref Id - anyOf: - - type: integer - - type: string - name: ref_id - in: path - - required: true - schema: - title: Project Uuid - type: string - format: uuid - name: project_uuid + title: Pricing Plan Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: pricing_plan_id in: path responses: '200': @@ -4857,155 +4847,167 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_CheckpointApiModel_' - /v0/wallets: - get: - tags: - - wallets - summary: List Wallets - operationId: list_wallets - responses: - '200': - description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_webserver.wallets.WalletGetWithAvailableCredits__' + $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_webserver.resource_usage.PricingPlanToServiceAdminGet__' post: tags: - - wallets - summary: Create Wallet - operationId: create_wallet + - admin + summary: Connect service with pricing plan + operationId: connect_service_to_pricing_plan + parameters: + - required: true + schema: + title: Pricing Plan Id + exclusiveMinimum: true + type: integer + minimum: 0 + name: pricing_plan_id + in: path requestBody: content: application/json: schema: - $ref: '#/components/schemas/CreateWalletBodyParams' + $ref: '#/components/schemas/ConnectServiceToPricingPlanBodyParams' required: true responses: - '201': + '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_WalletGet_' - /v0/wallets/default: + $ref: '#/components/schemas/Envelope_PricingPlanToServiceAdminGet_' + /: get: tags: - - wallets - summary: Get Default Wallet - operationId: get_default_wallet + - statics + summary: Get Cached Frontend Index + operationId: get_cached_frontend_index + responses: + '200': + description: Successful Response + content: + text/html: + schema: + type: string + /static-frontend-data.json: + get: + tags: + - statics + summary: Static Frontend Data + description: Generic static info on the product's app + operationId: static_frontend_data responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_WalletGetWithAvailableCredits_' - /v0/wallets/{wallet_id}: + $ref: '#/components/schemas/StaticFrontEndDict' + /v0/storage/locations: get: tags: - - wallets - summary: Get Wallet - operationId: get_wallet - parameters: - - required: true - schema: - title: Wallet Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: wallet_id - in: path + - storage + summary: Get available storage locations + description: Returns the list of available storage locations + operationId: get_storage_locations responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_WalletGetWithAvailableCredits_' - put: + title: Response Get Storage Locations + type: array + items: + $ref: '#/components/schemas/DatasetMetaData' + /v0/storage/locations/{location_id}:sync: + post: tags: - - wallets - summary: Update Wallet - operationId: update_wallet + - storage + summary: Manually triggers the synchronisation of the file meta data table in + the database + description: Returns an object containing added, changed and removed paths + operationId: synchronise_meta_data_table parameters: - required: true schema: - title: Wallet Id - exclusiveMinimum: true + title: Location Id type: integer - minimum: 0 - name: wallet_id + name: location_id in: path - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PutWalletBodyParams' - required: true + - required: false + schema: + title: Dry Run + type: boolean + default: false + name: dry_run + in: query + - required: false + schema: + title: Fire And Forget + type: boolean + default: false + name: fire_and_forget + in: query responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_WalletGet_' - /v0/wallets/{wallet_id}/payments: - post: + $ref: '#/components/schemas/Envelope_TableSynchronisation_' + /v0/storage/locations/{location_id}/datasets: + get: tags: - - wallets - summary: Create Payment - description: Creates payment to wallet `wallet_id` - operationId: create_payment + - storage + summary: Get datasets metadata + description: returns all the top level datasets a user has access to + operationId: get_datasets_metadata parameters: - required: true schema: - title: Wallet Id - exclusiveMinimum: true + title: Location Id type: integer - minimum: 0 - name: wallet_id + name: location_id in: path - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateWalletPayment' - required: true responses: - '202': - description: Payment initialized + '200': + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_WalletPaymentInitiated_' - /v0/wallets/-/payments: + $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.storage.schemas.DatasetMetaData__' + /v0/storage/locations/{location_id}/files/metadata: get: tags: - - wallets - summary: List All Payments - description: Lists all user payments to his/her wallets (only the ones he/she - created) - operationId: list_all_payments + - storage + summary: Get datasets metadata + description: returns all the file meta data a user has access to (uuid_filter + may be used) + operationId: get_files_metadata parameters: - - required: false + - required: true schema: - title: Limit - exclusiveMaximum: true - minimum: 1 + title: Location Id type: integer - default: 20 - maximum: 50 - name: limit - in: query + name: location_id + in: path - required: false schema: - title: Offset - minimum: 0 - type: integer - default: 0 - name: offset + title: Uuid Filter + type: string + default: '' + name: uuid_filter + in: query + - description: Automatic directory expansion. This will be replaced by pagination + the future + required: false + schema: + title: Expand Dirs + type: boolean + description: Automatic directory expansion. This will be replaced by pagination + the future + default: true + name: expand_dirs in: query responses: '200': @@ -5013,238 +5015,265 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Page_PaymentTransaction_' - /v0/wallets/{wallet_id}/payments/{payment_id}/invoice-link: + $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.storage.schemas.DatasetMetaData__' + /v0/storage/locations/{location_id}/datasets/{dataset_id}/metadata: get: tags: - - wallets - summary: Get Payment Invoice Link - operationId: get_payment_invoice_link + - storage + summary: Get Files Metadata + description: returns all the file meta data inside dataset with dataset_id + operationId: get_files_metadata_dataset parameters: - required: true schema: - title: Wallet Id - exclusiveMinimum: true + title: Location Id type: integer - minimum: 0 - name: wallet_id + name: location_id in: path - required: true schema: - title: Payment Id - maxLength: 100 - minLength: 1 + title: Dataset Id type: string - name: payment_id + name: dataset_id in: path + - description: Automatic directory expansion. This will be replaced by pagination + the future + required: false + schema: + title: Expand Dirs + type: boolean + description: Automatic directory expansion. This will be replaced by pagination + the future + default: true + name: expand_dirs + in: query responses: - '302': - description: redirection to invoice download link + '200': + description: Successful Response content: application/json: - schema: {} - /v0/wallets/{wallet_id}/payments/{payment_id}:cancel: - post: + schema: + $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_storage.FileMetaDataGet__' + /v0/storage/locations/{location_id}/files/{file_id}/metadata: + get: tags: - - wallets - summary: Cancel Payment - operationId: cancel_payment + - storage + summary: Get File Metadata + description: returns the file meta data of file_id if user_id has the rights + to + operationId: get_file_metadata parameters: - required: true schema: - title: Wallet Id - exclusiveMinimum: true + title: Location Id type: integer - minimum: 0 - name: wallet_id + name: location_id in: path - required: true schema: - title: Payment Id - maxLength: 100 - minLength: 1 + title: File Id type: string - name: payment_id + name: file_id in: path responses: - '204': - description: Successfully cancelled - /v0/wallets/{wallet_id}/payments-methods:init: - post: + '200': + description: Successful Response + content: + application/json: + schema: + title: Response Get File Metadata + anyOf: + - $ref: '#/components/schemas/FileMetaData' + - $ref: '#/components/schemas/Envelope_FileMetaDataGet_' + /v0/storage/locations/{location_id}/files/{file_id}: + get: tags: - - wallets - summary: Init Creation Of Payment Method - operationId: init_creation_of_payment_method + - storage + summary: Returns download link for requested file + description: creates a download file link if user has the rights to + operationId: download_file parameters: - required: true schema: - title: Wallet Id - exclusiveMinimum: true + title: Location Id type: integer - minimum: 0 - name: wallet_id + name: location_id + in: path + - required: true + schema: + title: File Id + type: string + name: file_id in: path + - required: false + schema: + allOf: + - $ref: '#/components/schemas/LinkType' + default: PRESIGNED + name: link_type + in: query responses: - '202': - description: Successfully initialized + '200': + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_PaymentMethodInitiated_' - /v0/wallets/{wallet_id}/payments-methods/{payment_method_id}:cancel: - post: + $ref: '#/components/schemas/Envelope_PresignedLink_' + put: tags: - - wallets - summary: Cancel Creation Of Payment Method - operationId: cancel_creation_of_payment_method + - storage + summary: Returns upload link + description: creates one or more upload file links if user has the rights to, + expects the client to complete/abort upload + operationId: upload_file parameters: - required: true schema: - title: Wallet Id - exclusiveMinimum: true + title: Location Id type: integer - minimum: 0 - name: wallet_id + name: location_id in: path - required: true schema: - title: Payment Method Id - maxLength: 100 - minLength: 1 + title: File Id type: string - name: payment_method_id + name: file_id in: path - responses: - '204': - description: Successfully cancelled - /v0/wallets/{wallet_id}/payments-methods: - get: - tags: - - wallets - summary: List Payments Methods - description: Lists all payments method associated to `wallet_id` - operationId: list_payments_methods - parameters: - required: true schema: - title: Wallet Id - exclusiveMinimum: true + title: File Size type: integer - minimum: 0 - name: wallet_id - in: path + name: file_size + in: query + - required: false + schema: + allOf: + - $ref: '#/components/schemas/LinkType' + default: PRESIGNED + name: link_type + in: query + - required: false + schema: + title: Is Directory + type: boolean + default: false + name: is_directory + in: query responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_models_library.api_schemas_webserver.wallets.PaymentMethodGet__' - /v0/wallets/{wallet_id}/payments-methods/{payment_method_id}: - get: + title: Response Upload File + anyOf: + - $ref: '#/components/schemas/Envelope_FileUploadSchema_' + - $ref: '#/components/schemas/Envelope_AnyUrl_' + delete: tags: - - wallets - summary: Get Payment Method - operationId: get_payment_method + - storage + summary: Deletes File + description: deletes file if user has the rights to + operationId: delete_file parameters: - required: true schema: - title: Wallet Id - exclusiveMinimum: true + title: Location Id type: integer - minimum: 0 - name: wallet_id + name: location_id in: path - required: true schema: - title: Payment Method Id - maxLength: 100 - minLength: 1 + title: File Id type: string - name: payment_method_id + name: file_id in: path responses: - '200': + '204': description: Successful Response - content: - application/json: - schema: - $ref: '#/components/schemas/Envelope_PaymentMethodGet_' - delete: + /v0/storage/locations/{location_id}/files/{file_id}:abort: + post: tags: - - wallets - summary: Delete Payment Method - operationId: delete_payment_method + - storage + summary: Abort Upload File + description: 'aborts an upload if user has the rights to, and reverts + + to the latest version if available, else will delete the file' + operationId: abort_upload_file parameters: - required: true schema: - title: Wallet Id - exclusiveMinimum: true + title: Location Id type: integer - minimum: 0 - name: wallet_id + name: location_id in: path - required: true schema: - title: Payment Method Id - maxLength: 100 - minLength: 1 + title: File Id type: string - name: payment_method_id + name: file_id in: path responses: '204': - description: Successfully deleted - /v0/wallets/{wallet_id}/payments-methods/{payment_method_id}:pay: + description: Successful Response + /v0/storage/locations/{location_id}/files/{file_id}:complete: post: tags: - - wallets - summary: Pay With Payment Method - operationId: pay_with_payment_method + - storage + summary: Complete Upload File + description: completes an upload if the user has the rights to + operationId: complete_upload_file parameters: - required: true schema: - title: Wallet Id - exclusiveMinimum: true + title: Location Id type: integer - minimum: 0 - name: wallet_id + name: location_id in: path - required: true schema: - title: Payment Method Id - maxLength: 100 - minLength: 1 + title: File Id type: string - name: payment_method_id + name: file_id in: path requestBody: content: application/json: schema: - $ref: '#/components/schemas/CreateWalletPayment' + $ref: '#/components/schemas/Envelope_FileUploadCompletionBody_' required: true responses: '202': - description: Pay with payment-method + description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_WalletPaymentInitiated_' - /v0/wallets/{wallet_id}/auto-recharge: - get: + $ref: '#/components/schemas/Envelope_FileUploadCompleteResponse_' + /v0/storage/locations/{location_id}/files/{file_id}:complete/futures/{future_id}: + post: tags: - - wallets - summary: Get Wallet Autorecharge - operationId: get_wallet_autorecharge + - storage + summary: Check for upload completion + description: Returns state of upload completion + operationId: is_completed_upload_file parameters: - required: true schema: - title: Wallet Id - exclusiveMinimum: true + title: Location Id type: integer - minimum: 0 - name: wallet_id + name: location_id + in: path + - required: true + schema: + title: File Id + type: string + name: file_id + in: path + - required: true + schema: + title: Future Id + type: string + name: future_id in: path responses: '200': @@ -5252,26 +5281,96 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_GetWalletAutoRecharge_' - put: + $ref: '#/components/schemas/Envelope_FileUploadCompleteFutureResponse_' + /v0/repos/projects: + get: tags: - - wallets - summary: Replace Wallet Autorecharge - operationId: replace_wallet_autorecharge + - repository + summary: List Repos + operationId: list_repos + parameters: + - required: false + schema: + title: Limit + exclusiveMaximum: true + minimum: 1 + type: integer + default: 20 + maximum: 50 + name: limit + in: query + - required: false + schema: + title: Offset + minimum: 0 + type: integer + default: 0 + name: offset + in: query + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Page_RepoApiModel_' + /v0/repos/projects/{project_uuid}/checkpoints: + get: + tags: + - repository + summary: List Checkpoints + operationId: list_checkpoints parameters: - required: true schema: - title: Wallet Id - exclusiveMinimum: true + title: Project Uuid + type: string + format: uuid + name: project_uuid + in: path + - required: false + schema: + title: Limit + exclusiveMaximum: true + minimum: 1 type: integer + default: 20 + maximum: 50 + name: limit + in: query + - required: false + schema: + title: Offset minimum: 0 - name: wallet_id + type: integer + default: 0 + name: offset + in: query + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Page_CheckpointApiModel_' + post: + tags: + - repository + summary: Create Checkpoint + operationId: create_checkpoint + parameters: + - required: true + schema: + title: Project Uuid + type: string + format: uuid + name: project_uuid in: path requestBody: content: application/json: schema: - $ref: '#/components/schemas/ReplaceWalletAutoRecharge' + $ref: '#/components/schemas/CheckpointNew' required: true responses: '200': @@ -5279,117 +5378,124 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_GetWalletAutoRecharge_' - /v0/wallets/{wallet_id}/groups/{group_id}: - put: + $ref: '#/components/schemas/Envelope_CheckpointApiModel_' + /v0/repos/projects/{project_uuid}/checkpoints/{ref_id}: + get: tags: - - wallets - summary: Update Wallet Group - operationId: update_wallet_group + - repository + summary: Get Checkpoint + operationId: get_checkpoint parameters: - required: true schema: - title: Wallet Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: wallet_id + title: Ref Id + anyOf: + - type: integer + - type: string + - enum: + - HEAD + type: string + name: ref_id in: path - required: true schema: - title: Group Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: group_id + title: Project Uuid + type: string + format: uuid + name: project_uuid in: path - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/_WalletsGroupsBodyParams' - required: true responses: '200': description: Successful Response content: application/json: schema: - $ref: '#/components/schemas/Envelope_WalletGroupGet_' - post: + $ref: '#/components/schemas/Envelope_CheckpointApiModel_' + patch: tags: - - wallets - summary: Create Wallet Group - operationId: create_wallet_group + - repository + summary: Update Checkpoint + description: Update Checkpoint Annotations + operationId: update_checkpoint parameters: - required: true schema: - title: Wallet Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: wallet_id + title: Ref Id + anyOf: + - type: integer + - type: string + name: ref_id in: path - required: true schema: - title: Group Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: group_id + title: Project Uuid + type: string + format: uuid + name: project_uuid in: path requestBody: content: application/json: schema: - $ref: '#/components/schemas/_WalletsGroupsBodyParams' + $ref: '#/components/schemas/CheckpointAnnotations' required: true responses: - '201': + '200': description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/Envelope_WalletGroupGet_' - delete: + schema: + $ref: '#/components/schemas/Envelope_CheckpointApiModel_' + /v0/repos/projects/{project_uuid}/checkpoints/{ref_id}/workbench/view: + get: tags: - - wallets - summary: Delete Wallet Group - operationId: delete_wallet_group + - repository + summary: View Project Workbench + operationId: view_project_workbench parameters: - required: true schema: - title: Wallet Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: wallet_id + title: Ref Id + anyOf: + - type: integer + - type: string + name: ref_id in: path - required: true schema: - title: Group Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: group_id + title: Project Uuid + type: string + format: uuid + name: project_uuid in: path responses: - '204': + '200': description: Successful Response - /v0/wallets/{wallet_id}/groups: - get: + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_WorkbenchViewApiModel_' + /v0/repos/projects/{project_uuid}/checkpoints/{ref_id}:checkout: + post: tags: - - wallets - summary: List Wallet Groups - operationId: list_wallet_groups + - repository + summary: Checkout + operationId: checkout parameters: - required: true schema: - title: Wallet Id - exclusiveMinimum: true - type: integer - minimum: 0 - name: wallet_id + title: Ref Id + anyOf: + - type: integer + - type: string + name: ref_id + in: path + - required: true + schema: + title: Project Uuid + type: string + format: uuid + name: project_uuid in: path responses: '200': @@ -5397,7 +5503,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.wallets._groups_api.WalletGroupGet__' + $ref: '#/components/schemas/Envelope_CheckpointApiModel_' /v0/workspaces: get: tags: @@ -5499,6 +5605,7 @@ paths: put: tags: - workspaces + - groups summary: Replace Workspace Group operationId: replace_workspace_group parameters: @@ -5534,6 +5641,7 @@ paths: post: tags: - workspaces + - groups summary: Create Workspace Group operationId: create_workspace_group parameters: @@ -5569,6 +5677,7 @@ paths: delete: tags: - workspaces + - groups summary: Delete Workspace Group operationId: delete_workspace_group parameters: @@ -5595,6 +5704,7 @@ paths: get: tags: - workspaces + - groups summary: List Workspace Groups operationId: list_workspace_groups parameters: @@ -5613,6 +5723,140 @@ paths: application/json: schema: $ref: '#/components/schemas/Envelope_list_simcore_service_webserver.workspaces._groups_api.WorkspaceGroupGet__' + /v0/email:test: + post: + tags: + - admin + summary: Test Email + operationId: test_email + parameters: + - required: false + schema: + title: X-Simcore-Products-Name + type: string + name: x-simcore-products-name + in: header + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TestEmail' + required: true + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_Union_EmailTestFailed__EmailTestPassed__' + /v0/: + get: + tags: + - maintenance + summary: Healthcheck Readiness Probe + description: 'Readiness probe: check if the container is ready to receive traffic' + operationId: healthcheck_readiness_probe + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_HealthInfoDict_' + /v0/health: + get: + tags: + - maintenance + summary: Healthcheck Liveness Probe + description: 'Liveness probe: check if the container is alive' + operationId: healthcheck_liveness_probe + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_dict_str__Any__' + /v0/config: + get: + tags: + - maintenance + summary: Front end runtime configuration + description: Returns app and products configs + operationId: get_config + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_dict_str__Any__' + /v0/scheduled_maintenance: + get: + tags: + - maintenance + summary: Get Scheduled Maintenance + operationId: get_scheduled_maintenance + responses: + '200': + description: Successful Response + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_str_' + /v0/status: + get: + tags: + - maintenance + summary: checks status of self and connected services + operationId: get_app_status + responses: + '200': + description: Returns app status check + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_AppStatusCheck_' + /v0/status/diagnostics: + get: + tags: + - maintenance + summary: Get App Diagnostics + operationId: get_app_diagnostics + parameters: + - required: false + schema: + title: Top Tracemalloc + type: integer + name: top_tracemalloc + in: query + responses: + '200': + description: Returns app diagnostics report + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_StatusDiagnosticsGet_' + /v0/status/{service_name}: + get: + tags: + - maintenance + summary: Get Service Status + operationId: get_service_status + parameters: + - required: true + schema: + title: Service Name + type: string + name: service_name + in: path + responses: + '200': + description: Returns app status check + content: + application/json: + schema: + $ref: '#/components/schemas/Envelope_AppStatusCheck_' components: schemas: AccessEnum: @@ -7640,8 +7884,8 @@ components: $ref: '#/components/schemas/Viewer' error: title: Error - Envelope_list_simcore_service_webserver.tags._handlers.TagGet__: - title: Envelope[list[simcore_service_webserver.tags._handlers.TagGet]] + Envelope_list_simcore_service_webserver.tags.schemas.TagGet__: + title: Envelope[list[simcore_service_webserver.tags.schemas.TagGet]] type: object properties: data: @@ -7651,6 +7895,17 @@ components: $ref: '#/components/schemas/TagGet' error: title: Error + Envelope_list_simcore_service_webserver.tags.schemas.TagGroupGet__: + title: Envelope[list[simcore_service_webserver.tags.schemas.TagGroupGet]] + type: object + properties: + data: + title: Data + type: array + items: + $ref: '#/components/schemas/TagGroupGet' + error: + title: Error Envelope_list_simcore_service_webserver.users._notifications.UserNotification__: title: Envelope[list[simcore_service_webserver.users._notifications.UserNotification]] type: object @@ -11634,6 +11889,56 @@ components: type: string accessRights: $ref: '#/components/schemas/TagAccessRights' + TagGroupCreate: + title: TagGroupCreate + required: + - read + - write + - delete + type: object + properties: + read: + title: Read + type: boolean + write: + title: Write + type: boolean + delete: + title: Delete + type: boolean + TagGroupGet: + title: TagGroupGet + required: + - gid + - read + - write + - delete + - created + - modified + type: object + properties: + gid: + title: Gid + exclusiveMinimum: true + type: integer + minimum: 0 + read: + title: Read + type: boolean + write: + title: Write + type: boolean + delete: + title: Delete + type: boolean + created: + title: Created + type: string + format: date-time + modified: + title: Modified + type: string + format: date-time TagUpdate: title: TagUpdate type: object diff --git a/services/web/server/src/simcore_service_webserver/catalog/_tags_handlers.py b/services/web/server/src/simcore_service_webserver/catalog/_tags_handlers.py new file mode 100644 index 00000000000..dc75617f497 --- /dev/null +++ b/services/web/server/src/simcore_service_webserver/catalog/_tags_handlers.py @@ -0,0 +1,59 @@ +import logging + +from aiohttp import web +from models_library.basic_types import IdInt +from servicelib.aiohttp.requests_validation import parse_request_path_parameters_as + +from .._meta import API_VTAG +from ..login.decorators import login_required +from ..security.decorators import permission_required +from ._handlers import ServicePathParams + +_logger = logging.getLogger(__name__) + + +class ServiceTagPathParams(ServicePathParams): + tag_id: IdInt + + +routes = web.RouteTableDef() + + +@routes.get( + f"/{API_VTAG}/catalog/services/{{service_key}}/{{service_version}}/tags", + name="list_service_tags", +) +@login_required +@permission_required("service.tag.*") +async def list_service_tags(request: web.Request): + path_params = parse_request_path_parameters_as(ServicePathParams, request) + assert path_params # nosec + raise NotImplementedError + + +@routes.post( + f"/{API_VTAG}/catalog/services/{{service_key}}/{{service_version}}/tags/{{tag_id}}:add", + name="add_service_tag", +) +@login_required +@permission_required("service.tag.*") +async def add_service_tag(request: web.Request): + path_params = parse_request_path_parameters_as(ServiceTagPathParams, request) + assert path_params # nosec + + # responds with parent's resource to get the current state (as with patch/update) + raise NotImplementedError + + +@routes.post( + f"/{API_VTAG}/catalog/services/{{service_key}}/{{service_version}}/tags/{{tag_id}}:remove", + name="remove_service_tag", +) +@login_required +@permission_required("service.tag.*") +async def remove_service_tag(request: web.Request): + path_params = parse_request_path_parameters_as(ServiceTagPathParams, request) + assert path_params # nosec + + # responds with parent's resource to get the current state (as with patch/update) + raise NotImplementedError diff --git a/services/web/server/src/simcore_service_webserver/catalog/plugin.py b/services/web/server/src/simcore_service_webserver/catalog/plugin.py index 5f4de728fb6..2af8da917f0 100644 --- a/services/web/server/src/simcore_service_webserver/catalog/plugin.py +++ b/services/web/server/src/simcore_service_webserver/catalog/plugin.py @@ -8,7 +8,7 @@ from pint import UnitRegistry from servicelib.aiohttp.application_setup import ModuleCategory, app_module_setup -from . import _handlers +from . import _handlers, _tags_handlers _logger = logging.getLogger(__name__) @@ -28,6 +28,7 @@ def setup_catalog(app: web.Application): ) app.add_routes(_handlers.routes) + app.add_routes(_tags_handlers.routes) # prepares units registry app[UnitRegistry.__name__] = UnitRegistry() diff --git a/services/web/server/src/simcore_service_webserver/projects/_tags_handlers.py b/services/web/server/src/simcore_service_webserver/projects/_tags_handlers.py index 4904dac4ce2..1eff696a177 100644 --- a/services/web/server/src/simcore_service_webserver/projects/_tags_handlers.py +++ b/services/web/server/src/simcore_service_webserver/projects/_tags_handlers.py @@ -20,10 +20,12 @@ routes = web.RouteTableDef() -@routes.put(f"/{API_VTAG}/projects/{{project_uuid}}/tags/{{tag_id}}", name="add_tag") +@routes.post( + f"/{API_VTAG}/projects/{{project_uuid}}/tags/{{tag_id}}:add", name="add_project_tag" +) @login_required @permission_required("project.tag.*") -async def add_tag(request: web.Request): +async def add_project_tag(request: web.Request): user_id: int = request[RQT_USERID_KEY] try: @@ -43,12 +45,13 @@ async def add_tag(request: web.Request): return envelope_json_response(project) -@routes.delete( - f"/{API_VTAG}/projects/{{project_uuid}}/tags/{{tag_id}}", name="remove_tag" +@routes.post( + f"/{API_VTAG}/projects/{{project_uuid}}/tags/{{tag_id}}:remove", + name="remove_project_tag", ) @login_required @permission_required("project.tag.*") -async def remove_tag(request: web.Request): +async def remove_project_tag(request: web.Request): user_id: int = request[RQT_USERID_KEY] tag_id, project_uuid = ( diff --git a/services/web/server/src/simcore_service_webserver/tags/_handlers.py b/services/web/server/src/simcore_service_webserver/tags/_handlers.py index b2f6537f5be..de0fc7dd5b1 100644 --- a/services/web/server/src/simcore_service_webserver/tags/_handlers.py +++ b/services/web/server/src/simcore_service_webserver/tags/_handlers.py @@ -1,11 +1,8 @@ import functools -import re from aiohttp import web from aiopg.sa.engine import Engine -from models_library.api_schemas_webserver._base import InputSchema, OutputSchema -from models_library.users import UserID -from pydantic import BaseModel, ConstrainedStr, Field, PositiveInt +from pydantic import parse_obj_as from servicelib.aiohttp.application_keys import APP_DB_ENGINE_KEY from servicelib.aiohttp.requests_validation import ( parse_request_body_as, @@ -13,9 +10,7 @@ ) from servicelib.aiohttp.typing_extension import Handler from servicelib.mimetype_constants import MIMETYPE_APPLICATION_JSON -from servicelib.request_keys import RQT_USERID_KEY from simcore_postgres_database.utils_tags import ( - TagDict, TagNotFoundError, TagOperationNotAllowedError, TagsRepo, @@ -25,6 +20,16 @@ from ..login.decorators import login_required from ..security.decorators import permission_required from ..utils_aiohttp import envelope_json_response +from .schemas import ( + TagCreate, + TagGet, + TagGroupCreate, + TagGroupGet, + TagGroupPathParams, + TagPathParams, + TagRequestContext, + TagUpdate, +) def _handle_tags_exceptions(handler: Handler): @@ -42,71 +47,6 @@ async def wrapper(request: web.Request) -> web.StreamResponse: return wrapper -# -# API components/schemas -# - - -class _RequestContext(BaseModel): - user_id: UserID = Field(..., alias=RQT_USERID_KEY) # type: ignore[literal-required] - - -class ColorStr(ConstrainedStr): - regex = re.compile(r"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$") - - -class TagPathParams(BaseModel): - tag_id: PositiveInt - - -class TagUpdate(InputSchema): - name: str | None = None - description: str | None = None - color: ColorStr | None = None - - -class TagCreate(InputSchema): - name: str - description: str | None = None - color: ColorStr - - -class TagAccessRights(OutputSchema): - # NOTE: analogous to GroupAccessRights - read: bool - write: bool - delete: bool - - -class TagGet(OutputSchema): - id: PositiveInt - name: str - description: str | None = None - color: str - - # analogous to UsersGroup - access_rights: TagAccessRights = Field(..., alias="accessRights") - - @classmethod - def from_db(cls, tag: TagDict) -> "TagGet": - # NOTE: cls(access_rights=tag, **tag) would also work because of Config - return cls( - id=tag["id"], - name=tag["name"], - description=tag["description"], - color=tag["color"], - access_rights=TagAccessRights( # type: ignore[call-arg] - read=tag["read"], - write=tag["write"], - delete=tag["delete"], - ), - ) - - -# -# API handlers -# - routes = web.RouteTableDef() @@ -116,7 +56,7 @@ def from_db(cls, tag: TagDict) -> "TagGet": @_handle_tags_exceptions async def create_tag(request: web.Request): engine: Engine = request.app[APP_DB_ENGINE_KEY] - req_ctx = _RequestContext.parse_obj(request) + req_ctx = TagRequestContext.parse_obj(request) new_tag = await parse_request_body_as(TagCreate, request) repo = TagsRepo(user_id=req_ctx.user_id) @@ -138,7 +78,7 @@ async def create_tag(request: web.Request): @_handle_tags_exceptions async def list_tags(request: web.Request): engine: Engine = request.app[APP_DB_ENGINE_KEY] - req_ctx = _RequestContext.parse_obj(request) + req_ctx = TagRequestContext.parse_obj(request) repo = TagsRepo(user_id=req_ctx.user_id) async with engine.acquire() as conn: @@ -154,7 +94,7 @@ async def list_tags(request: web.Request): @_handle_tags_exceptions async def update_tag(request: web.Request): engine: Engine = request.app[APP_DB_ENGINE_KEY] - req_ctx = _RequestContext.parse_obj(request) + req_ctx = TagRequestContext.parse_obj(request) path_params = parse_request_path_parameters_as(TagPathParams, request) tag_updates = await parse_request_body_as(TagUpdate, request) @@ -173,7 +113,7 @@ async def update_tag(request: web.Request): @_handle_tags_exceptions async def delete_tag(request: web.Request): engine: Engine = request.app[APP_DB_ENGINE_KEY] - req_ctx = _RequestContext.parse_obj(request) + req_ctx = TagRequestContext.parse_obj(request) path_params = parse_request_path_parameters_as(TagPathParams, request) repo = TagsRepo(user_id=req_ctx.user_id) @@ -181,3 +121,56 @@ async def delete_tag(request: web.Request): await repo.delete(conn, tag_id=path_params.tag_id) raise web.HTTPNoContent(content_type=MIMETYPE_APPLICATION_JSON) + + +@routes.get(f"/{VTAG}/tags/{{tag_id}}/groups", name="list_tag_groups") +@login_required +@permission_required("tag.crud.*") +@_handle_tags_exceptions +async def list_tag_groups(request: web.Request): + path_params = parse_request_path_parameters_as(TagPathParams, request) + + assert path_params # nosec + assert envelope_json_response(parse_obj_as(list[TagGroupGet], [])) + + raise NotImplementedError + + +@routes.post(f"/{VTAG}/tags/{{tag_id}}/groups/{{group_id}}", name="create_tag_group") +@login_required +@permission_required("tag.crud.*") +@_handle_tags_exceptions +async def create_tag_group(request: web.Request): + path_params = parse_request_path_parameters_as(TagGroupPathParams, request) + new_tag_group = await parse_request_body_as(TagGroupCreate, request) + + assert path_params # nosec + assert new_tag_group # nosec + + raise NotImplementedError + + +@routes.put(f"/{VTAG}/tags/{{tag_id}}/groups/{{group_id}}", name="replace_tag_groups") +@login_required +@permission_required("tag.crud.*") +@_handle_tags_exceptions +async def replace_tag_groups(request: web.Request): + path_params = parse_request_path_parameters_as(TagGroupPathParams, request) + new_tag_group = await parse_request_body_as(TagGroupCreate, request) + + assert path_params # nosec + assert new_tag_group # nosec + + raise NotImplementedError + + +@routes.delete(f"/{VTAG}/tags/{{tag_id}}/groups/{{group_id}}", name="delete_tag_group") +@login_required +@permission_required("tag.crud.*") +@_handle_tags_exceptions +async def delete_tag_group(request: web.Request): + path_params = parse_request_path_parameters_as(TagGroupPathParams, request) + + assert path_params # nosec + assert web.HTTPNoContent(content_type=MIMETYPE_APPLICATION_JSON) + raise NotImplementedError diff --git a/services/web/server/src/simcore_service_webserver/tags/schemas.py b/services/web/server/src/simcore_service_webserver/tags/schemas.py new file mode 100644 index 00000000000..1c62cd25d89 --- /dev/null +++ b/services/web/server/src/simcore_service_webserver/tags/schemas.py @@ -0,0 +1,91 @@ +import re +from datetime import datetime + +from models_library.api_schemas_webserver._base import InputSchema, OutputSchema +from models_library.users import GroupID, UserID +from pydantic import ConstrainedStr, Field, PositiveInt +from servicelib.aiohttp.requests_validation import RequestParams, StrictRequestParams +from servicelib.request_keys import RQT_USERID_KEY +from simcore_postgres_database.utils_tags import TagDict + + +class TagRequestContext(RequestParams): + user_id: UserID = Field(..., alias=RQT_USERID_KEY) # type: ignore[literal-required] + + +class TagPathParams(StrictRequestParams): + tag_id: PositiveInt + + +class ColorStr(ConstrainedStr): + regex = re.compile(r"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$") + + +class TagUpdate(InputSchema): + name: str | None = None + description: str | None = None + color: ColorStr | None = None + + +class TagCreate(InputSchema): + name: str + description: str | None = None + color: ColorStr + + +class TagAccessRights(OutputSchema): + # NOTE: analogous to GroupAccessRights + read: bool + write: bool + delete: bool + + +class TagGet(OutputSchema): + id: PositiveInt + name: str + description: str | None = None + color: str + + # analogous to UsersGroup + access_rights: TagAccessRights = Field(..., alias="accessRights") + + @classmethod + def from_db(cls, tag: TagDict) -> "TagGet": + # NOTE: cls(access_rights=tag, **tag) would also work because of Config + return cls( + id=tag["id"], + name=tag["name"], + description=tag["description"], + color=tag["color"], + access_rights=TagAccessRights( # type: ignore[call-arg] + read=tag["read"], + write=tag["write"], + delete=tag["delete"], + ), + ) + + +# +# Share API: GROUPS +# + + +class TagGroupPathParams(TagPathParams): + group_id: GroupID + + +class TagGroupCreate(InputSchema): + read: bool + write: bool + delete: bool + + +class TagGroupGet(OutputSchema): + gid: GroupID + # access + read: bool + write: bool + delete: bool + # timestamps + created: datetime + modified: datetime diff --git a/services/web/server/tests/unit/with_dbs/01/test_catalog_handlers__services.py b/services/web/server/tests/unit/with_dbs/01/test_catalog_handlers__services.py index 1f9cde45288..396e3a1f8a0 100644 --- a/services/web/server/tests/unit/with_dbs/01/test_catalog_handlers__services.py +++ b/services/web/server/tests/unit/with_dbs/01/test_catalog_handlers__services.py @@ -216,3 +216,89 @@ async def test_get_and_patch_service( assert mocked_rpc_catalog_service_api["get_service"].call_count == 1 assert mocked_rpc_catalog_service_api["update_service"].call_count == 1 + + +@pytest.mark.xfail(reason="service tags entrypoints under development") +@pytest.mark.parametrize( + "user_role", + [UserRole.USER], +) +async def test_tags_in_services( + client: TestClient, + logged_user: UserInfoDict, + mocked_rpc_catalog_service_api: dict[str, MagicMock], +): + assert client.app + assert client.app.router + + service_key = "simcore/services/dynamic/someservice" + service_version = "3.4.5" + + # the service + url = client.app.router["get_service"].url_for( + service_key=urllib.parse.quote(service_key, safe=""), + service_version=service_version, + ) + response = await client.get(f"{url}") + data, error = await assert_status(response, status.HTTP_200_OK) + assert not error + + # list tags + url = client.app.router["list_service_tags"].url_for( + service_key=urllib.parse.quote(service_key, safe=""), + service_version=service_version, + ) + response = await client.get(f"{url}") + data, error = await assert_status(response, status.HTTP_200_OK) + + assert not error + assert not data + + # create a tag + fake_tag = {"name": "tag1", "description": "description1", "color": "#f00"} + url = client.app.router["create_tag"].url_for() + resp = await client.post(f"{url}", json=fake_tag) + tag, _ = await assert_status(resp, status.HTTP_201_CREATED) + + tag_id = tag["id"] + assert tag["name"] == fake_tag["name"] + + # add_service_tag + url = client.app.router["add_service_tag"].url_for( + service_key=urllib.parse.quote(service_key, safe=""), + service_version=service_version, + tag_id=tag_id, + ) + response = await client.get(f"{url}") + data, error = await assert_status(response, status.HTTP_200_OK) + + # list_service_tags + url = client.app.router["list_service_tags"].url_for( + service_key=urllib.parse.quote(service_key, safe=""), + service_version=service_version, + ) + response = await client.put(f"{url}") + data, error = await assert_status(response, status.HTTP_200_OK) + + assert not error + assert len(data) == 1 + + # remove_service_tag + url = client.app.router["remove_service_tag"].url_for( + service_key=urllib.parse.quote(service_key, safe=""), + service_version=service_version, + tag_id=tag_id, + ) + response = await client.delete(f"{url}") + data, error = await assert_status(response, status.HTTP_204_NO_CONTENT) + + # list_service_tags + url = client.app.router["list_service_tags"].url_for( + service_key=urllib.parse.quote(service_key, safe=""), + service_version=service_version, + ) + response = await client.put(f"{url}") + data, error = await assert_status(response, status.HTTP_200_OK) + + assert not error + assert not data diff --git a/services/web/server/tests/unit/with_dbs/03/tags/test_tags.py b/services/web/server/tests/unit/with_dbs/03/tags/test_tags.py index 84c6647a4c5..71012571736 100644 --- a/services/web/server/tests/unit/with_dbs/03/tags/test_tags.py +++ b/services/web/server/tests/unit/with_dbs/03/tags/test_tags.py @@ -68,10 +68,10 @@ async def test_tags_to_studies( added_tags.append(added_tag) # Add tag to study - url = client.app.router["add_tag"].url_for( + url = client.app.router["add_project_tag"].url_for( project_uuid=user_project.get("uuid"), tag_id=str(added_tag.get("id")) ) - resp = await client.put(f"{url}") + resp = await client.post(f"{url}") data, _ = await assert_status(resp, expected) # Tag is included in response @@ -99,11 +99,12 @@ async def test_tags_to_studies( assert added_tags[0].get("id") not in data.get("tags") # Remove tag1 from project - url = client.app.router["remove_tag"].url_for( + url = client.app.router["remove_project_tag"].url_for( project_uuid=user_project.get("uuid"), tag_id=str(added_tags[1].get("id")) ) - resp = await client.delete(f"{url}") + resp = await client.post(f"{url}") await assert_status(resp, expected) + # Get project and check that tag is no longer there user_project["tags"].remove(added_tags[1]["id"]) data = await assert_get_same_project(client, user_project, expected)