openapi: 3.0.3 info: title: Cosmo Tech Solution Manager API description: Cosmo Tech Solution Manager API version: 0.0.8-SNAPSHOT servers: - url: 'https://api.azure.cosmo-platform.com' - url: 'http://localhost:4010' security: - oAuth2AuthCode: [ ] tags: - name: solution description: Solution Management paths: /organizations/{organization_id}/solutions: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string post: operationId: createSolution tags: - solution summary: Register a new solution requestBody: description: the Solution to create required: true content: application/json: schema: $ref: '#/components/schemas/Solution' examples: Brewery: $ref: '#/components/examples/Brewery' application/yaml: schema: type: string format: binary examples: ADTConnector: $ref: '#/components/examples/Brewery' responses: "201": description: the solution details content: application/json: schema: $ref: '#/components/schemas/Solution' examples: Brewery: $ref: '#/components/examples/Brewery' "400": description: Bad request get: operationId: findAllSolutions 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: - solution summary: List all Solutions responses: "200": description: the solution details content: application/json: schema: type: array items: $ref: '#/components/schemas/Solution' examples: Two: $ref: '#/components/examples/OneSolution' /organizations/{organization_id}/solutions/{solution_id}: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string - name: solution_id in: path description: the Solution identifier required: true schema: type: string get: operationId: findSolutionById tags: - solution summary: Get the details of a solution responses: "200": description: the Solution details content: application/json: schema: $ref: '#/components/schemas/Solution' examples: Brewery: $ref: '#/components/examples/Brewery' "404": description: the Solution specified is unknown or you don't have access to it patch: operationId: updateSolution tags: - solution summary: Update a solution requestBody: description: the new Solution details. This endpoint can't be used to update security required: true content: application/json: schema: $ref: '#/components/schemas/Solution' examples: BreweryUpdate: $ref: '#/components/examples/BreweryUpdate' application/yaml: schema: type: string format: binary examples: BreweryUpdate: $ref: '#/components/examples/BreweryUpdate' responses: "200": description: the solution details content: application/json: schema: $ref: '#/components/schemas/Solution' examples: BreweryUpdated: $ref: '#/components/examples/BreweryUpdated' "400": description: Bad request "404": description: the Solution specified is unknown or you don't have access to it delete: operationId: deleteSolution tags: - solution summary: Delete a solution responses: "204": description: Request succeeded "404": description: the Solution specified is unknown or you don't have access to it /organizations/{organization_id}/solutions/{solution_id}/parameters: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string - name: solution_id in: path description: the Solution identifier required: true schema: type: string post: operationId: addOrReplaceParameters tags: - solution summary: Add Parameters. Any item with the same ID will be overwritten requestBody: description: the Parameters required: true content: application/json: schema: type: array items: $ref: "#/components/schemas/RunTemplateParameter" responses: "201": description: the Parameters content: application/json: schema: type: array items: $ref: '#/components/schemas/RunTemplateParameter' "400": description: Bad request "404": description: the Solution specified is unknown or you don't have access to it delete: operationId: removeAllSolutionParameters tags: - solution summary: Remove all Parameters from the Solution specified responses: "204": description: the operation succeeded "404": description: the Solution specified is unknown or you don't have access to it /organizations/{organization_id}/solutions/{solution_id}/parameterGroups: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string - name: solution_id in: path description: the Solution identifier required: true schema: type: string post: operationId: addOrReplaceParameterGroups tags: - solution summary: Add Parameter Groups. Any item with the same ID will be overwritten requestBody: description: the Parameter Groups required: true content: application/json: schema: type: array items: $ref: "#/components/schemas/RunTemplateParameterGroup" responses: "201": description: the Parameter Groups content: application/json: schema: type: array items: $ref: '#/components/schemas/RunTemplateParameterGroup' "400": description: Bad request "404": description: the Solution specified is unknown or you don't have access to it delete: operationId: removeAllSolutionParameterGroups tags: - solution summary: Remove all Parameter Groups from the Solution specified responses: "204": description: the operation succeeded "404": description: the Solution specified is unknown or you don't have access to it /organizations/{organization_id}/solutions/{solution_id}/runTemplates: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string - name: solution_id in: path description: the Solution identifier required: true schema: type: string post: operationId: addOrReplaceRunTemplates tags: - solution summary: Add Run Templates. Any item with the same ID will be overwritten requestBody: description: the Run Templates required: true content: application/json: schema: type: array items: $ref: "#/components/schemas/RunTemplate" responses: "201": description: the Parameters content: application/json: schema: type: array items: $ref: '#/components/schemas/RunTemplate' "400": description: Bad request "404": description: the Solution specified is unknown or you don't have access to it delete: operationId: removeAllRunTemplates tags: - solution summary: Remove all Run Templates from the Solution specified responses: "204": description: the operation succeeded "404": description: the Solution specified is unknown or you don't have access to it /organizations/{organization_id}/solutions/{solution_id}/runTemplates/{run_template_id}: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string - name: solution_id in: path description: the Solution identifier required: true schema: type: string - name: run_template_id in: path description: the Run Template identifier required: true schema: type: string patch: operationId: updateSolutionRunTemplate tags: - solution summary: Update the specified Solution Run Template requestBody: description: the Run Templates required: true content: application/json: schema: $ref: "#/components/schemas/RunTemplate" application/yaml: schema: $ref: "#/components/schemas/RunTemplate" responses: "200": description: the Parameters content: application/json: schema: type: array items: $ref: '#/components/schemas/RunTemplate' "400": description: Bad request "404": description: the Solution or Run Template specified is unknown or you don't have access to it delete: operationId: deleteSolutionRunTemplate tags: - solution summary: Remove the specified Solution Run Template responses: "204": description: the operation succeeded "404": description: the Solution specified is unknown or you don't have access to it /organizations/{organization_id}/solutions/{solution_id}/runtemplates/{run_template_id}/handlers/{handler_id}/download: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string - name: solution_id in: path description: the Solution identifier required: true schema: type: string - name: run_template_id in: path description: the Run Template identifier required: true schema: type: string - name: handler_id in: path description: the Handler identifier required: true schema: $ref: '#/components/schemas/RunTemplateHandlerId' get: operationId: downloadRunTemplateHandler tags: - solution summary: Download a Run Template step handler zip file responses: "200": description: the run template handle file as a resource headers: Content-Disposition: schema: type: string format: byte description: Run Template step handler zip file example: attachment; filename="name.zip" content: application/octet-stream: schema: type: string format: byte "404": description: the Run Template Handler file specified is unknown or you don't have access to it /organizations/{organization_id}/solutions/{solution_id}/runtemplates/{run_template_id}/handlers/{handler_id}/upload: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string - name: solution_id in: path description: the Solution identifier required: true schema: type: string - name: run_template_id in: path description: the Run Template identifier required: true schema: type: string - name: handler_id in: path description: the Handler identifier required: true schema: $ref: '#/components/schemas/RunTemplateHandlerId' - name: overwrite in: query description: whether to overwrite any existing handler resource schema: type: boolean default: false post: operationId: uploadRunTemplateHandler tags: - solution summary: Upload a Run Template step handler zip file requestBody: required: true content: application/octet-stream: # Using 'application/octet-stream' so Swagger UI can display a file upload button. # See https://github.com/swagger-api/swagger-ui/issues/5636 # In any case, the request body mime type is enforced in the Service implementation. schema: type: string format: binary responses: "201": description: zip file uploaded "400": description: Bad request /organizations/{organization_id}/solutions/{solution_id}/security: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string - name: solution_id in: path description: the Solution identifier required: true schema: type: string get: operationId: getSolutionSecurity tags: - solution summary: Get the Solution security information responses: "200": description: The Solution security content: application/json: schema: $ref: '#/components/schemas/SolutionSecurity' "404": description: the Solution specified is unknown or you don't have access to it /organizations/{organization_id}/solutions/{solution_id}/security/default: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string - name: solution_id in: path description: the Solution identifier required: true schema: type: string post: operationId: setSolutionDefaultSecurity tags: - solution summary: Set the Solution default security requestBody: description: This change the solution 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 solution. required: true content: application/json: schema: $ref: '#/components/schemas/SolutionRole' examples: BrewerySolutionRole: $ref: '#/components/examples/BrewerySolutionRole' application/yaml: schema: type: string format: binary examples: BrewerySolutionRole: $ref: '#/components/examples/BrewerySolutionRole' responses: "201": description: The Solution default visibility content: application/json: schema: $ref: '#/components/schemas/SolutionSecurity' "404": description: the Solution specified is unknown or you don't have access to it /organizations/{organization_id}/solutions/{solution_id}/security/users: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string - name: solution_id in: path description: the Solution identifier required: true schema: type: string get: operationId: getSolutionSecurityUsers tags: - solution summary: Get the Solution security users list responses: "200": description: The Solution security users list content: application/json: schema: type: array items: type: string example: - alice@mycompany.com - bob@mycompany.com "404": description: the Solution or the User specified is unknown or you don't have access to them /organizations/{organization_id}/solutions/{solution_id}/security/access: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string - name: solution_id in: path description: the Solution identifier required: true schema: type: string post: operationId: addSolutionAccessControl tags: - solution summary: Add a control access to the Solution requestBody: description: the new Solution security access to add. required: true content: application/json: schema: $ref: '#/components/schemas/SolutionAccessControl' examples: SolutionAccess: $ref: '#/components/examples/BrewerySolutionAccessControl' application/yaml: schema: type: string format: binary examples: SolutionAccess: $ref: '#/components/examples/BrewerySolutionAccessControl' responses: "201": description: The Solution access content: application/json: schema: $ref: '#/components/schemas/SolutionAccessControl' examples: SolutionAccessControl: $ref: '#/components/examples/BrewerySolutionAccessControl' "404": description: the Solution specified is unknown or you don't have access to it /organizations/{organization_id}/solutions/{solution_id}/security/access/{identity_id}: parameters: - name: organization_id in: path description: the Organization identifier required: true schema: type: string - name: solution_id in: path description: the Solution identifier required: true schema: type: string - name: identity_id in: path description: the User identifier required: true schema: type: string get: operationId: getSolutionAccessControl tags: - solution summary: Get a control access for the Solution responses: "200": description: The Solution access content: application/json: schema: $ref: '#/components/schemas/SolutionAccessControl' examples: SolutionAccessControl: $ref: '#/components/examples/BrewerySolutionAccessControl' "404": description: The Solution or user specified is unknown or you don't have access to it patch: operationId: updateSolutionAccessControl tags: - solution summary: Update the specified access to User for a Solution requestBody: description: The new Solution Access Control required: true content: application/json: schema: $ref: '#/components/schemas/SolutionRole' examples: BrewerySolutionRole: $ref: '#/components/examples/BrewerySolutionRole' responses: "200": description: The Solution access content: application/json: schema: $ref: '#/components/schemas/SolutionAccessControl' examples: SolutionAccessControl: $ref: '#/components/examples/BrewerySolutionAccessControl' "404": description: The Solution specified is unknown or you don't have access to it delete: operationId: removeSolutionAccessControl tags: - solution summary: Remove the specified access from the given Organization Solution responses: "204": description: Request succeeded "404": description: The Solution 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: Solution: type: object x-class-extra-annotation: "@com.redis.om.spring.annotations.Document" description: a version of a Solution properties: id: type: string x-field-extra-annotation: "@org.springframework.data.annotation.Id" readOnly: true description: the Solution version unique identifier organizationId: x-field-extra-annotation: "@com.redis.om.spring.annotations.Indexed" type: string readOnly: true description: the Organization unique identifier key: type: string description: the Solution key which group Solution versions name: type: string x-field-extra-annotation: "@com.redis.om.spring.annotations.Searchable" description: the Solution name description: type: string description: the Solution description repository: type: string description: the registry repository containing the image csmSimulator: type: string description: the main Cosmo Tech simulator name used in standard Run Template version: type: string description: the Solution version MAJOR.MINOR.PATCH. Must be aligned with an existing repository tag ownerId: type: string readOnly: true description: the User id which own this Solution sdkVersion: type: string description: the MAJOR.MINOR version used to build this solution url: type: string description: an optional URL link to solution page tags: type: array description: the list of tags items: type: string parameters: type: array description: the list of Run Template Parameters items: $ref: '#/components/schemas/RunTemplateParameter' parameterGroups: type: array description: the list of parameters groups for the Run Templates items: $ref: '#/components/schemas/RunTemplateParameterGroup' runTemplates: type: array description: list of Run Template items: $ref: '#/components/schemas/RunTemplate' security: x-field-extra-annotation: "@com.redis.om.spring.annotations.Indexed" allOf: - $ref: '#/components/schemas/SolutionSecurity' # required: # - key # - name # - repository # - version # - runTemplates SolutionSecurity: type: object description: the Solution 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 Solution with detailed access control information items: $ref: '#/components/schemas/SolutionAccessControl' required: - default - accessControlList SolutionAccessControl: type: object description: a Solution 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 SolutionRole: type: object description: the Solution Role properties: role: type: string description: the Solution Role required: - role RunTemplate: type: object description: a Solution Run Template properties: id: type: string description: the Solution Run Template id name: type: string description: the Run Template name deprecated: true labels: $ref: '#/components/schemas/TranslatedLabels' description: type: string description: the Run Template description csmSimulation: type: string description: the Cosmo Tech simulation name. This information is send to the Engine. Mandatory information if no Engine is defined tags: type: array description: the list of Run Template tags items: type: string computeSize: type: string description: the compute size needed for this Run Template. Standard sizes are basic and highcpu. Default is basic runSizing: description: definition of resources needed for the scenario run $ref: "#/components/schemas/RunTemplateResourceSizing" noDataIngestionState: type: boolean description: set to true if the run template does not want to check data ingestion state (no probes or not control plane) fetchDatasets: type: boolean description: whether or not the fetch dataset step is done scenarioDataDownloadTransform: type: boolean description: whether or not the scenario data download transform step step is done fetchScenarioParameters: type: boolean description: whether or not the fetch parameters step is done applyParameters: type: boolean description: whether or not the apply parameter step is done validateData: type: boolean description: whether or not the validate step is done sendDatasetsToDataWarehouse: type: boolean description: whether or not the Datasets values are send to the DataWarehouse prior to Simulation Run. If not set follow the Workspace setting sendInputParametersToDataWarehouse: type: boolean description: whether or not the input parameters values are send to the DataWarehouse prior to Simulation Run. If not set follow the Workspace setting preRun: type: boolean description: whether or not the pre-run step is done run: type: boolean description: whether or not the run step is done postRun: type: boolean description: whether or not the post-run step is done parametersJson: type: boolean description: whether or not to store the scenario parameters in json instead of csv parametersHandlerSource: $ref: "#/components/schemas/RunTemplateStepSource" datasetValidatorSource: $ref: "#/components/schemas/RunTemplateStepSource" preRunSource: $ref: "#/components/schemas/RunTemplateStepSource" runSource: $ref: "#/components/schemas/RunTemplateStepSource" postRunSource: $ref: "#/components/schemas/RunTemplateStepSource" scenariodataTransformSource: $ref: "#/components/schemas/RunTemplateStepSource" parameterGroups: type: array description: the ordered list of parameters groups for the Run Template items: type: string description: a Run Template Group Parameter id stackSteps: type: boolean description: whether or not to stack adjacent scenario run steps in one container run which will chain steps gitRepositoryUrl: type: string description: an optional URL to the git repository gitBranchName: type: string description: an optional git branch name runTemplateSourceDir: type: string description: an optional directory where to find the run template source orchestratorType: $ref: "#/components/schemas/RunTemplateOrchestrator" executionTimeout: type: integer description: an optional duration in seconds in which a workflow is allowed to run deleteHistoricalData: $ref: "#/components/schemas/DeleteHistoricalData" required: - id # - name DeleteHistoricalData: type: object description: Configuration of scenario runs deletion automatic mecanism properties: enable: type: boolean description: Activate or Deactivate historical data deletion default: true pollFrequency: type: integer description: define the polling frequency of scenario run status (in millis) default: 10000 timeOut: type: integer description: define the polling timeout default: 28800 required: - enable RunTemplateOrchestrator: type: string description: the Orchestrator to use for the Run Template enum: - argoWorkflow - csmOrc RunTemplateHandlerId: type: string description: the Run Template step handler identifier enum: ["parameters_handler","validator","prerun","engine","postrun","scenariodata_transform"] RunTemplateStepSource: type: string description: the source local, cloud or git repository enum: ["cloud","git","local","platform"] RunTemplateResourceSizing: type: object description: a description object for resource requests and limits (default same configuration as basic sizing) properties: requests: $ref: '#/components/schemas/ResourceSizeInfo' limits: $ref: '#/components/schemas/ResourceSizeInfo' required: - requests - limits ResourceSizeInfo: type: object description: define cpus and memory needs properties: cpu: type: string description: define cpu needs memory: type: string description: define memory needs required: - cpu - memory RunTemplateParameterGroup: type: object description: a Parameter Group for a Run Template properties: id: type: string description: the Parameter Group id labels: $ref: '#/components/schemas/TranslatedLabels' isTable: type: boolean description: does the group define a table options: type: object description: freeform options additionalProperties: true parentId: type: string description: the Run Template Group parent Id parameters: type: array description: an ordered list of Run Template Parameters items: type: string description: a Run Template Parameter id required: - id #  - labels #  - parameters RunTemplateParameter: type: object description: a Run Template Parameter properties: id: type: string description: the Parameter id labels: $ref: '#/components/schemas/TranslatedLabels' varType: type: string description: the variable type for the parameter. Basic types or special type %DATASETID% defaultValue: type: string description: the default value for this parameter minValue: type: string description: the minimum value for this parameter maxValue: type: string description: the maximum value for this parameter regexValidation: type: string description: a regex to validate the value options: type: object description: freeform options additionalProperties: true required: - id # - labels # - varType TranslatedLabels: type: object description: a translated label with key as ISO 639-1 code additionalProperties: type: string examples: Brewery: summary: Brewery Solution description: Brewery Solution example value: id: "1" key: Brewery Solution name: Brewery Solution description: A Brewery Supplier Solution Model which simulate stock, production, transport and customer satisfaction repository: brewery_solution version: "1.0.0" ownerId: "1" url: https://github.com/Cosmo-Tech/brewery_sample_solution tags: - Brewery parameters: - id: prefix labels: fr: Prefix des noms en: Names prefix varType: string parameterGroups: - id: consumers labels: fr: Consommateurs en: Consumers parameters: - prefix runTemplates: - id: hundred name: Full simulation 100 steps description: Run a full simulation with 100 steps csmSimulation: DeployedSimulation tags: - Full - Supply computeSize: highcpu parameterGroups: - consumers deleteHistoricalData: enable: true pollFrequency: 10000 security: default: none accessControlList: - id: "jane.doe@cosmotech.com" role: "editor" - id: "john.doe@cosmotech.com" role: "viewer" BreweryUpdate: summary: Brewery Solution update description: Brewery Solution update example value: name: Brewery Solution 2021 BreweryUpdated: summary: Brewery Solution description: Brewery Solution example value: id: "1" key: Brewery Solution name: Brewery Solution 2021 description: A Brewery Supplier Solution Model which simulate stock, production, transport and customer satisfaction repository: brewery_solution version: "1.0.0" ownerId: "1" url: https://github.com/Cosmo-Tech/brewery_sample_solution tags: - Brewery parameters: - id: prefix labels: fr: Prefix des noms en: Names prefix varType: string parameterGroups: - id: consumers labels: fr: Consommateurs en: Consumers parameters: - prefix runTemplates: - id: hundred name: Full simulation 100 steps description: Run a full simulation with 100 steps csmSimulation: DeployedSimulation tags: - Full - Supply computeSize: highcpu parameterGroups: - consumers BrewerySolutionAccessControl: summary: Set an access control. description: Set an access control for a user to a solution. value: id: "bob.doe@cosmotech.com" role: "editor" BrewerySolutionRole: summary: Set a Solution Role. description: Set a Role for a user to a solution. value: role: "editor" OneSolution: summary: Brewery Solution description: Brewery Solution example value: - id: "1" key: Brewery Solution name: Brewery Solution description: A Brewery Supplier Solution Model which simulate stock, production, transport and customer satisfaction repository: brewery_solution version: "1.0.0" ownerId: "1" url: https://github.com/Cosmo-Tech/brewery_sample_solution tags: - Brewery parameters: - id: prefix labels: fr: Prefix des noms en: Names prefix varType: string parameterGroups: - id: consumers labels: fr: Consommateurs en: Consumers parameters: - prefix runTemplates: - id: hundred name: Full simulation 100 steps description: Run a full simulation with 100 steps csmSimulation: DeployedSimulation tags: - Full - Supply computeSize: highcpu parameterGroups: - consumers - id: standard name: Standard Simulation description: Run the standard Simulation csmSimulation: DeployedSimulation tags: - Full - Supply computeSize: basic