Class: Infrawrench::ChangesAlertSettingsNamespace

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

Overview

client.changes.alert_settings

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ ChangesAlertSettingsNamespace

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

Parameters:



1276
1277
1278
# File 'lib/infrawrench/client.rb', line 1276

def initialize(transport)
  @transport = transport
end

Instance Method Details

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

Get the organization's resource-drift alert filter

Drift notifications are batched: at most one message per organization per cooldownMinutes, covering every change since the previous one. These settings decide which changes count and how often a message may go out. Who receives it is the resourceDrift opt-in on push preferences, Slack channels and Teams webhooks — off by default on all three.

GET /api/org/orgId/changes/alert-settings

Parameters:

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

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

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

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

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

Returns:

  • (Hash)

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

Raises:



1296
1297
1298
1299
1300
1301
1302
1303
# File 'lib/infrawrench/client.rb', line 1296

def get(org_id: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/changes/alert-settings",
    path_params: { "orgId" => org_id },
    request_options: request_options
  )
end

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

Update the organization's resource-drift alert filter

Every field is optional so a single toggle can be saved on its own. cooldownMinutes is floored at 5: below the poller's own cycle the notification rate would follow the sync rate again, which is what the batching exists to prevent.

PUT /api/org/orgId/changes/alert-settings

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.

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

    Request body, shaped as DriftAlertSettingsUpdate.

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

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

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

Returns:

  • (Hash)

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

Raises:



1323
1324
1325
1326
1327
1328
1329
1330
1331
# File 'lib/infrawrench/client.rb', line 1323

def update(org_id: nil, body: nil, request_options: nil)
  @transport.request(
    http_method: "PUT",
    path: "/api/org/{orgId}/changes/alert-settings",
    path_params: { "orgId" => org_id },
    body: body,
    request_options: request_options
  )
end