Class: Google::Cloud::Debugger::Project

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/debugger/project.rb

Overview

Project

Projects are top-level containers in Google Cloud Platform. They store information about billing and authorized users, and they control access to Stackdriver Debugger resources. Each project has a friendly name and a unique ID. Projects can be created only in the Google Developers Console.

See Google::Cloud#debugger

Examples:

require "google/cloud/debugger"

debugger = Google::Cloud::Debugger.new
debugger.start

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#agentObject (readonly)

The Stackdriver Debugger Agent object.



49
50
51
# File 'lib/google/cloud/debugger/project.rb', line 49

def agent
  @agent
end

Instance Method Details

#projectString

The ID of the current project.

Examples:

require "google/cloud/debugger"

debugger = Google::Cloud::Debugger.new(
  project: "my-project",
  keyfile: "/path/to/keyfile.json"
)

debugger.project #=> "my-project"

Returns:

  • (String)

    the Google Cloud project ID



74
75
76
# File 'lib/google/cloud/debugger/project.rb', line 74

def project
  service.project
end

#startObject Also known as: attach

Start the Stackdriver Debugger Agent.

See Agent#start for more details.

Examples:

require "google/cloud/debugger"

debugger = Google::Cloud::Debugger.new
debugger.start


113
114
115
# File 'lib/google/cloud/debugger/project.rb', line 113

def start
  agent.start
end

#stopObject

Stop the Stackdriver Debugger Agent.

See Agent#stop for more details.

Examples:

require "google/cloud/debugger"

debugger = Google::Cloud::Debugger.new
debugger.start
debugger.stop


129
130
131
# File 'lib/google/cloud/debugger/project.rb', line 129

def stop
  agent.stop
end