Exemplo n.º 1
0
    def read(self):
        """Return a GCP cloud infrastructure configuration record.

        Yields:
            dict: A GCP cloud infrastructure configuration record.

        """
        yield from ioworkers.run(self._get_projects, self._get_resources,
                                 self._processes, self._threads, __name__)
Exemplo n.º 2
0
    def read(self):
        """Return an Azure Key Vault record.

        Yields:
            dict: An Azure Key Vault and associated resource record.

        """
        yield from ioworkers.run(self._get_tenant_kvs, self._process_key_vault,
                                 self._processes, self._threads, __name__)
Exemplo n.º 3
0
    def read(self):
        """Return an Azure virtual machine record.

        Yields:
            dict: An Azure virtual machine record.

        """
        yield from ioworkers.run(self._get_tenant_vms,
                                 self._get_vm_instance_views, self._processes,
                                 self._threads, __name__)
Exemplo n.º 4
0
    def read(self):
        """Return an Azure storage account record.

        Yields:
            dict: An Azure storage account record.

        """
        yield from ioworkers.run(self._get_tenant_storage_accounts,
                                 self._get_storage_account_properties,
                                 self._processes, self._threads, __name__)
Exemplo n.º 5
0
    def read(self):
        """Return an Azure Postgres record.

        Yields:
            dict: An Azure Postgres record.

        """
        yield from ioworkers.run(self._get_tenant_postgres,
                                 self._get_postgres_server_details,
                                 self._processes, self._threads, __name__)
Exemplo n.º 6
0
    def read(self):
        """Return an Azure web app record.

        Yields:
            dict: An Azure web app record.

        """
        yield from ioworkers.run(self._get_tenant_web_apps,
                                 self._get_web_app_configs, self._processes,
                                 self._threads, __name__)
Exemplo n.º 7
0
    def read(self):
        """Return an Azure disk record.

        Yields:
            dict: An Azure disk record.

        """
        yield from ioworkers.run(self._get_tenant_disks,
                                 self._get_disk_details, self._processes,
                                 self._threads, __name__)
Exemplo n.º 8
0
    def read(self):
        """Return an Azure monitor record.

        Yields:
            dict: An Azure monitor record.

        """
        yield from ioworkers.run(self._get_subscriptions,
                                 self._get_profiles,
                                 self._processes, self._threads,
                                 __name__)
Exemplo n.º 9
0
    def read(self):
        """Return an Azure cloud infrastructure configuration record.

        Yields:
            dict: An Azure cloud infrastructure configuration record.

        """
        yield from ioworkers.run(self._get_subscriptions,
                                 self._get_resources,
                                 self._processes, self._threads,
                                 __name__)
Exemplo n.º 10
0
 def test_run_default_workers(self):
     out = ioworkers.run(lambda: ((i, ) for i in range(5)),
                         lambda x: [x**2])
     self.assertEqual(set(out), {0, 1, 4, 9, 16})
Exemplo n.º 11
0
 def test_run_worker_counts(self):
     out = ioworkers.run(lambda: ((i, ) for i in range(5)),
                         lambda x: [x**2], 1, 1)
     self.assertEqual(list(out), [0, 1, 4, 9, 16])