Skip to main content

CreateContainerRequest

Struct CreateContainerRequest 

Source
pub struct CreateContainerRequest {
Show 18 fields pub image: String, pub name: Option<String>, pub pull_policy: Option<String>, pub env: HashMap<String, String>, pub command: Option<Vec<String>>, pub labels: HashMap<String, String>, pub resources: Option<ContainerResourceLimits>, pub volumes: Vec<VolumeMount>, pub ports: Vec<PortMapping>, pub work_dir: Option<String>, pub health_check: Option<HealthCheckRequest>, pub hostname: Option<String>, pub dns: Vec<String>, pub extra_hosts: Vec<String>, pub restart_policy: Option<ContainerRestartPolicy>, pub networks: Vec<NetworkAttachmentRequest>, pub registry_credential_id: Option<String>, pub registry_auth: Option<RegistryAuth>,
}
Expand description

Request to create and start a container

Fields§

§image: String

OCI image reference (e.g., “nginx:latest”, “ubuntu:22.04”)

§name: Option<String>

Optional human-readable name

§pull_policy: Option<String>

Image pull policy: “always”, “if_not_present”, or “never”

§env: HashMap<String, String>

Environment variables

§command: Option<Vec<String>>

Command to run (overrides image entrypoint)

§labels: HashMap<String, String>

Labels for filtering and grouping

§resources: Option<ContainerResourceLimits>

Resource limits (CPU, memory)

§volumes: Vec<VolumeMount>

Volume mounts

§ports: Vec<PortMapping>

Published ports (Docker’s -p host:container/proto). When omitted, the container is created without any host port publishing.

§work_dir: Option<String>

Working directory inside the container

§health_check: Option<HealthCheckRequest>

Optional health check. When omitted, the daemon installs a no-op placeholder (HealthCheck::Tcp { port: 0 }) matching the current default; the health monitor treats port == 0 as “skip”.

§hostname: Option<String>

Optional container hostname (maps to Docker’s --hostname).

§dns: Vec<String>

Additional DNS servers (maps to Docker’s --dns). Each entry must be a plausible IPv4 or IPv6 address.

§extra_hosts: Vec<String>

Extra hostname:ip entries appended to /etc/hosts (maps to Docker’s --add-host). The special literal host-gateway is accepted as the ip half.

§restart_policy: Option<ContainerRestartPolicy>

Container restart policy (Docker-style). When omitted, the runtime applies no explicit restart policy (Docker default: "no").

§networks: Vec<NetworkAttachmentRequest>

User-defined bridge/overlay networks to attach the newly-created container to. Each entry references a network by id or name and is attached after the container is successfully started. If any attachment fails, the partially-started container is rolled back (stopped + removed) and the request is failed.

§registry_credential_id: Option<String>

Id of a persisted registry credential (from POST /api/v1/credentials/registry) to use when pulling the image. Ignored when Self::registry_auth is also supplied (inline auth wins). Requires the daemon to be configured with a credential store — otherwise the request is rejected with 400.

§registry_auth: Option<RegistryAuth>

Inline Docker/OCI registry credentials used for this pull only. Not persisted, never logged, never echoed back on a response. When both registry_credential_id and registry_auth are set, this field takes precedence.

Trait Implementations§

Source§

impl ComposeSchema for CreateContainerRequest

Source§

impl Debug for CreateContainerRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CreateContainerRequest

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl ToSchema for CreateContainerRequest

Source§

fn name() -> Cow<'static, str>

Return name of the schema. Read more
Source§

fn schemas(schemas: &mut Vec<(String, RefOr<Schema>)>)

Implement reference utoipa::openapi::schema::Schemas for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromBase64 for T
where T: for<'de> Deserialize<'de>,

Source§

fn from_base64<Input>(raw: &Input) -> Result<T, Error>
where Input: AsRef<[u8]> + ?Sized,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PartialSchema for T
where T: ComposeSchema + ?Sized,

Source§

fn schema() -> RefOr<Schema>

Return ref or schema of implementing type that can then be used to construct combined schemas.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,