|
| 1 | +// Copyright 2025 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 VertexAIMetadataStoreGVK = GroupVersion.WithKind("VertexAIMetadataStore") |
| 24 | + |
| 25 | +// VertexAIMetadataStoreSpec defines the desired state of VertexAIMetadataStore |
| 26 | +// +kcc:proto=google.cloud.aiplatform.v1beta1.MetadataStore |
| 27 | +type VertexAIMetadataStoreSpec struct { |
| 28 | + // Customer-managed encryption key spec for a Metadata Store. If set, this |
| 29 | + // Metadata Store and all sub-resources of this Metadata Store are secured |
| 30 | + // using this key. |
| 31 | + // +kcc:proto:field=google.cloud.aiplatform.v1beta1.MetadataStore.encryption_spec |
| 32 | + EncryptionSpec *EncryptionSpec `json:"encryptionSpec,omitempty"` |
| 33 | + |
| 34 | + // Optional. Dataplex integration settings. |
| 35 | + // +kcc:proto:field=google.cloud.aiplatform.v1beta1.MetadataStore.dataplex_config |
| 36 | + DataplexConfig *MetadataStore_DataplexConfig `json:"dataplexConfig,omitempty"` |
| 37 | + |
| 38 | + // Description of the MetadataStore. |
| 39 | + // +kcc:proto:field=google.cloud.aiplatform.v1beta1.MetadataStore.description |
| 40 | + Description *string `json:"description,omitempty"` |
| 41 | + |
| 42 | + // The region of the Metadata Store. eg us-central1. |
| 43 | + Region string `json:"region,omitempty"` |
| 44 | + |
| 45 | + // The project that this resource belongs to. |
| 46 | + ProjectRef *refsv1beta1.ProjectRef `json:"projectRef,omitempty"` |
| 47 | + |
| 48 | + // The VertexAIMetadataStore name. If not given, the metadata.name will be used. |
| 49 | + ResourceID *string `json:"resourceID,omitempty"` |
| 50 | +} |
| 51 | + |
| 52 | +// VertexAIMetadataStoreStatus defines the config connector machine state of VertexAIMetadataStore |
| 53 | +type VertexAIMetadataStoreStatus struct { |
| 54 | + /* Conditions represent the latest available observations of the |
| 55 | + object's current state. */ |
| 56 | + Conditions []v1alpha1.Condition `json:"conditions,omitempty"` |
| 57 | + |
| 58 | + // 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. |
| 59 | + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` |
| 60 | + |
| 61 | + // A unique specifier for the VertexAIMetadataStore resource in GCP. |
| 62 | + ExternalRef *string `json:"externalRef,omitempty"` |
| 63 | + |
| 64 | + // ObservedState is the state of the resource as most recently observed in GCP. |
| 65 | + ObservedState *VertexAIMetadataStoreObservedState `json:"observedState,omitempty"` |
| 66 | +} |
| 67 | + |
| 68 | +// VertexAIMetadataStoreObservedState is the state of the VertexAIMetadataStore resource as most recently observed in GCP. |
| 69 | +// +kcc:proto=google.cloud.aiplatform.v1beta1.MetadataStore |
| 70 | +type VertexAIMetadataStoreObservedState struct { |
| 71 | + // Output only. The resource name of the MetadataStore instance. |
| 72 | + // +kcc:proto:field=google.cloud.aiplatform.v1beta1.MetadataStore.name |
| 73 | + Name *string `json:"name,omitempty"` |
| 74 | + |
| 75 | + // Output only. Timestamp when this MetadataStore was created. |
| 76 | + // +kcc:proto:field=google.cloud.aiplatform.v1beta1.MetadataStore.create_time |
| 77 | + CreateTime *string `json:"createTime,omitempty"` |
| 78 | + |
| 79 | + // Output only. Timestamp when this MetadataStore was last updated. |
| 80 | + // +kcc:proto:field=google.cloud.aiplatform.v1beta1.MetadataStore.update_time |
| 81 | + UpdateTime *string `json:"updateTime,omitempty"` |
| 82 | + |
| 83 | + // Output only. State information of the MetadataStore. |
| 84 | + // +kcc:proto:field=google.cloud.aiplatform.v1beta1.MetadataStore.state |
| 85 | + State *MetadataStore_MetadataStoreState `json:"state,omitempty"` |
| 86 | +} |
| 87 | + |
| 88 | +// +genclient |
| 89 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 90 | +// TODO(user): make sure the pluralizaiton below is correct" |
| 91 | +// +kubebuilder:resource:categories=gcp,shortName=gcpvertexaimetadatastore;gcpvertexaimetadatastores |
| 92 | +// +kubebuilder:subresource:status |
| 93 | +// +kubebuilder:metadata:labels="cnrm.cloud.google.com/managed-by-kcc=true";"cnrm.cloud.google.com/system=true";"cnrm.cloud.google.com/stability-level=alpha" |
| 94 | +// +kubebuilder:printcolumn:name="Age",JSONPath=".metadata.creationTimestamp",type="date" |
| 95 | +// +kubebuilder:printcolumn:name="Ready",JSONPath=".status.conditions[?(@.type=='Ready')].status",type="string",description="When 'True', the most recent reconcile of the resource succeeded" |
| 96 | +// +kubebuilder:printcolumn:name="Status",JSONPath=".status.conditions[?(@.type=='Ready')].reason",type="string",description="The reason for the value in 'Ready'" |
| 97 | +// +kubebuilder:printcolumn:name="Status Age",JSONPath=".status.conditions[?(@.type=='Ready')].lastTransitionTime",type="date",description="The last transition time for the value in 'Status'" |
| 98 | + |
| 99 | +// VertexAIMetadataStore is the Schema for the VertexAIMetadataStore API |
| 100 | +// +k8s:openapi-gen=true |
| 101 | +type VertexAIMetadataStore struct { |
| 102 | + metav1.TypeMeta `json:",inline"` |
| 103 | + metav1.ObjectMeta `json:"metadata,omitempty"` |
| 104 | + |
| 105 | + // +required |
| 106 | + Spec VertexAIMetadataStoreSpec `json:"spec,omitempty"` |
| 107 | + Status VertexAIMetadataStoreStatus `json:"status,omitempty"` |
| 108 | +} |
| 109 | + |
| 110 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 111 | +// VertexAIMetadataStoreList contains a list of VertexAIMetadataStore |
| 112 | +type VertexAIMetadataStoreList struct { |
| 113 | + metav1.TypeMeta `json:",inline"` |
| 114 | + metav1.ListMeta `json:"metadata,omitempty"` |
| 115 | + Items []VertexAIMetadataStore `json:"items"` |
| 116 | +} |
| 117 | + |
| 118 | +func init() { |
| 119 | + SchemeBuilder.Register(&VertexAIMetadataStore{}, &VertexAIMetadataStoreList{}) |
| 120 | +} |
0 commit comments