/// <summary>Snippet for CreateTableFromSnapshotAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task CreateTableFromSnapshotRequestObjectAsync() { // Create client BigtableTableAdminClient bigtableTableAdminClient = await BigtableTableAdminClient.CreateAsync(); // Initialize request argument(s) CreateTableFromSnapshotRequest request = new CreateTableFromSnapshotRequest { ParentAsInstanceName = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]"), TableId = "", SourceSnapshotAsSnapshotName = SnapshotName.FromProjectInstanceClusterSnapshot("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]"), }; // Make the request Operation <Table, CreateTableFromSnapshotMetadata> response = await bigtableTableAdminClient.CreateTableFromSnapshotAsync(request); // Poll until the returned long-running operation is complete Operation <Table, CreateTableFromSnapshotMetadata> completedResponse = await response.PollUntilCompletedAsync(); // Retrieve the operation result Table 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 <Table, CreateTableFromSnapshotMetadata> retrievedResponse = await bigtableTableAdminClient.PollOnceCreateTableFromSnapshotAsync(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result Table retrievedResult = retrievedResponse.Result; } }
/// <summary>Snippet for CreateTableFromSnapshot</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void CreateTableFromSnapshotResourceNames() { // Create client BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.Create(); // Initialize request argument(s) InstanceName parent = InstanceName.FromProjectInstance("[PROJECT]", "[INSTANCE]"); string tableId = ""; SnapshotName sourceSnapshot = SnapshotName.FromProjectInstanceClusterSnapshot("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]"); // Make the request Operation <Table, CreateTableFromSnapshotMetadata> response = bigtableTableAdminClient.CreateTableFromSnapshot(parent, tableId, sourceSnapshot); // Poll until the returned long-running operation is complete Operation <Table, CreateTableFromSnapshotMetadata> completedResponse = response.PollUntilCompleted(); // Retrieve the operation result Table 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 <Table, CreateTableFromSnapshotMetadata> retrievedResponse = bigtableTableAdminClient.PollOnceCreateTableFromSnapshot(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // If it has completed, then access the result Table retrievedResult = retrievedResponse.Result; } }
/// <summary>Snippet for GetSnapshot</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void GetSnapshotResourceNames() { // Create client BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.Create(); // Initialize request argument(s) SnapshotName name = SnapshotName.FromProjectInstanceClusterSnapshot("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]"); // Make the request Snapshot response = bigtableTableAdminClient.GetSnapshot(name); }
/// <summary>Snippet for DeleteSnapshotAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task DeleteSnapshotResourceNamesAsync() { // Create client BigtableTableAdminClient bigtableTableAdminClient = await BigtableTableAdminClient.CreateAsync(); // Initialize request argument(s) SnapshotName name = SnapshotName.FromProjectInstanceClusterSnapshot("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]"); // Make the request await bigtableTableAdminClient.DeleteSnapshotAsync(name); }
/// <summary>Snippet for GetSnapshotAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task GetSnapshotRequestObjectAsync() { // Create client BigtableTableAdminClient bigtableTableAdminClient = await BigtableTableAdminClient.CreateAsync(); // Initialize request argument(s) GetSnapshotRequest request = new GetSnapshotRequest { SnapshotName = SnapshotName.FromProjectInstanceClusterSnapshot("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]"), }; // Make the request Snapshot response = await bigtableTableAdminClient.GetSnapshotAsync(request); }
/// <summary>Snippet for DeleteSnapshot</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void DeleteSnapshotRequestObject() { // Create client BigtableTableAdminClient bigtableTableAdminClient = BigtableTableAdminClient.Create(); // Initialize request argument(s) DeleteSnapshotRequest request = new DeleteSnapshotRequest { SnapshotName = SnapshotName.FromProjectInstanceClusterSnapshot("[PROJECT]", "[INSTANCE]", "[CLUSTER]", "[SNAPSHOT]"), }; // Make the request bigtableTableAdminClient.DeleteSnapshot(request); }