Class: Infrawrench::CostsNamespace
- Inherits:
-
Object
- Object
- Infrawrench::CostsNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.costs
Instance Method Summary collapse
-
#dimensions(dimension:, org_id: nil, tag_key: nil, request_options: nil) ⇒ Hash
List distinct values for a cost dimension.
-
#initialize(transport) ⇒ CostsNamespace
constructor
private
A new instance of CostsNamespace.
-
#query(body:, org_id: nil, request_options: nil) ⇒ Hash
Query aggregated cost series.
-
#status(org_id: nil, request_options: nil) ⇒ Hash
Per-account cost collection status.
Constructor Details
#initialize(transport) ⇒ CostsNamespace
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 CostsNamespace.
1202 1203 1204 |
# File 'lib/infrawrench/client.rb', line 1202 def initialize(transport) @transport = transport end |
Instance Method Details
#dimensions(dimension:, org_id: nil, tag_key: nil, request_options: nil) ⇒ Hash
List distinct values for a cost dimension
Feeds the filter and group-by pickers. Pass dimension=tag-keys for tag keys; dimension=tag requires tagKey.
GET /api/org/orgId/costs/dimensions
Raises on 400: Bad request
1223 1224 1225 1226 1227 1228 1229 1230 1231 |
# File 'lib/infrawrench/client.rb', line 1223 def dimensions(dimension:, org_id: nil, tag_key: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/costs/dimensions", path_params: { "orgId" => org_id }, query: { "dimension" => dimension, "tagKey" => tag_key }, request_options: ) end |
#query(body:, org_id: nil, request_options: nil) ⇒ Hash
Query aggregated cost series
Aggregates collected provider spend into per-bucket, per-group series for cost graphs. Currencies are never merged; mixed-currency orgs get one series per currency. Optionally returns a previous-period comparison and a trend forecast.
POST /api/org/orgId/costs/query
Raises on 400: Bad request
1250 1251 1252 1253 1254 1255 1256 1257 1258 |
# File 'lib/infrawrench/client.rb', line 1250 def query(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/costs/query", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#status(org_id: nil, request_options: nil) ⇒ Hash
Per-account cost collection status
Which accounts support cost collection, whether their history backfill has completed, and the ingested date coverage.
GET /api/org/orgId/costs/status
1272 1273 1274 1275 1276 1277 1278 1279 |
# File 'lib/infrawrench/client.rb', line 1272 def status(org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/costs/status", path_params: { "orgId" => org_id }, request_options: ) end |