Class: Infrawrench::CostAlertsNamespace
- Inherits:
-
Object
- Object
- Infrawrench::CostAlertsNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.cost_alerts
Instance Attribute Summary collapse
-
#get ⇒ CostAlertsGetNamespace
readonly
client.cost_alerts.get.
Instance Method Summary collapse
-
#create(body:, org_id: nil, request_options: nil) ⇒ Hash
Create a change-based cost alert.
-
#delete(id:, org_id: nil, request_options: nil) ⇒ Hash
Delete a cost alert.
-
#events(org_id: nil, alert_id: nil, limit: nil, request_options: nil) ⇒ Hash
List recently fired cost-alert events.
-
#initialize(transport) ⇒ CostAlertsNamespace
constructor
private
A new instance of CostAlertsNamespace.
-
#update(id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Update a cost alert.
Constructor Details
#initialize(transport) ⇒ CostAlertsNamespace
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 CostAlertsNamespace.
3328 3329 3330 3331 |
# File 'lib/infrawrench/client.rb', line 3328 def initialize(transport) @transport = transport @get = CostAlertsGetNamespace.new(@transport) end |
Instance Attribute Details
#get ⇒ CostAlertsGetNamespace (readonly)
Returns client.cost_alerts.get.
3324 3325 3326 |
# File 'lib/infrawrench/client.rb', line 3324 def get @get end |
Instance Method Details
#create(body:, org_id: nil, request_options: nil) ⇒ Hash
Create a change-based cost alert
Requires permission: costs:write.
POST /api/org/orgId/cost-alerts
Raises on 400: Bad request
3347 3348 3349 3350 3351 3352 3353 3354 3355 |
# File 'lib/infrawrench/client.rb', line 3347 def create(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/cost-alerts", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#delete(id:, org_id: nil, request_options: nil) ⇒ Hash
Delete a cost alert
Soft delete. Fired events disappear from the org-wide event feed with it.
Requires permission: costs:write.
DELETE /api/org/orgId/cost-alerts/id
Raises on 404: Not found
3373 3374 3375 3376 3377 3378 3379 3380 |
# File 'lib/infrawrench/client.rb', line 3373 def delete(id:, org_id: nil, request_options: nil) @transport.request( http_method: "DELETE", path: "/api/org/{orgId}/cost-alerts/{id}", path_params: { "orgId" => org_id, "id" => id }, request_options: ) end |
#events(org_id: nil, alert_id: nil, limit: nil, request_options: nil) ⇒ Hash
List recently fired cost-alert events
Newest first. Optionally scoped to one alert with ?alertId=; an unknown alertId is a 404, distinct from an alert that simply has no events yet.
Requires permission: costs:read.
GET /api/org/orgId/cost-alerts/events
Raises on 400: Bad request
Raises on 404: Not found
3402 3403 3404 3405 3406 3407 3408 3409 3410 |
# File 'lib/infrawrench/client.rb', line 3402 def events(org_id: nil, alert_id: nil, limit: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/cost-alerts/events", path_params: { "orgId" => org_id }, query: { "alertId" => alert_id, "limit" => limit }, request_options: ) end |
#update(id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Update a cost alert
Requires permission: costs:write.
PUT /api/org/orgId/cost-alerts/id
Raises on 400: Bad request
Raises on 404: Not found
3429 3430 3431 3432 3433 3434 3435 3436 3437 |
# File 'lib/infrawrench/client.rb', line 3429 def update(id:, body:, org_id: nil, request_options: nil) @transport.request( http_method: "PUT", path: "/api/org/{orgId}/cost-alerts/{id}", path_params: { "orgId" => org_id, "id" => id }, body: body, request_options: ) end |