Example #1
0
        internal ListHealthChecksResponse ListHealthChecks(ListHealthChecksRequest request)
        {
            var marshaller   = new ListHealthChecksRequestMarshaller();
            var unmarshaller = ListHealthChecksResponseUnmarshaller.Instance;

            return(Invoke <ListHealthChecksRequest, ListHealthChecksResponse>(request, marshaller, unmarshaller));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the ListHealthChecks operation.
        /// <seealso cref="Amazon.Route53.IAmazonRoute53.ListHealthChecks"/>
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ListHealthChecks operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task <ListHealthChecksResponse> ListHealthChecksAsync(ListHealthChecksRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new ListHealthChecksRequestMarshaller();
            var unmarshaller = ListHealthChecksResponseUnmarshaller.GetInstance();

            return(Invoke <IRequest, ListHealthChecksRequest, ListHealthChecksResponse>(request, marshaller, unmarshaller, signer, cancellationToken));
        }
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonRoute53Config config = new AmazonRoute53Config();

            config.RegionEndpoint = region;
            ConfigureClient(config);
            AmazonRoute53Client client = new AmazonRoute53Client(creds, config);

            ListHealthChecksResponse resp = new ListHealthChecksResponse();

            do
            {
                ListHealthChecksRequest req = new ListHealthChecksRequest
                {
                    Marker = resp.NextMarker
                    ,
                    MaxItems = maxItems.ToString()
                };

                resp = client.ListHealthChecks(req);
                CheckError(resp.HttpStatusCode, "200");

                foreach (var obj in resp.HealthChecks)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextMarker));
        }
Example #4
0
        /// <summary>
        /// Initiates the asynchronous execution of the ListHealthChecks operation.
        /// <seealso cref="Amazon.Route53.IAmazonRoute53"/>
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ListHealthChecks operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task <ListHealthChecksResponse> ListHealthChecksAsync(ListHealthChecksRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new ListHealthChecksRequestMarshaller();
            var unmarshaller = ListHealthChecksResponseUnmarshaller.Instance;

            return(InvokeAsync <ListHealthChecksRequest, ListHealthChecksResponse>(request, marshaller,
                                                                                   unmarshaller, cancellationToken));
        }
Example #5
0
        /// <summary>Snippet for ListAsync</summary>
        public async Task ListRequestObjectAsync()
        {
            // Snippet: ListAsync(ListHealthChecksRequest, CallSettings)
            // Create client
            HealthChecksClient healthChecksClient = await HealthChecksClient.CreateAsync();

            // Initialize request argument(s)
            ListHealthChecksRequest request = new ListHealthChecksRequest
            {
                OrderBy = "",
                Project = "",
                Filter  = "",
                ReturnPartialSuccess = false,
            };
            // Make the request
            PagedAsyncEnumerable <HealthCheckList, HealthCheck> response = healthChecksClient.ListAsync(request);

            // Iterate over all response items, lazily performing RPCs as required
            await response.ForEachAsync((HealthCheck item) =>
            {
                // Do something with each item
                Console.WriteLine(item);
            });

            // Or iterate over pages (of server-defined size), performing one RPC per page
            await response.AsRawResponses().ForEachAsync((HealthCheckList page) =>
            {
                // Do something with each page of items
                Console.WriteLine("A page of results:");
                foreach (HealthCheck item in page)
                {
                    // Do something with each item
                    Console.WriteLine(item);
                }
            });

            // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
            int pageSize = 10;
            Page <HealthCheck> singlePage = await response.ReadPageAsync(pageSize);

            // Do something with the page of items
            Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
            foreach (HealthCheck item in singlePage)
            {
                // Do something with each item
                Console.WriteLine(item);
            }
            // Store the pageToken, for when the next page is required.
            string nextPageToken = singlePage.NextPageToken;
            // End snippet
        }
        /// <summary>
        /// <para> To retrieve a list of your health checks, send a <c>GET</c> request to the <c>2013-04-01/healthcheck</c> resource. The response to
        /// this request includes a <c>HealthChecks</c> element with zero, one, or multiple <c>HealthCheck</c> child elements. By default, the list of
        /// health checks is displayed on a single page. You can control the length of the page that is displayed by using the <c>MaxItems</c>
        /// parameter. You can use the <c>Marker</c> parameter to control the health check that the list begins with. </para> <para><b>NOTE:</b> Amazon
        /// Route 53 returns a maximum of 100 items. If you set MaxItems to a value greater than 100, Amazon Route 53 returns only the first 100.</para>
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ListHealthChecks service method on
        /// AmazonRoute53.</param>
        ///
        /// <returns>The response from the ListHealthChecks service method, as returned by AmazonRoute53.</returns>
        ///
        /// <exception cref="T:Amazon.Route53.Model.IncompatibleVersionException" />
        /// <exception cref="T:Amazon.Route53.Model.InvalidInputException" />
        public ListHealthChecksResponse ListHealthChecks(ListHealthChecksRequest request)
        {
            var task = ListHealthChecksAsync(request);

            try
            {
                return(task.Result);
            }
            catch (AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return(null);
            }
        }
