Skip to content

Commit a41e488

Browse files
Merge pull request GoogleCloudPlatform#2806 from 600lyy/add-bqcc-cloudspanner
add support for bigqueryconnection cloudSpanner and azure
2 parents b49359a + 3c0f1f5 commit a41e488

File tree

22 files changed

+1836
-13
lines changed

22 files changed

+1836
-13
lines changed

apis/bigqueryconnection/v1alpha1/connection_types.go

+81-8
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,8 @@ type BigQueryConnectionConnectionSpec struct {
5454
// Amazon Web Services (AWS) properties.
5555
AwsSpec *AwsPropertiesSpec `json:"aws,omitempty"`
5656

57-
/* NOTYET
5857
// Azure properties.
59-
Azure *AzureProperties `json:"azure,omitempty"`
60-
*/
61-
62-
/* NOTYET
63-
// Cloud Spanner properties.
64-
CloudSpanner *CloudSpannerProperties `json:"cloudSpanner,omitempty"`
65-
*/
58+
AzureSpec *AzurePropertiesSpec `json:"azure,omitempty"`
6659

6760
/* NOTYET
6861
// Spark properties.
@@ -78,6 +71,9 @@ type BigQueryConnectionConnectionSpec struct {
7871

7972
// Use Cloud Resource properties.
8073
CloudResourceSpec *CloudResourcePropertiesSpec `json:"cloudResource,omitempty"`
74+
75+
// Cloud Spanner properties.
76+
CloudSpannerSpec *CloudSpannerPropertiesSpec `json:"cloudSpanner,omitempty"`
8177
}
8278

8379
// BigQueryConnectionConnectionStatus defines the config connector machine state of BigQueryConnectionConnection
@@ -101,6 +97,8 @@ type BigQueryConnectionConnectionStatus struct {
10197
type BigQueryConnectionConnectionObservedState struct {
10298
Aws *AwsPropertiesStatus `json:"aws,omitempty"`
10399

100+
Azure *AzurePropertiesStatus `json:"azure,omitempty"`
101+
104102
CloudResource *CloudResourcePropertiesStatus `json:"cloudResource,omitempty"`
105103

106104
CloudSql *CloudSqlPropertiesStatus `json:"cloudSql,omitempty"`
@@ -149,6 +147,16 @@ type AwsAccessRoleSpec struct {
149147
IamRoleID *string `json:"iamRoleID,omitempty"`
150148
}
151149

150+
type AzurePropertiesSpec struct {
151+
// The id of customer's directory that host the data.
152+
// +required
153+
CustomerTenantID *string `json:"customerTenantID,omitempty"`
154+
155+
// The client ID of the user's Azure Active Directory Application used for a
156+
// federated connection.
157+
FederatedApplicationClientID *string `json:"federatedApplicationClientID,omitempty"`
158+
}
159+
152160
type CloudResourcePropertiesSpec struct{}
153161

154162
type CloudSqlPropertiesSpec struct {
@@ -165,6 +173,50 @@ type CloudSqlPropertiesSpec struct {
165173
Credential *CloudSqlCredential `json:"credential,omitempty"`
166174
}
167175

176+
type CloudSpannerPropertiesSpec struct {
177+
// Reference to a spanner database ID.
178+
// +required
179+
DatabaseRef *refv1beta1.SpannerDatabaseRef `json:"databaseRef,omitempty"`
180+
181+
// If parallelism should be used when reading from Cloud Spanner
182+
UseParallelism *bool `json:"useParallelism,omitempty"`
183+
184+
// Allows setting max parallelism per query when executing on Spanner
185+
// independent compute resources. If unspecified, default values of
186+
// parallelism are chosen that are dependent on the Cloud Spanner instance
187+
// configuration.
188+
//
189+
// REQUIRES: `use_parallelism` must be set.
190+
// REQUIRES: Either `use_data_boost` or `use_serverless_analytics` must be
191+
// set.
192+
MaxParallelism *int32 `json:"maxParallelism,omitempty"`
193+
194+
// If the serverless analytics service should be used to read data from Cloud
195+
// Spanner.
196+
// Note: `use_parallelism` must be set when using serverless analytics.
197+
UseServerlessAnalytics *bool `json:"useServerlessAnalytics,omitempty"`
198+
199+
// If set, the request will be executed via Spanner independent compute
200+
// resources.
201+
// REQUIRES: `use_parallelism` must be set.
202+
//
203+
// NOTE: `use_serverless_analytics` will be deprecated. Prefer
204+
// `use_data_boost` over `use_serverless_analytics`.
205+
UseDataBoost *bool `json:"useDataBoost,omitempty"`
206+
207+
// Optional. Cloud Spanner database role for fine-grained access control.
208+
// The Cloud Spanner admin should have provisioned the database role with
209+
// appropriate permissions, such as `SELECT` and `INSERT`. Other users should
210+
// only use roles provided by their Cloud Spanner admins.
211+
//
212+
// For more details, see [About fine-grained access control]
213+
// (https://cloud.google.com/spanner/docs/fgac-about).
214+
//
215+
// REQUIRES: The database role name must start with a letter, and can only
216+
// contain letters, numbers, and underscores.
217+
DatabaseRole *string `json:"databaseRole,omitempty"`
218+
}
219+
168220
// +kcc:proto=google.cloud.bigquery.connection.v1.AwsProperties
169221
type AwsPropertiesStatus struct {
170222
AccessRole *AwsAccessRoleStatus `json:"accessRole,omitempty"`
@@ -177,6 +229,27 @@ type AwsAccessRoleStatus struct {
177229
Identity *string `json:"identity,omitempty"`
178230
}
179231

232+
// +kcc:proto=google.cloud.bigquery.connection.v1.AzureProperties
233+
type AzurePropertiesStatus struct {
234+
// The name of the Azure Active Directory Application.
235+
Application *string `json:"application,omitempty"`
236+
237+
// The client id of the Azure Active Directory Application.
238+
ClientID *string `json:"clientID,omitempty"`
239+
240+
// The object id of the Azure Active Directory Application.
241+
ObjectID *string `json:"objectID,omitempty"`
242+
243+
// The URL user will be redirected to after granting consent during connection
244+
// setup.
245+
RedirectUri *string `json:"redirectUri,omitempty"`
246+
247+
// A unique Google-owned and Google-generated identity for the
248+
// Connection. This identity will be used to access the user's Azure Active
249+
// Directory Application.
250+
Identity *string `json:"identity,omitempty"`
251+
}
252+
180253
// +kcc:proto=google.cloud.bigquery.connection.v1.CloudSqlProperties
181254
type CloudSqlPropertiesStatus struct {
182255
// The account ID of the service used for the purpose of this connection.

apis/bigqueryconnection/v1alpha1/zz_generated.deepcopy.go

+125
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)