Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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))
def find(self, **kwargs):
obj_list = self
filters = ['name']
matches = cb_helpers.generic_find(filters, kwargs, obj_list)
return ClientPagedResultList(self._provider, list(matches))
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)
def find(self, **kwargs):
obj_list = self
filters = ['name']
matches = cb_helpers.generic_find(filters, kwargs, obj_list)
return ClientPagedResultList(self._provider, list(matches))
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 [])
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)
def find(self, **kwargs):
obj_list = self
filters = ['label']
matches = cb_helpers.generic_find(filters, kwargs, obj_list)
return ClientPagedResultList(self._provider, list(matches))
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))
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)