Module: Buildkit::Client::Agents
- Included in:
- Buildkit::Client
- Defined in:
- lib/buildkit/client/agents.rb
Overview
Methods for the Agents API
Instance Method Summary collapse
-
#agent(org, id, options = {}) ⇒ Sawyer::Resource
Get an agent.
-
#agents(org, options = {}) ⇒ Array<Sawyer::Resource>
List agents.
-
#create_agent(org, name, options = {}) ⇒ Sawyer::Resource
Create an agent.
-
#delete_agent(org, id, options = {}) ⇒ Object
Delete an agent.
-
#stop_agent(org, id, options = {}) ⇒ Object
Stop an agent.
Instance Method Details
#agent(org, id, options = {}) ⇒ Sawyer::Resource
Get an agent
25 26 27 |
# File 'lib/buildkit/client/agents.rb', line 25 def agent(org, id, = {}) get("/v1/organizations/#{org}/agents/#{id}", ) end |
#agents(org, options = {}) ⇒ Array<Sawyer::Resource>
List agents
13 14 15 |
# File 'lib/buildkit/client/agents.rb', line 13 def agents(org, = {}) get("/v1/organizations/#{org}/agents", ) end |
#create_agent(org, name, options = {}) ⇒ Sawyer::Resource
Create an agent
37 38 39 |
# File 'lib/buildkit/client/agents.rb', line 37 def create_agent(org, name, = {}) post("/v1/organizations/#{org}/agents", .merge(name: name)) end |
#delete_agent(org, id, options = {}) ⇒ Object
Delete an agent
48 49 50 |
# File 'lib/buildkit/client/agents.rb', line 48 def delete_agent(org, id, = {}) delete("/v1/organizations/#{org}/agents/#{id}", ) end |
#stop_agent(org, id, options = {}) ⇒ Object
Stop an agent
59 60 61 |
# File 'lib/buildkit/client/agents.rb', line 59 def stop_agent(org, id, = {}) put("/v1/organizations/#{org}/agents/#{id}/stop", ) end |