View Source Testcontainers.CephContainer (testcontainers v1.11.6)
Provides functionality for creating and managing Ceph container configurations.
Summary
Functions
Generates the connection options for accessing the Ceph service running within the container.
Compatible with what ex_aws expects in ExAws.request(options)
Generates the connection URL for accessing the Ceph service running within the container.
Retrieves the default Docker image used for the Ceph container.
Creates a new CephContainer
struct with default attributes.
Retrieves the port mapped by the Docker host for the Ceph container.
Sets the access_key
used for authentication with the Ceph container.
Sets the bucket
that is automatically in the Ceph container.
Set the regular expression to check the image validity.
Sets the image
of the Ceph container configuration.
Sets the port on which the Ceph container will be exposed.
Set the reuse flag to reuse the container if it is already running.
Sets the secret_key
used for authentication with the Ceph container.
Sets the maximum time (in milliseconds) the system will wait for the Ceph container to be ready before timing out.
Functions
Generates the connection options for accessing the Ceph service running within the container.
Compatible with what ex_aws expects in ExAws.request(options)
Generates the connection URL for accessing the Ceph service running within the container.
This URL is based on the standard localhost IP and the mapped port for the container.
Parameters
container
: The active Ceph container instance.
Examples
iex> CephContainer.connection_url(container)
"http://localhost:32768" # This value will be different depending on the mapped port.
Retrieves the default Docker image used for the Ceph container.
Examples
iex> CephContainer.default_image()
"quay.io/ceph/demo"
Creates a new CephContainer
struct with default attributes.
Retrieves the port mapped by the Docker host for the Ceph container.
Parameters
container
: The active Ceph container instance.
Examples
iex> CephContainer.port(container)
32768 # This value will be different depending on the mapped port.
Sets the access_key
used for authentication with the Ceph container.
Examples
iex> config = CephContainer.new()
iex> new_config = CephContainer.with_access_key(config, "new_access_key")
iex> new_config.access_key
"new_access_key"
Sets the bucket
that is automatically in the Ceph container.
Examples
iex> config = CephContainer.new()
iex> new_config = CephContainer.with_bucket(config, "test_bucket")
iex> new_config.bucket
"test_bucket"
Set the regular expression to check the image validity.
Sets the image
of the Ceph container configuration.
Examples
iex> config = CephContainer.new()
iex> new_config = CephContainer.with_image(config, "quay.io/ceph/alternative")
iex> new_config.image
"quay.io/ceph/alternative"
Sets the port on which the Ceph container will be exposed.
Parameters
config
: The current Ceph container configuration.port
: The target port number.
Examples
iex> config = CephContainer.new()
iex> new_config = CephContainer.with_port(config, 8081)
iex> new_config.port
8081
Set the reuse flag to reuse the container if it is already running.
Sets the secret_key
used for authentication with the Ceph container.
Examples
iex> config = CephContainer.new()
iex> new_config = CephContainer.with_secret_key(config, "new_secret_key")
iex> new_config.secret_key
"new_secret_key"
Sets the maximum time (in milliseconds) the system will wait for the Ceph container to be ready before timing out.
Parameters
config
: The current Ceph container configuration.wait_timeout
: The time to wait in milliseconds.
Examples
iex> config = CephContainer.new()
iex> new_config = CephContainer.with_wait_timeout(config, 400_000)
iex> new_config.wait_timeout
400_000