Skip to content

Commit

Permalink
Add ga version of bigquery reservation (#4342) (#8079)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Dec 23, 2020
1 parent a9ca2b9 commit df3a2b0
Show file tree
Hide file tree
Showing 7 changed files with 576 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .changelog/4342.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
bigquery: promoted bigquery reservation to GA.
```
3 changes: 3 additions & 0 deletions google/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ type Config struct {
AppEngineBasePath string
BigQueryBasePath string
BigqueryDataTransferBasePath string
BigqueryReservationBasePath string
BigtableBasePath string
BillingBasePath string
BinaryAuthorizationBasePath string
Expand Down Expand Up @@ -166,6 +167,7 @@ var ActiveDirectoryDefaultBasePath = "https://managedidentities.googleapis.com/v
var AppEngineDefaultBasePath = "https://appengine.googleapis.com/v1/"
var BigQueryDefaultBasePath = "https://bigquery.googleapis.com/bigquery/v2/"
var BigqueryDataTransferDefaultBasePath = "https://bigquerydatatransfer.googleapis.com/v1/"
var BigqueryReservationDefaultBasePath = "https://bigqueryreservation.googleapis.com/v1/"
var BigtableDefaultBasePath = "https://bigtableadmin.googleapis.com/v2/"
var BillingDefaultBasePath = "https://billingbudgets.googleapis.com/v1/"
var BinaryAuthorizationDefaultBasePath = "https://binaryauthorization.googleapis.com/v1/"
Expand Down Expand Up @@ -953,6 +955,7 @@ func ConfigureBasePaths(c *Config) {
c.AppEngineBasePath = AppEngineDefaultBasePath
c.BigQueryBasePath = BigQueryDefaultBasePath
c.BigqueryDataTransferBasePath = BigqueryDataTransferDefaultBasePath
c.BigqueryReservationBasePath = BigqueryReservationDefaultBasePath
c.BigtableBasePath = BigtableDefaultBasePath
c.BillingBasePath = BillingDefaultBasePath
c.BinaryAuthorizationBasePath = BinaryAuthorizationDefaultBasePath
Expand Down
14 changes: 12 additions & 2 deletions google/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,14 @@ func Provider() *schema.Provider {
"GOOGLE_BIGQUERY_DATA_TRANSFER_CUSTOM_ENDPOINT",
}, BigqueryDataTransferDefaultBasePath),
},
"bigquery_reservation_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
ValidateFunc: validateCustomEndpoint,
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
"GOOGLE_BIGQUERY_RESERVATION_CUSTOM_ENDPOINT",
}, BigqueryReservationDefaultBasePath),
},
"bigtable_custom_endpoint": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -695,9 +703,9 @@ func Provider() *schema.Provider {
return provider
}

// Generated resources: 177
// Generated resources: 178
// Generated IAM resources: 75
// Total generated resources: 252
// Total generated resources: 253
func ResourceMap() map[string]*schema.Resource {
resourceMap, _ := ResourceMapWithErrors()
return resourceMap
Expand Down Expand Up @@ -732,6 +740,7 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
"google_bigquery_table_iam_policy": ResourceIamPolicy(BigQueryTableIamSchema, BigQueryTableIamUpdaterProducer, BigQueryTableIdParseFunc),
"google_bigquery_routine": resourceBigQueryRoutine(),
"google_bigquery_data_transfer_config": resourceBigqueryDataTransferConfig(),
"google_bigquery_reservation": resourceBigqueryReservationReservation(),
"google_bigtable_app_profile": resourceBigtableAppProfile(),
"google_billing_budget": resourceBillingBudget(),
"google_binary_authorization_attestor": resourceBinaryAuthorizationAttestor(),
Expand Down Expand Up @@ -1150,6 +1159,7 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
config.AppEngineBasePath = d.Get("app_engine_custom_endpoint").(string)
config.BigQueryBasePath = d.Get("big_query_custom_endpoint").(string)
config.BigqueryDataTransferBasePath = d.Get("bigquery_data_transfer_custom_endpoint").(string)
config.BigqueryReservationBasePath = d.Get("bigquery_reservation_custom_endpoint").(string)
config.BigtableBasePath = d.Get("bigtable_custom_endpoint").(string)
config.BillingBasePath = d.Get("billing_custom_endpoint").(string)
config.BinaryAuthorizationBasePath = d.Get("binary_authorization_custom_endpoint").(string)
Expand Down
Loading

0 comments on commit df3a2b0

Please sign in to comment.