Class: Infrawrench::QuotasSettingsNamespace

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

Overview

client.quotas.settings

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ QuotasSettingsNamespace

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

Parameters:



11059
11060
11061
# File 'lib/infrawrench/client.rb', line 11059

def initialize(transport)
  @transport = transport
end

Instance Method Details

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

Get the organization's quota alert settings

The threshold feeds both the feed's severity buckets and the poller's daily alert scan. An organization that never saved reads the shipped defaults (enabled, 0.8).

Requires permission: org:settings:write.

GET /api/org/orgId/quotas/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 QuotaAlertSettings — see sig/infrawrench/sdk.rbs.

Raises:



11079
11080
11081
11082
11083
11084
11085
11086
# File 'lib/infrawrench/client.rb', line 11079

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

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

Update the quota alert settings

Every field is optional so a single toggle can be saved on its own. threshold is a fraction from 0.5 to 0.99 and is rejected rather than clamped when out of range. Saving never resets the alert cooldown.

Requires permission: org:settings:write.

PUT /api/org/orgId/quotas/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 QuotaAlertSettingsUpdate.

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

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

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

Returns:

  • (Hash)

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

Raises:



11107
11108
11109
11110
11111
11112
11113
11114
11115
# File 'lib/infrawrench/client.rb', line 11107

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