Class: Infrawrench::CostsAnomalySettingsNamespace
- Inherits:
-
Object
- Object
- Infrawrench::CostsAnomalySettingsNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.costs.anomaly_settings
Instance Method Summary collapse
-
#get(org_id: nil, request_options: nil) ⇒ Hash
Get the organization's anomaly detection thresholds.
-
#initialize(transport) ⇒ CostsAnomalySettingsNamespace
constructor
private
A new instance of CostsAnomalySettingsNamespace.
-
#update(body:, org_id: nil, request_options: nil) ⇒ Hash
Update the organization's anomaly detection thresholds.
Constructor Details
#initialize(transport) ⇒ CostsAnomalySettingsNamespace
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 CostsAnomalySettingsNamespace.
1522 1523 1524 |
# File 'lib/infrawrench/client.rb', line 1522 def initialize(transport) @transport = transport end |
Instance Method Details
#get(org_id: nil, request_options: nil) ⇒ Hash
Get the organization's anomaly detection thresholds
The tunable part of cost anomaly detection. Everything else about the
model — the 28-day baseline, the 7-day notification cooldown, the minimum
history a baseline needs — is fixed. An organization that has never
changed a threshold reads back the defaults. The response also carries the
derived, read-only smsConfigured.
Requires permission: costs:read.
GET /api/org/orgId/costs/anomaly-settings
1544 1545 1546 1547 1548 1549 1550 1551 |
# File 'lib/infrawrench/client.rb', line 1544 def get(org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/costs/anomaly-settings", path_params: { "orgId" => org_id }, request_options: ) end |
#update(body:, org_id: nil, request_options: nil) ⇒ Hash
Update the organization's anomaly detection thresholds
Takes effect on the next detection pass (which runs after each cost
collection). Anomalies already stored are not re-judged. All four fields
are required — this is a PUT of the whole settings object, not a patch —
and smsAlerts deliberately has no server-side default, so a client that
omits it is rejected rather than silently switching an organization's SMS
paging back off. smsConfigured is derived and is not accepted here.
Requires permission: costs:write.
PUT /api/org/orgId/costs/anomaly-settings
Raises on 400: Bad request
1575 1576 1577 1578 1579 1580 1581 1582 1583 |
# File 'lib/infrawrench/client.rb', line 1575 def update(body:, org_id: nil, request_options: nil) @transport.request( http_method: "PUT", path: "/api/org/{orgId}/costs/anomaly-settings", path_params: { "orgId" => org_id }, body: body, request_options: ) end |