Polarex.Meters (Polarex v0.2.8)
View SourceProvides API endpoints related to meters
Summary
Functions
@spec meters_create( Polarex.MeterCreate.t(), keyword() ) :: {:ok, Polarex.Meter.t()} | {:error, Polarex.HTTPValidationError.t()}
Create Meter
Create a meter.
Scopes: meters:write
@spec meters_get( String.t(), keyword() ) :: {:ok, Polarex.Meter.t()} | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}
Get Meter
Get a meter by ID.
Scopes: meters:read meters:write
@spec meters_list(keyword()) :: {:ok, Polarex.ListResourceMeter.t()} | {:error, Polarex.HTTPValidationError.t()}
List Meters
List meters.
Scopes: meters:read meters:write
Options
organization_id: Filter by organization ID.query: Filter by name.is_archived: Filter on archived meters.page: Page number, defaults to 1.limit: Size of a page, defaults to 10. Maximum is 100.sorting: Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign-before the criteria name to sort by descending order.metadata: Filter by metadata key-value pairs. It uses thedeepObjectstyle, e.g.?metadata[key]=value.
@spec meters_quantities( String.t(), keyword() ) :: {:ok, Polarex.MeterQuantities.t()} | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}
Get Meter Quantities
Get quantities of a meter over a time period.
Scopes: meters:read meters:write
Options
start_timestamp: Start timestamp.end_timestamp: End timestamp.interval: Interval between two timestamps.customer_id: Filter by customer ID.external_customer_id: Filter by external customer ID.customer_aggregation_function: If set, will first compute the quantities per customer before aggregating them using the given function. If not set, the quantities will be aggregated across all events.metadata: Filter by metadata key-value pairs. It uses thedeepObjectstyle, e.g.?metadata[key]=value.
@spec meters_update(String.t(), Polarex.MeterUpdate.t(), keyword()) :: {:ok, Polarex.Meter.t()} | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}
Update Meter
Update a meter.
Scopes: meters:write