Skip to main content

cluster_api_rs/api/
capi_ipaddressclaim.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 k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition;
8    pub use kube::CustomResource;
9    pub use schemars::JsonSchema;
10    pub use serde::{Deserialize, Serialize};
11}
12
13use self::prelude::*;
14
15/// spec is the desired state of IPAddressClaim.
16#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
17#[kube(
18    group = "ipam.cluster.x-k8s.io",
19    version = "v1beta2",
20    kind = "IPAddressClaim",
21    root = "IpAddressClaim",
22    plural = "ipaddressclaims"
23)]
24#[kube(namespaced)]
25#[kube(status = "IpAddressClaimStatus")]
26#[kube(derive = "Default")]
27#[kube(derive = "PartialEq")]
28pub struct IpAddressClaimSpec {
29    /// clusterName is the name of the Cluster this object belongs to.
30    #[serde(
31        default,
32        skip_serializing_if = "Option::is_none",
33        rename = "clusterName"
34    )]
35    pub cluster_name: Option<String>,
36    /// poolRef is a reference to the pool from which an IP address should be created.
37    #[serde(rename = "poolRef")]
38    pub pool_ref: IpAddressClaimPoolRef,
39}
40
41/// poolRef is a reference to the pool from which an IP address should be created.
42#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
43pub struct IpAddressClaimPoolRef {
44    /// apiGroup of the IPPool.
45    /// apiGroup must be fully qualified domain name.
46    #[serde(rename = "apiGroup")]
47    pub api_group: String,
48    /// kind of the IPPool.
49    /// kind must consist of alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character.
50    pub kind: String,
51    /// name of the IPPool.
52    /// name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character.
53    pub name: String,
54}
55
56/// status is the observed state of IPAddressClaim.
57#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
58pub struct IpAddressClaimStatus {
59    /// addressRef is a reference to the address that was created for this claim.
60    #[serde(
61        default,
62        skip_serializing_if = "Option::is_none",
63        rename = "addressRef"
64    )]
65    pub address_ref: Option<IpAddressClaimStatusAddressRef>,
66    /// conditions represents the observations of a IPAddressClaim's current state.
67    /// Known condition types are Ready.
68    #[serde(default, skip_serializing_if = "Option::is_none")]
69    pub conditions: Option<Vec<Condition>>,
70    /// deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed.
71    #[serde(default, skip_serializing_if = "Option::is_none")]
72    pub deprecated: Option<IpAddressClaimStatusDeprecated>,
73}
74
75/// addressRef is a reference to the address that was created for this claim.
76#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
77pub struct IpAddressClaimStatusAddressRef {
78    /// name of the IPAddress.
79    /// name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character.
80    pub name: String,
81}
82
83/// deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed.
84#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
85pub struct IpAddressClaimStatusDeprecated {
86    /// v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped.
87    #[serde(default, skip_serializing_if = "Option::is_none")]
88    pub v1beta1: Option<IpAddressClaimStatusDeprecatedV1beta1>,
89}
90
91/// v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped.
92#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
93pub struct IpAddressClaimStatusDeprecatedV1beta1 {
94    /// conditions summarises the current state of the IPAddressClaim
95    ///
96    /// Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see <https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md> for more details.
97    #[serde(default, skip_serializing_if = "Option::is_none")]
98    pub conditions: Option<Vec<Condition>>,
99}