# `Testcontainers.CephContainer`
[🔗](https://github.com/testcontainers/testcontainers-elixir/blob/main/lib/container/ceph_container.ex#L2)

Provides functionality for creating and managing Ceph container configurations.

# `t`

```elixir
@type t() :: %Testcontainers.CephContainer{
  access_key: term(),
  bucket: term(),
  check_image: term(),
  image: term(),
  port: term(),
  reuse: term(),
  secret_key: term(),
  wait_timeout: term()
}
```

# `connection_opts`

Generates the connection options for accessing the Ceph service running within the container.
Compatible with what ex_aws expects in `ExAws.request(options)`

# `connection_url`

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.

# `default_image`

Retrieves the default Docker image used for the Ceph container.

## Examples

    iex> CephContainer.default_image()
    "quay.io/ceph/demo"

# `new`

Creates a new `CephContainer` struct with default attributes.

# `port`

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.

# `with_access_key`

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"

# `with_bucket`

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"

# `with_check_image`

Set the regular expression to check the image validity.

# `with_image`

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"

# `with_port`

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

# `with_reuse`

Set the reuse flag to reuse the container if it is already running.

# `with_secret_key`

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"

# `with_wait_timeout`

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
