Update EMCO OpenAPI spec with DCM APIs 61/111061/11
authorIgor D.C <igor.duarte.cardoso@intel.com>
Fri, 7 Aug 2020 23:29:02 +0000 (23:29 +0000)
committerIgor D.C <igor.duarte.cardoso@intel.com>
Fri, 9 Oct 2020 00:02:50 +0000 (00:02 +0000)
Update emco_apis.yaml with all new API paths provided by DCM and
its /logical-clouds URL prefix. Update schemas and parameters too.

Issue-ID: MULTICLOUD-1143
Change-Id: I9d94cb2954c2f0131ffb8c3061a87a6b6a235cba
Signed-off-by: Igor D.C <igor.duarte.cardoso@intel.com>
docs/emco_apis.yaml

index bef9b25..cba2c9b 100644 (file)
@@ -2681,6 +2681,685 @@ paths:
           description: Network Controller Workload Interface not found
           content: {}
 
+############################ Logical Cloud API's #################################################
+  /projects/{project-name}/logical-clouds:
+    parameters:
+    - $ref: '#/components/parameters/projectName'
+    post:
+      tags:
+        - Logical Clouds
+      summary: Add a new Logical Cloud
+      description: Add a new Logical Cloud
+      operationId: addLogicalCloud
+      responses:
+        '201':
+          description: Logical Clouds successfully created
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/LogicalCloud'
+        '400':
+          description: Empty body or missing name
+          content: {}
+        '404':
+          description: The specified project doesn't exist
+          content: {}
+        '422':
+          description: Invalid input
+          content: {}
+        '500':
+          description: Internal error creating or returning Logical Cloud
+          content: {}
+      requestBody:
+        content:
+          application/json:
+            schema:
+                $ref: '#/components/schemas/LogicalCloud'
+        description: Logical Cloud info
+        required: true
+    get:
+      tags:
+        - Logical Clouds
+      summary: Get all Logical Clouds
+      description: Get all Logical Clouds
+      operationId: getAllLogicalCloud
+      responses:
+        '200':
+          description: List of Logical Clouds successfully returned
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/LogicalCloudArray'
+        '500':
+          description: Internal error while looking up Logical Clouds or encoding response
+          content: {}
+
+  /projects/{project-name}/logical-clouds/{logical-cloud-name}:
+    parameters:
+    - $ref: '#/components/parameters/projectName'
+    - $ref: '#/components/parameters/logicalCloudName'
+    get:
+      tags:
+        - Logical Clouds
+      summary: Get Logical Cloud
+      description: Get Logical Cloud
+      operationId: getLogicalCloudByName
+      responses:
+        '200':
+          description: Logical Cloud successfully returned
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/LogicalCloud'
+        '404':
+          description: Logical Cloud not found
+          content: {}
+        '500':
+          description: Internal error while looking up Logical Cloud or encoding response
+          content: {}
+    put:
+      tags:
+        - Logical Clouds
+      summary: Update Logical Cloud
+      description: Update Logical Cloud
+      operationId: updateLogicalClouds
+      responses:
+        '200':
+          description: Logical Cloud successfully updated
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/LogicalCloud'
+        '400':
+          description: Empty body or missing name
+          content: {}
+        '404':
+          description: Logical Cloud not found
+          content: {}
+        '422':
+          description: Invalid input
+          content: {}
+        '500':
+          description: Internal error while updating up Logical Cloud or encoding response
+          content: {}
+      requestBody:
+        content:
+          application/json:
+            schema:
+              $ref: '#/components/schemas/LogicalCloud'
+        description: Update Logical Cloud object
+        required: true
+    delete:
+      tags:
+        - Logical Clouds
+      summary: Delete Logical Cloud
+      description: Delete `Logical Cloud`
+      operationId: deleteLogicalCloudByName
+      responses:
+        '204':
+          description: Logical Cloud deleted
+          content: {}
+        '404':
+          description: Logical Cloud not found
+          content: {}
+        '409':
+          description: Logical Cloud is applied or being terminated
+          content: {}
+        '500':
+          description: Internal error
+          content: {}
+  /projects/{project-name}/logical-clouds/{logical-cloud-name}/apply:
+    parameters:
+    - $ref: '#/components/parameters/projectName'
+    - $ref: '#/components/parameters/logicalCloudName'
+    post:
+      tags:
+        - Logical Clouds
+      summary: Apply Logical Cloud configuration
+      description: Apply Logical Cloud configuration
+      operationId: applyLogicalCloud
+      responses:
+        '200':
+          description: Logical Cloud applied over clusters
+          content: {}
+        '400':
+          description: Logical Cloud lacks the necessary resources
+          content: {}
+        '404':
+          description: Logical Cloud does not exist
+          content: {}
+        '409':
+          description: Logical Cloud has already been applied or is being terminated
+          content: {}
+        '500':
+          description: Internal error
+          content: {}
+      requestBody:
+        content: {}
+  /projects/{project-name}/logical-clouds/{logical-cloud-name}/terminate:
+    parameters:
+    - $ref: '#/components/parameters/projectName'
+    - $ref: '#/components/parameters/logicalCloudName'
+    post:
+      tags:
+        - Logical Clouds
+      summary: Terminate Logical Cloud deployment
+      description: Terminate Logical Cloud deployment
+      operationId: terminateLogicalCloud
+      responses:
+        '200':
+          description: Logical Cloud removed from clusters
+          content: {}
+        '404':
+          description: Logical Cloud does not exist
+          content: {}
+        '409':
+          description: Logical Cloud has not been applied or is already terminating
+          content: {}
+        '500':
+          description: Internal error
+          content: {}
+      requestBody:
+        content: {}
+
+############################ Logical Cloud Cluster Reference API's ###############################
+  /projects/{project-name}/logical-clouds/{logical-cloud-name}/cluster-references:
+    parameters:
+    - $ref: '#/components/parameters/projectName'
+    - $ref: '#/components/parameters/logicalCloudName'
+    post:
+      tags:
+        - Logical Cloud Cluster References
+      summary: Add Cluster Reference to Logical Cloud
+      description: Add Cluster Reference to Logical Cloud
+      operationId: addClusterReference
+      responses:
+        '201':
+          description: Cluster Reference successfully created
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ClusterReference'
+        '400':
+          description: Empty body or missing name
+          content: {}
+        '422':
+          description: Invalid input
+          content: {}
+        '500':
+          description: Internal error
+          content: {}
+      requestBody:
+        content:
+          application/json:
+            schema:
+                $ref: '#/components/schemas/ClusterReference'
+    get:
+      tags:
+        - Logical Cloud Cluster References
+      summary: Get all Cluster References for Logical Cloud
+      description: Get all Cluster References for Logical Cloud
+      operationId: getAllClusters
+      responses:
+        '200':
+          description: Cluster References successfully returned
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ClusterReferenceArray'
+        '500':
+          description: Internal error
+          content: {}
+  /projects/{project-name}/logical-clouds/{logical-cloud-name}/cluster-references/{cluster-reference}:
+    parameters:
+    - $ref: '#/components/parameters/projectName'
+    - $ref: '#/components/parameters/logicalCloudName'
+    - $ref: '#/components/parameters/clusterReference'
+    get:
+      tags:
+        - Logical Cloud Cluster References
+      summary: Get Cluster Reference
+      description: Get Cluster Reference
+      operationId: getClusterReference
+      responses:
+        '200':
+          description: Cluster Reference successfully returned
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ClusterReference'
+
+        '404':
+          description: Cluster Reference not found
+          content: {}
+        '500':
+          description: Internal error
+          content: {}
+    put:
+      tags:
+        - Logical Cloud Cluster References
+      summary: Update Cluster Reference
+      description: Update Cluster Reference
+      operationId: updateClusterReference
+      responses:
+        '200':
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ClusterReference'
+          description: Cluster Reference successfully updated
+        '400':
+          description: Invalid data or missing name
+          content: {}
+        '404':
+          description: Cluster Reference not found
+          content: {}
+        '422':
+          description: Invalid input
+          content: {}
+        '500':
+          description: Internal error
+          content: {}
+      requestBody:
+        content:
+          application/json:
+            schema:
+                $ref: '#/components/schemas/ClusterReference'
+        required: true
+    delete:
+      tags:
+        - Logical Cloud Cluster References
+      summary: Delete Cluster Reference
+      description: Delete Cluster Reference
+      operationId: deleteClusterReference
+      responses:
+        '204':
+          description: Deleted
+          content: {}
+        '500':
+          description: Internal error
+          content: {}
+  /projects/{project-name}/logical-clouds/{logical-cloud-name}/cluster-references/{cluster-reference}/kubeconfig:
+    parameters:
+    - $ref: '#/components/parameters/projectName'
+    - $ref: '#/components/parameters/logicalCloudName'
+    - $ref: '#/components/parameters/clusterReference'
+    get:
+      tags:
+        - Logical Cloud Cluster References
+      summary: Get kubeconfig of Cluster Reference
+      description: Get kubeconfig of Cluster Reference
+      operationId: getClusterReferenceKubeconfig
+      responses:
+        '200':
+          description: Cluster Reference successfully returned
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ClusterReference'
+        '202':
+          description: User certificate hasn't been issued yet
+          content: {}
+        '400':
+          description: Logical Cloud hasn't been applied
+          content: {}
+        '404':
+          description: Cluster Reference not found
+          content: {}
+        '500':
+          description: Internal error
+          content: {}
+############################ Logical Cloud User Permission API's #################################
+  /projects/{project-name}/logical-clouds/{logical-cloud-name}/user-permissions:
+    parameters:
+    - $ref: '#/components/parameters/projectName'
+    - $ref: '#/components/parameters/logicalCloudName'
+    post:
+      tags:
+        - Logical Cloud User Permissions
+      summary: Add User Permission to Logical Cloud
+      description: Add User Permission to Logical Cloud
+      operationId: addUserPermission
+      responses:
+        '201':
+          description: User Permission successfully created
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/UserPermission'
+        '400':
+          description: Empty body or missing name
+          content: {}
+        '422':
+          description: Invalid input
+          content: {}
+        '500':
+          description: Internal error
+          content: {}
+      requestBody:
+        content:
+          application/json:
+            schema:
+                $ref: '#/components/schemas/UserPermission'
+    get:
+      tags:
+        - Logical Cloud User Permissions
+      summary: Get all User Permissions for Logical Cloud
+      description: Get all User Permissions for Logical Cloud
+      operationId: getAllUserPermissions
+      responses:
+        '200':
+          description: User Permissions successfully returned
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/UserPermissionArray'
+        '500':
+          description: Internal error
+          content: {}
+  /projects/{project-name}/logical-clouds/{logical-cloud-name}/user-permissions/{user-permission}:
+    parameters:
+    - $ref: '#/components/parameters/projectName'
+    - $ref: '#/components/parameters/logicalCloudName'
+    - $ref: '#/components/parameters/userPermission'
+    get:
+      tags:
+        - Logical Cloud User Permissions
+      summary: Get User Permission
+      description: Get User Permission
+      operationId: getUserPermission
+      responses:
+        '200':
+          description: User Permission successfully returned
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/UserPermission'
+
+        '404':
+          description: User Permission not found
+          content: {}
+        '500':
+          description: Internal error
+          content: {}
+    put:
+      tags:
+        - Logical Cloud User Permissions
+      summary: Update User Permission
+      description: Update User Permission
+      operationId: updateUserPermission
+      responses:
+        '200':
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/UserPermission'
+          description: User Permission successfully updated
+        '400':
+          description: Invalid data or missing name
+          content: {}
+        '404':
+          description: User Permission not found
+          content: {}
+        '422':
+          description: Invalid input
+          content: {}
+        '500':
+          description: Internal error
+          content: {}
+      requestBody:
+        content:
+          application/json:
+            schema:
+                $ref: '#/components/schemas/UserPermission'
+        required: true
+    delete:
+      tags:
+        - Logical Cloud User Permissions
+      summary: Delete User Permission
+      description: Delete User Permission
+      operationId: deleteUserPermission
+      responses:
+        '204':
+          description: Deleted
+          content: {}
+        '500':
+          description: Internal error
+          content: {}
+############################ Logical Cloud Cluster Quota API's ###################################
+  /projects/{project-name}/logical-clouds/{logical-cloud-name}/cluster-quotas:
+    parameters:
+    - $ref: '#/components/parameters/projectName'
+    - $ref: '#/components/parameters/logicalCloudName'
+    post:
+      tags:
+        - Logical Cloud Cluster Quotas
+      summary: Add Cluster Quota to Logical Cloud
+      description: Add Cluster Quota to Logical Cloud
+      operationId: addClusterQuota
+      responses:
+        '201':
+          description: Cluster Quota successfully created
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ClusterQuota'
+        '400':
+          description: Empty body or missing name
+          content: {}
+        '422':
+          description: Invalid input
+          content: {}
+        '500':
+          description: Internal error
+          content: {}
+      requestBody:
+        content:
+          application/json:
+            schema:
+                $ref: '#/components/schemas/ClusterQuota'
+    get:
+      tags:
+        - Logical Cloud Cluster Quotas
+      summary: Get allCluster Quotas for Logical Cloud
+      description: Get all Cluster Quotas for Logical Cloud
+      operationId: getAllClusterQuotas
+      responses:
+        '200':
+          description: Cluster Quotas successfully returned
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ClusterQuotaArray'
+        '500':
+          description: Internal error
+          content: {}
+  /projects/{project-name}/logical-clouds/{logical-cloud-name}/cluster-quotas/{cluster-quota}:
+    parameters:
+    - $ref: '#/components/parameters/projectName'
+    - $ref: '#/components/parameters/logicalCloudName'
+    - $ref: '#/components/parameters/clusterQuota'
+    get:
+      tags:
+        - Logical Cloud Cluster Quotas
+      summary: Get Cluster Quota
+      description: Get Cluster Quota
+      operationId: getClusterQuota
+      responses:
+        '200':
+          description: Cluster Quota successfully returned
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ClusterQuota'
+
+        '404':
+          description: Cluster Quota not found
+          content: {}
+        '500':
+          description: Internal error
+          content: {}
+    put:
+      tags:
+        - Logical Cloud Cluster Quotas
+      summary: Update Cluster Quota
+      description: Update Cluster Quota
+      operationId: updateClusterQuota
+      responses:
+        '200':
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ClusterQuota'
+          description: Cluster Quota successfully updated
+        '400':
+          description: Invalid data or missing name
+          content: {}
+        '404':
+          description: Cluster Quota not found
+          content: {}
+        '422':
+          description: Invalid input
+          content: {}
+        '500':
+          description: Internal error
+          content: {}
+      requestBody:
+        content:
+          application/json:
+            schema:
+                $ref: '#/components/schemas/ClusterQuota'
+        required: true
+    delete:
+      tags:
+        - Logical Cloud Cluster Quotas
+      summary: Delete Cluster Quota
+      description: Delete Cluster Quota
+      operationId: deleteClusterQuota
+      responses:
+        '204':
+          description: Deleted
+          content: {}
+        '500':
+          description: Internal error
+          content: {}
+############################ Logical Cloud KV Pair API's #########################################
+  /projects/{project-name}/logical-clouds/{logical-cloud-name}/kv-pairs:
+    parameters:
+    - $ref: '#/components/parameters/projectName'
+    - $ref: '#/components/parameters/logicalCloudName'
+    post:
+      tags:
+        - Logical Cloud KV Pairs
+      summary: Add KV Pair to Logical Cloud
+      description: Add KV Pair to Logical Cloud
+      operationId: addKVPair
+      responses:
+        '201':
+          description: KV Pair successfully created
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/Metadata'
+        '400':
+          description: Empty body or missing name
+          content: {}
+        '422':
+          description: Invalid input
+          content: {}
+        '500':
+          description: Internal error
+          content: {}
+      requestBody:
+        content:
+          application/json:
+            schema:
+                $ref: '#/components/schemas/KVPair'
+    get:
+      tags:
+        - Logical Cloud KV Pairs
+      summary: Get all KV Pairs for Logical Cloud
+      description: Get all KV Pairs for Logical Cloud
+      operationId: getAllKVPairs
+      responses:
+        '200':
+          description: KV Pairs successfully returned
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/KVPairArray'
+        '500':
+          description: Internal error
+          content: {}
+  /projects/{project-name}/logical-clouds/{logical-cloud-name}/kv-pairs/{kv-pair}:
+    parameters:
+    - $ref: '#/components/parameters/projectName'
+    - $ref: '#/components/parameters/logicalCloudName'
+    - $ref: '#/components/parameters/kvPair'
+    get:
+      tags:
+        - Logical Cloud KV Pairs
+      summary: Get KV Pair
+      description: Get KV Pair
+      operationId: getKVPair
+      responses:
+        '200':
+          description: KV Pair successfully returned
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/Metadata'
+
+        '404':
+          description: KV Pair not found
+          content: {}
+        '500':
+          description: Internal error
+          content: {}
+    put:
+      tags:
+        - Logical Cloud KV Pairs
+      summary: Update KV Pair
+      description: Update KV Pair
+      operationId: updateKVPair
+      responses:
+        '200':
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/Metadata'
+          description: KV Pair successfully updated
+        '400':
+          description: Invalid data or missing name
+          content: {}
+        '404':
+          description: KV Pair not found
+          content: {}
+        '422':
+          description: Invalid input
+          content: {}
+        '500':
+          description: Internal error
+          content: {}
+      requestBody:
+        content:
+          application/json:
+            schema:
+                $ref: '#/components/schemas/KVPair'
+        required: true
+    delete:
+      tags:
+        - Logical Cloud KV Pairs
+      summary: Delete KV Pair
+      description: Delete KV Pair
+      operationId: deleteKVPair
+      responses:
+        '204':
+          description: Deleted
+          content: {}
+        '500':
+          description: Internal error
+          content: {}
 
 #########################SCHEMAS####################################################
 # An object to hold reusable parts that can be used across the definition
