WeaviateEx.Backup.Location (WeaviateEx v0.7.4)

View Source

Backup storage location configurations.

Provides location configuration structs for each supported storage backend.

Examples

# Local filesystem
Location.filesystem("/var/backups")

# Amazon S3
Location.s3("my-bucket", "/backups",
  endpoint: "s3.us-west-2.amazonaws.com",
  region: "us-west-2"
)

# Google Cloud Storage
Location.gcs("my-bucket", "/backups",
  credentials: %{...}
)

# Azure Blob Storage
Location.azure("my-container", "/backups",
  connection_string: "..."
)

Summary

Functions

Create Azure location.

Get storage backend type from location.

Create filesystem location.

Create GCS location.

Create S3 location.

Convert location to API format.

Types

Functions

azure(container, path, opts \\ [])

Create Azure location.

Options

  • :connection_string - Azure connection string

Examples

iex> Location.azure("my-container", "/backups")
%Location.Azure{container: "my-container", path: "/backups"}

backend(arg1)

@spec backend(t()) :: atom()

Get storage backend type from location.

Examples

iex> Location.backend(Location.filesystem("/backups"))
:filesystem

iex> Location.backend(Location.s3("bucket", "/path"))
:s3

filesystem(path)

Create filesystem location.

Examples

iex> Location.filesystem("/var/backups")
%Location.Filesystem{path: "/var/backups"}

gcs(bucket, path, opts \\ [])

Create GCS location.

Options

  • :project_id - GCP project ID
  • :credentials - Service account credentials map

Examples

iex> Location.gcs("my-bucket", "/backups")
%Location.GCS{bucket: "my-bucket", path: "/backups"}

iex> Location.gcs("my-bucket", "/backups", project_id: "my-project")
%Location.GCS{bucket: "my-bucket", path: "/backups", project_id: "my-project"}

s3(bucket, path, opts \\ [])

Create S3 location.

Options

  • :endpoint - S3 endpoint URL
  • :region - AWS region
  • :access_key_id - AWS access key ID
  • :secret_access_key - AWS secret access key
  • :use_ssl - Use SSL (default: true)

Examples

iex> Location.s3("my-bucket", "/backups")
%Location.S3{bucket: "my-bucket", path: "/backups", use_ssl: true}

iex> Location.s3("my-bucket", "/backups", region: "us-west-2")
%Location.S3{bucket: "my-bucket", path: "/backups", region: "us-west-2", use_ssl: true}

to_api(loc)

@spec to_api(t()) :: map()

Convert location to API format.

Examples

iex> Location.to_api(Location.filesystem("/backups"))
%{path: "/backups"}

iex> Location.to_api(Location.s3("bucket", "/path"))
%{bucket: "bucket", path: "/path", useSSL: true}