Class: Infrawrench::IncidentsGetNamespace

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

Overview

client.incidents.get

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ IncidentsGetNamespace

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

Parameters:



7769
7770
7771
# File 'lib/infrawrench/client.rb', line 7769

def initialize(transport)
  @transport = transport
end

Instance Method Details

#get(org_id: nil, status: nil, request_options: nil) ⇒ Hash

List declared incidents

Every incident the organization has declared, newest first, each with the artefacts its declaration created — including the ones that failed.

Requires permission: incidents:read.

GET /api/org/orgId/incidents

Parameters:

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

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

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

    open, mitigated, resolved, or all (the default).

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

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

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

Returns:

  • (Hash)

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

Raises:



7788
7789
7790
7791
7792
7793
7794
7795
7796
# File 'lib/infrawrench/client.rb', line 7788

def get(org_id: nil, status: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/incidents",
    path_params: { "orgId" => org_id },
    query: { "status" => status },
    request_options: request_options
  )
end

#get_org_org_id_incidents_incident_id(incident_id:, org_id: nil, request_options: nil) ⇒ Hash

Read one incident

The incident with its artefacts and its operator notes.

Requires permission: incidents:read.

GET /api/org/orgId/incidents/incidentId

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.

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

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

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

Returns:

  • (Hash)

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

Raises:



7814
7815
7816
7817
7818
7819
7820
7821
# File 'lib/infrawrench/client.rb', line 7814

def get_org_org_id_incidents_incident_id(incident_id:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/incidents/{incidentId}",
    path_params: { "orgId" => org_id, "incidentId" => incident_id },
    request_options: request_options
  )
end