New API calls for Cluster update POST and cluster edit PATCH 40/14740/2
authorshahithya <shahithya.y@tataelxsi.co.in>
Mon, 18 Nov 2024 07:59:53 +0000 (07:59 +0000)
committershahithya <shahithya.y@tataelxsi.co.in>
Mon, 18 Nov 2024 09:00:11 +0000 (09:00 +0000)
Change-Id: Idb69cbcc5958bc3821e79033e87b3b870e89d158
Signed-off-by: shahithya <shahithya.y@tataelxsi.co.in>
osm-openapi.yaml

index 43284b4..d22df3b 100644 (file)
@@ -4546,6 +4546,48 @@ paths:
           $ref: '#/components/responses/UnexpectedError'
         default:
           $ref: '#/components/responses/UnexpectedError'
+    patch:
+      tags:
+        - "K8s Cluster"
+      summary: Patching Cluster
+      description: This API is used to edit name and description of the cluster
+      operationId: patchCluster
+      requestBody:
+        $ref: '#/components/requestBodies/ClusterEditRequest'
+      responses:
+        '202':
+          description: Accepted
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/OpId'
+            application/yaml:
+              schema:
+                $ref: '#/components/schemas/OpId'
+        '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'
     delete:
       tags:
         - "K8s Cluster"
@@ -4865,6 +4907,56 @@ paths:
           $ref: '#/components/responses/UnexpectedError'
         default:
           $ref: '#/components/responses/UnexpectedError'
+  '/k8scluster/v1/clusters/{cluster_id}/update':
+    parameters:
+      - name: cluster_id
+        in: path
+        required: true
+        description: cluster_id
+        schema:
+          type: string
+    post:
+      tags:
+        - "K8s Cluster"
+      summary: Update a Cluster
+      description: This API is used to Update k8s_version, node_count and node_size of a Cluster
+      operationId: updateCluster
+      requestBody:
+        $ref: '#/components/requestBodies/UpdateClusterRequest'
+      responses:
+        '202':
+          description: Accepted
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/OpId'
+            application/yaml:
+              schema:
+                $ref: '#/components/schemas/OpId'
+        '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/app_profiles':
     post:
       tags:
@@ -11950,6 +12042,22 @@ components:
     ClusterCreds:
       type: string
       format: yaml|json
+    ClusterEditRequest:
+      type: object
+      properties:
+        name:
+          type: string
+        description:
+          type: string
+    UpdateClusterRequest:
+      type: object
+      properties:
+        k8s_version:
+          type: string
+        node_count:
+          type: integer
+        node_size:
+          type: string
     ScaleNodeInfo:
       type: object
       properties:
@@ -12538,6 +12646,22 @@ components:
         application/yaml:
           schema:
             $ref: '#/components/schemas/RegisterClusterInfo'
+    ClusterEditRequest:
+      content:
+        application/json:
+          schema:
+            $ref: '#/components/schemas/ClusterEditRequest'
+        application/yaml:
+          schema:
+            $ref: '#/components/schemas/ClusterEditRequest'
+    UpdateClusterRequest:
+      content:
+        application/json:
+          schema:
+            $ref: '#/components/schemas/UpdateClusterRequest'
+        application/yaml:
+          schema:
+            $ref: '#/components/schemas/UpdateClusterRequest'
     ScaleNode:
       content:
           application/json: