Class: Infrawrench::BusinessMetricsGetNamespace

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

Overview

client.business_metrics.get

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ BusinessMetricsGetNamespace

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

Parameters:



2234
2235
2236
# File 'lib/infrawrench/client.rb', line 2234

def initialize(transport)
  @transport = transport
end

Instance Method Details

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

List business metrics

The organization's declared denominators, by key, each with the range of days it has values for.

Requires permission: costs:read.

GET /api/org/orgId/business-metrics

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 Hash — see sig/infrawrench/sdk.rbs.

Raises:



2252
2253
2254
2255
2256
2257
2258
2259
# File 'lib/infrawrench/client.rb', line 2252

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

#get_org_org_id_business_metrics_id(id:, org_id: nil, request_options: nil) ⇒ Hash

Get a business metric

id accepts either the metric's id or its key.

Requires permission: costs:read.

GET /api/org/orgId/business-metrics/id

Raises on 404: Not found

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • id (String)

    Metric id or key

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

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

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

Returns:

  • (Hash)

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

Raises:



2277
2278
2279
2280
2281
2282
2283
2284
# File 'lib/infrawrench/client.rb', line 2277

def get_org_org_id_business_metrics_id(id:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/business-metrics/{id}",
    path_params: { "orgId" => org_id, "id" => id },
    request_options: request_options
  )
end