diff --git a/code/API_definitions/edge-application-management.yaml b/code/API_definitions/edge-application-management.yaml index 12f7b10..db2e9e3 100644 --- a/code/API_definitions/edge-application-management.yaml +++ b/code/API_definitions/edge-application-management.yaml @@ -83,13 +83,20 @@ info: deployment. * __getAppDeployments__ - Retrieves a list of deployments for a given application. + * __addEdgeCloudZone__ / __removeEdgeCloudZone__ - Extend or reduce an + existing application deployment by adding or removing a specific Edge + Cloud Zone. + * __addKubernetesCluster__ / __removeKubernetesCluster__ - Add or remove + a specific Kubernetes cluster used by an existing application deployment. * __deleteAppDeployment__ - Terminates a specific application deployment, removing all associated instances. __Edge Cloud information__ - * __getEdgeCloudZones__ List of the operators Edge Cloud Zones and their - status, ordering the results by location and filtering by status - (active/inactive/unknown) + * __getEdgeCloudZones__ Paginated list of the operators Edge Cloud Zones, + including their status, geographical country code and, when applicable, + the Kubernetes clusters available within each zone. Results can be + filtered by country code, Edge Cloud Provider, Edge Cloud + Provider-specific region and status. @@ -201,8 +208,6 @@ tags: description: Application and Application Instance Lice Cycle Management - name: Edge Cloud description: Edge Cloud Zones Availability - - name: Cluster - description: Kubernetes Cluster information - name: App Instance CALLBACK Operation description: Operations for handling application instance callback notifications - name: App Deployment CALLBACK Operation @@ -243,11 +248,11 @@ paths: schema: $ref: "#/components/schemas/SubmittedApp" "400": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic400" + $ref: "#/components/responses/Generic400" "401": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic401" "403": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic403" + $ref: "#/components/responses/Generic403" "409": description: Conflict headers: @@ -292,11 +297,11 @@ paths: items: $ref: "#/components/schemas/AppManifestInfo" "400": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic400" + $ref: "#/components/responses/Generic400" "401": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic401" "403": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic403" + $ref: "#/components/responses/Generic403" "500": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic500" "503": @@ -336,13 +341,13 @@ paths: schema: $ref: "#/components/schemas/AppManifestInfo" "400": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic400" + $ref: "#/components/responses/Generic400" "401": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic401" "403": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic403" + $ref: "#/components/responses/Generic403" "404": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic404" + $ref: "#/components/responses/Generic404" "500": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic500" "503": @@ -380,13 +385,13 @@ paths: x-correlator: $ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator" "400": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic400" + $ref: "#/components/responses/Generic400" "401": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic401" "403": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic403" + $ref: "#/components/responses/Generic403" "404": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic404" + $ref: "#/components/responses/Generic404" "409": description: Conflict headers: @@ -463,11 +468,11 @@ paths: schema: $ref: "#/components/schemas/AppInstanceInfo" "400": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic400" + $ref: "#/components/responses/Generic400" "401": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic401" "403": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic403" + $ref: "#/components/responses/Generic403" "409": description: Conflict headers: @@ -536,11 +541,11 @@ paths: items: $ref: "#/components/schemas/AppInstanceInfo" "400": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic400" + $ref: "#/components/responses/Generic400" "401": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic401" "403": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic403" + $ref: "#/components/responses/Generic403" "500": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic500" "503": @@ -579,13 +584,13 @@ paths: schema: $ref: "#/components/schemas/AppInstanceInfo" "400": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic400" + $ref: "#/components/responses/Generic400" "401": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic401" "403": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic403" + $ref: "#/components/responses/Generic403" "404": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic404" + $ref: "#/components/responses/Generic404" "500": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic500" "503": @@ -625,13 +630,13 @@ paths: x-correlator: $ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator" "400": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic400" + $ref: "#/components/responses/Generic400" "401": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic401" "403": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic403" + $ref: "#/components/responses/Generic403" "404": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic404" + $ref: "#/components/responses/Generic404" "500": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic500" "503": @@ -704,11 +709,11 @@ paths: appDeploymentId: $ref: "#/components/schemas/AppDeploymentId" "400": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic400" + $ref: "#/components/responses/Generic400" "401": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic401" "403": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic403" + $ref: "#/components/responses/Generic403" "409": description: Conflict headers: @@ -769,11 +774,11 @@ paths: items: $ref: "#/components/schemas/AppDeploymentInfo" "400": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic400" + $ref: "#/components/responses/Generic400" "401": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic401" "403": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic403" + $ref: "#/components/responses/Generic403" "500": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic500" "503": @@ -812,13 +817,13 @@ paths: schema: $ref: "#/components/schemas/AppDeploymentInfo" "400": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic400" + $ref: "#/components/responses/Generic400" "401": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic401" "403": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic403" + $ref: "#/components/responses/Generic403" "404": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic404" + $ref: "#/components/responses/Generic404" "500": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic500" "503": @@ -852,115 +857,56 @@ paths: x-correlator: $ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator" "400": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic400" + $ref: "#/components/responses/Generic400" "401": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic401" "403": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic403" + $ref: "#/components/responses/Generic403" "404": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic404" + $ref: "#/components/responses/Generic404" "500": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic500" "503": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic503" - patch: + + /deployments/{appDeploymentId}/add-edge-cloud-zone: + post: security: - openId: - edge-application-management:deployments:update tags: - Application - summary: Update an Application Deployment + summary: Add an Edge Cloud Zone to an Application Deployment description: | - Update the configuration or properties of an existing application deployment - using JSON Merge Patch semantics (RFC 7396). Only the fields provided in the - request body will be updated. Fields not included in the request will remain unchanged. - - IMPORTANT: When updating array fields (like edgeCloudZones or kubernetesClusterRefs), - JSON Merge Patch will REPLACE the entire array, not merge or append to it. - - This operation may include changing the deployment name, target Edge Cloud Zones, or other updatable fields. - operationId: updateAppDeployment + Extend an existing application deployment to an additional Edge + Cloud Zone, instantiating the application there. + operationId: addEdgeCloudZone parameters: - $ref: "#/components/parameters/x-correlator" - name: appDeploymentId in: path description: | - Identifier of the specific application deployment to be updated. + Identifier of the specific application deployment to be + extended. required: true schema: $ref: "#/components/schemas/AppDeploymentId" requestBody: description: | - The fields to update for the application deployment using JSON Merge Patch (RFC 7396). - Only the fields included in the request will be updated; omitted fields remain unchanged. - - NOTE: When updating array fields (edgeCloudZones, kubernetesClusterRefs), the entire array - will be REPLACED, not merged. To modify an array, you must include the complete array - with all desired elements in your request. + The Edge Cloud Zone to add to the application deployment. required: true content: - application/merge-patch+json: + application/json: schema: type: object + required: + - edgeCloudZoneId properties: - appDeploymentName: - $ref: "#/components/schemas/AppDeploymentName" - edgeCloudZones: - type: array - maxItems: 100 - items: - $ref: "#/components/schemas/EdgeCloudZoneId" - kubernetesClusterRefs: - type: array - maxItems: 100 - items: - $ref: "#/components/schemas/KubernetesClusterRef" - examples: - updateDeploymentName: - summary: Update only the deployment name - description: | - This example shows how to update only the deployment name. - Other fields will remain unchanged. - value: - appDeploymentName: "my_updated_deployment" - updateMultipleFields: - summary: Update multiple fields simultaneously - description: | - This example shows how to update both the deployment name - and Edge Cloud Zones in a single request. Remember that both - array fields will be completely replaced with the new values. - value: - appDeploymentName: "production_deployment" - edgeCloudZones: - - "123e4567-e89b-12d3-a456-426614174000" - - "123e4567-e89b-12d3-a456-426614174001" - kubernetesClusterRefs: - - "642f6105-7015-4af1-a4d1-e1ecb8437abc" - - "642f6105-7015-4af1-a4d1-e1ecb8437def" - arrayReplacementExample: - summary: Example of array replacement behavior - description: | - This example demonstrates how arrays are completely replaced in JSON Merge Patch. - - If the current deployment has: - - edgeCloudZones: ["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174001", "123e4567-e89b-12d3-a456-426614174002"] - - kubernetesClusterRefs: ["642f6105-7015-4af1-a4d1-e1ecb8437abc", "642f6105-7015-4af1-a4d1-e1ecb8437def"] - - And the user sends this patch: - - edgeCloudZones: ["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174003"] - - The result will be: - - edgeCloudZones: ["123e4567-e89b-12d3-a456-426614174000", "123e4567-e89b-12d3-a456-426614174003"] (completely replaced) - - kubernetesClusterRefs: ["642f6105-7015-4af1-a4d1-e1ecb8437abc", "642f6105-7015-4af1-a4d1-e1ecb8437def"] (unchanged, as it wasn't in the patch) - - To add a single zone while keeping existing ones, ALL zones must be included in the request. - value: - edgeCloudZones: - - "123e4567-e89b-12d3-a456-426614174000" - - "123e4567-e89b-12d3-a456-426614174003" + edgeCloudZoneId: + $ref: "#/components/schemas/EdgeCloudZoneId" responses: "200": - description: Application deployment updated successfully + description: Edge Cloud Zone added successfully headers: x-correlator: $ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator" @@ -969,13 +915,13 @@ paths: schema: $ref: "#/components/schemas/AppDeploymentInfo" "400": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic400" + $ref: "#/components/responses/Generic400" "401": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic401" "403": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic403" + $ref: "#/components/responses/Generic403" "404": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic404" + $ref: "#/components/responses/Generic404" "409": description: Conflict headers: @@ -987,76 +933,226 @@ paths: $ref: "#/components/schemas/ErrorInfo" example: status: 409 - code: ABORTED - message: "Update conflict" + code: ALREADY_EXISTS + message: "Edge Cloud Zone already part of the deployment" "500": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic500" "503": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic503" - /clusters: - get: + /deployments/{appDeploymentId}/remove-edge-cloud-zone: + post: security: - openId: - - edge-application-management:clusters:read + - edge-application-management:deployments:update tags: - - Cluster - summary: | - Retrieve a list of the available clusters filtered by the optional - query parameters. + - Application + summary: Remove an Edge Cloud Zone from an Application Deployment description: | - List available cluster information - operationId: getClusters + Terminate the application instance in the given Edge Cloud Zone and + remove it from the deployment. + operationId: removeEdgeCloudZone parameters: - $ref: "#/components/parameters/x-correlator" - - name: region + - name: appDeploymentId + in: path description: | - Human readable name of the geographical Edge Cloud Region of - the Cluster. Defined by the Edge Cloud Provider. - in: query - required: false + Identifier of the specific application deployment to be + reduced. + required: true schema: - $ref: "#/components/schemas/EdgeCloudRegion" - - name: clusterRef + $ref: "#/components/schemas/AppDeploymentId" + requestBody: + description: | + The Edge Cloud Zone to remove from the application deployment. + required: true + content: + application/json: + schema: + type: object + required: + - edgeCloudZoneId + properties: + edgeCloudZoneId: + $ref: "#/components/schemas/EdgeCloudZoneId" + responses: + "200": + description: Edge Cloud Zone removed successfully + headers: + x-correlator: + $ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator" + content: + application/json: + schema: + $ref: "#/components/schemas/AppDeploymentInfo" + "400": + $ref: "#/components/responses/Generic400" + "401": + $ref: "../common/CAMARA_common.yaml#/components/responses/Generic401" + "403": + $ref: "#/components/responses/Generic403" + "404": description: | - A globally unique identifier for the Cluster. - in: query - required: false - schema: - $ref: "#/components/schemas/KubernetesClusterRef" - - name: edgeCloudZoneId + The application deployment, or the given Edge Cloud Zone within + it, was not found. + headers: + x-correlator: + $ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator" + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorInfo" + example: + status: 404 + code: NOT_FOUND + message: "Edge Cloud Zone not found in the deployment" + "500": + $ref: "../common/CAMARA_common.yaml#/components/responses/Generic500" + "503": + $ref: "../common/CAMARA_common.yaml#/components/responses/Generic503" + + /deployments/{appDeploymentId}/add-kubernetes-cluster: + post: + security: + - openId: + - edge-application-management:deployments:update + tags: + - Application + summary: Add a Kubernetes cluster to an Application Deployment + description: | + Add a specific Kubernetes cluster, within an Edge Cloud Zone already + part of the deployment, to be used by the application deployment. + operationId: addKubernetesCluster + parameters: + - $ref: "#/components/parameters/x-correlator" + - name: appDeploymentId + in: path description: | - Edge Cloud Zone identifier. - in: query - required: false + Identifier of the specific application deployment to be + extended. + required: true schema: - $ref: "#/components/schemas/EdgeCloudZoneId" + $ref: "#/components/schemas/AppDeploymentId" + requestBody: + description: | + The Kubernetes cluster to add to the application deployment. + required: true + content: + application/json: + schema: + type: object + required: + - kubernetesClusterRef + properties: + kubernetesClusterRef: + $ref: "#/components/schemas/KubernetesClusterRef" responses: "200": + description: Kubernetes cluster added successfully + headers: + x-correlator: + $ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator" + content: + application/json: + schema: + $ref: "#/components/schemas/AppDeploymentInfo" + "400": + $ref: "#/components/responses/Generic400" + "401": + $ref: "../common/CAMARA_common.yaml#/components/responses/Generic401" + "403": + $ref: "#/components/responses/Generic403" + "404": + $ref: "#/components/responses/Generic404" + "409": + description: Conflict + headers: + x-correlator: + $ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator" + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorInfo" + example: + status: 409 + code: ALREADY_EXISTS + message: "Kubernetes cluster already part of the deployment" + "500": + $ref: "../common/CAMARA_common.yaml#/components/responses/Generic500" + "503": + $ref: "../common/CAMARA_common.yaml#/components/responses/Generic503" + + /deployments/{appDeploymentId}/remove-kubernetes-cluster: + post: + security: + - openId: + - edge-application-management:deployments:update + tags: + - Application + summary: Remove a Kubernetes cluster from an Application Deployment + description: | + Stop using the given Kubernetes cluster for the application + deployment. + operationId: removeKubernetesCluster + parameters: + - $ref: "#/components/parameters/x-correlator" + - name: appDeploymentId + in: path description: | - Successful response, returning the cluster's information. - Returns an empty list if no clusters were found or none match - the specified query parameters. + Identifier of the specific application deployment to be + reduced. + required: true + schema: + $ref: "#/components/schemas/AppDeploymentId" + requestBody: + description: | + The Kubernetes cluster to remove from the application deployment. + required: true + content: + application/json: + schema: + type: object + required: + - kubernetesClusterRef + properties: + kubernetesClusterRef: + $ref: "#/components/schemas/KubernetesClusterRef" + responses: + "200": + description: Kubernetes cluster removed successfully headers: x-correlator: $ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator" content: application/json: schema: - type: array - maxItems: 100 - items: - $ref: "#/components/schemas/ClusterInfo" + $ref: "#/components/schemas/AppDeploymentInfo" "400": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic400" + $ref: "#/components/responses/Generic400" "401": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic401" "403": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic403" + $ref: "#/components/responses/Generic403" + "404": + description: | + The application deployment, or the given Kubernetes cluster + within it, was not found. + headers: + x-correlator: + $ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator" + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorInfo" + example: + status: 404 + code: NOT_FOUND + message: "Kubernetes cluster not found in the deployment" "500": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic500" "503": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic503" + /edge-cloud-zones: get: security: @@ -1064,50 +1160,81 @@ paths: - edge-application-management:edge-cloud-zones:read tags: - Edge Cloud - summary: Retrieve a list of the provider's Edge Cloud Zones and their status + summary: Retrieve a paginated list of the provider's Edge Cloud Zones description: | - List of the provider's Edge Cloud Zones and their - status, ordering the results by location and filtering by - status (active/inactive/unknown) + List of the provider's Edge Cloud Zones, including their status and, + when applicable, the Kubernetes clusters available within each zone. + Results can be filtered by country code, Edge Cloud Provider, + Edge Cloud Provider-specific region and status, and are returned as + a paginated collection. operationId: getEdgeCloudZones parameters: - $ref: "#/components/parameters/x-correlator" - - name: region + - $ref: "../common/CAMARA_common.yaml#/components/parameters/page" + - $ref: "../common/CAMARA_common.yaml#/components/parameters/perPage" + - name: countryCode description: | - Human readable name of the geographical Edge Cloud Region of - the Edge Cloud. Defined by the Edge Cloud Provider. + ISO 3166-1 alpha-2 country code to filter Edge Cloud Zones by + their geographical location, independent of any Edge Cloud + Provider-specific region naming. + in: query + required: false + schema: + $ref: "#/components/schemas/CountryCode" + - name: edgeCloudProvider + description: | + Human readable name of the Edge Cloud Provider to filter Edge + Cloud Zones by. + in: query + required: false + schema: + $ref: "#/components/schemas/EdgeCloudProvider" + - name: edgeCloudRegion + description: | + Edge Cloud Provider-specific geographical region name to filter + Edge Cloud Zones by. Since this value is not standardized across + Edge Cloud Providers, prefer filtering by countryCode when + provider-independent results are needed. in: query required: false schema: $ref: "#/components/schemas/EdgeCloudRegion" - name: status - description: Human readable status of the Edge Cloud Zone + description: | + Status of the Edge Cloud Zone to filter by. If omitted, Edge + Cloud Zones are returned regardless of their status. in: query required: false schema: - $ref: "#/components/schemas/EdgeCloudZoneStatus" + type: string + enum: + - active + - inactive + - unknown responses: "200": description: | - Successful response, returning the - Available Edge Cloud Zones. + Successful response, returning a paginated list of the Edge + Cloud Zones matching the specified query parameters. headers: x-correlator: $ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator" + x-total-count: + $ref: "../common/CAMARA_common.yaml#/components/headers/x-total-count" + x-total-pages: + $ref: "../common/CAMARA_common.yaml#/components/headers/x-total-pages" + link: + $ref: "../common/CAMARA_common.yaml#/components/headers/link" content: application/json: schema: - $ref: "#/components/schemas/EdgeCloudZones" + $ref: "#/components/schemas/EdgeCloudZoneList" "400": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic400" + $ref: "#/components/responses/Generic400" "401": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic401" "403": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic403" - "500": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic500" - "503": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic503" + $ref: "#/components/responses/Generic403" components: securitySchemes: openId: @@ -1130,6 +1257,83 @@ components: schema: $ref: "#/components/schemas/XCorrelator" + responses: + Generic400: + description: Bad Request + headers: + x-correlator: + $ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "../common/CAMARA_common.yaml#/components/schemas/ErrorInfo" + - type: object + properties: + status: + enum: + - 400 + code: + enum: + - INVALID_ARGUMENT + examples: + GENERIC_400_INVALID_ARGUMENT: + description: Invalid Argument. Generic Syntax Exception + value: + status: 400 + code: INVALID_ARGUMENT + message: Client specified an invalid argument, request body or query param. + Generic403: + description: Forbidden + headers: + x-correlator: + $ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "../common/CAMARA_common.yaml#/components/schemas/ErrorInfo" + - type: object + properties: + status: + enum: + - 403 + code: + enum: + - PERMISSION_DENIED + examples: + GENERIC_403_PERMISSION_DENIED: + description: Permission denied. OAuth2 token access does not have the required scope or when the user fails operational security + value: + status: 403 + code: PERMISSION_DENIED + message: Client does not have sufficient permissions to perform this action. + Generic404: + description: Not found + headers: + x-correlator: + $ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator" + content: + application/json: + schema: + allOf: + - $ref: "../common/CAMARA_common.yaml#/components/schemas/ErrorInfo" + - type: object + properties: + status: + enum: + - 404 + code: + enum: + - NOT_FOUND + examples: + GENERIC_404_NOT_FOUND: + description: Resource is not found + value: + status: 404 + code: NOT_FOUND + message: The specified resource is not found. + callbacks: onAppInstanceStatusChange: "{$request.body#/subscriptionRequest/sink}": @@ -1164,11 +1368,11 @@ components: x-correlator: $ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator" "400": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic400" + $ref: "#/components/responses/Generic400" "401": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic401" "403": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic403" + $ref: "#/components/responses/Generic403" "410": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic410" "429": @@ -1206,11 +1410,11 @@ components: x-correlator: $ref: "../common/CAMARA_common.yaml#/components/headers/x-correlator" "400": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic400" + $ref: "#/components/responses/Generic400" "401": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic401" "403": - $ref: "../common/CAMARA_common.yaml#/components/responses/Generic403" + $ref: "#/components/responses/Generic403" "410": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic410" "429": @@ -1454,6 +1658,14 @@ components: maxItems: 100 items: $ref: "#/components/schemas/AppInstanceId" + kubernetesClusterRefs: + description: | + List of Kubernetes clusters used by this deployment, when + applicable. + type: array + maxItems: 100 + items: + $ref: "#/components/schemas/KubernetesClusterRef" AppInstanceInfo: description: Information about the application instance. @@ -1718,26 +1930,24 @@ components: ClusterInfo: type: object - description: Kubernetes cluster information + description: | + Kubernetes cluster information. Returned nested within the Edge + Cloud Zone it belongs to, so identifiers already provided by the + enclosing Edge Cloud Zone (zone id, region) are not repeated here. required: - name - - provider + - edgeCloudProvider - clusterRef - - edgeCloudZoneId properties: name: type: string maxLength: 64 description: | - Name of the Cluster, scoped to the Provider - provider: - $ref: "#/components/schemas/AppProvider" + Name of the Cluster, scoped to the Edge Cloud Provider + edgeCloudProvider: + $ref: "#/components/schemas/EdgeCloudProvider" clusterRef: $ref: "#/components/schemas/KubernetesClusterRef" - edgeCloudZoneId: - $ref: "#/components/schemas/EdgeCloudZoneId" - edgeCloudRegion: - $ref: "#/components/schemas/EdgeCloudRegion" version: type: string maxLength: 64 @@ -1751,6 +1961,17 @@ components: $ref: "#/components/schemas/KubernetesNodePool" minItems: 1 + CountryCode: + type: string + pattern: ^[A-Z]{2}$ + minLength: 2 + maxLength: 2 + description: | + ISO 3166-1 alpha-2 country code representing the geographical + location of the Edge Cloud Zone, independent of any Edge Cloud + Provider-specific region naming. + example: "GB" + EdgeCloudProvider: type: string maxLength: 64 @@ -1763,15 +1984,25 @@ components: Human readable name of the geographical Edge Cloud Region of the Edge Cloud. Defined by the Edge Cloud Provider. - EdgeCloudZones: - type: array - items: - $ref: "#/components/schemas/EdgeCloudZone" - minItems: 1 - maxItems: 100 + EdgeCloudZoneList: + type: object description: | - A collection of Edge Cloud Zones where the Application Provider can - instantiate an Application Instance. + A paginated collection of Edge Cloud Zones where the Application + Provider can instantiate an Application Instance. + required: + - edgeCloudZones + - pagination + properties: + edgeCloudZones: + description: | + The Edge Cloud Zones matching the specified query parameters, + for the requested page. + type: array + maxItems: 100 + items: + $ref: "#/components/schemas/EdgeCloudZone" + pagination: + $ref: "../common/CAMARA_common.yaml#/components/schemas/Pagination" EdgeCloudZoneId: type: string @@ -1795,6 +2026,7 @@ components: - edgeCloudZoneId - edgeCloudZoneName - edgeCloudProvider + - countryCode properties: edgeCloudZoneId: $ref: "#/components/schemas/EdgeCloudZoneId" @@ -1806,6 +2038,17 @@ components: $ref: "#/components/schemas/EdgeCloudProvider" edgeCloudRegion: $ref: "#/components/schemas/EdgeCloudRegion" + countryCode: + $ref: "#/components/schemas/CountryCode" + clusters: + description: | + Kubernetes clusters available within this Edge Cloud Zone, when + applicable. Omitted or empty if the Edge Cloud Provider does not + offer Kubernetes clusters in this zone. + type: array + maxItems: 100 + items: + $ref: "#/components/schemas/ClusterInfo" EdgeCloudZoneName: type: string diff --git a/code/Test_definitions/edge-application-management-updateAppDeployment.feature b/code/Test_definitions/edge-application-management-addEdgeCloudZone.feature similarity index 54% rename from code/Test_definitions/edge-application-management-updateAppDeployment.feature rename to code/Test_definitions/edge-application-management-addEdgeCloudZone.feature index f75ebc3..9b29baa 100644 --- a/code/Test_definitions/edge-application-management-updateAppDeployment.feature +++ b/code/Test_definitions/edge-application-management-addEdgeCloudZone.feature @@ -1,4 +1,4 @@ -Feature: CAMARA Edge Application Management API, vwip - Operation updateAppDeployment +Feature: CAMARA Edge Application Management API, vwip - Operation addEdgeCloudZone # Input to be provided by the implementation to the tester # # Implementation indications: @@ -7,46 +7,69 @@ Feature: CAMARA Edge Application Management API, vwip - Operation updateAppDeplo # Testing assets: # * An appId of a submitted application and the values used in the submitApp operation. # * A deployment instantiated by createAppDeployment operation. + # * An additional edgeCloudZoneId not yet part of the deployment. # # References to OAS spec schemas refer to schemas specified in edge-application-management.yaml - Background: Common updateAppDeployment setup + Background: Common addEdgeCloudZone setup Given an environment at "apiRoot" - And the resource "/edge-application-management/vwip/deployments/{appDeploymentId}" + And the resource "/edge-application-management/vwip/deployments/{appDeploymentId}/add-edge-cloud-zone" And the header "Content-Type" is set to "application/json" And the header "Authorization" is set to a valid access token And the header "x-correlator" complies with the schema at "#/components/schemas/XCorrelator" # Properties not explicitly overwritten in the Scenarios can take any values compliant with the schema And the request body is set by default to a request body compliant with the request body schema for this operation # Success scenarios - @eam_updateAppDeployment_01_generic_success_scenario - Scenario: Update a running instance of an application within an Edge Cloud Zone with mandatory parameter ("appDeploymentId") - Given there are application instances running + @eam_addEdgeCloudZone_01_generic_success_scenario + Scenario: Add an Edge Cloud Zone to an existing deployment with mandatory parameters + Given there is a deployment created by operation createAppDeployment And the request path parameter "$.appDeploymentId" is set to a valid application deployment ID - And the body property "$.appDeploymentName" is set to a valid name - When the request "updateAppDeployment" is sent + And the request body property "$.edgeCloudZoneId" is set to a valid edge zone id not yet part of the deployment + When the request "addEdgeCloudZone" is sent Then the response status code is 200 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" And the response body complies with the OAS schema at "/components/schemas/AppDeploymentInfo" + And the response property "$.edgeCloudZones" contains the value provided for "$.edgeCloudZoneId" + # Error scenarios # Error 409 - @eam_updateAppDeployment_409.1_aborted - Scenario: Error response for a concurrent update conflict - Given there is a concurrent update in progress for the deployment + @eam_addEdgeCloudZone_409.1_already_exists + Scenario: Add an Edge Cloud Zone already part of the deployment + Given there is a deployment created by operation createAppDeployment And the request path parameter "$.appDeploymentId" is set to a valid application deployment ID - When the request "updateAppDeployment" is sent + And the request body property "$.edgeCloudZoneId" is set to an edge zone id already part of the deployment + When the request "addEdgeCloudZone" is sent Then the response status code is 409 - And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" And the response property "$.status" is 409 - And the response property "$.code" is "ABORTED" + And the response property "$.code" is "ALREADY_EXISTS" + And the response property "$.message" contains a user friendly text + # Error 400 + @eam_addEdgeCloudZone_400.1_schema_not_compliant + Scenario: Invalid Argument. Generic Syntax Exception + Given the request body is set to any value which is not compliant with the request body schema for this operation + When the request "addEdgeCloudZone" is sent + Then the response status code is 400 + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 400 + And the response property "$.code" is "INVALID_ARGUMENT" + And the response property "$.message" contains a user friendly text + @eam_addEdgeCloudZone_400.2_no_request_body + Scenario: Missing request body + Given the request body is not included + When the request "addEdgeCloudZone" is sent + Then the response status code is 400 + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 400 + And the response property "$.code" is "INVALID_ARGUMENT" And the response property "$.message" contains a user friendly text - # Errors # Error 404 - @eam_updateAppDeployment_404.1_invalid_parameter - Scenario: Update a running instance of an application within an Edge Cloud Zone with mandatory, and non-existing, parameter ("appDeploymentId") - Given there are application instances running - And the path parameter "$.appDeploymentId" is set to an invalid application instance ID - When the request "updateAppDeployment" is sent + @eam_addEdgeCloudZone_404.1_invalid_parameter + Scenario: Add an Edge Cloud Zone to a non-existing deployment + Given the request path parameter "$.appDeploymentId" is set to an invalid application deployment ID + When the request "addEdgeCloudZone" is sent Then the response status code is 404 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" @@ -54,21 +77,21 @@ Feature: CAMARA Edge Application Management API, vwip - Operation updateAppDeplo And the response property "$.code" is "NOT_FOUND" And the response property "$.message" contains a user friendly text # Error 401 - @eam_updateAppDeployment_401.1_missing_access_token + @eam_addEdgeCloudZone_401.1_missing_access_token Scenario: Missing access token Given the header "Authorization" is not included - When the request "updateAppDeployment" is sent + When the request "addEdgeCloudZone" is sent Then the response status code is 401 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" And the response property "$.status" is 401 And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text - # Error 403 - @eam_updateAppDeployment_403.1_missing_access_token_scope + # Errors 403 + @eam_addEdgeCloudZone_403.1_missing_access_token_scope Scenario: Missing access token scope Given the header "Authorization" is set to an access token that does not include the required scope - When the request "updateAppDeployment" is sent + When the request "addEdgeCloudZone" is sent Then the response status code is 403 And the response header "x-correlator" has same value as the request header "x-correlator" And the response header "Content-Type" is "application/json" diff --git a/code/Test_definitions/edge-application-management-addKubernetesCluster.feature b/code/Test_definitions/edge-application-management-addKubernetesCluster.feature new file mode 100644 index 0000000..1a58e05 --- /dev/null +++ b/code/Test_definitions/edge-application-management-addKubernetesCluster.feature @@ -0,0 +1,101 @@ +Feature: CAMARA Edge Application Management API, vwip - Operation addKubernetesCluster + # Input to be provided by the implementation to the tester + # + # Implementation indications: + # * apiRoot: API root of the server URL + # + # Testing assets: + # * An appId of a submitted application and the values used in the submitApp operation. + # * A deployment instantiated by createAppDeployment operation. + # * An additional kubernetesClusterRef, within an Edge Cloud Zone already part of the + # deployment, not yet used by the deployment. + # + # References to OAS spec schemas refer to schemas specified in edge-application-management.yaml + Background: Common addKubernetesCluster setup + Given an environment at "apiRoot" + And the resource "/edge-application-management/vwip/deployments/{appDeploymentId}/add-kubernetes-cluster" + And the header "Content-Type" is set to "application/json" + And the header "Authorization" is set to a valid access token + And the header "x-correlator" complies with the schema at "#/components/schemas/XCorrelator" + # Properties not explicitly overwritten in the Scenarios can take any values compliant with the schema + And the request body is set by default to a request body compliant with the request body schema for this operation + # Success scenarios + @eam_addKubernetesCluster_01_generic_success_scenario + Scenario: Add a Kubernetes cluster to an existing deployment with mandatory parameters + Given there is a deployment created by operation createAppDeployment + And the request path parameter "$.appDeploymentId" is set to a valid application deployment ID + And the request body property "$.kubernetesClusterRef" is set to a valid kubernetes cluster not yet part of the deployment + When the request "addKubernetesCluster" is sent + Then the response status code is 200 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response body complies with the OAS schema at "/components/schemas/AppDeploymentInfo" + And the response property "$.kubernetesClusterRefs" contains the value provided for "$.kubernetesClusterRef" + # Error scenarios + # Error 409 + @eam_addKubernetesCluster_409.1_already_exists + Scenario: Add a Kubernetes cluster already part of the deployment + Given there is a deployment created by operation createAppDeployment + And the request path parameter "$.appDeploymentId" is set to a valid application deployment ID + And the request body property "$.kubernetesClusterRef" is set to a kubernetes cluster already part of the deployment + When the request "addKubernetesCluster" is sent + Then the response status code is 409 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response property "$.status" is 409 + And the response property "$.code" is "ALREADY_EXISTS" + And the response property "$.message" contains a user friendly text + # Error 400 + @eam_addKubernetesCluster_400.1_schema_not_compliant + Scenario: Invalid Argument. Generic Syntax Exception + Given the request body is set to any value which is not compliant with the request body schema for this operation + When the request "addKubernetesCluster" is sent + Then the response status code is 400 + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 400 + And the response property "$.code" is "INVALID_ARGUMENT" + And the response property "$.message" contains a user friendly text + @eam_addKubernetesCluster_400.2_no_request_body + Scenario: Missing request body + Given the request body is not included + When the request "addKubernetesCluster" is sent + Then the response status code is 400 + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 400 + And the response property "$.code" is "INVALID_ARGUMENT" + And the response property "$.message" contains a user friendly text + # Error 404 + @eam_addKubernetesCluster_404.1_invalid_parameter + Scenario: Add a Kubernetes cluster to a non-existing deployment + Given the request path parameter "$.appDeploymentId" is set to an invalid application deployment ID + When the request "addKubernetesCluster" is sent + Then the response status code is 404 + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 404 + And the response property "$.code" is "NOT_FOUND" + And the response property "$.message" contains a user friendly text + # Error 401 + @eam_addKubernetesCluster_401.1_missing_access_token + Scenario: Missing access token + Given the header "Authorization" is not included + When the request "addKubernetesCluster" is sent + Then the response status code is 401 + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 401 + And the response property "$.code" is "UNAUTHENTICATED" + And the response property "$.message" contains a user friendly text + # Errors 403 + @eam_addKubernetesCluster_403.1_missing_access_token_scope + Scenario: Missing access token scope + Given the header "Authorization" is set to an access token that does not include the required scope + When the request "addKubernetesCluster" is sent + Then the response status code is 403 + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 403 + And the response property "$.code" is "PERMISSION_DENIED" + And the response property "$.message" contains a user friendly text diff --git a/code/Test_definitions/edge-application-management-getClusters.feature b/code/Test_definitions/edge-application-management-getClusters.feature deleted file mode 100644 index 7b6f57d..0000000 --- a/code/Test_definitions/edge-application-management-getClusters.feature +++ /dev/null @@ -1,94 +0,0 @@ -Feature: CAMARA Edge Application Management API, vwip - Operation getClusters - # Input to be provided by the implementation to the tester - # - # Implementation indications: - # * apiRoot: API root of the server URL - # - # Testing assets: - # * An available cluster to get information - # - # References to OAS spec schemas refer to schemas specified in edge-application-management.yaml - Background: Common getClusters setup - Given an environment at "apiRoot" - And the resource "/edge-application-management/vwip/clusters" - And the header "Content-Type" is set to "application/json" - And the header "Authorization" is set to a valid access token - And the header "x-correlator" complies with the schema at "#/components/schemas/XCorrelator" - # Success scenarios - #/clusters GET 200 - @eam_getClusters_01_generic_success_scenario - Scenario: Get information of existing clusters - Given There are at least one cluster available - When the request "getClusters" is sent - Then the response status code is 200 - And the response header "Content-Type" is "application/json" - And the response header "x-correlator" has same value as the request header "x-correlator" - And A list of clusters is returned - And the response body complies with the OAS schema at "/components/schemas/ClusterInfo" - #/clusters GET 200 filtered by region - @eam_getClusters_02_generic_success_scenario_filtered_by_region - Scenario: Get information of existing clusters with optional parameters ("region") - Given There are at least one cluster available - And the request query parameter "$.region" is set to a valid region - When the request "getClusters" is sent - Then the response status code is 200 - And the response header "Content-Type" is "application/json" - And the response header "x-correlator" has same value as the request header "x-correlator" - And information of clusters of "$.region" is returned - And the response body complies with the OAS schema at "/components/schemas/ClusterInfo" - #/clusters GET 200 filtered by edgeCloudZoneId - @eam_getClusters_03_generic_success_scenario_filtered_by_edgeCloudZone - Scenario: Get information of existing clusters with optional parameters ("edgeCloudZoneId") - Given There are at least one cluster available - And the request query parameter "$.edgeCloudZoneId" is set to a valid edgeCloudZoneId - When the request "getClusters" is sent - Then the response status code is 200 - And the response header "Content-Type" is "application/json" - And the response header "x-correlator" has same value as the request header "x-correlator" - And information of clusters of "$.edgeCloudZoneId" is returned - And the response body complies with the OAS schema at "/components/schemas/ClusterInfo" - #/clusters GET 200 filtered by clusterRef - @eam_getClusters_04_generic_success_scenario_filtered_by_clusterRef - Scenario: Get information of existing clusters with optional parameters ("clusterRef") - Given There are at least one cluster available - And the request query parameter "$.clusterRef" is set to a valid clusterRef - When the request "getClusters" is sent - Then the response status code is 200 - And the response header "Content-Type" is "application/json" - And the response header "x-correlator" has same value as the request header "x-correlator" - And information of clusters of "$.edgeCloudZoneId" is returned - And the response body complies with the OAS schema at "/components/schemas/ClusterInfo" - #Errors - #/clusters GET 404 - @eam_getClusters_404.1_not_found - Scenario: Get information of existing clusters with invalid optional parameters ("region") - Given the request query parameter "$.region" is set to an invalid region - When the request "getClusters" is sent - Then the response status code is 404 - And the response header "x-correlator" has same value as the request header "x-correlator" - And the response header "Content-Type" is "application/json" - And the response property "$.status" is 404 - And the response property "$.code" is "NOT_FOUND" - And the response property "$.message" contains a user friendly text - # Error 401 - @eam_getClusters_401.1_missing_access_token - Scenario: Missing access token - Given the header "Authorization" is not included - When the request "getClusters" is sent - Then the response status code is 401 - And the response header "x-correlator" has same value as the request header "x-correlator" - And the response header "Content-Type" is "application/json" - And the response property "$.status" is 401 - And the response property "$.code" is "UNAUTHENTICATED" - And the response property "$.message" contains a user friendly text - # Errors 403 - @eam_getClusters_403.1_missing_access_token_scope - Scenario: Missing access token scope - Given the header "Authorization" is set to an access token that does not include the required scope - When the request "getClusters" is sent - Then the response status code is 403 - And the response header "x-correlator" has same value as the request header "x-correlator" - And the response header "Content-Type" is "application/json" - And the response property "$.status" is 403 - And the response property "$.code" is "PERMISSION_DENIED" - And the response property "$.message" contains a user friendly text diff --git a/code/Test_definitions/edge-application-management-getEdgeCloudZones.feature b/code/Test_definitions/edge-application-management-getEdgeCloudZones.feature index 6da9841..909689e 100644 --- a/code/Test_definitions/edge-application-management-getEdgeCloudZones.feature +++ b/code/Test_definitions/edge-application-management-getEdgeCloudZones.feature @@ -5,7 +5,8 @@ Feature: CAMARA Edge Application Management API, vwip - Operation getEdgeCloudZo # * apiRoot: API root of the server URL # # Testing assets: - # * An available edge Cloud Zones to get information + # * An available edge Cloud Zones to get information, at least one of which + # has Kubernetes clusters available # # References to OAS spec schemas refer to schemas specified in edge-application-management.yaml Background: Common getEdgeCloudZones setup @@ -17,28 +18,52 @@ Feature: CAMARA Edge Application Management API, vwip - Operation getEdgeCloudZo # Success scenarios #/edge-cloud-zones GET 200 @eam_getEdgeCloudZones_01_generic_success_scenario - Scenario: Get information of existing edge cloud zones + Scenario: Get a paginated list of existing edge cloud zones Given There are at least one Edge Cloud Zones available When the request "getEdgeCloudZones" is sent Then the response status code is 200 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" - And A list of Edge Cloud Zones is returned - And the response body complies with the OAS schema at "/components/schemas/EdgeCloudZones" - #/edge-cloud-zones GET 200 filtered by region - @eam_getEdgeCloudZones_02_generic_success_scenario_filtered_by_region - Scenario: Get information of existing Edge Cloud Zones with optional parameters ("region") + And the response body complies with the OAS schema at "/components/schemas/EdgeCloudZoneList" + And the response property "$.edgeCloudZones" is a list of Edge Cloud Zones + And the response property "$.pagination" is present and complies with the OAS schema at "/components/schemas/Pagination" + And any Edge Cloud Zone with Kubernetes clusters includes them in the "$.edgeCloudZones[].clusters" property + #/edge-cloud-zones GET 200 filtered by countryCode + @eam_getEdgeCloudZones_02_success_scenario_filtered_by_countryCode + Scenario: Get information of existing Edge Cloud Zones with optional parameter ("countryCode") Given There are at least one Edge Cloud Zones available - And the request query parameter "$.region" is set to a valid region + And the request query parameter "$.countryCode" is set to a valid ISO 3166-1 alpha-2 country code When the request "getEdgeCloudZones" is sent Then the response status code is 200 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" - And information of Edge Cloud Zones of "$.region" is returned - And the response body complies with the OAS schema at "/components/schemas/EdgeCloudZones" + And information of Edge Cloud Zones with "$.countryCode" is returned + And the response body complies with the OAS schema at "/components/schemas/EdgeCloudZoneList" + #/edge-cloud-zones GET 200 filtered by edgeCloudProvider + @eam_getEdgeCloudZones_03_success_scenario_filtered_by_edgeCloudProvider + Scenario: Get information of existing Edge Cloud Zones with optional parameter ("edgeCloudProvider") + Given There are at least one Edge Cloud Zones available + And the request query parameter "$.edgeCloudProvider" is set to a valid Edge Cloud Provider name + When the request "getEdgeCloudZones" is sent + Then the response status code is 200 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And information of Edge Cloud Zones of "$.edgeCloudProvider" is returned + And the response body complies with the OAS schema at "/components/schemas/EdgeCloudZoneList" + #/edge-cloud-zones GET 200 filtered by edgeCloudRegion + @eam_getEdgeCloudZones_04_success_scenario_filtered_by_edgeCloudRegion + Scenario: Get information of existing Edge Cloud Zones with optional parameter ("edgeCloudRegion") + Given There are at least one Edge Cloud Zones available + And the request query parameter "$.edgeCloudRegion" is set to a valid Edge Cloud Provider-specific region name + When the request "getEdgeCloudZones" is sent + Then the response status code is 200 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And information of Edge Cloud Zones of "$.edgeCloudRegion" is returned + And the response body complies with the OAS schema at "/components/schemas/EdgeCloudZoneList" #/edge-cloud-zones GET 200 filtered by status - @eam_getEdgeCloudZones_03_generic_success_scenario_filtered_by_status - Scenario: Get information of existing Edge Cloud Zones with optional parameters ("status") + @eam_getEdgeCloudZones_05_success_scenario_filtered_by_status + Scenario: Get information of existing Edge Cloud Zones with optional parameter ("status") Given There are at least one Edge Cloud Zones available And the request query parameter "$.status" is set to a valid status When the request "getEdgeCloudZones" is sent @@ -46,7 +71,41 @@ Feature: CAMARA Edge Application Management API, vwip - Operation getEdgeCloudZo And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" And information of Edge Cloud Zones of "$.status" is returned - And the response body complies with the OAS schema at "/components/schemas/EdgeCloudZones" + And the response body complies with the OAS schema at "/components/schemas/EdgeCloudZoneList" + #/edge-cloud-zones GET 200 no status filter returns zones regardless of status + @eam_getEdgeCloudZones_06_success_scenario_no_status_filter + Scenario: Get existing Edge Cloud Zones without the optional parameter ("status") + Given there are Edge Cloud Zones available with different statuses + When the request "getEdgeCloudZones" is sent + Then the response status code is 200 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And Edge Cloud Zones with any status are returned + And the response body complies with the OAS schema at "/components/schemas/EdgeCloudZoneList" + #/edge-cloud-zones GET 200 paginated by page and perPage + @eam_getEdgeCloudZones_07_success_scenario_paginated + Scenario: Get a specific page of existing Edge Cloud Zones with optional parameters ("page", "perPage") + Given there are more Edge Cloud Zones available than the requested "perPage" value + And the request query parameter "$.page" is set to a valid page number + And the request query parameter "$.perPage" is set to a valid perPage value + When the request "getEdgeCloudZones" is sent + Then the response status code is 200 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response property "$.pagination.page" has the value provided for "$.page" + And the response property "$.pagination.perPage" has the value provided for "$.perPage" + And the response body complies with the OAS schema at "/components/schemas/EdgeCloudZoneList" + # Error 400 + @eam_getEdgeCloudZones_400.1_invalid_page + Scenario: Invalid pagination parameter ("page") + Given the request query parameter "$.page" is set to an invalid page number + When the request "getEdgeCloudZones" is sent + Then the response status code is 400 + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 400 + And the response property "$.code" is "INVALID_ARGUMENT" + And the response property "$.message" contains a user friendly text # Error 401 @eam_getEdgeCloudZones_401.1_missing_access_token Scenario: Missing access token diff --git a/code/Test_definitions/edge-application-management-removeEdgeCloudZone.feature b/code/Test_definitions/edge-application-management-removeEdgeCloudZone.feature new file mode 100644 index 0000000..eef4df5 --- /dev/null +++ b/code/Test_definitions/edge-application-management-removeEdgeCloudZone.feature @@ -0,0 +1,99 @@ +Feature: CAMARA Edge Application Management API, vwip - Operation removeEdgeCloudZone + # Input to be provided by the implementation to the tester + # + # Implementation indications: + # * apiRoot: API root of the server URL + # + # Testing assets: + # * An appId of a submitted application and the values used in the submitApp operation. + # * A deployment instantiated by createAppDeployment operation, with at least one + # edgeCloudZoneId that can be removed. + # + # References to OAS spec schemas refer to schemas specified in edge-application-management.yaml + Background: Common removeEdgeCloudZone setup + Given an environment at "apiRoot" + And the resource "/edge-application-management/vwip/deployments/{appDeploymentId}/remove-edge-cloud-zone" + And the header "Content-Type" is set to "application/json" + And the header "Authorization" is set to a valid access token + And the header "x-correlator" complies with the schema at "#/components/schemas/XCorrelator" + # Properties not explicitly overwritten in the Scenarios can take any values compliant with the schema + And the request body is set by default to a request body compliant with the request body schema for this operation + # Success scenarios + @eam_removeEdgeCloudZone_01_generic_success_scenario + Scenario: Remove an Edge Cloud Zone from an existing deployment with mandatory parameters + Given there is a deployment created by operation createAppDeployment + And the request path parameter "$.appDeploymentId" is set to a valid application deployment ID + And the request body property "$.edgeCloudZoneId" is set to an edge zone id part of the deployment + When the request "removeEdgeCloudZone" is sent + Then the response status code is 200 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response body complies with the OAS schema at "/components/schemas/AppDeploymentInfo" + And the response property "$.edgeCloudZones" does not contain the value provided for "$.edgeCloudZoneId" + # Error scenarios + # Error 400 + @eam_removeEdgeCloudZone_400.1_schema_not_compliant + Scenario: Invalid Argument. Generic Syntax Exception + Given the request body is set to any value which is not compliant with the request body schema for this operation + When the request "removeEdgeCloudZone" is sent + Then the response status code is 400 + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 400 + And the response property "$.code" is "INVALID_ARGUMENT" + And the response property "$.message" contains a user friendly text + @eam_removeEdgeCloudZone_400.2_no_request_body + Scenario: Missing request body + Given the request body is not included + When the request "removeEdgeCloudZone" is sent + Then the response status code is 400 + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 400 + And the response property "$.code" is "INVALID_ARGUMENT" + And the response property "$.message" contains a user friendly text + # Error 404 + @eam_removeEdgeCloudZone_404.1_invalid_deployment + Scenario: Remove an Edge Cloud Zone from a non-existing deployment + Given the request path parameter "$.appDeploymentId" is set to an invalid application deployment ID + When the request "removeEdgeCloudZone" is sent + Then the response status code is 404 + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 404 + And the response property "$.code" is "NOT_FOUND" + And the response property "$.message" contains a user friendly text + @eam_removeEdgeCloudZone_404.2_zone_not_in_deployment + Scenario: Remove an Edge Cloud Zone not part of the deployment + Given there is a deployment created by operation createAppDeployment + And the request path parameter "$.appDeploymentId" is set to a valid application deployment ID + And the request body property "$.edgeCloudZoneId" is set to a valid edge zone id not part of the deployment + When the request "removeEdgeCloudZone" is sent + Then the response status code is 404 + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 404 + And the response property "$.code" is "NOT_FOUND" + And the response property "$.message" contains a user friendly text + # Error 401 + @eam_removeEdgeCloudZone_401.1_missing_access_token + Scenario: Missing access token + Given the header "Authorization" is not included + When the request "removeEdgeCloudZone" is sent + Then the response status code is 401 + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 401 + And the response property "$.code" is "UNAUTHENTICATED" + And the response property "$.message" contains a user friendly text + # Errors 403 + @eam_removeEdgeCloudZone_403.1_missing_access_token_scope + Scenario: Missing access token scope + Given the header "Authorization" is set to an access token that does not include the required scope + When the request "removeEdgeCloudZone" is sent + Then the response status code is 403 + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 403 + And the response property "$.code" is "PERMISSION_DENIED" + And the response property "$.message" contains a user friendly text diff --git a/code/Test_definitions/edge-application-management-removeKubernetesCluster.feature b/code/Test_definitions/edge-application-management-removeKubernetesCluster.feature new file mode 100644 index 0000000..3e03b59 --- /dev/null +++ b/code/Test_definitions/edge-application-management-removeKubernetesCluster.feature @@ -0,0 +1,99 @@ +Feature: CAMARA Edge Application Management API, vwip - Operation removeKubernetesCluster + # Input to be provided by the implementation to the tester + # + # Implementation indications: + # * apiRoot: API root of the server URL + # + # Testing assets: + # * An appId of a submitted application and the values used in the submitApp operation. + # * A deployment instantiated by createAppDeployment operation, with at least one + # kubernetesClusterRef that can be removed. + # + # References to OAS spec schemas refer to schemas specified in edge-application-management.yaml + Background: Common removeKubernetesCluster setup + Given an environment at "apiRoot" + And the resource "/edge-application-management/vwip/deployments/{appDeploymentId}/remove-kubernetes-cluster" + And the header "Content-Type" is set to "application/json" + And the header "Authorization" is set to a valid access token + And the header "x-correlator" complies with the schema at "#/components/schemas/XCorrelator" + # Properties not explicitly overwritten in the Scenarios can take any values compliant with the schema + And the request body is set by default to a request body compliant with the request body schema for this operation + # Success scenarios + @eam_removeKubernetesCluster_01_generic_success_scenario + Scenario: Remove a Kubernetes cluster from an existing deployment with mandatory parameters + Given there is a deployment created by operation createAppDeployment + And the request path parameter "$.appDeploymentId" is set to a valid application deployment ID + And the request body property "$.kubernetesClusterRef" is set to a kubernetes cluster part of the deployment + When the request "removeKubernetesCluster" is sent + Then the response status code is 200 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response body complies with the OAS schema at "/components/schemas/AppDeploymentInfo" + And the response property "$.kubernetesClusterRefs" does not contain the value provided for "$.kubernetesClusterRef" + # Error scenarios + # Error 400 + @eam_removeKubernetesCluster_400.1_schema_not_compliant + Scenario: Invalid Argument. Generic Syntax Exception + Given the request body is set to any value which is not compliant with the request body schema for this operation + When the request "removeKubernetesCluster" is sent + Then the response status code is 400 + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 400 + And the response property "$.code" is "INVALID_ARGUMENT" + And the response property "$.message" contains a user friendly text + @eam_removeKubernetesCluster_400.2_no_request_body + Scenario: Missing request body + Given the request body is not included + When the request "removeKubernetesCluster" is sent + Then the response status code is 400 + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 400 + And the response property "$.code" is "INVALID_ARGUMENT" + And the response property "$.message" contains a user friendly text + # Error 404 + @eam_removeKubernetesCluster_404.1_invalid_deployment + Scenario: Remove a Kubernetes cluster from a non-existing deployment + Given the request path parameter "$.appDeploymentId" is set to an invalid application deployment ID + When the request "removeKubernetesCluster" is sent + Then the response status code is 404 + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 404 + And the response property "$.code" is "NOT_FOUND" + And the response property "$.message" contains a user friendly text + @eam_removeKubernetesCluster_404.2_cluster_not_in_deployment + Scenario: Remove a Kubernetes cluster not part of the deployment + Given there is a deployment created by operation createAppDeployment + And the request path parameter "$.appDeploymentId" is set to a valid application deployment ID + And the request body property "$.kubernetesClusterRef" is set to a valid kubernetes cluster not part of the deployment + When the request "removeKubernetesCluster" is sent + Then the response status code is 404 + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 404 + And the response property "$.code" is "NOT_FOUND" + And the response property "$.message" contains a user friendly text + # Error 401 + @eam_removeKubernetesCluster_401.1_missing_access_token + Scenario: Missing access token + Given the header "Authorization" is not included + When the request "removeKubernetesCluster" is sent + Then the response status code is 401 + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 401 + And the response property "$.code" is "UNAUTHENTICATED" + And the response property "$.message" contains a user friendly text + # Errors 403 + @eam_removeKubernetesCluster_403.1_missing_access_token_scope + Scenario: Missing access token scope + Given the header "Authorization" is set to an access token that does not include the required scope + When the request "removeKubernetesCluster" is sent + Then the response status code is 403 + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 403 + And the response property "$.code" is "PERMISSION_DENIED" + And the response property "$.message" contains a user friendly text