Class: Infrawrench::CostsEfficiencyAlertSettingsNamespace

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

Overview

client.costs.efficiency_alert_settings

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ CostsEfficiencyAlertSettingsNamespace

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

Parameters:



4876
4877
4878
# File 'lib/infrawrench/client.rb', line 4876

def initialize(transport)
  @transport = transport
end

Instance Method Details

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

Get the organization's efficiency alert tuning

Thresholds for the commitment-expiry, idle-commitment and unit-cost-regression detectors. An organization that has never changed one reads back the defaults, which are chosen to work with no setup.

Requires permission: costs:read.

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

Raises:



4896
4897
4898
4899
4900
4901
4902
4903
# File 'lib/infrawrench/client.rb', line 4896

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

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

Update the organization's efficiency alert tuning

Takes effect on the next evaluation pass (which runs after each cost collection). Already-fired alerts are not re-judged, and horizons that have already fired for a commitment's current term do not fire again — widening the horizon list warns about future crossings, not past ones. A PUT of the whole object, not a patch.

Requires permission: costs:write.

PUT /api/org/orgId/costs/efficiency-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)

    Request body, shaped as CostEfficiencySettings.

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

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

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

Returns:

  • (Hash)

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

Raises:



4926
4927
4928
4929
4930
4931
4932
4933
4934
# File 'lib/infrawrench/client.rb', line 4926

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