1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
use crate::error::OciSpecError;
use derive_builder::Builder;
use getset::{Getters, Setters};
use serde::{Deserialize, Serialize};

#[derive(
    Builder, Clone, Debug, Default, Deserialize, Getters, Setters, Eq, PartialEq, Serialize,
)]
#[serde(rename_all = "camelCase")]
#[builder(
    default,
    pattern = "owned",
    setter(into, strip_option),
    build_fn(error = "OciSpecError")
)]
#[getset(get = "pub", set = "pub")]
/// Solaris contains platform-specific configuration for Solaris application
/// containers.
pub struct Solaris {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    /// SMF FMRI which should go "online" before we start the container
    /// process.
    milestone: Option<String>,

    #[serde(default, skip_serializing_if = "Option::is_none")]
    /// Maximum set of privileges any process in this container can obtain.
    limitpriv: Option<String>,

    #[serde(default, skip_serializing_if = "Option::is_none")]
    /// The maximum amount of shared memory allowed for this container.
    max_shm_memory: Option<String>,

    #[serde(default, skip_serializing_if = "Option::is_none")]
    /// Specification for automatic creation of network resources for this
    /// container.
    anet: Option<Vec<SolarisAnet>>,

    #[serde(default, skip_serializing_if = "Option::is_none", rename = "cappedCPU")]
    /// Set limit on the amount of CPU time that can be used by container.
    capped_cpu: Option<SolarisCappedCPU>,

    #[serde(default, skip_serializing_if = "Option::is_none")]
    /// The physical and swap caps on the memory that can be used by this
    /// container.
    capped_memory: Option<SolarisCappedMemory>,
}

#[derive(
    Builder, Clone, Debug, Default, Deserialize, Getters, Setters, Eq, PartialEq, Serialize,
)]
#[serde(rename_all = "camelCase")]
#[builder(
    default,
    pattern = "owned",
    setter(into, strip_option),
    build_fn(error = "OciSpecError")
)]
#[getset(get = "pub", set = "pub")]
/// SolarisAnet provides the specification for automatic creation of network
/// resources for this container.
pub struct SolarisAnet {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    /// Specify a name for the automatically created VNIC datalink.
    linkname: Option<String>,

    #[serde(default, skip_serializing_if = "Option::is_none")]
    /// Specify the link over which the VNIC will be created.
    lower_link: Option<String>,

    #[serde(default, skip_serializing_if = "Option::is_none")]
    /// The set of IP addresses that the container can use.
    allowed_address: Option<String>,

    #[serde(default, skip_serializing_if = "Option::is_none")]
    /// Specifies whether allowedAddress limitation is to be applied to the
    /// VNIC.
    configure_allowed_address: Option<String>,

    #[serde(default, skip_serializing_if = "Option::is_none")]
    /// The value of the optional default router.
    defrouter: Option<String>,

    #[serde(default, skip_serializing_if = "Option::is_none")]
    /// Enable one or more types of link protection.
    link_protection: Option<String>,

    #[serde(default, skip_serializing_if = "Option::is_none")]
    /// Set the VNIC's macAddress.
    mac_address: Option<String>,
}

#[derive(
    Builder, Clone, Debug, Default, Deserialize, Getters, Setters, Eq, PartialEq, Serialize,
)]
#[builder(
    default,
    pattern = "owned",
    setter(into, strip_option),
    build_fn(error = "OciSpecError")
)]
#[getset(get = "pub", set = "pub")]
/// SolarisCappedCPU allows users to set limit on the amount of CPU time
/// that can be used by container.
pub struct SolarisCappedCPU {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    /// The amount of CPUs.
    ncpus: Option<String>,
}

#[derive(
    Builder, Clone, Debug, Default, Deserialize, Getters, Setters, Eq, PartialEq, Serialize,
)]
#[builder(
    default,
    pattern = "owned",
    setter(into, strip_option),
    build_fn(error = "OciSpecError")
)]
#[getset(get = "pub", set = "pub")]
/// SolarisCappedMemory allows users to set the physical and swap caps on
/// the memory that can be used by this container.
pub struct SolarisCappedMemory {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    /// The physical caps on the memory.
    physical: Option<String>,

    #[serde(default, skip_serializing_if = "Option::is_none")]
    /// The swap caps on the memory.
    swap: Option<String>,
}