Ejemplo n.º 1
0
        /// <summary>Snippet for DebugInstanceAsync</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 DebugInstanceRequestObjectAsync()
        {
            // Create client
            InstancesClient instancesClient = await InstancesClient.CreateAsync();

            // Initialize request argument(s)
            DebugInstanceRequest request = new DebugInstanceRequest {
                Name = "", SshKey = "",
            };
            // Make the request
            Operation <Instance, OperationMetadataV1> response = await instancesClient.DebugInstanceAsync(request);

            // Poll until the returned long-running operation is complete
            Operation <Instance, OperationMetadataV1> completedResponse = await response.PollUntilCompletedAsync();

            // Retrieve the operation result
            Instance 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 <Instance, OperationMetadataV1> retrievedResponse = await instancesClient.PollOnceDebugInstanceAsync(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Instance retrievedResult = retrievedResponse.Result;
            }
        }
Ejemplo n.º 2
0
        /// <summary>Snippet for DebugInstance</summary>
        public void DebugInstanceRequestObject()
        {
            // Snippet: DebugInstance(DebugInstanceRequest, CallSettings)
            // Create client
            InstancesClient instancesClient = InstancesClient.Create();
            // Initialize request argument(s)
            DebugInstanceRequest request = new DebugInstanceRequest {
                Name = "", SshKey = "",
            };
            // Make the request
            Operation <Instance, OperationMetadataV1> response = instancesClient.DebugInstance(request);

            // Poll until the returned long-running operation is complete
            Operation <Instance, OperationMetadataV1> completedResponse = response.PollUntilCompleted();
            // Retrieve the operation result
            Instance 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 <Instance, OperationMetadataV1> retrievedResponse = instancesClient.PollOnceDebugInstance(operationName);

            // Check if the retrieved long-running operation has completed
            if (retrievedResponse.IsCompleted)
            {
                // If it has completed, then access the result
                Instance retrievedResult = retrievedResponse.Result;
            }
            // End snippet
        }
        /// <summary>
        /// Enables debugging on a VM instance. This allows you to use the SSH command to connect to the virtual machine where the instance lives. While in "debug mode", the instance continues to serve live traffic. You should delete the instance when you are done debugging and then allow the system to take over and determine if another instance should be started.Only applicable for instances in App Engine flexible environment.
        /// Documentation https://developers.google.com/appengine/v1beta5/reference/instances/debug
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated appengine service.</param>
        /// <param name="appsId">Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1.</param>
        /// <param name="servicesId">Part of `name`. See documentation of `appsId`.</param>
        /// <param name="versionsId">Part of `name`. See documentation of `appsId`.</param>
        /// <param name="instancesId">Part of `name`. See documentation of `appsId`.</param>
        /// <param name="body">A valid appengine v1beta5 body.</param>
        /// <returns>OperationResponse</returns>
        public static Operation Debug(appengineService service, string appsId, string servicesId, string versionsId, string instancesId, DebugInstanceRequest body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (appsId == null)
                {
                    throw new ArgumentNullException(appsId);
                }
                if (servicesId == null)
                {
                    throw new ArgumentNullException(servicesId);
                }
                if (versionsId == null)
                {
                    throw new ArgumentNullException(versionsId);
                }
                if (instancesId == null)
                {
                    throw new ArgumentNullException(instancesId);
                }

                // Make the request.
                return(service.Instances.Debug(body, appsId, servicesId, versionsId, instancesId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Instances.Debug failed.", ex);
            }
        }
 /// <summary>
 /// Enables debugging on a VM instance. This allows you to use the SSH
 /// command to connect to the virtual machine where the instance lives.
 /// While in "debug mode", the instance continues to serve live traffic.
 /// You should delete the instance when you are done debugging and then
 /// allow the system to take over and determine if another instance
 /// should be started.
 ///
 /// Only applicable for instances in App Engine flexible environment.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public override async stt::Task <lro::Operation <Instance, OperationMetadataV1> > DebugInstanceAsync(DebugInstanceRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_DebugInstanceRequest(ref request, ref callSettings);
     return(new lro::Operation <Instance, OperationMetadataV1>(await _callDebugInstance.Async(request, callSettings).ConfigureAwait(false), DebugInstanceOperationsClient));
 }
 /// <summary>
 /// Enables debugging on a VM instance. This allows you to use the SSH
 /// command to connect to the virtual machine where the instance lives.
 /// While in "debug mode", the instance continues to serve live traffic.
 /// You should delete the instance when you are done debugging and then
 /// allow the system to take over and determine if another instance
 /// should be started.
 ///
 /// Only applicable for instances in App Engine flexible environment.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>The RPC response.</returns>
 public override lro::Operation <Instance, OperationMetadataV1> DebugInstance(DebugInstanceRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_DebugInstanceRequest(ref request, ref callSettings);
     return(new lro::Operation <Instance, OperationMetadataV1>(_callDebugInstance.Sync(request, callSettings), DebugInstanceOperationsClient));
 }
 partial void Modify_DebugInstanceRequest(ref DebugInstanceRequest request, ref gaxgrpc::CallSettings settings);
 /// <summary>
 /// Enables debugging on a VM instance. This allows you to use the SSH
 /// command to connect to the virtual machine where the instance lives.
 /// While in "debug mode", the instance continues to serve live traffic.
 /// You should delete the instance when you are done debugging and then
 /// allow the system to take over and determine if another instance
 /// should be started.
 ///
 /// Only applicable for instances in App Engine flexible environment.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="cancellationToken">A <see cref="st::CancellationToken"/> to use for this RPC.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public virtual stt::Task <lro::Operation <Instance, OperationMetadataV1> > DebugInstanceAsync(DebugInstanceRequest request, st::CancellationToken cancellationToken) =>
 DebugInstanceAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
 /// <summary>
 /// Enables debugging on a VM instance. This allows you to use the SSH
 /// command to connect to the virtual machine where the instance lives.
 /// While in "debug mode", the instance continues to serve live traffic.
 /// You should delete the instance when you are done debugging and then
 /// allow the system to take over and determine if another instance
 /// should be started.
 ///
 /// Only applicable for instances in App Engine flexible environment.
 /// </summary>
 /// <param name="request">The request object containing all of the parameters for the API call.</param>
 /// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
 /// <returns>A Task containing the RPC response.</returns>
 public virtual stt::Task <lro::Operation <Instance, OperationMetadataV1> > DebugInstanceAsync(DebugInstanceRequest request, gaxgrpc::CallSettings callSettings = null) =>
 throw new sys::NotImplementedException();