How to use the cloudbridge.cloud.base.helpers.generic_find function in cloudbridge

To help you get started, we’ve selected a few cloudbridge 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 CloudVE / cloudbridge / cloudbridge / cloud / base / services.py View on Github external
def find(self, network=None, **kwargs):
        if not network:
            obj_list = self
        else:
            obj_list = network.subnets
        filters = ['label']
        matches = cb_helpers.generic_find(filters, kwargs, obj_list)
        return ClientPagedResultList(self._provider, list(matches))
github CloudVE / cloudbridge / cloudbridge / cloud / base / services.py View on Github external
def find(self, **kwargs):
        obj_list = self
        filters = ['name']
        matches = cb_helpers.generic_find(filters, kwargs, obj_list)
        return ClientPagedResultList(self._provider, list(matches))
github CloudVE / cloudbridge / cloudbridge / cloud / providers / gcp / services.py View on Github external
def find(self, limit=None, marker=None, **kwargs):
        """
        GCP networks are global. There is at most one network with a given
        name.
        """
        obj_list = self
        filters = ['name', 'label']
        matches = cb_helpers.generic_find(filters, kwargs, obj_list)
        return ClientPagedResultList(self._provider, list(matches),
                                     limit=limit, marker=marker)
github CloudVE / cloudbridge / cloudbridge / cloud / base / services.py View on Github external
def find(self, **kwargs):
        obj_list = self
        filters = ['name']
        matches = cb_helpers.generic_find(filters, kwargs, obj_list)
        return ClientPagedResultList(self._provider, list(matches))
github CloudVE / cloudbridge / cloudbridge / cloud / base / services.py View on Github external
def find(self, **kwargs):
        obj_list = self
        filters = ['label']
        matches = cb_helpers.generic_find(filters, kwargs, obj_list)

        # All kwargs should have been popped at this time.
        if len(kwargs) > 0:
            raise TypeError("Unrecognised parameters for search: %s."
                            " Supported attributes: %s" % (kwargs,
                                                           ", ".join(filters)))

        return ClientPagedResultList(self.provider,
                                     matches if matches else [])
github CloudVE / cloudbridge / cloudbridge / cloud / providers / gcp / services.py View on Github external
def find(self, bucket, limit=None, marker=None, **kwargs):
        filters = ['name']
        matches = cb_helpers.generic_find(filters, kwargs, bucket.objects)
        return ClientPagedResultList(self._provider, list(matches),
                                     limit=limit, marker=marker)
github CloudVE / cloudbridge / cloudbridge / cloud / providers / openstack / services.py View on Github external
def find(self, **kwargs):
        obj_list = self
        filters = ['label']
        matches = cb_helpers.generic_find(filters, kwargs, obj_list)
        return ClientPagedResultList(self._provider, list(matches))
github CloudVE / cloudbridge / cloudbridge / cloud / providers / openstack / services.py View on Github external
def find(self, bucket, **kwargs):
        _, obj_list = self.provider.swift.get_container(bucket.name)
        cb_objs = [OpenStackBucketObject(self.provider, bucket, obj)
                   for obj in obj_list]
        filters = ['name']
        matches = cb_helpers.generic_find(filters, kwargs, cb_objs)
        return ClientPagedResultList(self.provider, list(matches))
github CloudVE / cloudbridge / cloudbridge / cloud / providers / gcp / services.py View on Github external
def find(self, limit=None, marker=None, **kwargs):
        obj_list = self
        filters = ['name', 'label']
        matches = cb_helpers.generic_find(filters, kwargs, obj_list)
        return ClientPagedResultList(self._provider, list(matches),
                                     limit=limit, marker=marker)