Class: Buildkite::ClusterQueue
- Inherits:
-
Object
- Object
- OpenStruct
- Object
- Buildkite::ClusterQueue
show all
- Defined in:
- lib/buildkite/models/cluster_queue.rb
Class Method Summary
collapse
-
.create(org: Buildkite.config.org, cluster:, key:, **args) ⇒ Object
-
.delete(org: Buildkite.config.org, cluster:, id:) ⇒ Object
-
.list(org: Buildkite.config.org, cluster:) ⇒ Object
-
.pause(org: Buildkite.config.org, cluster:, id:, note: nil) ⇒ Object
-
.resume(org: Buildkite.config.org, cluster:, id:) ⇒ Object
-
.retrieve(org: Buildkite.config.org, cluster:, id:) ⇒ Object
-
.update(org: Buildkite.config.org, cluster:, id:, **args) ⇒ Object
Methods inherited from Object
#initialize, #to_ostruct
Class Method Details
.create(org: Buildkite.config.org, cluster:, key:, **args) ⇒ Object
16
17
18
19
20
|
# File 'lib/buildkite/models/cluster_queue.rb', line 16
def create(org: Buildkite.config.org, cluster:, key:, **args)
data = {key: key}
response = Client.post_request("organizations/#{org}/clusters/#{cluster}/queues", body: data.merge(args))
ClusterQueue.new response.body
end
|
.delete(org: Buildkite.config.org, cluster:, id:) ⇒ Object
37
38
39
|
# File 'lib/buildkite/models/cluster_queue.rb', line 37
def delete(org: Buildkite.config.org, cluster:, id:)
Client.delete_request("organizations/#{org}/clusters/#{cluster}/queues/#{id}")
end
|
.list(org: Buildkite.config.org, cluster:) ⇒ Object
.pause(org: Buildkite.config.org, cluster:, id:, note: nil) ⇒ Object
27
28
29
30
|
# File 'lib/buildkite/models/cluster_queue.rb', line 27
def pause(org: Buildkite.config.org, cluster:, id:, note: nil)
response = Client.post_request("organizations/#{org}/clusters/#{cluster}/queues/#{id}/pause_dispatch", body: {note: note})
ClusterQueue.new response.body
end
|
.resume(org: Buildkite.config.org, cluster:, id:) ⇒ Object
32
33
34
35
|
# File 'lib/buildkite/models/cluster_queue.rb', line 32
def resume(org: Buildkite.config.org, cluster:, id:)
response = Client.post_request("organizations/#{org}/clusters/#{cluster}/queues/#{id}/resume_dispatch", body: {})
ClusterQueue.new response.body
end
|
.retrieve(org: Buildkite.config.org, cluster:, id:) ⇒ Object
11
12
13
14
|
# File 'lib/buildkite/models/cluster_queue.rb', line 11
def retrieve(org: Buildkite.config.org, cluster:, id:)
response = Client.get_request("organizations/#{org}/clusters/#{cluster}/queues/#{id}")
ClusterQueue.new response.body
end
|
.update(org: Buildkite.config.org, cluster:, id:, **args) ⇒ Object
22
23
24
25
|
# File 'lib/buildkite/models/cluster_queue.rb', line 22
def update(org: Buildkite.config.org, cluster:, id:, **args)
response = Client.patch_request("organizations/#{org}/clusters/#{cluster}/queues/#{id}", body: args)
ClusterQueue.new response.body
end
|