...
Ajay Deep Singh to pad out this section
3.1.1: Deployment REST API
This section defines Deployment/CRUD Operations that can be performed on ControlLoop.
A Client in this case CLAMP can perform CRUD operations or can deploy ControlLoops from DesignTime to RunTime Catalogue Database.
DesignTime/RunTime Catalogue Database stores ControlLoop definitions, CRUD operations on database supported by REST Endpoints like Get, Delete, Create allowing selection of a particular ControlLoop to be addressed, below sequence diag will help you understand flow how a client(Clamp) application can initiate Rest call for performing different operations on Database.
CL_Instance_Control Service is Gateway for interacting to different database DesignTime/RunTime and should be responsible for responding success or failure status on different operations.
3.1.1: Deployment REST API
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
Code Block | ||||||||||
| ||||||||||
openapi: 3.0.3 info: description: >- The ControlLoop Deployment API allows users to search and perform CRUD action on Controlloop Tosca exported data sets. version: 1.0.0 title: Control Loop Deployment API license: name: Apache 2.0 url: 'http://www.apache.org/licenses/LICENSE-2.0' contact: email: lego@est.tech servers: - url: '{scheme}://onap/controlloop/v2/' variables: scheme: description: 'The Data Set API is accessible via https and http' enum: - 'https' - 'http' default: 'http' tags: - name: Control Loop description: Deployment API - name: design-catalogue description: CRUD actions on an designtime Control Loop data sets. - name: runtime-catalogue description: CRUD actions on an runtime Control Loop data sets. paths: /design-catalogue/loops: get: tags: - design-catalogue operationId: getAllLoopsUsingGET summary: Returns a list of all available Control Loops. responses: '200': description: OK content: application/yaml: schema: type: array items: $ref: '#/components/schemas/ControlLoop' /design-catalogue/loop/{controlLoopId}: get: tags: - design-catalogue summary: >- Returns a specific control loop. description: >- This GET API returns a specific control loop. operationId: getLoopByIdUsingGET parameters: - name: controlLoopId in: path description: 'Id of the control loop.' required: true example: "org.onap.PM_CDS_Blueprint" schema: type: string responses: '200': description: OK content: application/yaml: schema: $ref: '#/components/schemas/ControlLoop' delete: tags: - design-catalogue summary: Delete a specific Control Loop by ID. operationId: deleteLoopByIdUsingDELETE parameters: - name: controlLoopId in: path description: Identity for the control loop required: true style: simple schema: type: string responses: '200': description: OK '404': description: Control Loop not present post: tags: - design-catalogue summary: >- Accepts a Tosca Service Template representing a Control Loop. description: >- This API Create a Control Loop. operationId: createLoopWithIDUsingPOST parameters: - name: controlLoopId in: path description: Identity for the control loop required: true style: simple schema: type: string responses: '200': description: OK '409': description: Control Loop already exist. put: tags: - design-catalogue summary: Updates a Control Loop. operationId: updateLoopWithIDUsingPUT parameters: - name: controlLoopId in: path description: Identity for the control loop required: true style: simple schema: type: string responses: '200': description: OK '404': description: Control Loop not found /runtime-catalogue/deploy: post: tags: - runtime-catalogue summary: >- Deploys Tosca Service Template in RunTime Catalogue. description: >- This API Deploys Tosca Service Template in RunTime Catalogue DB. operationId: deployLoopWithPOST responses: '200': description: OK '404': description: No matching record found for the given criteria. /runtime-catalogue/loop/{controlLoopId}: get: tags: - runtime-catalogue summary: >- Returns a specific control loop. description: >- This GET API returns a specific control loop. operationId: getLoopByIdUsing parameters: - name: controlLoopId in: path description: 'Id of the control loop.' required: true example: "org.onap.PM_CDS_Blueprint" schema: type: string responses: '200': description: OK content: application/yaml: schema: type: array items: $ref: '#/components/schemas/ControlLoop' delete: tags: - runtime-catalogue summary: Delete a specific Control Loop by ID. operationId: deleteLoopByIdUsing parameters: - name: controlLoopId in: path description: Identity for the control loop required: true style: simple schema: type: string responses: '200': description: OK '404': description: Control Loop not present post: tags: - runtime-catalogue summary: >- Accepts a Tosca Service Template representing a Control Loop. description: >- This API Create a Control Loop. operationId: createLoopWithIDUsing parameters: - name: controlLoopId in: path description: Identity for the control loop required: true style: simple schema: type: string responses: '200': description: OK '409': description: Control Loop already exist. put: tags: - runtime-catalogue summary: Updates a Control Loop. operationId: updateLoopWithIDUsing parameters: - name: controlLoopId in: path description: Identity for the control loop required: true style: simple schema: type: string responses: '200': description: OK '404': description: Control Loop not found components: schemas: ControlLoop: title: ControlLoop type: object properties: id: type: string ControlLoop: type: string |
3.1.2: Deployment Sequence Diagrams
This section defines Deployment/CRUD Operations that can be performed on ControlLoop.
A Client in this case CLAMP can perform CRUD operations or can deploy ControlLoops from DesignTime to RunTime Catalogue Database.
DesignTime/RunTime Catalogue Database stores ControlLoop definitions, CRUD operations on database supported by REST Endpoints like Get, Delete, Create allowing selection of a particular ControlLoop to be addressed, below sequence diag will help you understand flow how a client(Clamp) application can initiate Rest call for performing different operations on Database.
...
GET, DELETE, CREATE API ControlLoop Sequence Diagram
PlantUML Macro title GET, DELETE, CREATE API Sequence Diag @startuml actor CLAMP control CL_Instance_Control database Database note over Database: It can be DesiginTime Or RuntTime Catalogue Database CLAMP -> CL_Instance_Control: Rest API Request (JSON/Yaml) CL_Instance_Control -> Database: Get, Delete Or Create ControlLoops activate CL_Instance_Control note over CL_Instance_Control,Database: Pull, Delete existing Or Create New ControlLoops in Database alt successful case Database -> CL_Instance_Control : Return List of ControlLoops Or able to Delete, Create ControlLoop in Database CL_Instance_Control -> CLAMP: Return Success else failure case CL_Instance_Control <- Database: Return either Empty List for Get ControlLoops Or Failure Status for Delete, Create Request deactivate CL_Instance_Control note over Database: No ControlLoops exist Or Failed in Deleting, Creating ControlLoops CL_Instance_Control -> CLAMP : Return Failure end @enduml
Deploy API ControlLoop Sequence Diagram
PlantUML Macro title Deploy API ControlLoop Sequence Diag @startuml actor CLAMP control CL_Instance_Control database DesignTime_Catalogue_Database database RunTime_Catalogue_Database CLAMP -> CL_Instance_Control: Rest Deploy API Request (JSON/Yaml) CL_Instance_Control -> DesignTime_Catalogue_Database: Fetch ControlLoop from DesignTime Catalogue Database activate CL_Instance_Control note over CL_Instance_Control,DesignTime_Catalogue_Database: Fetch existing ControlLoops from DesignTime Catalogue Database alt successful case DesignTime_Catalogue_Database -> CL_Instance_Control : Return List of existing ControlLoops from DesignTime Catalogue Database note over DesignTime_Catalogue_Database, RunTime_Catalogue_Database: Populate RunTime Catalogue with ControlLoops existing in DesignTime Catalogue Database CL_Instance_Control -> RunTime_Catalogue_Database: Push ControlLoop to RunTime Catalogue Database CL_Instance_Control -> CLAMP: Return Success else failure case CL_Instance_Control <- DesignTime_Catalogue_Database: Return Empty ControlLoop List, No ControlLoop exist in DesignTime Catalogue deactivate CL_Instance_Control note over CL_Instance_Control, DesignTime_Catalogue_Database: DesignTime Catalogue Database is Empty, cannot deploy ControLoop in RunTime Catalogue Database CL_Instance_Control -> CLAMP : Return Failure end @enduml
...