Skip to content

Commit

Permalink
feat: added UpdateRuntime, UpgradeRuntime, DiagnoseRuntime, DiagnoseI…
Browse files Browse the repository at this point in the history
…nstance to v1 API

feat: add Instance.reservation_affinity, nic_type, can_ip_forward to v1beta1 API
feat: add IsInstanceUpgradeableResponse.upgrade_image to v1beta1 API
feat: added Location and IAM methods
fix: deprecate AcceleratorType.NVIDIA_TESLA_K80

PiperOrigin-RevId: 489032946

Source-Link: googleapis/googleapis@1d21a86

Source-Link: googleapis/googleapis-gen@6da6c08
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuTm90ZWJvb2tzLlYxLy5Pd2xCb3QueWFtbCIsImgiOiI2ZGE2YzA4NTBiMDJiMmYwZDZhYjljNTg2MmQwMjFjNGQxNmRhZGM5In0=
  • Loading branch information
gcf-owl-bot[bot] authored and jskeet committed Nov 17, 2022
1 parent 0b4f620 commit 61da370
Show file tree
Hide file tree
Showing 38 changed files with 6,376 additions and 695 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Copyright 2022 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 Google.Cloud.Notebooks.V1.Snippets
{
// [START notebooks_v1_generated_ManagedNotebookService_DiagnoseRuntime_async_flattened]
using Google.Cloud.Notebooks.V1;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedManagedNotebookServiceClientSnippets
{
/// <summary>Snippet for DiagnoseRuntimeAsync</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 DiagnoseRuntimeAsync()
{
// Create client
ManagedNotebookServiceClient managedNotebookServiceClient = await ManagedNotebookServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/runtimes/[RUNTIME]";
DiagnosticConfig diagnosticConfig = new DiagnosticConfig();
// Make the request
Operation<Runtime, OperationMetadata> response = await managedNotebookServiceClient.DiagnoseRuntimeAsync(name, diagnosticConfig);

// Poll until the returned long-running operation is complete
Operation<Runtime, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Runtime 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<Runtime, OperationMetadata> retrievedResponse = await managedNotebookServiceClient.PollOnceDiagnoseRuntimeAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Runtime retrievedResult = retrievedResponse.Result;
}
}
}
// [END notebooks_v1_generated_ManagedNotebookService_DiagnoseRuntime_async_flattened]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// Copyright 2022 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 Google.Cloud.Notebooks.V1.Snippets
{
// [START notebooks_v1_generated_ManagedNotebookService_DiagnoseRuntime_async]
using Google.Cloud.Notebooks.V1;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedManagedNotebookServiceClientSnippets
{
/// <summary>Snippet for DiagnoseRuntimeAsync</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 DiagnoseRuntimeRequestObjectAsync()
{
// Create client
ManagedNotebookServiceClient managedNotebookServiceClient = await ManagedNotebookServiceClient.CreateAsync();
// Initialize request argument(s)
DiagnoseRuntimeRequest request = new DiagnoseRuntimeRequest
{
RuntimeName = RuntimeName.FromProjectLocationRuntime("[PROJECT]", "[LOCATION]", "[RUNTIME]"),
DiagnosticConfig = new DiagnosticConfig(),
};
// Make the request
Operation<Runtime, OperationMetadata> response = await managedNotebookServiceClient.DiagnoseRuntimeAsync(request);

// Poll until the returned long-running operation is complete
Operation<Runtime, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Runtime 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<Runtime, OperationMetadata> retrievedResponse = await managedNotebookServiceClient.PollOnceDiagnoseRuntimeAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Runtime retrievedResult = retrievedResponse.Result;
}
}
}
// [END notebooks_v1_generated_ManagedNotebookService_DiagnoseRuntime_async]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// Copyright 2022 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 Google.Cloud.Notebooks.V1.Snippets
{
// [START notebooks_v1_generated_ManagedNotebookService_DiagnoseRuntime_sync]
using Google.Cloud.Notebooks.V1;
using Google.LongRunning;

public sealed partial class GeneratedManagedNotebookServiceClientSnippets
{
/// <summary>Snippet for DiagnoseRuntime</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 DiagnoseRuntimeRequestObject()
{
// Create client
ManagedNotebookServiceClient managedNotebookServiceClient = ManagedNotebookServiceClient.Create();
// Initialize request argument(s)
DiagnoseRuntimeRequest request = new DiagnoseRuntimeRequest
{
RuntimeName = RuntimeName.FromProjectLocationRuntime("[PROJECT]", "[LOCATION]", "[RUNTIME]"),
DiagnosticConfig = new DiagnosticConfig(),
};
// Make the request
Operation<Runtime, OperationMetadata> response = managedNotebookServiceClient.DiagnoseRuntime(request);

// Poll until the returned long-running operation is complete
Operation<Runtime, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Runtime 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<Runtime, OperationMetadata> retrievedResponse = managedNotebookServiceClient.PollOnceDiagnoseRuntime(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Runtime retrievedResult = retrievedResponse.Result;
}
}
}
// [END notebooks_v1_generated_ManagedNotebookService_DiagnoseRuntime_sync]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Copyright 2022 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 Google.Cloud.Notebooks.V1.Snippets
{
// [START notebooks_v1_generated_ManagedNotebookService_DiagnoseRuntime_async_flattened_resourceNames]
using Google.Cloud.Notebooks.V1;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedManagedNotebookServiceClientSnippets
{
/// <summary>Snippet for DiagnoseRuntimeAsync</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 DiagnoseRuntimeResourceNamesAsync()
{
// Create client
ManagedNotebookServiceClient managedNotebookServiceClient = await ManagedNotebookServiceClient.CreateAsync();
// Initialize request argument(s)
RuntimeName name = RuntimeName.FromProjectLocationRuntime("[PROJECT]", "[LOCATION]", "[RUNTIME]");
DiagnosticConfig diagnosticConfig = new DiagnosticConfig();
// Make the request
Operation<Runtime, OperationMetadata> response = await managedNotebookServiceClient.DiagnoseRuntimeAsync(name, diagnosticConfig);

// Poll until the returned long-running operation is complete
Operation<Runtime, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Runtime 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<Runtime, OperationMetadata> retrievedResponse = await managedNotebookServiceClient.PollOnceDiagnoseRuntimeAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Runtime retrievedResult = retrievedResponse.Result;
}
}
}
// [END notebooks_v1_generated_ManagedNotebookService_DiagnoseRuntime_async_flattened_resourceNames]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// Copyright 2022 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 Google.Cloud.Notebooks.V1.Snippets
{
// [START notebooks_v1_generated_ManagedNotebookService_DiagnoseRuntime_sync_flattened_resourceNames]
using Google.Cloud.Notebooks.V1;
using Google.LongRunning;

public sealed partial class GeneratedManagedNotebookServiceClientSnippets
{
/// <summary>Snippet for DiagnoseRuntime</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 DiagnoseRuntimeResourceNames()
{
// Create client
ManagedNotebookServiceClient managedNotebookServiceClient = ManagedNotebookServiceClient.Create();
// Initialize request argument(s)
RuntimeName name = RuntimeName.FromProjectLocationRuntime("[PROJECT]", "[LOCATION]", "[RUNTIME]");
DiagnosticConfig diagnosticConfig = new DiagnosticConfig();
// Make the request
Operation<Runtime, OperationMetadata> response = managedNotebookServiceClient.DiagnoseRuntime(name, diagnosticConfig);

// Poll until the returned long-running operation is complete
Operation<Runtime, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Runtime 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<Runtime, OperationMetadata> retrievedResponse = managedNotebookServiceClient.PollOnceDiagnoseRuntime(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Runtime retrievedResult = retrievedResponse.Result;
}
}
}
// [END notebooks_v1_generated_ManagedNotebookService_DiagnoseRuntime_sync_flattened_resourceNames]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// Copyright 2022 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 Google.Cloud.Notebooks.V1.Snippets
{
// [START notebooks_v1_generated_ManagedNotebookService_DiagnoseRuntime_sync_flattened]
using Google.Cloud.Notebooks.V1;
using Google.LongRunning;

public sealed partial class GeneratedManagedNotebookServiceClientSnippets
{
/// <summary>Snippet for DiagnoseRuntime</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 DiagnoseRuntime()
{
// Create client
ManagedNotebookServiceClient managedNotebookServiceClient = ManagedNotebookServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/runtimes/[RUNTIME]";
DiagnosticConfig diagnosticConfig = new DiagnosticConfig();
// Make the request
Operation<Runtime, OperationMetadata> response = managedNotebookServiceClient.DiagnoseRuntime(name, diagnosticConfig);

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

0 comments on commit 61da370

Please sign in to comment.