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)