Split the CpsRestController.java
[cps.git] / cps-rest / docs / api / swagger / openapi.yml
old mode 100644 (file)
new mode 100755 (executable)
index 82f47c0..ff7cdf8
@@ -12,7 +12,7 @@ paths:
   /v1/dataspaces/{dataspace-name}/:
     delete:
       tags:
-        - cps-rest
+        - cps-admin
       summary: Delete the given dataspace
       operationId: deleteDataspace
       parameters:
@@ -41,7 +41,7 @@ paths:
   /v1/dataspaces/{dataspace-name}/anchors:
     get:
       tags:
-        - cps-rest
+        - cps-admin
       summary: Read all anchors, given a dataspace
       operationId: getAnchors
       parameters:
@@ -61,15 +61,20 @@ paths:
         401:
           description: Unauthorized
           content: {}
+        400:
+          description: Bad Request
+          content: {}
         403:
           description: Forbidden
-          content: {}
         404:
           description: Not Found
           content: {}
+        204:
+          description: No Content
+          content: {}
     post:
       tags:
-        - cps-rest
+        - cps-admin
       summary: Create a new anchor in the given dataspace
       operationId: createAnchor
       parameters:
@@ -81,26 +86,19 @@ paths:
             type: string
       requestBody:
         content:
-          multipart/form-data:
+          application/json:
             schema:
-              required:
-                - file
-              properties:
-                multipartFile:
-                  type: string
-                  description: multipartFile
-                  format: binary
+              title: Anchor
+              description: anchor
+              $ref: '#/components/schemas/Anchor'
         required: true
       responses:
-        200:
-          description: OK
+        201:
+          description: Created
           content:
             application/json:
               schema:
-                type: object
-        201:
-          description: Created
-          content: {}
+                type: string
         401:
           description: Unauthorized
           content: {}
@@ -113,7 +111,7 @@ paths:
   /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}:
     get:
       tags:
-        - cps-rest
+        - cps-admin
       summary: Read an anchor given a anchor and a dataspace
       operationId: getAnchor
       parameters:
@@ -147,7 +145,7 @@ paths:
           content: {}
     delete:
       tags:
-        - cps-rest
+        - cps-admin
       summary: Delete an anchor given a anchor and a dataspace
       operationId: deleteAnchor
       parameters:
@@ -182,7 +180,7 @@ paths:
   /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes:
     get:
       tags:
-        - cps-rest
+        - cps-data
       summary: Get a node given an anchor for the given dataspace
       operationId: getNodeByDataspaceAndAnchor
       parameters:
@@ -215,92 +213,10 @@ paths:
           description: Not Found
           content: {}
       x-codegen-request-body-name: xpath
-  /v1/dataspaces/{dataspace-name}/modules:
-    get:
-      tags:
-        - cps-rest
-      summary: Read all yang modules in the store
-      operationId: getModule
-      parameters:
-        - name: dataspace-name
-          in: path
-          description: dataspace-name
-          required: true
-          schema:
-            type: string
-        - name: namespace-name
-          in: query
-          description: namespace-name
-          schema:
-            type: string
-        - name: revision
-          in: query
-          description: revision
-          schema:
-            type: string
-      responses:
-        200:
-          description: OK
-          content:
-            application/json:
-              schema:
-                type: object
-        401:
-          description: Unauthorized
-          content: {}
-        403:
-          description: Forbidden
-          content: {}
-        404:
-          description: Not Found
-          content: {}
-    post:
-      tags:
-        - cps-rest
-      summary: Create modules for the given dataspace
-      operationId: createModules
-      parameters:
-        - name: dataspace-name
-          in: path
-          description: dataspace-name
-          required: true
-          schema:
-            type: string
-      requestBody:
-        content:
-          multipart/form-data:
-            schema:
-              required:
-                - file
-              properties:
-                multipartFile:
-                  type: string
-                  description: multipartFile
-                  format: binary
-        required: true
-      responses:
-        200:
-          description: OK
-          content:
-            application/json:
-              schema:
-                type: object
-        201:
-          description: Created
-          content: {}
-        401:
-          description: Unauthorized
-          content: {}
-        403:
-          description: Forbidden
-          content: {}
-        404:
-          description: Not Found
-          content: {}
   /v1/dataspaces/{dataspace-name}/nodes:
     get:
       tags:
-        - cps-rest
+        - cps-data
       summary: Get all nodes for a given dataspace using an xpath or schema node identifier
       operationId: getNode
       parameters:
@@ -329,7 +245,7 @@ paths:
       x-codegen-request-body-name: requestBody
     post:
       tags:
-        - cps-rest
+        - cps-data
       summary: Create a node for a given anchor for the given dataspace
       operationId: createNode
       parameters:
@@ -370,4 +286,29 @@ paths:
         404:
           description: Not Found
           content: {}
-components: {}
\ No newline at end of file
+components:
+  schemas:
+    ErrorMessage:
+      type: object
+      title: Error
+      properties:
+        status:
+          type: string
+        message:
+          type: string
+        details:
+          type: string
+    Anchor:
+      type: object
+      title: Anchor
+      required:
+        - anchorName
+        - namespace
+        - revision
+      properties:
+        anchorName:
+          type: string
+        namespace:
+          type: string
+        revision:
+          type: string