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 21, 2023
1 parent 2b8ddf7 commit f21e7f4
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 95 deletions.
61 changes: 14 additions & 47 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
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 Down Expand Up @@ -114,11 +113,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 +125,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
Expand Up @@ -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 @@ -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 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 f21e7f4

Please sign in to comment.