How to use the towerlib.entities.core.EntityManager function in towerlib

To help you get started, we’ve selected a few towerlib 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 schubergphilis / towerlib / towerlib / entities / organization.py View on Github external
def teams(self):
        """The teams of the organization.

        Returns:
            EntityManager: EntityManager of the teams of the organization.

        """
        url = '{organization}teams/'.format(organization=self.api_url)
        return EntityManager(self._tower,
                             entity_object='Team',
                             primary_match_field='name',
                             url=url)
github schubergphilis / towerlib / towerlib / entities / job.py View on Github external
def object_roles(self):
        """The object roles.

        Returns:
            ObjectRole: The object roles supported.

        """
        if not self._object_roles:
            url = self._data.get('related', {}).get('object_roles')
            self._object_roles = EntityManager(self._tower,
                                               entity_object='ObjectRole',
                                               primary_match_field='name',
                                               url=url)
        return self._object_roles
github schubergphilis / towerlib / towerlib / entities / organization.py View on Github external
def projects(self):
        """The projects of the organization.

        Returns:
            EntityManager: EntityManager of the projects.

        """
        url = self._data.get('related', {}).get('projects')
        return EntityManager(self._tower,
                             entity_object='Project',
                             primary_match_field='name',
                             url=url)
github schubergphilis / towerlib / towerlib / entities / organization.py View on Github external
def inventories(self):
        """The inventories of the organization.

        Returns:
            EntityManager: EntityManager of the inventories of the organization.

        """
        url = '{organization}inventories/'.format(organization=self.api_url)
        return EntityManager(self._tower,
                             entity_object='Inventory',
                             primary_match_field='name',
                             url=url)
github schubergphilis / towerlib / towerlib / entities / organization.py View on Github external
def object_roles(self):
        """The object roles.

        Returns:
            EntityManager: EntityManager of the roles supported.

        """
        url = self._data.get('related', {}).get('object_roles')
        return EntityManager(self._tower,
                             entity_object='ObjectRole',
                             primary_match_field='name',
                             url=url)
github schubergphilis / towerlib / towerlib / entities / organization.py View on Github external
def credentials(self):
        """The credentials of the organization.

        Returns:
            EntityManager: EntityManager of the credentials of the organization.

        """
        url = '{organization}credentials/'.format(organization=self.api_url)
        return EntityManager(self._tower,
                             entity_object='Credential',
                             primary_match_field='name',
                             url=url)
github schubergphilis / towerlib / towerlib / entities / credential.py View on Github external
def owner_teams(self):
        """The owner teams of the credential.

        Returns:
            EntityManager: EntityManager of the teams that are owners.

        """
        url = self._data.get('related', {}).get('owner_teams')
        return EntityManager(self._tower,
                             entity_object='Team',
                             primary_match_field='name',
                             url=url)
github schubergphilis / towerlib / towerlib / entities / team.py View on Github external
def credentials(self):
        """The credentials of the team.

        Returns:
            EntityManager: EntityManager of the credentials.

        """
        url = self._data.get('related', {}).get('credentials')
        return EntityManager(self._tower,
                             entity_object='Credential',
                             primary_match_field='name',
                             url=url)
github schubergphilis / towerlib / towerlib / entities / credential.py View on Github external
def object_roles(self):
        """The object roles.

        Returns:
            EntityManager: EntityManager of the object roles supported.

        """
        if not self._object_roles:
            url = self._data.get('related', {}).get('object_roles')
            self._object_roles = EntityManager(self._tower,
                                               entity_object='ObjectRole',
                                               primary_match_field='name',
                                               url=url)
        return self._object_roles
github schubergphilis / towerlib / towerlib / entities / project.py View on Github external
def object_roles(self):
        """The object roles.

        Returns:
            EntityManager: EntityManager of the object roles supported.

        """
        if not self._object_roles:
            url = self._data.get('related', {}).get('object_roles')
            self._object_roles = EntityManager(self._tower,
                                               entity_object='ObjectRole',
                                               primary_match_field='name',
                                               url=url)
        return self._object_roles