|
| 1 | +/* |
| 2 | +Copyright 2025 The ORC Authors. |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/ |
| 16 | + |
| 17 | +package v1alpha1 |
| 18 | + |
| 19 | +// VolumeTypeResourceSpec contains the desired state of the resource. |
| 20 | +type VolumeTypeResourceSpec struct { |
| 21 | + // name will be the name of the created resource. If not specified, the |
| 22 | + // name of the ORC object will be used. |
| 23 | + // +optional |
| 24 | + Name *OpenStackName `json:"name,omitempty"` |
| 25 | + |
| 26 | + // description is a human-readable description for the resource. |
| 27 | + // +kubebuilder:validation:MinLength:=1 |
| 28 | + // +kubebuilder:validation:MaxLength:=255 |
| 29 | + // +optional |
| 30 | + Description *string `json:"description,omitempty"` |
| 31 | + |
| 32 | + // extraSpecs is a map of key-value pairs that define extra specifications for the volume type. |
| 33 | + // +kubebuilder:validation:MaxItems:=32 |
| 34 | + // +listType=atomic |
| 35 | + // +optional |
| 36 | + ExtraSpecs []VolumeTypeExtraSpec `json:"extraSpecs,omitempty"` |
| 37 | + |
| 38 | + // isPublic indicates whether the volume type is public. |
| 39 | + // +optional |
| 40 | + IsPublic *bool `json:"isPublic,omitempty"` |
| 41 | +} |
| 42 | + |
| 43 | +// VolumeTypeFilter defines an existing resource by its properties |
| 44 | +// +kubebuilder:validation:MinProperties:=1 |
| 45 | +type VolumeTypeFilter struct { |
| 46 | + // name of the existing resource |
| 47 | + // +optional |
| 48 | + Name *OpenStackName `json:"name,omitempty"` |
| 49 | + |
| 50 | + // description of the existing resource |
| 51 | + // +kubebuilder:validation:MinLength:=1 |
| 52 | + // +kubebuilder:validation:MaxLength:=255 |
| 53 | + // +optional |
| 54 | + Description *string `json:"description,omitempty"` |
| 55 | + |
| 56 | + // isPublic indicates whether the VolumeType is public. |
| 57 | + // +optional |
| 58 | + IsPublic *bool `json:"isPublic,omitempty"` |
| 59 | +} |
| 60 | + |
| 61 | +// VolumeTypeResourceStatus represents the observed state of the resource. |
| 62 | +type VolumeTypeResourceStatus struct { |
| 63 | + // name is a Human-readable name for the resource. Might not be unique. |
| 64 | + // +kubebuilder:validation:MaxLength=1024 |
| 65 | + // +optional |
| 66 | + Name string `json:"name,omitempty"` |
| 67 | + |
| 68 | + // description is a human-readable description for the resource. |
| 69 | + // +kubebuilder:validation:MaxLength=1024 |
| 70 | + // +optional |
| 71 | + Description string `json:"description,omitempty"` |
| 72 | + |
| 73 | + // extraSpecs is a map of key-value pairs that define extra specifications for the volume type. |
| 74 | + // +kubebuilder:validation:MaxItems:=32 |
| 75 | + // +listType=atomic |
| 76 | + // +optional |
| 77 | + ExtraSpecs []VolumeTypeExtraSpecStatus `json:"extraSpecs"` |
| 78 | + |
| 79 | + // isPublic indicates whether the VolumeType is public. |
| 80 | + // +optional |
| 81 | + IsPublic *bool `json:"isPublic"` |
| 82 | +} |
| 83 | + |
| 84 | +type VolumeTypeExtraSpec struct { |
| 85 | + // name is the name of the extraspec |
| 86 | + // +kubebuilder:validation:MaxLength:=255 |
| 87 | + // +required |
| 88 | + Name string `json:"name"` |
| 89 | + |
| 90 | + // value is the value of the extraspec |
| 91 | + // +kubebuilder:validation:MaxLength:=255 |
| 92 | + // +required |
| 93 | + Value string `json:"value"` |
| 94 | +} |
| 95 | + |
| 96 | +type VolumeTypeExtraSpecStatus struct { |
| 97 | + // name is the name of the extraspec |
| 98 | + // +kubebuilder:validation:MaxLength:=255 |
| 99 | + // +optional |
| 100 | + Name string `json:"name,omitempty"` |
| 101 | + |
| 102 | + // value is the value of the extraspec |
| 103 | + // +kubebuilder:validation:MaxLength:=255 |
| 104 | + // +optional |
| 105 | + Value string `json:"value,omitempty"` |
| 106 | +} |
0 commit comments