Skip to content

Commit

Permalink
add FeatureView resource with standard base_url
Browse files Browse the repository at this point in the history
  • Loading branch information
kkram01 committed Dec 22, 2023
1 parent 2b8ddf7 commit 76d2d3b
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 104 deletions.
66 changes: 15 additions & 51 deletions mmv1/products/vertexai/FeatureOnlineStoreFeatureview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

--- !ruby/object:Api::Resource
name: FeatureOnlinestoreFeatureview
base_url: '{{feature_online_store}}/featureViews'
create_url: '{{feature_online_store}}/featureViews?featureViewId={{name}}'
self_link: '{{feature_online_store}}/featureViews/{{name}}'
base_url: projects/{{project}}/locations/{{region}}/featureOnlineStores/{{feature_online_store}}/featureViews
create_url: projects/{{project}}/locations/{{region}}/featureOnlineStores/{{feature_online_store}}/featureViews?featureViewId={{name}}
self_link: projects/{{project}}/locations/{{region}}/featureOnlineStores/{{feature_online_store}}/featureViews/{{name}}
update_verb: :PATCH
update_mask: true
references: !ruby/object:Api::Resource::ReferenceLinks
Expand All @@ -42,34 +42,33 @@ async: !ruby/object:Api::OpAsync
error: !ruby/object:Api::OpAsync::Error
path: 'error'
message: 'message'
include_project: true
description: |-
FeatureView is representation of values that the FeatureOnlineStore will serve based on its syncConfig.
import_format: ['{{feature_online_store}}/featureViews/{{name}}']
import_format:
[
'projects/{{project}}/locations/{{region}}/featureOnlineStores/{{feature_online_store}}/featureViews/{{name}}',
]
autogen_async: false
# Skipping the sweeper due to the non-standard base_url
skip_sweeper: true
examples:
- !ruby/object:Provider::Terraform::Examples
name: 'vertex_ai_featureonlinestore_featureview'
primary_resource_id: 'featureview'
vars:
name: 'tf_test_fv1'
custom_code: !ruby/object:Provider::Terraform::CustomCode
pre_create: templates/terraform/constants/vertex_ai_featureonlinestore_featureview.go.erb
pre_delete: templates/terraform/constants/vertex_ai_featureonlinestore_featureview.go.erb
custom_import: templates/terraform/custom_import/vertex_ai_featureonlinestore_featureview.go.erb
extra_schema_entry: templates/terraform/extra_schema_entry/vertex_ai_featureonlinestore_featureview.go.erb
encoder: templates/terraform/encoders/vertex_ai_featureonlinestore_featureview.go.erb
name: 'example_feature_view'
parameters:
- !ruby/object:Api::Type::String
name: featureOnlineStore
description:
The name of the FeatureOnlineStore to use, in the format
projects/{project}/locations/{region}/featureOnlineStores/{featureOnlineStore}.
The name of the FeatureOnlineStore to use for the featureview.
url_param_only: true
immutable: true
required: true
- !ruby/object:Api::Type::String
name: 'region'
description: The region for the resource. It should be the same as the featureonlinestore region.
required: true
immutable: true
url_param_only: true
properties:
- !ruby/object:Api::Type::String
name: 'name'
Expand All @@ -78,13 +77,10 @@ properties:
valid characters are [a-z0-9_]. The first character cannot be a number.
immutable: true
url_param_only: true
pattern: 'projects/{{project}}/locations/{{region}}/featureOnlineStores/{{featureOnlineStore}}/featureViews/{{name}}'
custom_flatten: templates/terraform/custom_flatten/name_from_self_link.erb
- !ruby/object:Api::Type::String
name: 'etag'
description: Used to perform consistent read-modify-write updates.
output: true
ignore_read: true
- !ruby/object:Api::Type::String
name: 'createTime'
output: true
Expand Down Expand Up @@ -114,11 +110,6 @@ properties:
name: 'bigQuerySource'
description: |
Configures how data is supposed to be extracted from a BigQuery source to be loaded onto the FeatureOnlineStore.
conflicts:
- feature_registry_source
exactly_one_of:
- big_query_source
- feature_registry_source
properties:
- !ruby/object:Api::Type::String
name: 'uri'
Expand All @@ -131,30 +122,3 @@ properties:
description: |
Columns to construct entityId / row keys. Start by supporting 1 only.
item_type: Api::Type::String
- !ruby/object:Api::Type::NestedObject
name: 'featureRegistrySource'
conflicts:
- big_query_source
exactly_one_of:
- big_query_source
- feature_registry_source
description: |
Configures the features from a Feature Registry source that need to be loaded onto the FeatureOnlineStore.
properties:
- !ruby/object:Api::Type::NestedObject
name: 'featureGroups'
required: true
description: |
List of features that need to be synced to Online Store.
properties:
- !ruby/object:Api::Type::String
name: 'featureGroupId'
required: true
description: |
Identifier of the feature group.
- !ruby/object:Api::Type::Array
name: featureIds
required: true
description: |
Identifiers of features under the feature group.
item_type: Api::Type::String

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "google_vertex_ai_feature_online_store" "featureonlinestore" {
name = "tf_test_featureonlinestore12"
name = "<%= ctx[:vars]['name'] %>"
labels = {
foo = "bar"
}
Expand All @@ -15,7 +15,7 @@ resource "google_vertex_ai_feature_online_store" "featureonlinestore" {

resource "google_bigquery_dataset" "tf-test-dataset" {

dataset_id = "tf_test_dataset1_featureview1"
dataset_id = "<%= ctx[:vars]['name'] %>"
friendly_name = "test"
description = "This is a test description"
location = "US"
Expand All @@ -25,7 +25,7 @@ resource "google_bigquery_table" "tf-test-table" {
deletion_protection = false

dataset_id = google_bigquery_dataset.tf-test-dataset.dataset_id
table_id = "tf_test_bq_table"
table_id = "<%= ctx[:vars]['name'] %>"
schema = <<EOF
[
{
Expand All @@ -52,7 +52,8 @@ EOF

resource "google_vertex_ai_feature_onlinestore_featureview" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]['name'] %>"
feature_online_store = google_vertex_ai_feature_online_store.featureonlinestore.id
region = "us-central1"
feature_online_store = google_vertex_ai_feature_online_store.featureonlinestore.name
sync_config {
cron = "0 0 * * *"
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func TestAccVertexAIFeatureOnlinestoreFeatureview_vertexAiFeatureonlinestoreFeat
acctest.VcrTest(t, resource.TestCase{
PreCheck: func() { acctest.AccTestPreCheck(t) },
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
CheckDestroy: testAccCheckVertexAIFeatureOnlinestoreFeatureviewDestroyProducer(t),
Steps: []resource.TestStep{
{
Config: testAccVertexAIFeatureOnlinestoreFeatureview_vertexAiFeatureonlinestoreFeatureview_basic(context),
Expand Down Expand Up @@ -63,7 +64,7 @@ resource "google_vertex_ai_feature_online_store" "featureonlinestore" {
resource "google_bigquery_dataset" "tf-test-dataset" {
dataset_id = "tf_test_dataset1_featureview1"
dataset_id = "tf_test_dataset1_featureview12"
friendly_name = "test"
description = "This is a test description"
location = "US"
Expand Down Expand Up @@ -100,7 +101,11 @@ EOF
resource "google_vertex_ai_feature_onlinestore_featureview" "featureview" {
name = "tf_test_tf_test_fv1%{random_suffix}"
feature_online_store = google_vertex_ai_feature_online_store.featureonlinestore.id
region = "us-central1"
labels = {
foo = "bar"
}
feature_online_store = google_vertex_ai_feature_online_store.featureonlinestore.name
sync_config {
cron = "0 0 * * *"
}
Expand All @@ -122,7 +127,7 @@ func testAccVertexAIFeatureOnlinestoreFeatureview_vertexAiFeatureonlinestoreFeat
resource "google_vertex_ai_feature_online_store" "featureonlinestore" {
name = "tf_test_featureonlinestore12"
labels = {
foo = "bar"
foo1 = "bar1"
}
region = "us-central1"
bigtable {
Expand All @@ -136,7 +141,7 @@ cpu_utilization_target = 80
resource "google_bigquery_dataset" "tf-test-dataset" {
dataset_id = "tf_test_dataset1_featureview1"
dataset_id = "tf_test_dataset1_featureview12"
friendly_name = "test"
description = "This is a test description"
location = "US"
Expand Down Expand Up @@ -173,7 +178,11 @@ EOF
resource "google_vertex_ai_feature_onlinestore_featureview" "featureview" {
name = "tf_test_tf_test_fv1%{random_suffix}"
feature_online_store = google_vertex_ai_feature_online_store.featureonlinestore.id
region = "us-central1"
labels = {
foo1 = "bar1"
}
feature_online_store = google_vertex_ai_feature_online_store.featureonlinestore.name
sync_config {
cron = "0 4 * * *"
}
Expand Down

0 comments on commit 76d2d3b

Please sign in to comment.