Class: Google::Cloud::Logging::ResourceDescriptor

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/logging/resource_descriptor.rb,
lib/google/cloud/logging/resource_descriptor/list.rb

Overview

ResourceDescriptor

Describes a type of monitored resource supported by Stackdriver Logging. Each ResourceDescriptor has a type name, such as cloudsql_database, gae_app, or gce_instance. It also specifies a set of labels that must all be given values in a Resource instance to represent an actual instance of the type.

ResourceDescriptor instances are read-only. You cannot create your own instances, but you can list them with Project#resource_descriptors.

Examples:

require "google/cloud"

gcloud = Google::Cloud.new
logging = gcloud.logging
resource_descriptor = logging.resource_descriptors.first
resource_descriptor.type #=> "cloudsql_database"
resource_descriptor.name #=> "Cloud SQL Database"
resource_descriptor.labels.map &:key #=> ["database_id", "region"]

Defined Under Namespace

Classes: LabelDescriptor, List

Instance Attribute Summary collapse

Instance Attribute Details

#descriptionObject (readonly)

A detailed description of the monitored resource type, which is used in documentation.



62
63
64
# File 'lib/google/cloud/logging/resource_descriptor.rb', line 62

def description
  @description
end

#labelsArray<LabelDescriptor> (readonly)

A set of definitions of the labels that can be used to describe instances of this monitored resource type. For example, Cloud SQL databases must be labeled with their database_id and their region.

Returns:



71
72
73
# File 'lib/google/cloud/logging/resource_descriptor.rb', line 71

def labels
  @labels
end

#nameObject (readonly)

A display name for the monitored resource type. For example, Cloud SQL Database.



57
58
59
# File 'lib/google/cloud/logging/resource_descriptor.rb', line 57

def name
  @name
end

#typeObject (readonly)

The monitored resource type. For example, cloudsql_database.



52
53
54
# File 'lib/google/cloud/logging/resource_descriptor.rb', line 52

def type
  @type
end