Class: Buildkite::ClusterToken
- Inherits:
-
Object
- Object
- OpenStruct
- Object
- Buildkite::ClusterToken
show all
- Defined in:
- lib/buildkite/models/cluster_token.rb
Class Method Summary
collapse
-
.create(org: Buildkite.config.org, cluster:, description:, **args) ⇒ Object
-
.delete(org: Buildkite.config.org, cluster:, id:) ⇒ Object
-
.list(org: Buildkite.config.org, cluster:) ⇒ 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:, description:, **args) ⇒ Object
16
17
18
19
20
|
# File 'lib/buildkite/models/cluster_token.rb', line 16
def create(org: Buildkite.config.org, cluster:, description:, **args)
data = {description: description}
response = Client.post_request("organizations/#{org}/clusters/#{cluster}/tokens", body: data.merge(args))
ClusterToken.new response.body
end
|
.delete(org: Buildkite.config.org, cluster:, id:) ⇒ Object
27
28
29
|
# File 'lib/buildkite/models/cluster_token.rb', line 27
def delete(org: Buildkite.config.org, cluster:, id:)
Client.delete_request("organizations/#{org}/clusters/#{cluster}/tokens/#{id}")
end
|
.list(org: Buildkite.config.org, cluster:) ⇒ Object
.retrieve(org: Buildkite.config.org, cluster:, id:) ⇒ Object
11
12
13
14
|
# File 'lib/buildkite/models/cluster_token.rb', line 11
def retrieve(org: Buildkite.config.org, cluster:, id:)
response = Client.get_request("organizations/#{org}/clusters/#{cluster}/tokens/#{id}")
ClusterToken.new response.body
end
|
.update(org: Buildkite.config.org, cluster:, id:, **args) ⇒ Object
22
23
24
25
|
# File 'lib/buildkite/models/cluster_token.rb', line 22
def update(org: Buildkite.config.org, cluster:, id:, **args)
response = Client.patch_request("organizations/#{org}/clusters/#{cluster}/tokens/#{id}", body: args)
ClusterToken.new response.body
end
|