Expose deployable regions per app (#225)#226
Merged
Merged
Conversation
The deploy form needs to know which regions can host a given app, but the
customer API exposed no region/cluster info and app clusters are admin-
configured per region (VM regions don't apply). Add:
- GET /api/v1/apps/{id}/regions -> [{ id, name, available }] for every region
with an enabled app cluster, where 'available' is whether a cluster there
currently fits the app's footprint. Lets the picker show full regions
disabled instead of failing at order time; ids are valid region_id for
POST /api/v1/app-deployments.
- AppClusterCapacityService::regions_availability(need) computing that set.
e2e ordering test asserts the seeded region is returned with available=true.
Docs + changelog updated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #225.
The web app is building the app deploy form (compose
config:→ inputs + a region picker), but the customer API had no way to discover which regions can actually host a given app — app clusters are admin-configured per region and don't follow the VM regions, so the picker had no valid source and would risk a400at order time.Change
GET /api/v1/apps/{id}/regions→[{ id, name, available }]for every region that has an enabled app cluster.availableistruewhen a cluster in that region currently has enough free capacity for this app's footprint, so the picker can show full regions disabled instead of failing onPOST. The returnedids are exactly theregion_idvalues accepted byPOST /api/v1/app-deployments.404if the app doesn't exist / isn't offered.AppClusterCapacityService::regions_availability(need)computes the (region_id, available) set — the read-side counterpart to the existingselect_in_regionused at order time (same capacity accounting, no overcommit).Follows the same "surface the id the client needs" pattern as #210 / #216.
Tests / docs
available: true.API_DOCUMENTATION.md+API_CHANGELOG.mdupdated.