Class: Infrawrench::BusinessMetricsValuesNamespace
- Inherits:
-
Object
- Object
- Infrawrench::BusinessMetricsValuesNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.business_metrics.values
Instance Method Summary collapse
-
#create(id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Report metric values.
-
#get(id:, org_id: nil, limit: nil, request_options: nil) ⇒ Hash
List a metric's reported values.
-
#initialize(transport) ⇒ BusinessMetricsValuesNamespace
constructor
private
A new instance of BusinessMetricsValuesNamespace.
Constructor Details
#initialize(transport) ⇒ BusinessMetricsValuesNamespace
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 BusinessMetricsValuesNamespace.
2291 2292 2293 |
# File 'lib/infrawrench/client.rb', line 2291 def initialize(transport) @transport = transport end |
Instance Method Details
#create(id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Report metric values
Write a batch of days. Re-reporting a day restates it rather than
accumulating, which is what makes a nightly job safe to retry. Nothing
lands unless the whole batch validates, so a bad row is a 400 rather than
half a month restated. The same guarantees back
infra.businessMetrics.write(...) in a workflow — both go through one
validator.
Requires permission: costs:write.
POST /api/org/orgId/business-metrics/id/values
Raises on 400: Bad request
Raises on 404: Not found
2319 2320 2321 2322 2323 2324 2325 2326 2327 |
# File 'lib/infrawrench/client.rb', line 2319 def create(id:, body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/business-metrics/{id}/values", path_params: { "orgId" => org_id, "id" => id }, body: body, request_options: ) end |
#get(id:, org_id: nil, limit: nil, request_options: nil) ⇒ Hash
List a metric's reported values
Newest day first.
Requires permission: costs:read.
GET /api/org/orgId/business-metrics/id/values
Raises on 400: Bad request
Raises on 404: Not found
2348 2349 2350 2351 2352 2353 2354 2355 2356 |
# File 'lib/infrawrench/client.rb', line 2348 def get(id:, org_id: nil, limit: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/business-metrics/{id}/values", path_params: { "orgId" => org_id, "id" => id }, query: { "limit" => limit }, request_options: ) end |