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/logging"

logging = Google::Cloud::Logging.new
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.



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

def initialize
  @labels = {}
end

Instance Attribute Details

#labelsObject

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



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

def labels
  @labels
end

#typeObject

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



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

def type
  @type
end