How to use the towerlib.entities.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 / tests / integration / test_towerlib.py View on Github external
def test_hosts(self):
        with self.recorder:
            self.assertIsInstance(self.tower.hosts, EntityManager)
            host_generator = self.tower.get_hosts_by_name('example.com')
            host = list(host_generator)[0]
            self.assertIsInstance(host, Host)
            self.assertTrue(host.name == self.tower.get_host_by_id(host.id).name)
            other_host = self.tower.get_inventory_host_by_name('workflow', 'Test Inventory', 'example.com')
            self.assertTrue(host.name == other_host.name)
            with self.assertRaises(InvalidInventory):
                self.tower.get_inventory_host_by_name('workflow', 'Test Inventory Broken', 'example.com')
github schubergphilis / towerlib / tests / integration / test_team.py View on Github external
def test_roles(self):
        with self.recorder:
            self.assertIsInstance(self.team.roles, EntityManager)
github schubergphilis / towerlib / tests / integration / test_user.py View on Github external
def test_credentials(self):
        with self.recorder:
            self.assertIsInstance(self.user.credentials, EntityManager)
github schubergphilis / towerlib / tests / integration / test_user.py View on Github external
def test_organizations(self):
        with self.recorder:
            self.assertIsInstance(self.user.organizations, EntityManager)
github schubergphilis / towerlib / towerlib / towerlib.py View on Github external
def custom_credential_types(self):
        """The custom credential_types configured in tower.

        Returns:
            EntityManager: The manager object for external credential types.

        """
        return EntityManager(self,
                             entity_name='credential_types',
                             entity_object='CredentialType',
                             primary_match_field='name').filter({'managed_by_tower': 'false'})
github schubergphilis / towerlib / towerlib / towerlib.py View on Github external
def organizations(self):
        """The organizations configured in tower.

        Returns:
            EntityManager: The manager object for organizations.

        """
        return EntityManager(self,
                             entity_name='organizations',
                             entity_object='Organization',
                             primary_match_field='name')
github schubergphilis / towerlib / towerlib / towerlib.py View on Github external
def notification_templates(self):
        """The notification templates configured in tower.

        Returns:
            EntityManager: The manager object for groups.

        """
        return EntityManager(self,
                             entity_name='notification_templates',
                             entity_object='NotificationTemplate',
                             primary_match_field='name')
github schubergphilis / towerlib / towerlib / towerlib.py View on Github external
def hosts(self):
        """The hosts configured in tower.

        Returns:
            EntityManager: The manager object for hosts

        """
        return EntityManager(self,
                             entity_name='hosts',
                             entity_object='Host',
                             primary_match_field='name')
github schubergphilis / towerlib / towerlib / towerlib.py View on Github external
def unified_jobs(self):
        """The unified jobs executed in tower.

        Returns:
            EntityManager: The manager object for unified jobs.

        """
        return EntityManager(self,
                             entity_name='unified_jobs',
                             entity_object='Job',
                             primary_match_field='name')
github schubergphilis / towerlib / towerlib / towerlib.py View on Github external
def credentials(self):
        """The credentials configured in tower.

        Returns:
            EntityManager: The manager object for credentials.

        """
        return EntityManager(self,
                             entity_name='credentials',
                             entity_object='Credential',
                             primary_match_field='name')