-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(spanner): Add instance partitions field in backup proto
PiperOrigin-RevId: 726160420 Source-Link: googleapis/googleapis@1185fe5 Source-Link: googleapis/googleapis-gen@d1ab008 Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuU3Bhbm5lci5BZG1pbi5EYXRhYmFzZS5WMS8uT3dsQm90LnlhbWwiLCJoIjoiZDFhYjAwODgyODI5N2JhMWJjNWUwZDc5Njc4ZjcyNWY5NTU4MzNkNyJ9
- Loading branch information
1 parent
f4430c8
commit 94b0df7
Showing
168 changed files
with
51,413 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
...r.Admin.Database.V1.GeneratedSnippets/DatabaseAdminClient.AddSplitPointsAsyncSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright 2025 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Generated code. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START spanner_v1_generated_DatabaseAdmin_AddSplitPoints_async_flattened] | ||
using Google.Cloud.Spanner.Admin.Database.V1; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedDatabaseAdminClientSnippets | ||
{ | ||
/// <summary>Snippet for AddSplitPointsAsync</summary> | ||
/// <remarks> | ||
/// This snippet has been automatically generated and should be regarded as a code template only. | ||
/// It will require modifications to work: | ||
/// - It may require correct/in-range values for request initialization. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public async Task AddSplitPointsAsync() | ||
{ | ||
// Create client | ||
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
string database = "projects/[PROJECT]/instances/[INSTANCE]/databases/[DATABASE]"; | ||
IEnumerable<SplitPoints> splitPoints = new SplitPoints[] { new SplitPoints(), }; | ||
// Make the request | ||
AddSplitPointsResponse response = await databaseAdminClient.AddSplitPointsAsync(database, splitPoints); | ||
} | ||
} | ||
// [END spanner_v1_generated_DatabaseAdmin_AddSplitPoints_async_flattened] | ||
} |
49 changes: 49 additions & 0 deletions
49
...ase.V1.GeneratedSnippets/DatabaseAdminClient.AddSplitPointsRequestObjectAsyncSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright 2025 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Generated code. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START spanner_v1_generated_DatabaseAdmin_AddSplitPoints_async] | ||
using Google.Cloud.Spanner.Admin.Database.V1; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedDatabaseAdminClientSnippets | ||
{ | ||
/// <summary>Snippet for AddSplitPointsAsync</summary> | ||
/// <remarks> | ||
/// This snippet has been automatically generated and should be regarded as a code template only. | ||
/// It will require modifications to work: | ||
/// - It may require correct/in-range values for request initialization. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public async Task AddSplitPointsRequestObjectAsync() | ||
{ | ||
// Create client | ||
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
AddSplitPointsRequest request = new AddSplitPointsRequest | ||
{ | ||
DatabaseAsDatabaseName = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]"), | ||
SplitPoints = { new SplitPoints(), }, | ||
Initiator = "", | ||
}; | ||
// Make the request | ||
AddSplitPointsResponse response = await databaseAdminClient.AddSplitPointsAsync(request); | ||
} | ||
} | ||
// [END spanner_v1_generated_DatabaseAdmin_AddSplitPoints_async] | ||
} |
48 changes: 48 additions & 0 deletions
48
...Database.V1.GeneratedSnippets/DatabaseAdminClient.AddSplitPointsRequestObjectSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2025 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Generated code. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START spanner_v1_generated_DatabaseAdmin_AddSplitPoints_sync] | ||
using Google.Cloud.Spanner.Admin.Database.V1; | ||
|
||
public sealed partial class GeneratedDatabaseAdminClientSnippets | ||
{ | ||
/// <summary>Snippet for AddSplitPoints</summary> | ||
/// <remarks> | ||
/// This snippet has been automatically generated and should be regarded as a code template only. | ||
/// It will require modifications to work: | ||
/// - It may require correct/in-range values for request initialization. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public void AddSplitPointsRequestObject() | ||
{ | ||
// Create client | ||
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create(); | ||
// Initialize request argument(s) | ||
AddSplitPointsRequest request = new AddSplitPointsRequest | ||
{ | ||
DatabaseAsDatabaseName = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]"), | ||
SplitPoints = { new SplitPoints(), }, | ||
Initiator = "", | ||
}; | ||
// Make the request | ||
AddSplitPointsResponse response = databaseAdminClient.AddSplitPoints(request); | ||
} | ||
} | ||
// [END spanner_v1_generated_DatabaseAdmin_AddSplitPoints_sync] | ||
} |
46 changes: 46 additions & 0 deletions
46
...ase.V1.GeneratedSnippets/DatabaseAdminClient.AddSplitPointsResourceNamesAsyncSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright 2025 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Generated code. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START spanner_v1_generated_DatabaseAdmin_AddSplitPoints_async_flattened_resourceNames] | ||
using Google.Cloud.Spanner.Admin.Database.V1; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedDatabaseAdminClientSnippets | ||
{ | ||
/// <summary>Snippet for AddSplitPointsAsync</summary> | ||
/// <remarks> | ||
/// This snippet has been automatically generated and should be regarded as a code template only. | ||
/// It will require modifications to work: | ||
/// - It may require correct/in-range values for request initialization. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public async Task AddSplitPointsResourceNamesAsync() | ||
{ | ||
// Create client | ||
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
DatabaseName database = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]"); | ||
IEnumerable<SplitPoints> splitPoints = new SplitPoints[] { new SplitPoints(), }; | ||
// Make the request | ||
AddSplitPointsResponse response = await databaseAdminClient.AddSplitPointsAsync(database, splitPoints); | ||
} | ||
} | ||
// [END spanner_v1_generated_DatabaseAdmin_AddSplitPoints_async_flattened_resourceNames] | ||
} |
45 changes: 45 additions & 0 deletions
45
...Database.V1.GeneratedSnippets/DatabaseAdminClient.AddSplitPointsResourceNamesSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright 2025 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Generated code. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START spanner_v1_generated_DatabaseAdmin_AddSplitPoints_sync_flattened_resourceNames] | ||
using Google.Cloud.Spanner.Admin.Database.V1; | ||
using System.Collections.Generic; | ||
|
||
public sealed partial class GeneratedDatabaseAdminClientSnippets | ||
{ | ||
/// <summary>Snippet for AddSplitPoints</summary> | ||
/// <remarks> | ||
/// This snippet has been automatically generated and should be regarded as a code template only. | ||
/// It will require modifications to work: | ||
/// - It may require correct/in-range values for request initialization. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public void AddSplitPointsResourceNames() | ||
{ | ||
// Create client | ||
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create(); | ||
// Initialize request argument(s) | ||
DatabaseName database = DatabaseName.FromProjectInstanceDatabase("[PROJECT]", "[INSTANCE]", "[DATABASE]"); | ||
IEnumerable<SplitPoints> splitPoints = new SplitPoints[] { new SplitPoints(), }; | ||
// Make the request | ||
AddSplitPointsResponse response = databaseAdminClient.AddSplitPoints(database, splitPoints); | ||
} | ||
} | ||
// [END spanner_v1_generated_DatabaseAdmin_AddSplitPoints_sync_flattened_resourceNames] | ||
} |
45 changes: 45 additions & 0 deletions
45
...panner.Admin.Database.V1.GeneratedSnippets/DatabaseAdminClient.AddSplitPointsSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright 2025 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Generated code. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START spanner_v1_generated_DatabaseAdmin_AddSplitPoints_sync_flattened] | ||
using Google.Cloud.Spanner.Admin.Database.V1; | ||
using System.Collections.Generic; | ||
|
||
public sealed partial class GeneratedDatabaseAdminClientSnippets | ||
{ | ||
/// <summary>Snippet for AddSplitPoints</summary> | ||
/// <remarks> | ||
/// This snippet has been automatically generated and should be regarded as a code template only. | ||
/// It will require modifications to work: | ||
/// - It may require correct/in-range values for request initialization. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public void AddSplitPoints() | ||
{ | ||
// Create client | ||
DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.Create(); | ||
// Initialize request argument(s) | ||
string database = "projects/[PROJECT]/instances/[INSTANCE]/databases/[DATABASE]"; | ||
IEnumerable<SplitPoints> splitPoints = new SplitPoints[] { new SplitPoints(), }; | ||
// Make the request | ||
AddSplitPointsResponse response = databaseAdminClient.AddSplitPoints(database, splitPoints); | ||
} | ||
} | ||
// [END spanner_v1_generated_DatabaseAdmin_AddSplitPoints_sync_flattened] | ||
} |
65 changes: 65 additions & 0 deletions
65
...anner.Admin.Database.V1.GeneratedSnippets/DatabaseAdminClient.CopyBackupAsyncSnippet.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// Copyright 2025 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// Generated code. DO NOT EDIT! | ||
|
||
namespace GoogleCSharpSnippets | ||
{ | ||
// [START spanner_v1_generated_DatabaseAdmin_CopyBackup_async_flattened] | ||
using Google.Cloud.Spanner.Admin.Database.V1; | ||
using Google.LongRunning; | ||
using Google.Protobuf.WellKnownTypes; | ||
using System.Threading.Tasks; | ||
|
||
public sealed partial class GeneratedDatabaseAdminClientSnippets | ||
{ | ||
/// <summary>Snippet for CopyBackupAsync</summary> | ||
/// <remarks> | ||
/// This snippet has been automatically generated and should be regarded as a code template only. | ||
/// It will require modifications to work: | ||
/// - It may require correct/in-range values for request initialization. | ||
/// - It may require specifying regional endpoints when creating the service client as shown in | ||
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint. | ||
/// </remarks> | ||
public async Task CopyBackupAsync() | ||
{ | ||
// Create client | ||
DatabaseAdminClient databaseAdminClient = await DatabaseAdminClient.CreateAsync(); | ||
// Initialize request argument(s) | ||
string parent = "projects/[PROJECT]/instances/[INSTANCE]"; | ||
string backupId = ""; | ||
string sourceBackup = "projects/[PROJECT]/instances/[INSTANCE]/backups/[BACKUP]"; | ||
Timestamp expireTime = new Timestamp(); | ||
// Make the request | ||
Operation<Backup, CopyBackupMetadata> response = await databaseAdminClient.CopyBackupAsync(parent, backupId, sourceBackup, expireTime); | ||
|
||
// Poll until the returned long-running operation is complete | ||
Operation<Backup, CopyBackupMetadata> completedResponse = await response.PollUntilCompletedAsync(); | ||
// Retrieve the operation result | ||
Backup result = completedResponse.Result; | ||
|
||
// Or get the name of the operation | ||
string operationName = response.Name; | ||
// This name can be stored, then the long-running operation retrieved later by name | ||
Operation<Backup, CopyBackupMetadata> retrievedResponse = await databaseAdminClient.PollOnceCopyBackupAsync(operationName); | ||
// Check if the retrieved long-running operation has completed | ||
if (retrievedResponse.IsCompleted) | ||
{ | ||
// If it has completed, then access the result | ||
Backup retrievedResult = retrievedResponse.Result; | ||
} | ||
} | ||
} | ||
// [END spanner_v1_generated_DatabaseAdmin_CopyBackup_async_flattened] | ||
} |
Oops, something went wrong.