Class: Infrawrench::RunbooksNamespace
- Inherits:
-
Object
- Object
- Infrawrench::RunbooksNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.runbooks
Instance Attribute Summary collapse
-
#get ⇒ RunbooksGetNamespace
readonly
client.runbooks.get. -
#runs ⇒ RunbooksRunsNamespace
readonly
client.runbooks.runs.
Instance Method Summary collapse
-
#create(org_id: nil, body: nil, request_options: nil) ⇒ Hash
Write a runbook.
-
#delete(runbook_id:, org_id: nil, request_options: nil) ⇒ nil
Delete a runbook.
-
#initialize(transport) ⇒ RunbooksNamespace
constructor
private
A new instance of RunbooksNamespace.
-
#update(runbook_id:, org_id: nil, body: nil, request_options: nil) ⇒ Hash
Edit a runbook.
Constructor Details
#initialize(transport) ⇒ RunbooksNamespace
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of RunbooksNamespace.
13325 13326 13327 13328 13329 |
# File 'lib/infrawrench/client.rb', line 13325 def initialize(transport) @transport = transport @get = RunbooksGetNamespace.new(@transport) @runs = RunbooksRunsNamespace.new(@transport) end |
Instance Attribute Details
#get ⇒ RunbooksGetNamespace (readonly)
Returns client.runbooks.get.
13319 13320 13321 |
# File 'lib/infrawrench/client.rb', line 13319 def get @get end |
#runs ⇒ RunbooksRunsNamespace (readonly)
Returns client.runbooks.runs.
13321 13322 13323 |
# File 'lib/infrawrench/client.rb', line 13321 def runs @runs end |
Instance Method Details
#create(org_id: nil, body: nil, request_options: nil) ⇒ Hash
Write a runbook
Editing takes org:settings:write — a procedure is an org-wide statement
about how something is done, and it is read by strangers under pressure.
Names are unique within an organization: two runbooks called "Failover" is
how the wrong one gets run.
POST /api/org/orgId/runbooks
Raises on 400: Bad request
Raises on 409: Conflict
13350 13351 13352 13353 13354 13355 13356 13357 13358 |
# File 'lib/infrawrench/client.rb', line 13350 def create(org_id: nil, body: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/runbooks", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#delete(runbook_id:, org_id: nil, request_options: nil) ⇒ nil
Delete a runbook
Takes its run history with it. To retire a procedure without losing the
record of the runs performed against it, set enabled to false instead.
DELETE /api/org/orgId/runbooks/runbookId
Raises on 404: Not found
13375 13376 13377 13378 13379 13380 13381 13382 13383 |
# File 'lib/infrawrench/client.rb', line 13375 def delete(runbook_id:, org_id: nil, request_options: nil) @transport.request( http_method: "DELETE", path: "/api/org/{orgId}/runbooks/{runbookId}", path_params: { "orgId" => org_id, "runbookId" => runbook_id }, accept: :empty, request_options: ) end |
#update(runbook_id:, org_id: nil, body: nil, request_options: nil) ⇒ Hash
Edit a runbook
Omitted fields are left alone. The result is validated after merging,
so a patch that only changes the steps still has to produce a runbook that
is valid as a whole. A step sent with its id keeps its identity, so a
run in progress still matches it.
PATCH /api/org/orgId/runbooks/runbookId
Raises on 400: Bad request
Raises on 404: Not found
Raises on 409: Conflict
13407 13408 13409 13410 13411 13412 13413 13414 13415 |
# File 'lib/infrawrench/client.rb', line 13407 def update(runbook_id:, org_id: nil, body: nil, request_options: nil) @transport.request( http_method: "PATCH", path: "/api/org/{orgId}/runbooks/{runbookId}", path_params: { "orgId" => org_id, "runbookId" => runbook_id }, body: body, request_options: ) end |