-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate resources API in Controller (#14896)
* add resources api to controller * update setting models are not the source of truth in AWX * Force creation of ServiceID object in tests * fix typo * settings fix for CI --------- Co-authored-by: Alan Rominger <arominge@redhat.com>
- Loading branch information
1 parent
d35d8b6
commit 8876043
Showing
6 changed files
with
43 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from ansible_base.resource_registry.registry import ParentResource, ResourceConfig, ServiceAPIConfig, SharedResource | ||
from ansible_base.resource_registry.shared_types import OrganizationType, TeamType, UserType | ||
|
||
from awx.main import models | ||
|
||
|
||
class APIConfig(ServiceAPIConfig): | ||
service_type = "awx" | ||
|
||
|
||
RESOURCE_LIST = ( | ||
ResourceConfig( | ||
models.Organization, | ||
shared_resource=SharedResource(serializer=OrganizationType, is_provider=False), | ||
), | ||
ResourceConfig(models.User, shared_resource=SharedResource(serializer=UserType, is_provider=False), name_field="username"), | ||
ResourceConfig( | ||
models.Team, | ||
shared_resource=SharedResource(serializer=TeamType, is_provider=False), | ||
parent_resources=[ParentResource(model=models.Organization, field_name="organization")], | ||
), | ||
) |
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