v2 bucket CRUD operations for backwards compatibility.
Delegates to the configured InfluxElixir.Client implementation.
Use this module when working with InfluxDB v2 bucket APIs.
Examples
{:ok, conn} = InfluxElixir.Client.Local.start(profile: :v2)
:ok = InfluxElixir.Admin.Buckets.create(conn, "my_bucket")
{:ok, buckets} = InfluxElixir.Admin.Buckets.list(conn)
:ok = InfluxElixir.Admin.Buckets.delete(conn, "my_bucket")
Summary
Functions
Creates a bucket in InfluxDB v2.
Deletes a bucket in InfluxDB v2.
Lists all buckets in InfluxDB v2.
Functions
@spec create(InfluxElixir.Client.connection(), binary(), keyword()) :: :ok | {:error, term()}
Creates a bucket in InfluxDB v2.
Parameters
connection- a client connection termname- the bucket name to createopts- optional keyword list::retention- retention in seconds (default0, no expiry). InfluxDB 2 refuses anything between 1 and 3599 with a 500retention policy duration must be at least 1h0m0s(verified); the bucket lists its rule as"retentionRules" => [%{"type" => "expire", "everySeconds" => n}]:org_id- the org ID; looked up from the connection's:orgwhen omitted
Returns
:okon success{:error, reason}on failure
@spec delete(InfluxElixir.Client.connection(), binary()) :: :ok | {:error, term()}
Deletes a bucket in InfluxDB v2.
Parameters
connection- a client connection termname- the bucket name to delete
Returns
:okon success{:error, reason}on failure
@spec list(InfluxElixir.Client.connection()) :: {:ok, [map()]} | {:error, term()}
Lists all buckets in InfluxDB v2.
Parameters
connection- a client connection term
Every bucket of the connection's :org, across all of the server's
pages.
Returns
{:ok, [map()]}on success{:error, reason}on failure