Expose execution environments in awxkit and awx-cli

This commit is contained in:
Jeff Bradberry 2020-07-06 15:44:06 -04:00 committed by Shane McDonald
parent cc429f9741
commit c05e4e07ee
4 changed files with 39 additions and 0 deletions

View File

@ -14,6 +14,7 @@ from .teams import * # NOQA
from .credentials import * # NOQA
from .unified_jobs import * # NOQA
from .unified_job_templates import * # NOQA
from .execution_environments import * # NOQA
from .projects import * # NOQA
from .inventory import * # NOQA
from .system_job_templates import * # NOQA

View File

@ -23,6 +23,7 @@ EXPORTABLE_RESOURCES = [
'inventory_sources',
'job_templates',
'workflow_job_templates',
'execution_environments',
]
@ -33,6 +34,7 @@ EXPORTABLE_RELATIONS = [
'Credentials',
'Hosts',
'Groups',
'ExecutionEnvironments',
]

View File

@ -0,0 +1,33 @@
import logging
from awxkit.api.mixins import HasCreate
from awxkit.api.pages import (
Credential,
Organization,
)
from awxkit.api.resources import resources
from . import base
from . import page
log = logging.getLogger(__name__)
class ExecutionEnvironment(HasCreate, base.Base):
dependencies = [Organization, Credential]
NATURAL_KEY = ('organization', 'image')
page.register_page([resources.execution_environment,
(resources.execution_environments, 'post'),
(resources.organization_execution_environments, 'post')], ExecutionEnvironment)
class ExecutionEnvironments(page.PageList, ExecutionEnvironment):
pass
page.register_page([resources.execution_environments,
resources.organization_execution_environments], ExecutionEnvironments)

View File

@ -28,6 +28,8 @@ class Resources(object):
_credential_types = 'credential_types/'
_credentials = 'credentials/'
_dashboard = 'dashboard/'
_execution_environment = r'execution_environments/\d+/'
_execution_environments = 'execution_environments/'
_fact_view = r'hosts/\d+/fact_view/'
_group = r'groups/\d+/'
_group_access_list = r'groups/\d+/access_list/'
@ -141,6 +143,7 @@ class Resources(object):
_organization_access_list = r'organizations/\d+/access_list/'
_organization_admins = r'organizations/\d+/admins/'
_organization_applications = r'organizations/\d+/applications/'
_organization_execution_environments = r'organizations/\d+/execution_environments/'
_organization_inventories = r'organizations/\d+/inventories/'
_organization_users = r'organizations/\d+/users/'
_organizations = 'organizations/'