Class: Infrawrench::AlertRulesDeliveriesNamespace

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

Overview

client.alert_rules.deliveries

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ AlertRulesDeliveriesNamespace

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

Parameters:



1079
1080
1081
# File 'lib/infrawrench/client.rb', line 1079

def initialize(transport)
  @transport = transport
end

Instance Method Details

#ack(id:, org_id: nil, request_options: nil) ⇒ Hash

Acknowledge an alert, cancelling its escalation

A conditional update: only a delivery still in awaiting_ack can move, so two people pressing at once produce one acknowledgement and an alert that already escalated cannot be retroactively silenced.

POST /api/org/orgId/alert-rules/deliveries/id/ack

Raises on 401: Unauthenticated

Raises on 403: Forbidden

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.

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

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

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

Returns:

  • (Hash)

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

Raises:



1103
1104
1105
1106
1107
1108
1109
1110
# File 'lib/infrawrench/client.rb', line 1103

def ack(id:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/org/{orgId}/alert-rules/deliveries/{id}/ack",
    path_params: { "orgId" => org_id, "id" => id },
    request_options: request_options
  )
end

#cancel(org_id: nil, body: nil, request_options: nil) ⇒ Hash

Drop held or awaiting-acknowledgement deliveries

POST /api/org/orgId/alert-rules/deliveries/cancel

Raises on 400: Bad request

Raises on 403: Forbidden

Parameters:

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

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

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

    Request body, shaped as Hash.

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

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

  • org_id: (String, nil) (defaults to: nil)
  • body: ({ "ids" => Array[String] }, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

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

Raises:



1126
1127
1128
1129
1130
1131
1132
1133
1134
# File 'lib/infrawrench/client.rb', line 1126

def cancel(org_id: nil, body: nil, request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/org/{orgId}/alert-rules/deliveries/cancel",
    path_params: { "orgId" => org_id },
    body: body,
    request_options: request_options
  )
end

#list(org_id: nil, limit: nil, request_options: nil) ⇒ Array<Hash>

List recent held and escalating alerts

Only alerts a rule created follow-up work for appear here: one held by quiet hours, or one waiting on an acknowledgement. An alert that went straight out leaves no row.

GET /api/org/orgId/alert-rules/deliveries

Raises on 403: Forbidden

Parameters:

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

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

  • 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)
  • limit: (Integer, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Array<Hash>)

    Parsed JSON, shaped as Array<AlertDelivery> — see sig/infrawrench/sdk.rbs.

Raises:



1153
1154
1155
1156
1157
1158
1159
1160
1161
# File 'lib/infrawrench/client.rb', line 1153

def list(org_id: nil, limit: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/alert-rules/deliveries",
    path_params: { "orgId" => org_id },
    query: { "limit" => limit },
    request_options: request_options
  )
end