Example #7
0
 /// <summary>Snippet for List</summary>
 public void ListRequestObject()
 {
     // Snippet: List(ListHealthChecksRequest, CallSettings)
     // Create client
     HealthChecksClient healthChecksClient = HealthChecksClient.Create();
     // Initialize request argument(s)
     ListHealthChecksRequest request = new ListHealthChecksRequest
     {
         PageToken            = "",
         MaxResults           = 0U,
         Filter               = "",
         OrderBy              = "",
         Project              = "",
         ReturnPartialSuccess = false,
     };
     // Make the request
     HealthCheckList response = healthChecksClient.List(request);
     // End snippet
 }
Example #8
0
        async Task <HealthCheck> FindExistingHealthCheck(R53HealthSpec r53Health)
        {
            HealthCheck existingHealth = null;

            if (r53Health != null)
            {
                var listRequ = new ListHealthChecksRequest();
                var listResp = await _r53.ListHealthChecksAsync(listRequ);

                _logger.LogInformation("Looking for existing Health Check for RefName: " + r53Health.RefName);
                while (listResp.HealthChecks?.Count > 0)
                {
                    existingHealth = listResp.HealthChecks.FirstOrDefault(hc =>
                                                                          hc.CallerReference == r53Health.RefName);

                    if (existingHealth != null)
                    {
                        // Found a match
                        break;
                    }

                    if (!listResp.IsTruncated)
                    {
                        // No more records
                        break;
                    }

                    // Get the next page of results
                    listRequ.Marker = listResp.Marker;
                    listResp        = await _r53.ListHealthChecksAsync(listRequ);
                }

                if (existingHealth == null)
                {
                    _logger.LogInformation("Found NO EXISTING Health Check for resolved spec");
                }
                else
                {
                    _logger.LogInformation("Found existing Health Check for resolved spec: " + existingHealth.Id);
                }
            }
            return(existingHealth);
        }
Example #9
0
        /// <summary>Snippet for ListAsync</summary>
        public async Task ListRequestObjectAsync()
        {
            // Snippet: ListAsync(ListHealthChecksRequest, CallSettings)
            // Additional: ListAsync(ListHealthChecksRequest, CancellationToken)
            // Create client
            HealthChecksClient healthChecksClient = await HealthChecksClient.CreateAsync();

            // Initialize request argument(s)
            ListHealthChecksRequest request = new ListHealthChecksRequest
            {
                PageToken            = "",
                MaxResults           = 0U,
                Filter               = "",
                OrderBy              = "",
                Project              = "",
                ReturnPartialSuccess = false,
            };
            // Make the request
            HealthCheckList response = await healthChecksClient.ListAsync(request);

            // End snippet
        }
Example #10
0
 public virtual Task <ListHealthChecksResponse> ListHealthChecksAsync(ListHealthChecksRequest request, CancellationToken cancellationToken = default(CancellationToken))
 {
     throw new NotImplementedException();
 }