Skip to content

Commit

Permalink
update bigquery analyticshub to GA (#6689)
Browse files Browse the repository at this point in the history
* update to GA

* fmt

* iam now works

* iam now works

* iam now works

* iam now works

* fmt
  • Loading branch information
DrFaust92 authored Oct 20, 2022
1 parent 9878448 commit 34f61c6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 18 deletions.
9 changes: 5 additions & 4 deletions mmv1/products/bigqueryanalyticshub/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ versions:
- !ruby/object:Api::Product::Version
name: beta
base_url: https://analyticshub.googleapis.com/v1beta1/
- !ruby/object:Api::Product::Version
name: ga
base_url: https://analyticshub.googleapis.com/v1/
apis_required:
- !ruby/object:Api::Product::ApiReference
name: Bigquery Analytics Hub API
url: https://console.cloud.google.com/apis/library/analyticshub.googleapis.com/
objects:
- !ruby/object:Api::Resource
name: "DataExchange"
min_version: beta
base_url: projects/{{project}}/locations/{{location}}/dataExchanges
create_url: projects/{{project}}/locations/{{location}}/dataExchanges?data_exchange_id={{data_exchange_id}}
self_link: projects/{{project}}/locations/{{location}}/dataExchanges/{{data_exchange_id}}
Expand All @@ -38,7 +40,7 @@ objects:
references: !ruby/object:Api::Resource::ReferenceLinks
guides:
"Official Documentation": "https://cloud.google.com/bigquery/docs/analytics-hub-introduction"
api: "https://cloud.google.com/bigquery/docs/reference/analytics-hub/rest/v1beta1/projects.locations.dataExchanges"
api: "https://cloud.google.com/bigquery/docs/reference/analytics-hub/rest/v1/projects.locations.dataExchanges"
iam_policy: !ruby/object:Api::Resource::IamPolicy
exclude: false
method_name_separator: ':'
Expand Down Expand Up @@ -94,7 +96,6 @@ objects:
Base64 encoded image representing the data exchange.
- !ruby/object:Api::Resource
name: "Listing"
min_version: beta
base_url: projects/{{project}}/locations/{{location}}/dataExchanges/{{data_exchange_id}}/listings
create_url: projects/{{project}}/locations/{{location}}/dataExchanges/{{data_exchange_id}}/listings?listing_id={{listing_id}}
self_link: projects/{{project}}/locations/{{location}}/dataExchanges/{{data_exchange_id}}/listings/{{listing_id}}
Expand All @@ -104,7 +105,7 @@ objects:
references: !ruby/object:Api::Resource::ReferenceLinks
guides:
"Official Documentation": "https://cloud.google.com/bigquery/docs/analytics-hub-introduction"
api: "https://cloud.google.com/bigquery/docs/reference/analytics-hub/rest/v1beta1/projects.locations.dataExchanges.listings"
api: "https://cloud.google.com/bigquery/docs/reference/analytics-hub/rest/v1/projects.locations.dataExchanges.listings"
iam_policy: !ruby/object:Api::Resource::IamPolicy
exclude: false
method_name_separator: ':'
Expand Down
6 changes: 3 additions & 3 deletions mmv1/products/bigqueryanalyticshub/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ overrides: !ruby/object:Overrides::ResourceOverrides
examples:
- !ruby/object:Provider::Terraform::Examples
name: "bigquery_analyticshub_data_exchange_basic"
min_version: beta
primary_resource_id: "data_exchange"
primary_resource_name: "fmt.Sprintf(\"tf_test_my_data_exchange%s\", context[\"random_suffix\"])"
region_override: "US"
vars:
data_exchange_id: "my_data_exchange"
description: "example data exchange"
Expand All @@ -31,9 +31,9 @@ overrides: !ruby/object:Overrides::ResourceOverrides
examples:
- !ruby/object:Provider::Terraform::Examples
name: "bigquery_analyticshub_listing_basic"
min_version: beta
primary_resource_id: "listing"
primary_resource_name: "fmt.Sprintf(\"tf_test_my_listing%s\", context[\"random_suffix\"])"
primary_resource_name: "fmt.Sprintf(\"tf_test_my_data_exchange%s\", context[\"random_suffix\"]), fmt.Sprintf(\"tf_test_my_listing%s\", context[\"random_suffix\"])"
region_override: "US"
vars:
data_exchange_id: "my_data_exchange"
listing_id: "my_listing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
resource "google_bigquery_analytics_hub_data_exchange" "<%= ctx[:primary_resource_id] %>" {
provider = google-beta
location = "US"
data_exchange_id = "<%= ctx[:vars]['data_exchange_id'] %>"
display_name = "<%= ctx[:vars]['data_exchange_id'] %>"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
resource "google_bigquery_analytics_hub_data_exchange" "<%= ctx[:primary_resource_id] %>" {
provider = google-beta
location = "US"
data_exchange_id = "<%= ctx[:vars]['data_exchange_id'] %>"
display_name = "<%= ctx[:vars]['data_exchange_id'] %>"
description = "<%= ctx[:vars]['description'] %>"
}

resource "google_bigquery_analytics_hub_listing" "<%= ctx[:primary_resource_id] %>" {
provider = google-beta
location = "US"
data_exchange_id = google_bigquery_analytics_hub_data_exchange.<%= ctx[:primary_resource_id] %>.data_exchange_id
listing_id = "<%= ctx[:vars]['listing_id'] %>"
Expand All @@ -20,7 +18,6 @@ resource "google_bigquery_analytics_hub_listing" "<%= ctx[:primary_resource_id]
}

resource "google_bigquery_dataset" "<%= ctx[:primary_resource_id] %>" {
provider = google-beta
dataset_id = "<%= ctx[:vars]['listing_id'] %>"
friendly_name = "<%= ctx[:vars]['listing_id'] %>"
description = "<%= ctx[:vars]['description'] %>"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<% autogen_exception -%>
package google
<% unless version == 'ga' -%>

import (
"testing"
Expand All @@ -17,7 +15,7 @@ func TestAccBigqueryAnalyticsHubListing_bigqueryAnalyticshubListingUpdate(t *tes

vcrTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProvidersOiCS,
Providers: testAccProviders,
CheckDestroy: testAccCheckBigqueryAnalyticsHubListingDestroyProducer(t),
Steps: []resource.TestStep{
{
Expand All @@ -38,15 +36,13 @@ func TestAccBigqueryAnalyticsHubListing_bigqueryAnalyticshubListingUpdate(t *tes
func testAccBigqueryAnalyticsHubListing_bigqueryAnalyticshubListingUpdate(context map[string]interface{}) string {
return Nprintf(`
resource "google_bigquery_analytics_hub_data_exchange" "listing" {
provider = google-beta
location = "US"
data_exchange_id = "tf_test_my_data_exchange%{random_suffix}"
display_name = "tf_test_my_data_exchange%{random_suffix}"
description = "example data exchange%{random_suffix}"
}
resource "google_bigquery_analytics_hub_listing" "listing" {
provider = google-beta
location = "US"
data_exchange_id = google_bigquery_analytics_hub_data_exchange.listing.data_exchange_id
listing_id = "tf_test_my_listing%{random_suffix}"
Expand All @@ -59,12 +55,10 @@ resource "google_bigquery_analytics_hub_listing" "listing" {
}
resource "google_bigquery_dataset" "listing" {
provider = google-beta
dataset_id = "tf_test_my_listing%{random_suffix}"
friendly_name = "tf_test_my_listing%{random_suffix}"
description = "example data exchange%{random_suffix}"
location = "US"
}
`, context)
}
<% end -%>

0 comments on commit 34f61c6

Please sign in to comment.