def fetch_resource_descriptor(self, resource_type): """Look up a resource descriptor by type. Example:: >>> print(client.fetch_resource_descriptor('gce_instance')) :type resource_type: string :param resource_type: The resource type name. :rtype: :class:`~gcloud.monitoring.resource.ResourceDescriptor` :returns: The resource descriptor instance. :raises: :class:`gcloud.exceptions.NotFound` if the resource descriptor is not found. """ return ResourceDescriptor._fetch(self, resource_type)
def fetch_resource_descriptor(self, resource_type): """Look up a monitored resource descriptor by type. Example:: >>> print(client.fetch_resource_descriptor('gce_instance')) :type resource_type: string :param resource_type: The resource type name. :rtype: :class:`~gcloud.monitoring.resource.ResourceDescriptor` :returns: The resource descriptor instance. :raises: :class:`gcloud.exceptions.NotFound` if the resource descriptor is not found. """ return ResourceDescriptor._fetch(self, resource_type)
def list_resource_descriptors(self, filter_string=None): """List all resource descriptors for the project. Example:: >>> for descriptor in client.list_resource_descriptors(): ... print(descriptor.type) :type filter_string: string or None :param filter_string: An optional filter expression describing the resource descriptors to be returned. See the `filter documentation`_. :rtype: list of :class:`~gcloud.monitoring.resource.ResourceDescriptor` :returns: A list of resource descriptor instances. .. _filter documentation: https://cloud.google.com/monitoring/api/v3/filters """ return ResourceDescriptor._list(self, filter_string)
def list_resource_descriptors(self, filter_string=None): """List all monitored resource descriptors for the project. Example:: >>> for descriptor in client.list_resource_descriptors(): ... print(descriptor.type) :type filter_string: string or None :param filter_string: An optional filter expression describing the resource descriptors to be returned. See the `filter documentation`_. :rtype: list of :class:`~gcloud.monitoring.resource.ResourceDescriptor` :returns: A list of resource descriptor instances. .. _filter documentation: https://cloud.google.com/monitoring/api/v3/filters """ return ResourceDescriptor._list(self, filter_string)