openapi: 3.0.3 info: title: Cosmo Tech Workspace Manager API description: Cosmo Tech Workspace Manager API version: 0.0.8-SNAPSHOT servers: - url: 'https://api.azure.cosmo-platform.com' - url: 'http://localhost:4010' security: - oAuth2AuthCode: [ ] tags: - name: workspace description: Workspace Management paths: /organizations/{organization_id}/workspaces: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string post: operationId: createWorkspace tags: - workspace summary: Create a new workspace requestBody: description: the Workspace to create required: true content: application/json: schema: $ref: '#/components/schemas/Workspace' examples: Workspace: $ref: '#/components/examples/BreweryWorkspaceCreateIn' application/yaml: schema: type: string format: binary examples: Workspace: $ref: '#/components/examples/BreweryWorkspaceCreateIn' responses: "201": description: the workspace details content: application/json: schema: $ref: '#/components/schemas/Workspace' examples: Workspace: $ref: '#/components/examples/BreweryWorkspace' "400": description: Bad request get: operationId: findAllWorkspaces parameters: - name: page in: query description: page number to query required: false schema: type: integer - name: size in: query description: amount of result by page required: false schema: type: integer tags: - workspace summary: List all Workspaces responses: "200": description: the workspace details content: application/json: schema: type: array items: $ref: '#/components/schemas/Workspace' examples: WorkspaceList: $ref: '#/components/examples/WorkspaceList' /organizations/{organization_id}/workspaces/{workspace_id}: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string - name: workspace_id in: path description: the Workspace identifier required: true schema: type: string get: operationId: findWorkspaceById tags: - workspace summary: Get the details of an workspace responses: "200": description: the Workspace details content: application/json: schema: $ref: '#/components/schemas/Workspace' examples: Workspace: $ref: '#/components/examples/BreweryWorkspace' "404": description: The Workspace specified is unknown or you don't have access to it patch: operationId: updateWorkspace tags: - workspace summary: Update a workspace requestBody: description: The new Workspace details. This endpoint can't be used to update security required: true content: application/json: schema: $ref: '#/components/schemas/Workspace' examples: BreweryUpdate: $ref: '#/components/examples/BreweryWorkspaceUpdate' application/yaml: schema: type: string format: binary examples: BreweryUpdate: $ref: '#/components/examples/BreweryWorkspaceUpdate' responses: "200": description: the workspace details content: application/json: schema: $ref: '#/components/schemas/Workspace' examples: BreweryUpdated: $ref: '#/components/examples/BreweryWorkspaceUpdated' "400": description: Bad request "404": description: the Workspace specified is unknown or you don't have access to it delete: operationId: deleteWorkspace tags: - workspace summary: Delete a workspace responses: "200": description: the workspace details content: application/json: schema: $ref: '#/components/schemas/Workspace' examples: Workspace: $ref: '#/components/examples/BreweryWorkspace' "400": description: Bad request "404": description: the Workspace specified is unknown or you don't have access to it /organizations/{organization_id}/workspaces/{workspace_id}/files: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string - name: workspace_id in: path description: the Workspace identifier required: true schema: type: string post: operationId: uploadWorkspaceFile tags: - workspace summary: Upload a file for the Workspace requestBody: description: the file to upload required: true content: multipart/form-data: schema: type: object properties: overwrite: type: boolean default: false destination: # PROD-7601 : Allow clients to specify where the file should be uploaded type: string description: | Destination path. Must end with a '/' if specifying a folder. Note that paths may or may not start with a '/', but they are always treated as relative to the Workspace root location. example: "path/to/a/directory/" file: type: string format: binary required: - file examples: use_file_name_as_is: summary: Use the file name as is as destination value: file: "Lorem Ipsum Dolor Sit Amet" upload_to_workspace_root_under_a_different_file_name: summary: Upload to the Workspace root folder, but rename the target file value: destination: "my_file_renamed.txt" file: "Lorem Ipsum Dolor Sit Amet" upload_to_a_folder: summary: | Upload to a sub-folder. Destination may or may not start with a '/', but must end with '/' to be treated as a directory. Final file path will always be relative to the Workspace root location. value: destination: "path/to/a/directory/" file: "Lorem Ipsum Dolor Sit Amet" upload_to_a_specific_folder_and_under_a_different_file_name: summary: | Upload to a sub-folder. Destination may or may not start with a '/', but must not end with '/'. Final file path will always be relative to the Workspace root location. value: destination: "/path/to/a/directory/my_file_renamed.txt" file: "Lorem Ipsum Dolor Sit Amet" responses: "201": description: the file resource details content: application/json: schema: $ref: '#/components/schemas/WorkspaceFile' examples: BreweryWorkspaceFile: $ref: '#/components/examples/BreweryWorkspaceFile' "400": description: Bad request get: operationId: findAllWorkspaceFiles tags: - workspace summary: List all Workspace files responses: "200": description: the workspace files content: application/json: schema: type: array items: $ref: '#/components/schemas/WorkspaceFile' examples: WorkspaceFiles: $ref: '#/components/examples/WorkspaceFiles' "404": description: the Workspace specified is unknown or you don't have access to it delete: operationId: deleteAllWorkspaceFiles tags: - workspace summary: Delete all Workspace files responses: "204": description: Request succeeded "404": description: the Workspace specified is unknown or you don't have access to them /organizations/{organization_id}/workspaces/{workspace_id}/files/download: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string - name: workspace_id in: path description: the Workspace identifier required: true schema: type: string - name: file_name in: query description: the file name required: true schema: type: string get: operationId: downloadWorkspaceFile tags: - workspace summary: Download the Workspace File specified responses: "200": description: the workspace file as a resource content: application/octet-stream: schema: type: string format: binary "404": description: the Workspace file specified is unknown or you don't have access to it /organizations/{organization_id}/workspaces/{workspace_id}/files/delete: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string - name: workspace_id in: path description: the Workspace identifier required: true schema: type: string - name: file_name in: query description: the file name required: true schema: type: string delete: operationId: deleteWorkspaceFile tags: - workspace summary: Delete a workspace file responses: "204": description: Request succeeded "404": description: the Workspace or the file specified is unknown or you don't have access to them /organizations/{organization_id}/workspaces/{workspace_id}/link: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string - name: workspace_id in: path description: the Workspace identifier required: true schema: type: string post: parameters: - name: datasetId in: query description: dataset id to be linked to required: true schema: type: string operationId: linkDataset tags: - workspace responses: "200": description: the workspace details content: application/json: schema: $ref: '#/components/schemas/Workspace' examples: BreweryADTUpdated: $ref: '#/components/examples/BreweryWorkspaceWithLink' "400": description: Bad request "404": description: the workspace specified is unknown or you don't have access to it /organizations/{organization_id}/workspaces/{workspace_id}/unlink: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string - name: workspace_id in: path description: the Workspace identifier required: true schema: type: string post: parameters: - name: datasetId in: query description: dataset id to be linked to required: true schema: type: string operationId: unlinkDataset tags: - workspace responses: "200": description: the workspace details content: application/json: schema: $ref: '#/components/schemas/Workspace' examples: BreweryADT: $ref: '#/components/examples/BreweryWorkspace' "400": description: Bad request "404": description: the Dataset specified is unknown or you don't have access to it /organizations/{organization_id}/workspaces/{workspace_id}/permissions/{role}: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string - name: workspace_id in: path description: the Workspace identifier required: true schema: type: string - name: role in: path description: the Role required: true schema: type: string get: operationId: getWorkspacePermissions tags: - workspace summary: Get the Workspace permission by given role responses: "200": description: The Workspace security permission list content: application/json: schema: type: array items: type: string example: - "read" - "read_security" - "create_children" /organizations/{organization_id}/workspaces/{workspace_id}/security: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string - name: workspace_id in: path description: the Workspace identifier required: true schema: type: string get: operationId: getWorkspaceSecurity tags: - workspace summary: Get the Workspace security information responses: "200": description: The Workspace security content: application/json: schema: $ref: '#/components/schemas/WorkspaceSecurity' examples: WorkspaceSecurity: $ref: '#/components/examples/BreweryWorkspaceSecurity' "404": description: the Workspace specified is unknown or you don't have access to it /organizations/{organization_id}/workspaces/{workspace_id}/security/default: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string - name: workspace_id in: path description: the Workspace identifier required: true schema: type: string post: operationId: setWorkspaceDefaultSecurity tags: - workspace summary: Set the Workspace default security requestBody: description: This change the workspace default security. The default security is the role assigned to any person not on the Access Control List. If the default security is None, then nobody outside of the ACL can access the workspace. required: true content: application/json: schema: $ref: '#/components/schemas/WorkspaceRole' examples: BreweryWorkspaceRole: $ref: '#/components/examples/BreweryWorkspaceRole' application/yaml: schema: type: string format: binary examples: BreweryWorkspaceRole: $ref: '#/components/examples/BreweryWorkspaceRole' responses: "201": description: The Workspace default visibility content: application/json: schema: $ref: '#/components/schemas/WorkspaceSecurity' examples: WriterWorkspaceSecurity: $ref: '#/components/examples/BreweryDefaultSecurityRoleWriter' "404": description: the Workspace specified is unknown or you don't have access to it /organizations/{organization_id}/workspaces/{workspace_id}/security/access: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string - name: workspace_id in: path description: the Workspace identifier required: true schema: type: string post: operationId: addWorkspaceAccessControl tags: - workspace summary: Add a control access to the Workspace requestBody: description: the new Workspace security access to add. required: true content: application/json: schema: $ref: '#/components/schemas/WorkspaceAccessControl' examples: WorkspaceAccess: $ref: '#/components/examples/BreweryWorkspaceAccessControl' application/yaml: schema: type: string format: binary examples: WorkspaceAccess: $ref: '#/components/examples/BreweryWorkspaceAccessControl' responses: "201": description: The Workspace access content: application/json: schema: $ref: '#/components/schemas/WorkspaceAccessControl' examples: WorkspaceAccessControl: $ref: '#/components/examples/BreweryWorkspaceAccessControl' "404": description: the Workspace specified is unknown or you don't have access to it /organizations/{organization_id}/workspaces/{workspace_id}/security/access/{identity_id}: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string - name: workspace_id in: path description: the Workspace identifier required: true schema: type: string - name: identity_id in: path description: the User identifier required: true schema: type: string get: operationId: getWorkspaceAccessControl tags: - workspace summary: Get a control access for the Workspace responses: "200": description: The Workspace access content: application/json: schema: $ref: '#/components/schemas/WorkspaceAccessControl' examples: WorkspaceAccessControl: $ref: '#/components/examples/BreweryWorkspaceAccessControl' "404": description: The Workspace or user specified is unknown or you don't have access to it patch: operationId: updateWorkspaceAccessControl tags: - workspace summary: Update the specified access to User for a Workspace requestBody: description: The new Workspace Access Control required: true content: application/json: schema: $ref: '#/components/schemas/WorkspaceRole' examples: BreweryWorkspaceRole: $ref: '#/components/examples/BreweryWorkspaceRole' responses: "200": description: The Workspace access content: application/json: schema: $ref: '#/components/schemas/WorkspaceAccessControl' examples: WorkspaceAccessControl: $ref: '#/components/examples/BreweryWorkspaceAccessControl' "404": description: The Workspace specified is unknown or you don't have access to it delete: operationId: removeWorkspaceAccessControl tags: - workspace summary: Remove the specified access from the given Organization Workspace responses: "204": description: Request succeeded "404": description: The Workspace or the user specified is unknown or you don't have access to them /organizations/{organization_id}/workspaces/{workspace_id}/security/users: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string - name: workspace_id in: path description: the Workspace identifier required: true schema: type: string get: operationId: getWorkspaceSecurityUsers tags: - workspace summary: Get the Workspace security users list responses: "200": description: The Workspace security users list content: application/json: schema: type: array items: type: string example: - alice@mycompany.com - bob@mycompany.com "404": description: the Workspace or the User specified is unknown or you don't have access to them /organizations/{organization_id}/workspaces/{workspace_id}/secret: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string - name: workspace_id in: path description: the Workspace identifier required: true schema: type: string post: operationId: createSecret tags: - workspace summary: Create a secret for the Workspace requestBody: description: the definition of the secret required: true content: application/json: schema: $ref: '#/components/schemas/WorkspaceSecret' examples: Workspace: $ref: '#/components/examples/WorkspaceSecretExample' application/yaml: schema: type: string format: binary examples: Workspace: $ref: '#/components/examples/WorkspaceSecretExample' responses: "201": description: Request succeeded "404": description: the Workspace or the User specified is unknown or you don't have access to them components: securitySchemes: oAuth2AuthCode: type: oauth2 description: OAuth2 authentication flows: implicit: authorizationUrl: https://login.microsoftonline.com/common/oauth2/v2.0/authorize scopes: http://dev.api.cosmotech.com/platform: Platform scope schemas: Workspace: type: object x-class-extra-annotation: "@com.redis.om.spring.annotations.Document" description: a Workspace properties: id: type: string x-field-extra-annotation: "@org.springframework.data.annotation.Id" readOnly: true description: Workspace unique identifier generated by the API example: "w-0123456789ab" organizationId: x-field-extra-annotation: "@com.redis.om.spring.annotations.Indexed" type: string readOnly: true description: Organization unique identifier under which the workspace resides example: "o-0123456789ab" key: type: string description: technical key for resource name convention and version grouping. Must be unique example: "MyKey" name: type: string x-field-extra-annotation: "@com.redis.om.spring.annotations.Searchable" description: Workspace name. This name is display in the sample webApp example: "FranceOffice" description: type: string description: the Workspace description linkedDatasetIdList: type: array description: list of dataset linked to this dataset items: type: string version: type: string description: the Workspace version MAJOR.MINOR.PATCH. example: "1.0.0" tags: type: array description: the list of tags items: type: string ownerId: type: string readOnly: true description: the user id which own this workspace. set by the API from Authentification service receved id solution: $ref: '#/components/schemas/WorkspaceSolution' webApp: $ref: '#/components/schemas/WorkspaceWebApp' sendInputToDataWarehouse: type: boolean description: default setting for all Scenarios and Run Templates to set whether or not the Dataset values and the input parameters values are send to the DataWarehouse prior to the ScenarioRun useDedicatedEventHubNamespace: type: boolean default: false description: Set this property to true to use a dedicated Azure Event Hub Namespace for this Workspace. The Event Hub Namespace must be named \'-\' (in lower case). This Namespace must also contain two Event Hubs named \'probesmeasures\' and \'scenariorun\'. dedicatedEventHubSasKeyName: type: string description: the Dedicated Event Hub SAS key name, default to RootManageSharedAccessKey. Use the /secret endpoint to set the key value dedicatedEventHubAuthenticationStrategy: type: string description: the Event Hub authentication strategy, SHARED_ACCESS_POLICY or TENANT_CLIENT_CREDENTIALS. Default to the one defined for the tenant. sendScenarioRunToEventHub: type: boolean default : true description: default setting for all Scenarios and Run Templates to set whether or not the ScenarioRun is send to the Event Hub sendScenarioMetadataToEventHub: type: boolean default: false description: Set this property to false to not send scenario metada to Azure Event Hub Namespace for this Workspace. The Event Hub Namespace must be named \'-\' (in lower case). This Namespace must also contain two Event Hubs named \'scenariometadata\' and \'scenariorunmetadata\'. datasetCopy: type: boolean default: true description: Activate the copy of dataset on scenario creation, meaning that each scenario created in this workspace will make this copy. when false, scenario use directly the dataset specified. security: x-field-extra-annotation: "@com.redis.om.spring.annotations.Indexed" allOf: - $ref: '#/components/schemas/WorkspaceSecurity' required: - key - name - solution WorkspaceSecurity: type: object description: the workspace security information properties: default: type: string x-field-extra-annotation: "@com.redis.om.spring.annotations.Indexed" description: the role by default accessControlList: type: array x-field-extra-annotation: "@com.redis.om.spring.annotations.Indexed" description: the list which can access this Workspace with detailed access control information items: $ref: '#/components/schemas/WorkspaceAccessControl' required: - default - accessControlList WorkspaceAccessControl: type: object description: a Workspace access control item properties: id: type: string x-field-extra-annotation: "@com.redis.om.spring.annotations.Indexed" description: the identity id role: type: string description: a role required: - id - role WorkspaceRole: type: object description: the Workspace Role properties: role: type: string description: the Workspace Role required: - role WorkspaceFile: type: object description: a Workspace File resource properties: fileName: type: string description: the Workspace File name WorkspaceWebApp: type: object description: a Workspace Web Application properties: url: type: string description: the Workspace Web Application URL iframes: type: object description: a map of iframeKey/iframeURL additionalProperties: true options: type: object description: free form options for Web Application additionalProperties: true required: - url WorkspaceSolution: type: object description: the Workspace Solution configuration properties: solutionId: type: string description: the Solution Id attached to this workspace runTemplateFilter: type: array description: the list of Solution Run Template Id to filter items: type: string defaultRunTemplateDataset: type: object description: a map of RunTemplateId/DatasetId to set a default dataset for a Run Template additionalProperties: true # required: # - solutionId WorkspaceSecret: type: object description: the secret definition properties: dedicatedEventHubKey: type: string description: the dedicated event hub shared access key examples: BreweryWorkspace: summary: Brewery Workspace description: Brewery Workspace example value: id: "w-da345dia76fg" organisationId: "o-daup4fea311" key: brewery name: Brewery Analysis description: Brewery analysis for stock, production, transport and customer satisfaction linkedDatasetIdList: - "d-pe57ai0h34" version: "1.0.0" tags: - Brewery ownerId: "da3518zpo-coizou3154851354dam-izhva38fze1" solution: solutionId: "sol-feo16eua48o" runTemplateFilter: - "run1" defaultRunTemplateDataset: run1: "data1" sendInputToDataWarehouse: null useDedicatekdEventHubNamespace: false dedicatedEventHubSasKeyName: null dedicatedEventHubAuthenticationStrategy: null sendScenarioRunToEventHub: true sendScenarioMetadataToEventHub: false datasetCopy: true security: default: "viewer" accessControlList: - id: "alice.doe@cosmotech.com" role: "admin" BreweryWorkspaceWithLink: summary: Brewery Workspace description: Brewery Workspace example value: id: "w-da345dia76fg" organisationId: "o-daup4fea311" key: brewery name: Brewery Analysis description: Brewery analysis for stock, production, transport and customer satisfaction version: "1.0.0" tags: - Brewery ownerId: "da3518zpo-coizou3154851354dam-izhva38fze1" solution: solutionId: "sol-feo16eua48o" runTemplateFilter: - "run1" defaultRunTemplateDataset: run1: "data1" sendInputToDataWarehouse: null useDedicatekdEventHubNamespace: false dedicatedEventHubSasKeyName: null dedicatedEventHubAuthenticationStrategy: null sendScenarioRunToEventHub: true sendScenarioMetadataToEventHub: false datasetCopy: true security: default: "viewer" accessControlList: - id: "alice.doe@cosmotech.com" role: "admin" BreweryWorkspaceCreateIn: summary: Brewery Workspace Create input parameters example description: Brewery Workspace Create input parameters example value: organisationId: "o-daup4fea311" name: Brewery Analysis key: brewery description: Brewery analysis for stock, production, transport and customer satisfaction version: "1.0.0" tags: - Brewery solution: solutionId: "sol-feo16eua48o" runTemplateFilter: - "run1" defaultRunTemplateDataset: run1: "data1" security: default: "viewer" accessControlList: - id: "alice.doe@cosmotech.com" role: "admin" WorkspaceList: summary: Workspace list description: Workspace list example value: - id: "w-da345dia76fg" organisationId: "o-daup4fea311" key: brewery name: Brewery Analysis description: Brewery analysis for stock, production, transport and customer satisfaction version: "1.0.0" tags: - Brewery ownerId: "da3518zpo-coizou3154851354dam-izhva38fze1" solution: solutionId: "sol-feo16eua48o" runTemplateFilter: - "run1" defaultRunTemplateDataset: run1: "data1" sendInputToDataWarehouse: null useDedicatekdEventHubNamespace: false dedicatedEventHubSasKeyName: null dedicatedEventHubAuthenticationStrategy: null sendScenarioRunToEventHub: true sendScenarioMetadataToEventHub: false datasetCopy: true security: default: "viewer" accessControlList: - id: "alice.doe@cosmotech.com" role: "admin" - id: "w-fdl255kbq87" organisationId: "o-daup4fea311" key: breweryPlus name: Brewery Analysis Plus description: Brewery analysis for stock, production, transport and customer satisfaction with a plus version: "1.0.0" tags: - Brewery ownerId: "da3518zpo-coizou3154851354dam-izhva38fze1" solution: solutionId: "sol-ojd96oz14pz" runTemplateFilter: - "runA" defaultRunTemplateDataset: runA: "data1" sendInputToDataWarehouse: null useDedicatekdEventHubNamespace: false dedicatedEventHubSasKeyName: null dedicatedEventHubAuthenticationStrategy: null sendScenarioRunToEventHub: true sendScenarioMetadataToEventHub: false datasetCopy: true security: default: "viewer" accessControlList: - id: "bob.doe@cosmotech.com" role: "admin" BreweryWorkspaceUpdate: summary: Update the Brewery Workspace description: Update the Brewery Workspace by changing its name value: name: Brewery Analysis 2021 BreweryWorkspaceUpdated: summary: Brewery Workspace description: Brewery Workspace example value: id: "w-da345dia76fg" organisationId: "o-daup4fea311" key: brewery name: Brewery Analysis 2021 description: Brewery analysis for stock, production, transport and customer satisfaction version: "1.0.0" tags: - Brewery ownerId: "da3518zpo-coizou3154851354dam-izhva38fze1" solution: solutionId: "sol-feo16eua48o" runTemplateFilter: - "run1" defaultRunTemplateDataset: run1: "data1" sendInputToDataWarehouse: null useDedicatekdEventHubNamespace: false dedicatedEventHubSasKeyName: null dedicatedEventHubAuthenticationStrategy: null sendScenarioRunToEventHub: true sendScenarioMetadataToEventHub: false datasetCopy: true security: default: "viewer" accessControlList: - id: "alice.doe@cosmotech.com" role: "admin" BreweryWorkspaceSecurity: summary: Brewery Workspace security description: Brewery Workspace security example value: default: "viewer" accessControlList: - id: "alice.doe@cosmotech.com" role: "editor" BreweryWorkspaceAccessControl: summary: Set an access control. description: Set an access control for a user to a workspace. value: id: "bob.doe@cosmotech.com" role: "editor" BreweryWorkspaceRole: summary: Set a Workspace Role. description: Set a Role for a user to a workspace. value: role: "editor" BreweryDefaultSecurityRoleWriter: summary: Brewery Workspace Writer default security description: Brewery Workspace example value: default: "editor" BreweryWorkspaceFile: summary: Brewery Workspace file example description: Brewery Workspace file uploaded return example value: fileName: myData.csv WorkspaceFiles: summary: Brewery Workspace files example description: Brewery Workspace files example value: - fileName: myData.csv - fileName: myData2.csv - fileName: myData3.csv WorkspaceSecretExample: summary: a shared access policy description: a shared policy example value: dedicatedEventHubKey: xxx