mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
* 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>
23 lines
820 B
Python
23 lines
820 B
Python
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")],
|
|
),
|
|
)
|