|
| 1 | +// Copyright 2026 Google LLC |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +package v1alpha1 |
| 16 | + |
| 17 | +import ( |
| 18 | + refsv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1" |
| 19 | + "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/apis/k8s/v1alpha1" |
| 20 | + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 21 | +) |
| 22 | + |
| 23 | +var VertexAIStudyGVK = GroupVersion.WithKind("VertexAIStudy") |
| 24 | + |
| 25 | +// VertexAIStudySpec defines the desired state of VertexAIStudy |
| 26 | +// +kcc:spec:proto=google.cloud.aiplatform.v1.Study |
| 27 | +type VertexAIStudySpec struct { |
| 28 | + // The project that this resource belongs to. |
| 29 | + // +required |
| 30 | + ProjectRef *refsv1beta1.ProjectRef `json:"projectRef"` |
| 31 | + |
| 32 | + // The location of this resource. |
| 33 | + // +required |
| 34 | + Location *string `json:"location"` |
| 35 | + |
| 36 | + // The VertexAIStudy name. If not given, the metadata.name will be used. |
| 37 | + ResourceID *string `json:"resourceID,omitempty"` |
| 38 | + |
| 39 | + // Required. Describes the Study, default value is empty string. |
| 40 | + // +kcc:proto:field=google.cloud.aiplatform.v1.Study.display_name |
| 41 | + // +required |
| 42 | + DisplayName *string `json:"displayName"` |
| 43 | + |
| 44 | + // Required. Configuration of the Study. |
| 45 | + // +kcc:proto:field=google.cloud.aiplatform.v1.Study.study_spec |
| 46 | + // +required |
| 47 | + StudySpec *StudySpec `json:"studySpec"` |
| 48 | +} |
| 49 | + |
| 50 | +// VertexAIStudyStatus defines the config connector machine state of VertexAIStudy |
| 51 | +type VertexAIStudyStatus struct { |
| 52 | + /* Conditions represent the latest available observations of the |
| 53 | + object's current state. */ |
| 54 | + Conditions []v1alpha1.Condition `json:"conditions,omitempty"` |
| 55 | + |
| 56 | + // ObservedGeneration is the generation of the resource that was most recently observed by the Config Connector controller. If this is equal to metadata.generation, then that means that the current reported status reflects the most recent desired state of the resource. |
| 57 | + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` |
| 58 | + |
| 59 | + // A unique specifier for the VertexAIStudy resource in GCP. |
| 60 | + ExternalRef *string `json:"externalRef,omitempty"` |
| 61 | + |
| 62 | + // ObservedState is the state of the resource as most recently observed in GCP. |
| 63 | + ObservedState *VertexAIStudyObservedState `json:"observedState,omitempty"` |
| 64 | +} |
| 65 | + |
| 66 | +// VertexAIStudyObservedState is the state of the VertexAIStudy resource as most recently observed in GCP. |
| 67 | +// +kcc:observedstate:proto=google.cloud.aiplatform.v1.Study |
| 68 | +type VertexAIStudyObservedState struct { |
| 69 | + // Output only. The name of a study. The study's globally unique identifier. |
| 70 | + // Format: `projects/{project}/locations/{location}/studies/{study}` |
| 71 | + // +kcc:proto:field=google.cloud.aiplatform.v1.Study.name |
| 72 | + Name *string `json:"name,omitempty"` |
| 73 | + |
| 74 | + // Output only. The detailed state of a Study. |
| 75 | + // +kcc:proto:field=google.cloud.aiplatform.v1.Study.state |
| 76 | + State *string `json:"state,omitempty"` |
| 77 | + |
| 78 | + // Output only. Time at which the study was created. |
| 79 | + // +kcc:proto:field=google.cloud.aiplatform.v1.Study.create_time |
| 80 | + CreateTime *string `json:"createTime,omitempty"` |
| 81 | +} |
| 82 | + |
| 83 | +// +genclient |
| 84 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 85 | +// +kubebuilder:resource:categories=gcp,shortName=gcpvertexaistudy;gcpvertexaistudies |
| 86 | +// +kubebuilder:subresource:status |
| 87 | +// +kubebuilder:metadata:labels="cnrm.cloud.google.com/managed-by-kcc=true" |
| 88 | +// +kubebuilder:metadata:labels="cnrm.cloud.google.com/system=true" |
| 89 | +// +kubebuilder:metadata:labels="cnrm.cloud.google.com/stability-level=alpha" |
| 90 | +// +kubebuilder:printcolumn:name="Age",JSONPath=".metadata.creationTimestamp",type="date" |
| 91 | +// +kubebuilder:printcolumn:name="Ready",JSONPath=".status.conditions[?(@.type=='Ready')].status",type="string",description="When 'True', the most recent reconcile of the resource succeeded" |
| 92 | +// +kubebuilder:printcolumn:name="Status",JSONPath=".status.conditions[?(@.type=='Ready')].reason",type="string",description="The reason for the value in 'Ready'" |
| 93 | +// +kubebuilder:printcolumn:name="Status Age",JSONPath=".status.conditions[?(@.type=='Ready')].lastTransitionTime",type="date",description="The last transition time for the value in 'Status'" |
| 94 | + |
| 95 | +// VertexAIStudy is the Schema for the VertexAIStudy API |
| 96 | +// +k8s:openapi-gen=true |
| 97 | +type VertexAIStudy struct { |
| 98 | + metav1.TypeMeta `json:",inline"` |
| 99 | + metav1.ObjectMeta `json:"metadata,omitempty"` |
| 100 | + |
| 101 | + // +required |
| 102 | + Spec VertexAIStudySpec `json:"spec,omitempty"` |
| 103 | + Status VertexAIStudyStatus `json:"status,omitempty"` |
| 104 | +} |
| 105 | + |
| 106 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 107 | +// VertexAIStudyList contains a list of VertexAIStudy |
| 108 | +type VertexAIStudyList struct { |
| 109 | + metav1.TypeMeta `json:",inline"` |
| 110 | + metav1.ListMeta `json:"metadata,omitempty"` |
| 111 | + Items []VertexAIStudy `json:"items"` |
| 112 | +} |
| 113 | + |
| 114 | +func init() { |
| 115 | + SchemeBuilder.Register(&VertexAIStudy{}, &VertexAIStudyList{}) |
| 116 | +} |
| 117 | + |
| 118 | +// +kcc:proto=google.cloud.aiplatform.v1.StudySpec.ParameterSpec.ConditionalParameterSpec |
| 119 | +type StudySpec_ParameterSpec_ConditionalParameterSpec struct { |
| 120 | + // The spec for matching values from a parent parameter of |
| 121 | + // `DISCRETE` type. |
| 122 | + // +kcc:proto:field=google.cloud.aiplatform.v1.StudySpec.ParameterSpec.ConditionalParameterSpec.parent_discrete_values |
| 123 | + ParentDiscreteValues *StudySpec_ParameterSpec_ConditionalParameterSpec_DiscreteValueCondition `json:"parentDiscreteValues,omitempty"` |
| 124 | + |
| 125 | + // The spec for matching values from a parent parameter of `INTEGER` |
| 126 | + // type. |
| 127 | + // +kcc:proto:field=google.cloud.aiplatform.v1.StudySpec.ParameterSpec.ConditionalParameterSpec.parent_int_values |
| 128 | + ParentIntValues *StudySpec_ParameterSpec_ConditionalParameterSpec_IntValueCondition `json:"parentIntValues,omitempty"` |
| 129 | + |
| 130 | + // The spec for matching values from a parent parameter of |
| 131 | + // `CATEGORICAL` type. |
| 132 | + // +kcc:proto:field=google.cloud.aiplatform.v1.StudySpec.ParameterSpec.ConditionalParameterSpec.parent_categorical_values |
| 133 | + ParentCategoricalValues *StudySpec_ParameterSpec_ConditionalParameterSpec_CategoricalValueCondition `json:"parentCategoricalValues,omitempty"` |
| 134 | + |
| 135 | + // Required. The spec for a conditional parameter. |
| 136 | + // +kcc:proto:field=google.cloud.aiplatform.v1.StudySpec.ParameterSpec.ConditionalParameterSpec.parameter_spec |
| 137 | + // +kubebuilder:pruning:PreserveUnknownFields |
| 138 | + // +kubebuilder:validation:Schemaless |
| 139 | + // ParameterSpec is temporarily disabled due to recursion |
| 140 | + // ParameterSpec *StudySpec_ParameterSpec `json:"parameterSpec,omitempty"` |
| 141 | +} |
0 commit comments