Class: Buildkite::Agent

Inherits:
Object
  • Object
show all
Defined in:
lib/buildkite/models/agent.rb

Class Method Summary collapse

Methods inherited from Object

#initialize, #to_ostruct

Constructor Details

This class inherits a constructor from Buildkite::Object

Class Method Details

.list(org: Buildkite.config.org) ⇒ Object



6
7
8
9
# File 'lib/buildkite/models/agent.rb', line 6

def list(org: Buildkite.config.org)
  response = Client.get_request("organizations/#{org}/agents")
  Collection.from_response(response, type: Agent)
end

.retrieve(org: Buildkite.config.org, id:) ⇒ Object



11
12
13
14
# File 'lib/buildkite/models/agent.rb', line 11

def retrieve(org: Buildkite.config.org, id:)
  response = Client.get_request("organizations/#{org}/agents/#{id}")
  Agent.new response.body
end

.stop(org: Buildkite.config.org, id:, **args) ⇒ Object



16
17
18
# File 'lib/buildkite/models/agent.rb', line 16

def stop(org: Buildkite.config.org, id:, **args)
  Client.put_request("organizations/#{org}/agents/#{id}/stop", body: args)
end