Skip to main content

cluster_api_rs/api/
capi_ipaddress.rs

1// WARNING: generated by kopium - manual changes will be overwritten
2// kopium command: kopium --smart-derive-elision -D Default -D PartialEq -A -d -f -
3// kopium version: 0.23.0
4
5#[allow(unused_imports)]
6mod prelude {
7    pub use kube::CustomResource;
8    pub use schemars::JsonSchema;
9    pub use serde::{Deserialize, Serialize};
10}
11
12use self::prelude::*;
13
14/// spec is the desired state of IPAddress.
15#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
16#[kube(
17    group = "ipam.cluster.x-k8s.io",
18    version = "v1beta2",
19    kind = "IPAddress",
20    root = "IpAddress",
21    plural = "ipaddresses"
22)]
23#[kube(namespaced)]
24#[kube(derive = "Default")]
25#[kube(derive = "PartialEq")]
26pub struct IpAddressSpec {
27    /// address is the IP address.
28    pub address: String,
29    /// claimRef is a reference to the claim this IPAddress was created for.
30    #[serde(rename = "claimRef")]
31    pub claim_ref: IpAddressClaimRef,
32    /// gateway is the network gateway of the network the address is from.
33    #[serde(default, skip_serializing_if = "Option::is_none")]
34    pub gateway: Option<String>,
35    /// poolRef is a reference to the pool that this IPAddress was created from.
36    #[serde(rename = "poolRef")]
37    pub pool_ref: IpAddressPoolRef,
38    /// prefix is the prefix of the address.
39    pub prefix: i32,
40}
41
42/// claimRef is a reference to the claim this IPAddress was created for.
43#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
44pub struct IpAddressClaimRef {
45    /// name of the IPAddressClaim.
46    /// name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character.
47    pub name: String,
48}
49
50/// poolRef is a reference to the pool that this IPAddress was created from.
51#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
52pub struct IpAddressPoolRef {
53    /// apiGroup of the IPPool.
54    /// apiGroup must be fully qualified domain name.
55    #[serde(rename = "apiGroup")]
56    pub api_group: String,
57    /// kind of the IPPool.
58    /// kind must consist of alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character.
59    pub kind: String,
60    /// name of the IPPool.
61    /// name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character.
62    pub name: String,
63}