Skip to content

Commit

Permalink
feat(parallelstore/v1beta): add ImportData and ExportData RPCs
Browse files Browse the repository at this point in the history
docs: fix typo in Instance.reserved_ip_range field doc

PiperOrigin-RevId: 629176948

Source-Link: googleapis/googleapis@35125cf

Source-Link: googleapis/googleapis-gen@dda684f
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuUGFyYWxsZWxzdG9yZS5WMUJldGEvLk93bEJvdC55YW1sIiwiaCI6ImRkYTY4NGZlZDMyNWI0YjNiOGNlODAzNWNmOWI1MzE3NjM4MWMzODgifQ==
  • Loading branch information
gcf-owl-bot[bot] authored and amanda-tarafa committed Apr 30, 2024
1 parent f73940b commit aded486
Show file tree
Hide file tree
Showing 11 changed files with 3,607 additions and 75 deletions.
@@ -0,0 +1,67 @@
// Copyright 2024 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 parallelstore_v1beta_generated_Parallelstore_ExportData_async]
using Google.Cloud.Parallelstore.V1Beta;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedParallelstoreClientSnippets
{
/// <summary>Snippet for ExportDataAsync</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 ExportDataRequestObjectAsync()
{
// Create client
ParallelstoreClient parallelstoreClient = await ParallelstoreClient.CreateAsync();
// Initialize request argument(s)
ExportDataRequest request = new ExportDataRequest
{
InstanceName = InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
SourcePath = "",
DestinationGcsUri = "",
RequestId = "",
};
// Make the request
Operation<ExportDataResponse, ExportDataMetadata> response = await parallelstoreClient.ExportDataAsync(request);

// Poll until the returned long-running operation is complete
Operation<ExportDataResponse, ExportDataMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ExportDataResponse 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<ExportDataResponse, ExportDataMetadata> retrievedResponse = await parallelstoreClient.PollOnceExportDataAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
ExportDataResponse retrievedResult = retrievedResponse.Result;
}
}
}
// [END parallelstore_v1beta_generated_Parallelstore_ExportData_async]
}
@@ -0,0 +1,66 @@
// Copyright 2024 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 parallelstore_v1beta_generated_Parallelstore_ExportData_sync]
using Google.Cloud.Parallelstore.V1Beta;
using Google.LongRunning;

public sealed partial class GeneratedParallelstoreClientSnippets
{
/// <summary>Snippet for ExportData</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 ExportDataRequestObject()
{
// Create client
ParallelstoreClient parallelstoreClient = ParallelstoreClient.Create();
// Initialize request argument(s)
ExportDataRequest request = new ExportDataRequest
{
InstanceName = InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
SourcePath = "",
DestinationGcsUri = "",
RequestId = "",
};
// Make the request
Operation<ExportDataResponse, ExportDataMetadata> response = parallelstoreClient.ExportData(request);

// Poll until the returned long-running operation is complete
Operation<ExportDataResponse, ExportDataMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
ExportDataResponse 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<ExportDataResponse, ExportDataMetadata> retrievedResponse = parallelstoreClient.PollOnceExportData(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
ExportDataResponse retrievedResult = retrievedResponse.Result;
}
}
}
// [END parallelstore_v1beta_generated_Parallelstore_ExportData_sync]
}
@@ -0,0 +1,67 @@
// Copyright 2024 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 parallelstore_v1beta_generated_Parallelstore_ImportData_async]
using Google.Cloud.Parallelstore.V1Beta;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedParallelstoreClientSnippets
{
/// <summary>Snippet for ImportDataAsync</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 ImportDataRequestObjectAsync()
{
// Create client
ParallelstoreClient parallelstoreClient = await ParallelstoreClient.CreateAsync();
// Initialize request argument(s)
ImportDataRequest request = new ImportDataRequest
{
InstanceName = InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
SourceGcsUri = "",
DestinationPath = "",
RequestId = "",
};
// Make the request
Operation<ImportDataResponse, ImportDataMetadata> response = await parallelstoreClient.ImportDataAsync(request);

// Poll until the returned long-running operation is complete
Operation<ImportDataResponse, ImportDataMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
ImportDataResponse 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<ImportDataResponse, ImportDataMetadata> retrievedResponse = await parallelstoreClient.PollOnceImportDataAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
ImportDataResponse retrievedResult = retrievedResponse.Result;
}
}
}
// [END parallelstore_v1beta_generated_Parallelstore_ImportData_async]
}
@@ -0,0 +1,66 @@
// Copyright 2024 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 parallelstore_v1beta_generated_Parallelstore_ImportData_sync]
using Google.Cloud.Parallelstore.V1Beta;
using Google.LongRunning;

public sealed partial class GeneratedParallelstoreClientSnippets
{
/// <summary>Snippet for ImportData</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 ImportDataRequestObject()
{
// Create client
ParallelstoreClient parallelstoreClient = ParallelstoreClient.Create();
// Initialize request argument(s)
ImportDataRequest request = new ImportDataRequest
{
InstanceName = InstanceName.FromProjectLocationInstance("[PROJECT]", "[LOCATION]", "[INSTANCE]"),
SourceGcsUri = "",
DestinationPath = "",
RequestId = "",
};
// Make the request
Operation<ImportDataResponse, ImportDataMetadata> response = parallelstoreClient.ImportData(request);

// Poll until the returned long-running operation is complete
Operation<ImportDataResponse, ImportDataMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
ImportDataResponse 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<ImportDataResponse, ImportDataMetadata> retrievedResponse = parallelstoreClient.PollOnceImportData(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
ImportDataResponse retrievedResult = retrievedResponse.Result;
}
}
}
// [END parallelstore_v1beta_generated_Parallelstore_ImportData_sync]
}

0 comments on commit aded486

Please sign in to comment.