module Buildkit::Client::Agents

Methods for the Agents API

@see buildkite.com/docs/api/agents

Public Instance Methods

agent(org, id, options = {}) click to toggle source

Get an agent

@param org [String] Organization slug. @param id [String] Agent id. @return [Sawyer::Resource] Hash representing Buildkite agent @see buildkite.com/docs/api/agents#get-an-agent @example

Buildkit.agent('my-great-org', '0b461f65-e7be-4c80-888a-ef11d81fd971')
# File lib/buildkit/client/agents.rb, line 27
def agent(org, id, options = {})
  get("/v2/organizations/#{org}/agents/#{id}", options)
end
agents(org, options = {}) click to toggle source

List agents

@return [Array<Sawyer::Resource>] Array of hashes representing Buildkite agents. @see buildkite.com/docs/api/agents#list-agents @example

Buildkit.agents('my-great-org')
# File lib/buildkit/client/agents.rb, line 15
def agents(org, options = {})
  get("/v2/organizations/#{org}/agents", options)
end
stop_agent(org, id, options = {}) click to toggle source

Stop an agent

@param org [String] Organization slug. @param id [String] Agent id. @see buildkite.com/docs/api/agents#stop-an-agent @example Stop an agent

Buildkit.stop_agent('my-great-org', '16940c91-f12d-4122-8154-0edf6c0978c2')
# File lib/buildkit/client/agents.rb, line 38
def stop_agent(org, id, options = {})
  put("/v2/organizations/#{org}/agents/#{id}/stop", options)
end