|
| 1 | +/* |
| 2 | +Copyright 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 | +// UserResourceSpec contains the desired state of the resource. |
| 20 | +type UserResourceSpec 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 | + // domainRef is a reference to the ORC Domain which this resource is associated with. |
| 33 | + // +optional |
| 34 | + // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="domainRef is immutable" |
| 35 | + DomainRef *KubernetesNameRef `json:"domainRef,omitempty"` |
| 36 | + |
| 37 | + // defaultProjectRef is a reference to the Default Project which this resource is associated with. |
| 38 | + // +optional |
| 39 | + // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="defaultProjectRef is immutable" |
| 40 | + DefaultProjectRef *KubernetesNameRef `json:"defaultProjectRef,omitempty"` |
| 41 | + |
| 42 | + // enabled defines whether a user is enabled or disabled |
| 43 | + // +optional |
| 44 | + Enabled *bool `json:"enabled,omitempty"` |
| 45 | +} |
| 46 | + |
| 47 | +// UserFilter defines an existing resource by its properties |
| 48 | +// +kubebuilder:validation:MinProperties:=1 |
| 49 | +type UserFilter struct { |
| 50 | + // name of the existing resource |
| 51 | + // +optional |
| 52 | + Name *OpenStackName `json:"name,omitempty"` |
| 53 | + |
| 54 | + // domainRef is a reference to the ORC Domain which this resource is associated with. |
| 55 | + // +optional |
| 56 | + DomainRef *KubernetesNameRef `json:"domainRef,omitempty"` |
| 57 | +} |
| 58 | + |
| 59 | +// UserResourceStatus represents the observed state of the resource. |
| 60 | +type UserResourceStatus struct { |
| 61 | + // name is a Human-readable name for the resource. Might not be unique. |
| 62 | + // +kubebuilder:validation:MaxLength=1024 |
| 63 | + // +optional |
| 64 | + Name string `json:"name,omitempty"` |
| 65 | + |
| 66 | + // description is a human-readable description for the resource. |
| 67 | + // +kubebuilder:validation:MaxLength=1024 |
| 68 | + // +optional |
| 69 | + Description string `json:"description,omitempty"` |
| 70 | + |
| 71 | + // domainID is the ID of the Domain to which the resource is associated. |
| 72 | + // +kubebuilder:validation:MaxLength=1024 |
| 73 | + // +optional |
| 74 | + DomainID string `json:"domainID,omitempty"` |
| 75 | + |
| 76 | + // defaultProjectID is the ID of the Default Project to which the user is associated with. |
| 77 | + // +kubebuilder:validation:MaxLength=1024 |
| 78 | + // +optional |
| 79 | + DefaultProjectID string `json:"defaultProjectID,omitempty"` |
| 80 | + |
| 81 | + // enabled defines whether a user is enabled or disabled |
| 82 | + // +optional |
| 83 | + Enabled bool `json:"enabled,omitempty"` |
| 84 | +} |
0 commit comments