Skip to content

Redesign GET /edge-cloud-zones and remove GET /clusters per issue #73 - #79

Open
DLondonoD wants to merge 2 commits into
camaraproject:mainfrom
DLondonoD:fix/issue-73
Open

Redesign GET /edge-cloud-zones and remove GET /clusters per issue #73#79
DLondonoD wants to merge 2 commits into
camaraproject:mainfrom
DLondonoD:fix/issue-73

Conversation

@DLondonoD

Copy link
Copy Markdown
Contributor

What type of PR is this?

correction

What this PR does / why we need it:

Reviews and fixes the design of the GET /edge-cloud-zones and GET /clusters list endpoints
per the issues identified:

Fixes (mandatory):

  • ClusterInfo.provider renamed to edgeCloudProvider, now referencing EdgeCloudProvider
    instead of the incorrect AppProvider (an Application Provider is the API consumer, not the
    entity running the Kubernetes cluster).
  • Documented error responses reviewed: removed 500/503 and restricted 400/403 to only
    INVALID_ARGUMENT/PERMISSION_DENIED, per the same rationale already applied for Review documented error response codes #72.

Design changes (adopted from the "Consider" list):

  • Combined GET /clusters into GET /edge-cloud-zones: removed the standalone /clusters
    path, the getClusters operation, its dedicated security scope and the now-unused Cluster tag.
    EdgeCloudZone gains an optional clusters array, populated when the zone has Kubernetes
    clusters available.
  • Added pagination per the [Commonalities pagination guide](https://github.
    com/camaraproject/Commonalities/blob/r4.3/documentation/CAMARA-API-Design-Guide.md#41-pagination):
    page/perPage query params, x-total-count/x-total-pages/link response headers, and a new
    EdgeCloudZoneList response schema wrapping an edgeCloudZones array (named per-API rather than
    the generic items, as the guide allows) plus the common Pagination object.
  • Added a standardized countryCode filter (ISO 3166-1 alpha-2), independent of Edge Cloud
    Provider terminology, as a new required EdgeCloudZone.countryCode property. The previous
    provider-specific edgeCloudRegion filter is kept alongside it (not removed) for cases
    needing finer, provider-specific granularity.
  • Added an edgeCloudProvider filter to filter zones by provider.
  • Removed the default: unknown from the status query parameter, so omitting it now
    returns zones of any status instead of only unknown ones.

Which issue(s) this PR fixes:

Fixes #73

Special notes for reviewers:

getClusters.feature was deleted since the operation no longer exists; getEdgeCloudZones. feature was updated with new scenarios for countryCode, edgeCloudProvider, edgeCloudRegion,
pagination, and the no-default-status behavior.

Changelog input

release-note Redesign GET /edge-cloud-zones to include paginated results and, when applicable,
Kubernetes cluster information; remove the standalone GET /clusters endpoint; add countryCode and
edgeCloudProvider filters; fix ClusterInfo's provider field to reference the Edge Cloud Provider
instead of the Application Provider.

Additional documentation

This section can be blank.

docs

…araproject#73

Per issue camaraproject#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 camaraproject#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 camaraproject#73
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review design of list endpoints GET /edge-cloud-zones and GET /clusters and fix issues

2 participants