@@ -3250,6 +3929,196 @@ components:
       type: array
       items:
         $ref: '#/components/schemas/NetworkWorkloadInterface'
+    LogicalCloud:
+      type: object
+      properties:
+        metadata:
+          $ref: '#/components/schemas/MetadataBase'
+        spec:
+          type: object
+          properties:
+            namespace:
+              type: string
+              description: namespace name
+              maxLength: 128
+              example: "ns1"
+            user:
+              properties:
+                user-name:
+                  type: string
+                  description: user name for auth
+                  maxLength: 20
+                type:
+                  type: string
+                  description: authentication type
+                  maxLength: 128
+                  example: "certificate"
+                user-permissions:
+                  type: array
+                  items:
+                    type: object
+                    properties:
+                      permission-name:
+                        type: string
+                        description: name of permission
+                        maxLength: 128
+                      apiGroups:
+                        type: array
+                        items:
+                          type: string
+                          description: API group expression
+                      resources:
+                        type: array
+                        description: K8s resource list
+                        items:
+                          type: string
+                          description: K8s resource
+                      verbs:
+                        type: array
+                        description: K8s verb list
+                        items:
+                          type: string
+                          description: K8s verb
+    ClusterReference:
+      type: object
+      properties:
+        metadata:
+          $ref: '#/components/schemas/MetadataBase'
+        spec:
+          type: object
+          properties:
+            cluster-provider:
+              type: string
+              description: cluster provider name
+              maxLength: 128
+              example: "cp-1"
+            cluster-name:
+              type: string
+              description: cluster name
+              maxLength: 128
+              example: "c1"
+            loadbalancer-ip:
+              type: string
+              description: IP address of load balancer
+              maxLength: 16
+              example: "0.0.0.0"
+    UserPermission:
+      type: object
+      properties:
+        permission-name:
+          type: string
+          description: name of permission
+          maxLength: 128
+        apiGroups:
+          type: array
+          items:
+            type: string
+            description: API group expression
+        resources:
+          type: array
+          description: K8s resource list
+          items:
+            type: string
+            description: K8s resource
+        verbs:
+          type: array
+          description: K8s verb list
+          items:
+            type: string
+            description: K8s verb
+    ClusterQuota:
+      type: object
+      properties:
+        metadata:
+          $ref: '#/components/schemas/MetadataBase'
+        spec:
+          type: object
+          properties:
+            limits.cpu:
+              type: string
+            limits.memory:
+              type: string
+            requests.cpu:
+              type: string
+            requests.memory:
+              type: string
+            requests.storage:
+              type: string
+            requests.ephemeral-storage:
+              type: string
+            limits.ephemeral-storage:
+              type: string
+            persistentvolumeclaims:
+              type: string
+            pods:
+              type: string
+            configmaps:
+              type: string
+            replicationcontrollers:
+              type: string
+            resourcequotas:
+              type: string
+            services:
+              type: string
+            services.loadbalancers:
+              type: string
+            services.nodeports:
+              type: string
+            secrets:
+              type: string
+            count/replicationcontrollers:
+              type: string
+            count/deployments.apps:
+              type: string
+            count/replicasets.apps:
+              type: string
+            count/statefulsets.apps:
+              type: string
+            count/jobs.batch:
+              type: string
+            count/cronjobs.batch:
+              type: string
+            count/deployments.extensions:
+              type: string
+    KVPair:
+      type: object
+      properties:
+        metadata:
+          $ref: '#/components/schemas/MetadataBase'
+        spec:
+          type: object
+          properties:
+            kv:
+              type: array
+              description: list of key-value pairs
+              items:
+                type: object
+                properties:
+                  key:
+                    type: string
+                  value:
+                    type: string
+    LogicalCloudArray:
+      type: array
+      items:
+        $ref: '#/components/schemas/LogicalCloud'
+    ClusterReferenceArray:
+      type: array
+      items:
+        $ref: '#/components/schemas/ClusterReference'
+    UserPermissionArray:
+      type: array
+      items:
+        $ref: '#/components/schemas/UserPermission'
+    ClusterQuotaArray:
+      type: array
+      items:
+        $ref: '#/components/schemas/ClusterQuota'
+    KVPairArray:
+      type: array
+      items:
+        $ref: '#/components/schemas/KVPair'
+
   parameters:
     projectName:
       name: project-name
@@ -3394,3 +4263,43 @@ components:
       schema:
         type: string
         maxLength: 128
+    logicalCloudName:
+      name: logical-cloud-name
+      in: path
+      description: Logical Cloud name
+      required: true
+      schema:
+        type: string
+        maxLength: 128
+    clusterReference:
+      name: cluster-reference
+      in: path
+      description: Cluster Reference name
+      required: true
+      schema:
+        type: string
+        maxLength: 128
+    userPermission:
+      name: user-permission
+      in: path
+      description: User Permission name
+      required: true
+      schema:
+        type: string
+        maxLength: 128
+    clusterQuota:
+      name: cluster-quota
+      in: path
+      description: Cluster Quota name
+      required: true
+      schema:
+        type: string
+        maxLength: 128
+    kvPair:
+      name: kv-pair
+      in: path
+      description: KV Pair name
+      required: true
+      schema:
+        type: string
+        maxLength: 128