Class: Gcloud::Logging::ResourceDescriptor
- Inherits:
-
Object
- Object
- Gcloud::Logging::ResourceDescriptor
- Defined in:
- lib/gcloud/logging/resource_descriptor.rb,
lib/gcloud/logging/resource_descriptor/list.rb
Overview
# ResourceDescriptor
Describes a type of monitored resource supported by Cloud 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.
Defined Under Namespace
Classes: LabelDescriptor, List
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
A detailed description of the monitored resource type, which is used in documentation.
-
#labels ⇒ Array<LabelDescriptor>
readonly
A set of definitions of the labels that can be used to describe instances of this monitored resource type.
-
#name ⇒ Object
readonly
A display name for the monitored resource type.
-
#type ⇒ Object
readonly
The monitored resource type.
Class Method Summary collapse
-
.from_grpc(grpc) ⇒ Object
Google::Api::MonitoredResourceDescriptor object.
Instance Method Summary collapse
-
#initialize ⇒ ResourceDescriptor
constructor
A new instance of ResourceDescriptor.
Constructor Details
#initialize ⇒ ResourceDescriptor
Returns a new instance of ResourceDescriptor.
45 46 47 |
# File 'lib/gcloud/logging/resource_descriptor.rb', line 45 def initialize @labels = [] end |
Instance Attribute Details
#description ⇒ Object (readonly)
A detailed description of the monitored resource type, which is used in documentation.
61 62 63 |
# File 'lib/gcloud/logging/resource_descriptor.rb', line 61 def description @description end |
#labels ⇒ Array<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`.
70 71 72 |
# File 'lib/gcloud/logging/resource_descriptor.rb', line 70 def labels @labels end |
#name ⇒ Object (readonly)
A display name for the monitored resource type. For example, ‘Cloud SQL Database`.
56 57 58 |
# File 'lib/gcloud/logging/resource_descriptor.rb', line 56 def name @name end |
#type ⇒ Object (readonly)
The monitored resource type. For example, ‘cloudsql_database`.
51 52 53 |
# File 'lib/gcloud/logging/resource_descriptor.rb', line 51 def type @type end |
Class Method Details
.from_grpc(grpc) ⇒ Object
Google::Api::MonitoredResourceDescriptor object.
75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/gcloud/logging/resource_descriptor.rb', line 75 def self.from_grpc grpc r = new r.instance_eval do @type = grpc.type @name = grpc.display_name @description = grpc.description @labels = Array(grpc.labels).map do |g| LabelDescriptor.from_grpc g end end r end |