Class: Infrawrench::RunbooksRunsNamespace

Inherits:
Object
  • Object
show all
Defined in:
lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs

Overview

client.runbooks.runs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ RunbooksRunsNamespace

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 RunbooksRunsNamespace.

Parameters:



13196
13197
13198
13199
# File 'lib/infrawrench/client.rb', line 13196

def initialize(transport)
  @transport = transport
  @steps = RunbooksRunsStepsNamespace.new(@transport)
end

Instance Attribute Details

#stepsRunbooksRunsStepsNamespace (readonly)

Returns client.runbooks.runs.steps.

Returns:



13192
13193
13194
# File 'lib/infrawrench/client.rb', line 13192

def steps
  @steps
end

Instance Method Details

#close(run_id:, org_id: nil, body: nil, request_options: nil) ⇒ Hash

Close a run out

Closing does not settle outstanding steps. A run completed with three steps still pending is a true and useful record — it says the incident ended before the checklist did — and quietly marking them done would erase the one thing a postmortem wants to know.

POST /api/org/orgId/runbooks/runs/runId/close

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: Conflict

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • run_id (String)
  • body (Hash, nil) (defaults to: nil)

    Request body, shaped as RunbookRunClose.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • run_id: (String)
  • org_id: (String, nil) (defaults to: nil)
  • body: (runbook_run_close, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as RunbookRun — see sig/infrawrench/sdk.rbs.

Raises:



13223
13224
13225
13226
13227
13228
13229
13230
13231
# File 'lib/infrawrench/client.rb', line 13223

def close(run_id:, org_id: nil, body: nil, request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/org/{orgId}/runbooks/runs/{runId}/close",
    path_params: { "orgId" => org_id, "runId" => run_id },
    body: body,
    request_options: request_options
  )
end

#create(runbook_id:, org_id: nil, body: nil, request_options: nil) ⇒ Hash

Start performing a runbook

Copies every step's title and kind into the run, so the record of what somebody was asked to do survives the runbook being rewritten next week.

Takes resources:read, like ticking a step: performing a checklist is not an act of configuration, and requiring an admin mid-incident is how a team stops using it. Deliberately not deduplicated against a run already in progress — performing the failover twice in one incident is a real thing, and refusing the second would mean it goes unrecorded rather than not happening.

POST /api/org/orgId/runbooks/runbookId/runs

Raises on 400: Bad request

Raises on 404: Not found

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • runbook_id (String)
  • body (Hash, nil) (defaults to: nil)

    Request body, shaped as RunbookRunStart.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • runbook_id: (String)
  • org_id: (String, nil) (defaults to: nil)
  • body: (runbook_run_start, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as RunbookRun — see sig/infrawrench/sdk.rbs.

Raises:



13258
13259
13260
13261
13262
13263
13264
13265
13266
# File 'lib/infrawrench/client.rb', line 13258

def create(runbook_id:, org_id: nil, body: nil, request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/org/{orgId}/runbooks/{runbookId}/runs",
    path_params: { "orgId" => org_id, "runbookId" => runbook_id },
    body: body,
    request_options: request_options
  )
end

#get(org_id: nil, runbook_id: nil, incident_id: nil, limit: nil, request_options: nil) ⇒ Hash

List runbook runs

Newest first, optionally narrowed to one runbook or one incident.

GET /api/org/orgId/runbooks/runs

Raises on 400: Bad request

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • runbook_id (String, nil) (defaults to: nil)
  • incident_id (String, nil) (defaults to: nil)
  • limit (Integer, nil) (defaults to: nil)
  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • org_id: (String, nil) (defaults to: nil)
  • runbook_id: (String, nil) (defaults to: nil)
  • incident_id: (String, nil) (defaults to: nil)
  • limit: (Integer, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as RunbookRunList — see sig/infrawrench/sdk.rbs.

Raises:



13284
13285
13286
13287
13288
13289
13290
13291
13292
# File 'lib/infrawrench/client.rb', line 13284

def get(org_id: nil, runbook_id: nil, incident_id: nil, limit: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/runbooks/runs",
    path_params: { "orgId" => org_id },
    query: { "runbookId" => runbook_id, "incidentId" => incident_id, "limit" => limit },
    request_options: request_options
  )
end

#get_org_org_id_runbooks_runs_run_id(run_id:, org_id: nil, request_options: nil) ⇒ Hash

Get one runbook run

GET /api/org/orgId/runbooks/runs/runId

Raises on 404: Not found

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • run_id (String)
  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • run_id: (String)
  • org_id: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as RunbookRun — see sig/infrawrench/sdk.rbs.

Raises:



13306
13307
13308
13309
13310
13311
13312
13313
# File 'lib/infrawrench/client.rb', line 13306

def get_org_org_id_runbooks_runs_run_id(run_id:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/runbooks/runs/{runId}",
    path_params: { "orgId" => org_id, "runId" => run_id },
    request_options: request_options
  )
end