InfluxEx.Buckets (influx_ex v0.3.1)

Module for working with buckets in InfluxDB

Link to this section Summary

Types

Optional fields for creating a bucket

Functions

Get all the buckets

Delete a bucket

Get field keys for a measurement that is in a bucket

Get the measurements in a bucket

Link to this section Types

Link to this type

create_bucket_opt()

@type create_bucket_opt() ::
  {:retention_rules, [InfluxEx.Bucket.retention_rule()]}
  | {:expires_in, InfluxEx.Bucket.expires_in()}
  | {:group_shard, boolean()}
  | {:rp, binary()}
  | {:schema_type, InfluxEx.Bucket.schema_type()}
  | {:org_id, InfluxEx.Org.id()}

Optional fields for creating a bucket

You can either provide a list of Bucket.retention_rule() for maxim control over the bucket's data retention rules, or you can provide the short hand Bucket.expires_in() to the :expires_in option.

When using the :expires_in optional shorthand for build a retention policy group sharding is disabled by default. If you want to enable group sharding set the :group_shard option to true and the retention policy will include the group shard duration based off the :expires_in field.

By default the retention will by 30 days if no retention policy is provided. If both the :retention_rules field and the :expires_in field are provided the :retention_rules field will be used.

Link to this section Functions

Get all the buckets

Link to this function

create(client, bucket_name, opts \\ [])

Create a new bucket

Link to this function

delete(client, bucket_id)

@spec delete(InfluxEx.Client.t(), InfluxEx.Bucket.id()) ::
  :ok | {:error, InfluxEx.error()}

Delete a bucket

Link to this function

get_measurement_field_keys(client, bucket, measurement, opts \\ [])

@spec get_measurement_field_keys(
  InfluxEx.Client.t(),
  InfluxEx.Bucket.name(),
  binary(),
  [
    InfluxEx.query_opt()
  ]
) :: {:ok, [binary()]} | {:error, InfluxEx.error()}

Get field keys for a measurement that is in a bucket

Link to this function

get_measurements(client, bucket, opts \\ [])

@spec get_measurements(InfluxEx.Client.t(), InfluxEx.Bucket.name(), [
  InfluxEx.query_opt()
]) ::
  {:ok, [binary()]} | {:error, InfluxEx.error()}

Get the measurements in a bucket