InfluxElixir.Admin.Buckets (InfluxElixir v0.1.12)

Copy Markdown View Source

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()

: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

create(connection, name, opts \\ [])

@spec create(InfluxElixir.Client.connection(), binary(), keyword()) ::
  :ok | {:error, term()}

Creates a bucket in InfluxDB v2.

Parameters

  • connection - a client connection term
  • name - the bucket name to create
  • opts - optional keyword list (e.g. :org_id, :retention_seconds)

Returns

  • :ok on success
  • {:error, reason} on failure

delete(connection, name)

@spec delete(InfluxElixir.Client.connection(), binary()) :: :ok | {:error, term()}

Deletes a bucket in InfluxDB v2.

Parameters

  • connection - a client connection term
  • name - the bucket name to delete

Returns

  • :ok on success
  • {:error, reason} on failure

list(connection)

@spec list(InfluxElixir.Client.connection()) :: {:ok, [map()]} | {:error, term()}

Lists all buckets in InfluxDB v2.

Parameters

  • connection - a client connection term

Returns

  • {:ok, [map()]} on success
  • {:error, reason} on failure