/// <summary>Snippet for RemoveHealthCheck</summary>
 public void RemoveHealthCheck()
 {
     // Snippet: RemoveHealthCheck(string, string, string, TargetPoolsRemoveHealthCheckRequest, CallSettings)
     // Create client
     TargetPoolsClient targetPoolsClient = TargetPoolsClient.Create();
     // Initialize request argument(s)
     string project    = "";
     string region     = "";
     string targetPool = "";
     TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = new TargetPoolsRemoveHealthCheckRequest();
     // Make the request
     Operation response = targetPoolsClient.RemoveHealthCheck(project, region, targetPool, targetPoolsRemoveHealthCheckRequestResource);
     // End snippet
 }
        /// <summary>Snippet for RemoveHealthCheckAsync</summary>
        public async Task RemoveHealthCheckAsync()
        {
            // Snippet: RemoveHealthCheckAsync(string, string, string, TargetPoolsRemoveHealthCheckRequest, CallSettings)
            // Additional: RemoveHealthCheckAsync(string, string, string, TargetPoolsRemoveHealthCheckRequest, CancellationToken)
            // Create client
            TargetPoolsClient targetPoolsClient = await TargetPoolsClient.CreateAsync();

            // Initialize request argument(s)
            string project    = "";
            string region     = "";
            string targetPool = "";
            TargetPoolsRemoveHealthCheckRequest targetPoolsRemoveHealthCheckRequestResource = new TargetPoolsRemoveHealthCheckRequest();
            // Make the request
            Operation response = await targetPoolsClient.RemoveHealthCheckAsync(project, region, targetPool, targetPoolsRemoveHealthCheckRequestResource);

            // End snippet
        }
        /// <summary>
        /// Removes health check URL from a target pool.
        /// Documentation https://developers.google.com/compute/beta/reference/targetPools/removeHealthCheck
        /// 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 compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="region">Name of the region for this request.</param>
        /// <param name="targetPool">Name of the target pool to remove health checks from.</param>
        /// <param name="body">A valid compute beta body.</param>
        /// <returns>OperationResponse</returns>
        public static Operation RemoveHealthCheck(computeService service, string project, string region, string targetPool, TargetPoolsRemoveHealthCheckRequest body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (region == null)
                {
                    throw new ArgumentNullException(region);
                }
                if (targetPool == null)
                {
                    throw new ArgumentNullException(targetPool);
                }

                // Make the request.
                return(service.TargetPools.RemoveHealthCheck(body, project, region, targetPool).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request TargetPools.RemoveHealthCheck failed.", ex);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Removes health check URL from a target pool.
        /// Documentation https://developers.google.com/compute/alpha/reference/targetPools/removeHealthCheck
        /// 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 Compute service.</param>
        /// <param name="project">Project ID for this request.</param>
        /// <param name="region">Name of the region for this request.</param>
        /// <param name="targetPool">Name of the target pool to remove health checks from.</param>
        /// <param name="body">A valid Compute alpha body.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>OperationResponse</returns>
        public static Operation RemoveHealthCheck(ComputeService service, string project, string region, string targetPool, TargetPoolsRemoveHealthCheckRequest body, TargetPoolsRemoveHealthCheckOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (project == null)
                {
                    throw new ArgumentNullException(project);
                }
                if (region == null)
                {
                    throw new ArgumentNullException(region);
                }
                if (targetPool == null)
                {
                    throw new ArgumentNullException(targetPool);
                }

                // Building the initial request.
                var request = service.TargetPools.RemoveHealthCheck(body, project, region, targetPool);

                // Applying optional parameters to the request.
                request = (TargetPoolsResource.RemoveHealthCheckRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request TargetPools.RemoveHealthCheck failed.", ex);
            }
        }