Enhanced response with Complex State in API
[cps.git] / cps-ncmp-rest / docs / openapi / components.yaml
index 32d25e3..5fe47e4 100644 (file)
@@ -209,6 +209,8 @@ components:
           example: my-cm-handle1
         publicCmHandleProperties:
           $ref: '#/components/schemas/CmHandlePublicProperties'
+        state:
+          $ref: '#/components/schemas/RestOutputCmHandleState'
     CmHandlePublicProperties:
       type: array
       items:
@@ -216,6 +218,50 @@ components:
         additionalProperties:
           type: string
           example: Book Type
+    RestOutputCmHandleState:
+      type: object
+      properties:
+        cmHandleState:
+          type: string
+          example: ADVISED
+        lockReason:
+          $ref: '#/components/schemas/lock-reason'
+        lastUpdateTime:
+          type: string
+          example: 2022-12-31T20:30:40.000+0000
+        dataSyncEnabled:
+          type: boolean
+          example: false
+        dataSyncState:
+          $ref: '#/components/schemas/dataStores'
+
+    lock-reason:
+      type: object
+      properties:
+        reason:
+          type: string
+          example: LOCKED_OTHER
+        details:
+          type: string
+          example: locked due to module sync
+
+    dataStores:
+      type: object
+      properties:
+        operational:
+          $ref: '#/components/schemas/sync-state'
+        running:
+          $ref: '#/components/schemas/sync-state'
+
+    sync-state:
+      type: object
+      properties:
+        state:
+          type: string
+          example: NONE_REQUESTED
+        lastSyncTime:
+          type: string
+          example: 2022-12-31T20:30:40.000+0000
 
     RestOutputCmHandlePublicProperties:
       type: object