Cluster register and deregister API calls 39/14739/2
authorshahithya <shahithya.y@tataelxsi.co.in>
Mon, 18 Nov 2024 07:44:02 +0000 (07:44 +0000)
committershahithya <shahithya.y@tataelxsi.co.in>
Mon, 18 Nov 2024 08:17:05 +0000 (08:17 +0000)
Change-Id: I497a1e0c3ed27bd5e9980309c3a2f8cc24dbcc0d
Signed-off-by: shahithya <shahithya.y@tataelxsi.co.in>
osm-openapi.yaml

index 742bbd3..43284b4 100644 (file)
@@ -4579,6 +4579,90 @@ paths:
           $ref: '#/components/responses/UnexpectedError'
         default:
           $ref: '#/components/responses/UnexpectedError'
+  '/k8scluster/v1/clusters/register':
+    post:
+      tags:
+        - "K8s Cluster"
+      summary: Registering a Cluster
+      description: This API is used to register a cluster
+      operationId: registerk8sCluster
+      requestBody:
+        $ref: '#/components/requestBodies/RegisterClusterInfo'
+      responses:
+        '201':
+          description: Created
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ObjectId'
+            application/yaml:
+              schema:
+                $ref: '#/components/schemas/ObjectId'
+        '400':
+          $ref: '#/components/responses/BadRequest'
+        '401':
+          $ref: '#/components/responses/Unauthorized'
+        '403':
+          $ref: '#/components/responses/Forbidden'
+        '404':
+          $ref: '#/components/responses/NotFound'
+        '405':
+          $ref: '#/components/responses/MethodNotAllowed'
+        '406':
+          $ref: '#/components/responses/NotAcceptable'
+        '409':
+          $ref: '#/components/responses/Conflict'
+        '422':
+          $ref: '#/components/responses/UnprocessableEntity'
+        '500':
+          $ref: '#/components/responses/InternalServerError'
+        '503':
+          $ref: '#/components/responses/ServiceUnavailable'
+        '5XX':
+          $ref: '#/components/responses/UnexpectedError'
+        default:
+          $ref: '#/components/responses/UnexpectedError'
+  '/k8scluster/v1/clusters/{cluster_id}/deregister':
+    parameters:
+      - name: cluster_id
+        in: path
+        required: true
+        description: cluster_id
+        schema:
+          type: string
+    delete:
+      tags:
+        - "K8s Cluster"
+      summary: Deregister a Cluster
+      description: This API is used to deregister a specified cluster.
+      operationId: deregisterk8sCluster
+      responses:
+        '202':
+          description: Accepted
+        '400':
+          $ref: '#/components/responses/BadRequest'
+        '401':
+          $ref: '#/components/responses/Unauthorized'
+        '403':
+          $ref: '#/components/responses/Forbidden'
+        '404':
+          $ref: '#/components/responses/NotFound'
+        '405':
+          $ref: '#/components/responses/MethodNotAllowed'
+        '406':
+          $ref: '#/components/responses/NotAcceptable'
+        '409':
+          $ref: '#/components/responses/Conflict'
+        '422':
+          $ref: '#/components/responses/UnprocessableEntity'
+        '500':
+          $ref: '#/components/responses/InternalServerError'
+        '503':
+          $ref: '#/components/responses/ServiceUnavailable'
+        '5XX':
+          $ref: '#/components/responses/UnexpectedError'
+        default:
+          $ref: '#/components/responses/UnexpectedError'
   '/k8scluster/v1/clusters/{cluster_id}/get_creds':
     parameters:
       - name: cluster_id
@@ -11849,6 +11933,20 @@ components:
           type: array
           items:
             type: integer
+    RegisterClusterInfo:
+      type: object
+      properties:
+        name:
+          type: string
+        credentials:
+          type: string
+          format: yaml|json
+        vim_account:
+          type: string
+        description:
+          type: string
+        bootstrap:
+          type: boolean
     ClusterCreds:
       type: string
       format: yaml|json
@@ -12432,6 +12530,14 @@ components:
         application/yaml:
           schema:
             $ref: '#/components/schemas/CreateClusterInfo'
+    RegisterClusterInfo:
+      content:
+        application/json:
+          schema:
+            $ref: '#/components/schemas/RegisterClusterInfo'
+        application/yaml:
+          schema:
+            $ref: '#/components/schemas/RegisterClusterInfo'
     ScaleNode:
       content:
           application/json: