-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hide internal silos in utilization (#4943)
Fixes #4708. I've updated the `/v1/system/utilization/silos` endpoint to only return non-discoverable silos if they have a quota set. I believe the `default-silo` _does_ get a quota set currently which is non-ideal, but that should be the only one that shows up on the list. I need specific eyes on the migration b/c I've never written a view migration before.
- Loading branch information
Showing
6 changed files
with
78 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
CREATE OR REPLACE VIEW omicron.public.silo_utilization | ||
AS SELECT | ||
c.id AS silo_id, | ||
s.name AS silo_name, | ||
c.cpus_provisioned AS cpus_provisioned, | ||
c.ram_provisioned AS memory_provisioned, | ||
c.virtual_disk_bytes_provisioned AS storage_provisioned, | ||
q.cpus AS cpus_allocated, | ||
q.memory_bytes AS memory_allocated, | ||
q.storage_bytes AS storage_allocated, | ||
-- This is the added column | ||
s.discoverable as silo_discoverable | ||
FROM | ||
omicron.public.virtual_provisioning_collection AS c | ||
RIGHT JOIN omicron.public.silo_quotas AS q | ||
ON c.id = q.silo_id | ||
INNER JOIN omicron.public.silo AS s | ||
ON c.id = s.id | ||
WHERE | ||
c.collection_type = 'Silo' | ||
AND | ||
s.time_deleted IS NULL; |
This file contains 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