How to use the awxkit.api.mixins.DSAdapter function in awxkit

To help you get started, we’ve selected a few awxkit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ansible / awx / awxkit / awxkit / api / pages / job_templates.py View on Github external
(project,
                 Project)))
        project = self.ds.project if project else None
        inventory = self.ds.inventory if inventory else None
        credential = self.ds.credential if credential else None

        payload = self.payload(
            name=name,
            description=description,
            job_type=job_type,
            playbook=playbook,
            credential=credential,
            inventory=inventory,
            project=project,
            **kwargs)
        payload.ds = DSAdapter(self.__class__.__name__, self._dependency_store)
        return payload, credential
github ansible / awx / awxkit / awxkit / api / pages / workflow_job_templates.py View on Github external
def create_payload(self, name='', description='', organization=None, **kwargs):
        self.create_and_update_dependencies(*filter_by_class((organization, Organization)))
        organization = self.ds.organization if organization else None
        payload = self.payload(name=name, description=description, organization=organization, **kwargs)
        payload.ds = DSAdapter(self.__class__.__name__, self._dependency_store)
        return payload
github ansible / awx / awxkit / awxkit / api / pages / workflow_job_template_nodes.py View on Github external
unified_job_template=JobTemplate,
            **kwargs):
        if not unified_job_template:
            self.create_and_update_dependencies(workflow_job_template)
            payload = self.payload(
                workflow_job_template=self.ds.workflow_job_template,
                unified_job_template=None,
                **kwargs)
        else:
            self.create_and_update_dependencies(
                workflow_job_template, unified_job_template)
            payload = self.payload(
                workflow_job_template=self.ds.workflow_job_template,
                unified_job_template=self.ds.unified_job_template,
                **kwargs)
        payload.ds = DSAdapter(self.__class__.__name__, self._dependency_store)
        return payload
github ansible / awx / awxkit / awxkit / api / pages / credentials.py View on Github external
def create_payload(self, kind='cloud', **kwargs):
        payload = self.payload(kind=kind, **kwargs)
        payload.ds = DSAdapter(self.__class__.__name__, self._dependency_store)
        return payload
github ansible / awx / awxkit / awxkit / api / pages / credentials.py View on Github external
if not any((user, team, organization)):
            organization = Organization
        self.create_and_update_dependencies(
            credential_type, organization, user, team)
        user = self.ds.user if user else None
        team = self.ds.team if team else None
        organization = self.ds.organization if organization else None

        payload = self.payload(
            self.ds.credential_type,
            user=user,
            team=team,
            organization=organization,
            inputs=inputs,
            **kwargs)
        payload.ds = DSAdapter(self.__class__.__name__, self._dependency_store)
        return payload
github ansible / awx / awxkit / awxkit / api / pages / notification_templates.py View on Github external
description='',
            notification_type='slack',
            organization=Organization,
            **kwargs):
        if notification_type not in notification_types:
            raise ValueError(
                'Unsupported notification type "{0}".  Please use one of {1}.' .format(
                    notification_type, notification_types))
        self.create_and_update_dependencies(organization)
        payload = self.payload(
            organization=self.ds.organization,
            notification_type=notification_type,
            name=name,
            description=description,
            **kwargs)
        payload.ds = DSAdapter(self.__class__.__name__, self._dependency_store)
        return payload
github ansible / awx / awxkit / awxkit / api / pages / users.py View on Github external
def create_payload(self, username='', password='', **kwargs):
        payload = self.payload(username=username, password=password, **kwargs)
        payload.ds = DSAdapter(self.__class__.__name__, self._dependency_store)
        return payload