ExBifrost.Api.Containers (ex_bifrost v0.1.0)

Copy Markdown View Source

API calls for all endpoints tagged Containers.

Summary

Functions

Create a container Creates a new container for storing files and data.

Create a file in a container Creates a new file in a container. You can either upload file content directly via multipart/form-data or reference an existing file by its ID.

Delete a file from a container Deletes a file from a container.

Download file content from a container Downloads the content of a file from a container.

List files in a container Lists all files in a container.

List containers Lists containers for a provider.

Retrieve a container Retrieves a specific container by ID.

Retrieve a file from a container Retrieves metadata for a specific file in a container.

Functions

create_container(connection, create_container_request, opts \\ [])

Create a container Creates a new container for storing files and data.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • create_container_request (CreateContainerRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.CreateContainer200Response.t} on success
  • {:error, Tesla.Env.t} on failure

create_container_file(connection, container_id, provider, opts \\ [])

Create a file in a container Creates a new file in a container. You can either upload file content directly via multipart/form-data or reference an existing file by its ID.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • container_id (String.t): The ID of the container
  • provider (ModelProvider): The provider of the container
  • opts (keyword): Optional parameters
    • :file (String.t): The file content to upload
    • :file_path (String.t): Optional path for the file within the container

Returns

  • {:ok, ExBifrost.Model.CreateContainerFile200Response.t} on success
  • {:error, Tesla.Env.t} on failure

delete_container(connection, container_id, provider, opts \\ [])

Delete a container Deletes a container.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • container_id (String.t): The ID of the container to delete
  • provider (ModelProvider): The provider of the container
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.DeleteFile200Response.t} on success
  • {:error, Tesla.Env.t} on failure

delete_container_file(connection, container_id, file_id, provider, opts \\ [])

Delete a file from a container Deletes a file from a container.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • container_id (String.t): The ID of the container
  • file_id (String.t): The ID of the file to delete
  • provider (ModelProvider): The provider of the container
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.DeleteFile200Response.t} on success
  • {:error, Tesla.Env.t} on failure

get_container_file_content(connection, container_id, file_id, provider, opts \\ [])

@spec get_container_file_content(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  ExBifrost.Model.ModelProvider.t(),
  keyword()
) ::
  {:ok, ExBifrost.Model.BifrostError.t()}
  | {:ok, String.t()}
  | {:error, Tesla.Env.t()}

Download file content from a container Downloads the content of a file from a container.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • container_id (String.t): The ID of the container
  • file_id (String.t): The ID of the file
  • provider (ModelProvider): The provider of the container
  • opts (keyword): Optional parameters

Returns

  • {:ok, String.t} on success
  • {:error, Tesla.Env.t} on failure

list_container_files(connection, container_id, provider, opts \\ [])

List files in a container Lists all files in a container.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • container_id (String.t): The ID of the container
  • provider (ModelProvider): The provider of the container
  • opts (keyword): Optional parameters
    • :limit (integer()): Maximum number of files to return
    • :after (String.t): Cursor for pagination
    • :order (String.t): Sort order (asc/desc)

Returns

  • {:ok, ExBifrost.Model.ListContainerFiles200Response.t} on success
  • {:error, Tesla.Env.t} on failure

list_containers(connection, provider, opts \\ [])

List containers Lists containers for a provider.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • provider (ModelProvider): Provider to list containers for
  • opts (keyword): Optional parameters
    • :limit (integer()): Maximum number of containers to return (1-100, default 20)
    • :after (String.t): Cursor for pagination
    • :order (String.t): Sort order (asc/desc)

Returns

  • {:ok, ExBifrost.Model.ListContainers200Response.t} on success
  • {:error, Tesla.Env.t} on failure

retrieve_container(connection, container_id, provider, opts \\ [])

Retrieve a container Retrieves a specific container by ID.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • container_id (String.t): The ID of the container to retrieve
  • provider (ModelProvider): The provider of the container
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.CreateContainer200Response.t} on success
  • {:error, Tesla.Env.t} on failure

retrieve_container_file(connection, container_id, file_id, provider, opts \\ [])

Retrieve a file from a container Retrieves metadata for a specific file in a container.

Parameters

  • connection (ExBifrost.Connection): Connection to server
  • container_id (String.t): The ID of the container
  • file_id (String.t): The ID of the file
  • provider (ModelProvider): The provider of the container
  • opts (keyword): Optional parameters

Returns

  • {:ok, ExBifrost.Model.CreateContainerFile200Response.t} on success
  • {:error, Tesla.Env.t} on failure