From df997e0b964e33551138c7545f59f1fe70362f92 Mon Sep 17 00:00:00 2001 From: DlondonoD Date: Wed, 5 Aug 2026 16:51:32 +0200 Subject: [PATCH 1/2] Redesign GET /edge-cloud-zones and remove GET /clusters per issue #73 Per issue #73's analysis of both list endpoints against the CAMARA Design Guide (including the pagination guide at Commonalities/documentation/CAMARA-API-Design-Guide.md#41-pagination): Fix (mandatory per issue): - ClusterInfo.provider renamed to edgeCloudProvider, now referencing EdgeCloudProvider instead of the incorrect AppProvider (Application Provider != Edge Cloud Provider running the cluster). - Removed 500/503 from the endpoint, and restricted 400/403 to only INVALID_ARGUMENT/PERMISSION_DENIED via new local Generic400/403 response objects, per the rationale already applied for issue #72 (5xx not documented by default; OUT_OF_RANGE/INVALID_TOKEN_CONTEXT irrelevant to this API). Consider (adopted): - Combined GET /clusters into GET /edge-cloud-zones: removed the standalone /clusters path, getClusters operation, its dedicated security scope and the now-unused 'Cluster' tag. EdgeCloudZone gains an optional 'clusters' array (ClusterInfo items, without the redundant edgeCloudZoneId/edgeCloudRegion fields already provided by the enclosing zone), populated when the zone has Kubernetes clusters available. - Added pagination support per the Commonalities pagination guide: page/perPage query params (ref'd from CAMARA_common.yaml), x-total-count/x-total-pages/link response headers, and a new EdgeCloudZoneList response schema (replacing the bare EdgeCloudZones array) wrapping items + the common Pagination object. - Added a new CountryCode schema (ISO 3166-1 alpha-2) and countryCode query parameter, replacing the previous edge-cloud-provider-specific 'region' filter with a standardized, interoperable one. EdgeCloudZone gains a required 'countryCode' property; the existing free-text edgeCloudRegion field is kept as provider-specific descriptive info. - Added an edgeCloudProvider query parameter to filter zones by provider. - Removed the 'default: unknown' from the status query parameter (now defined inline instead of -ing EdgeCloudZoneStatus, whose default remains appropriate for the response object) so omitting the filter returns zones of any status instead of defaulting to 'unknown' only. Updated getEdgeCloudZones.feature accordingly (new schema references, countryCode/edgeCloudProvider/pagination scenarios, removed the region-filter scenario, added a no-default-status scenario and a 400 invalid-page scenario) and deleted getClusters.feature, since the operation no longer exists. Fixes #73 --- .../edge-application-management.yaml | 246 ++++++++++-------- ...application-management-getClusters.feature | 94 ------- ...ation-management-getEdgeCloudZones.feature | 74 +++++- 3 files changed, 202 insertions(+), 212 deletions(-) delete mode 100644 code/Test_definitions/edge-application-management-getClusters.feature diff --git a/code/API_definitions/edge-application-management.yaml b/code/API_definitions/edge-application-management.yaml index 12f7b10..4753376 100644 --- a/code/API_definitions/edge-application-management.yaml +++ b/code/API_definitions/edge-application-management.yaml @@ -87,9 +87,10 @@ info: 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, status and Edge Cloud Provider. @@ -201,8 +202,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 @@ -994,69 +993,6 @@ paths: "503": $ref: "../common/CAMARA_common.yaml#/components/responses/Generic503" - /clusters: - get: - security: - - openId: - - edge-application-management:clusters:read - tags: - - Cluster - summary: | - Retrieve a list of the available clusters filtered by the optional - query parameters. - description: | - List available cluster information - operationId: getClusters - parameters: - - $ref: "#/components/parameters/x-correlator" - - name: region - description: | - Human readable name of the geographical Edge Cloud Region of - the Cluster. Defined by the Edge Cloud Provider. - in: query - required: false - schema: - $ref: "#/components/schemas/EdgeCloudRegion" - - name: clusterRef - description: | - A globally unique identifier for the Cluster. - in: query - required: false - schema: - $ref: "#/components/schemas/KubernetesClusterRef" - - name: edgeCloudZoneId - description: | - Edge Cloud Zone identifier. - in: query - required: false - schema: - $ref: "#/components/schemas/EdgeCloudZoneId" - responses: - "200": - description: | - Successful response, returning the cluster's information. - Returns an empty list if no clusters were found or none match - the specified query parameters. - 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" - "400": - $ref: "../common/CAMARA_common.yaml#/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" /edge-cloud-zones: get: security: @@ -1064,50 +1000,70 @@ 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, status and Edge Cloud + Provider, 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/EdgeCloudRegion" + $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: 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 +1086,58 @@ 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. + callbacks: onAppInstanceStatusChange: "{$request.body#/subscriptionRequest/sink}": @@ -1718,26 +1726,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 +1757,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 +1780,22 @@ 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: + - items + - pagination + properties: + items: + type: array + maxItems: 100 + items: + $ref: "#/components/schemas/EdgeCloudZone" + pagination: + $ref: "../common/CAMARA_common.yaml#/components/schemas/Pagination" EdgeCloudZoneId: type: string @@ -1795,6 +1819,7 @@ components: - edgeCloudZoneId - edgeCloudZoneName - edgeCloudProvider + - countryCode properties: edgeCloudZoneId: $ref: "#/components/schemas/EdgeCloudZoneId" @@ -1806,6 +1831,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-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..f4e6dfd 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,41 @@ 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 "$.items" 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 "$.items[].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 status - @eam_getEdgeCloudZones_03_generic_success_scenario_filtered_by_status - Scenario: Get information of existing Edge Cloud Zones with optional parameters ("status") + @eam_getEdgeCloudZones_04_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 +60,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_05_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_06_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 From f0dbe25562a06e749995575a25c33e2b700f6404 Mon Sep 17 00:00:00 2001 From: DlondonoD Date: Wed, 5 Aug 2026 17:13:48 +0200 Subject: [PATCH 2/2] Avoid generic 'items' name and restore edgeCloudRegion filtering Per the Commonalities pagination guide, the 'items' array name in the paginated response schema is API-specific, not mandatory - renamed EdgeCloudZoneList.items to edgeCloudZones for clarity in this API's context. Updated the .feature file's property references accordingly. Also restored the ability to filter by edgeCloudRegion, lost when 'region' was replaced by the new standardized countryCode filter. The EdgeCloudZone schema still exposes edgeCloudRegion as a provider-specific descriptive field, so it makes sense to keep it filterable alongside countryCode: countryCode for provider-independent results, edgeCloudRegion when finer, provider-specific granularity is needed. Added the corresponding query parameter, operation/API description updates, and a getEdgeCloudZones.feature scenario. --- .../edge-application-management.yaml | 22 ++++++++++++++----- ...ation-management-getEdgeCloudZones.feature | 21 +++++++++++++----- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/code/API_definitions/edge-application-management.yaml b/code/API_definitions/edge-application-management.yaml index 4753376..227f951 100644 --- a/code/API_definitions/edge-application-management.yaml +++ b/code/API_definitions/edge-application-management.yaml @@ -90,7 +90,8 @@ info: * __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, status and Edge Cloud Provider. + filtered by country code, Edge Cloud Provider, Edge Cloud + Provider-specific region and status. @@ -1004,8 +1005,9 @@ paths: description: | 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, status and Edge Cloud - Provider, and are returned as a paginated collection. + 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" @@ -1028,6 +1030,16 @@ paths: 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: | Status of the Edge Cloud Zone to filter by. If omitted, Edge @@ -1786,10 +1798,10 @@ components: A paginated collection of Edge Cloud Zones where the Application Provider can instantiate an Application Instance. required: - - items + - edgeCloudZones - pagination properties: - items: + edgeCloudZones: type: array maxItems: 100 items: diff --git a/code/Test_definitions/edge-application-management-getEdgeCloudZones.feature b/code/Test_definitions/edge-application-management-getEdgeCloudZones.feature index f4e6dfd..909689e 100644 --- a/code/Test_definitions/edge-application-management-getEdgeCloudZones.feature +++ b/code/Test_definitions/edge-application-management-getEdgeCloudZones.feature @@ -25,9 +25,9 @@ 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 the response body complies with the OAS schema at "/components/schemas/EdgeCloudZoneList" - And the response property "$.items" is a list of Edge Cloud Zones + 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 "$.items[].clusters" property + 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") @@ -50,8 +50,19 @@ Feature: CAMARA Edge Application Management API, vwip - Operation getEdgeCloudZo 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_04_success_scenario_filtered_by_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 @@ -62,7 +73,7 @@ Feature: CAMARA Edge Application Management API, vwip - Operation getEdgeCloudZo And information of Edge Cloud Zones of "$.status" is returned 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_05_success_scenario_no_status_filter + @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 @@ -72,7 +83,7 @@ Feature: CAMARA Edge Application Management API, vwip - Operation getEdgeCloudZo 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_06_success_scenario_paginated + @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