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

#project_idString Also known as: project

The ID of the current project.

Examples:

require "google/cloud/debugger"

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

debugger.project_id #=> "my-project"

Returns:

  • (String)

    the Google Cloud project ID



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

def project_id
  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


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

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


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

def stop
  agent.stop
end