Skip to main content

nominal_api_conjure/conjure/objects/ingest/api/
container_resources.rs

1/// Compute resources granted to an extractor container. Every field is optional; an unset
2/// field falls back to the deployment-wide default configured on combined-service.
3#[derive(
4    Debug,
5    Clone,
6    conjure_object::serde::Serialize,
7    conjure_object::serde::Deserialize,
8    PartialEq,
9    Eq,
10    PartialOrd,
11    Ord,
12    Hash,
13    Copy
14)]
15#[serde(crate = "conjure_object::serde")]
16#[conjure_object::private::staged_builder::staged_builder]
17#[builder(crate = conjure_object::private::staged_builder, update, inline)]
18pub struct ContainerResources {
19    #[builder(default, into)]
20    #[serde(rename = "cpuCores", skip_serializing_if = "Option::is_none", default)]
21    cpu_cores: Option<i32>,
22    #[builder(default, into)]
23    #[serde(rename = "memoryGib", skip_serializing_if = "Option::is_none", default)]
24    memory_gib: Option<i32>,
25    #[builder(default, into)]
26    #[serde(rename = "diskGib", skip_serializing_if = "Option::is_none", default)]
27    disk_gib: Option<i32>,
28}
29impl ContainerResources {
30    /// Constructs a new instance of the type.
31    #[inline]
32    pub fn new() -> Self {
33        Self::builder().build()
34    }
35    /// CPU cores requested for the extractor container.
36    #[inline]
37    pub fn cpu_cores(&self) -> Option<i32> {
38        self.cpu_cores.as_ref().map(|o| *o)
39    }
40    /// Memory in GiB, applied as both the request and the limit.
41    #[inline]
42    pub fn memory_gib(&self) -> Option<i32> {
43        self.memory_gib.as_ref().map(|o| *o)
44    }
45    /// Size in GiB of each of the ephemeral input and output volumes.
46    #[inline]
47    pub fn disk_gib(&self) -> Option<i32> {
48        self.disk_gib.as_ref().map(|o| *o)
49    }
50}