-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(host): Add host set information to static host (#1828)
* feat(host): Add host set information to static host Updates LookupHost and ListHost API to include sets a static host is part of, as like with plugin hosts. * test: updated TestList_Plugin and TestCrud to be more consistent under race conditions
- Loading branch information
Showing
9 changed files
with
305 additions
and
35 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
internal/db/schema/migrations/oss/postgres/25/01_static_host_view.up.sql
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,24 @@ | ||
begin; | ||
|
||
-- static_host_with_set_memberships is used for associating a static host instance with all its related host sets | ||
-- in the set_ids column. Currently there are no size limits. | ||
create view static_host_with_set_memberships as | ||
select | ||
h.public_id, | ||
h.create_time, | ||
h.update_time, | ||
h.name, | ||
h.description, | ||
h.catalog_id, | ||
h.address, | ||
h.version, | ||
-- the string_agg(..) column will be null if there are no associated value objects | ||
string_agg(distinct hsm.set_id, '|') as set_ids | ||
from | ||
static_host h | ||
left outer join static_host_set_member hsm on h.public_id = hsm.host_id | ||
group by h.public_id; | ||
comment on view static_host_with_set_memberships is | ||
'static host with its associated host sets'; | ||
|
||
commit; |
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
Oops, something went wrong.