Class: Google::Cloud::Logging::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/logging/resource.rb

Overview

Resource

A monitored resource is an abstraction used to characterize many kinds of objects in your cloud infrastructure, including Google Cloud SQL databases, Google App Engine apps, Google Compute Engine virtual machine instances, and so forth. Each of those kinds of objects is described by an instance of ResourceDescriptor.

For use with Entry#resource, Project#resource, and Project#write_entries.

Examples:

require "google/cloud"

gcloud = Google::Cloud.new
logging = gcloud.logging
resource = logging.resource "gae_app",
                            "module_id" => "1",
                            "version_id" => "20150925t173233"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeResource

Create an empty Resource object.



44
45
46
# File 'lib/google/cloud/logging/resource.rb', line 44

def initialize
  @labels = {}
end

Instance Attribute Details

#labelsObject

A set of labels that can be used to describe instances of this monitored resource type.



55
56
57
# File 'lib/google/cloud/logging/resource.rb', line 55

def labels
  @labels
end

#typeObject

The type of resource, as represented by a Google::Cloud::Logging::ResourceDescriptor.



50
51
52
# File 'lib/google/cloud/logging/resource.rb', line 50

def type
  @type
end