Esempio n. 1
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonSyntheticsConfig config = new AmazonSyntheticsConfig();

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

            DescribeCanariesLastRunResponse resp = new DescribeCanariesLastRunResponse();

            do
            {
                DescribeCanariesLastRunRequest req = new DescribeCanariesLastRunRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxResults = maxItems
                };

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

                foreach (var obj in resp.CanariesLastRun)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
        internal virtual DescribeCanariesLastRunResponse DescribeCanariesLastRun(DescribeCanariesLastRunRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DescribeCanariesLastRunRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DescribeCanariesLastRunResponseUnmarshaller.Instance;

            return(Invoke <DescribeCanariesLastRunResponse>(request, options));
        }
        /// <summary>
        /// Use this operation to see information from the most recent run of each canary that
        /// you have created.
        ///
        ///
        /// <para>
        /// This operation supports resource-level authorization using an IAM policy and the <code>Names</code>
        /// parameter. If you specify the <code>Names</code> parameter, the operation is successful
        /// only if you have authorization to view all the canaries that you specify in your request.
        /// If you do not have permission to view any of the canaries, the request fails with
        /// a 403 response.
        /// </para>
        ///
        /// <para>
        /// You are required to use the <code>Names</code> parameter if you are logged on to a
        /// user or role that has an IAM policy that restricts which canaries that you are allowed
        /// to view. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Restricted.html">
        /// Limiting a user to viewing specific canaries</a>.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the DescribeCanariesLastRun service method.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        ///
        /// <returns>The response from the DescribeCanariesLastRun service method, as returned by Synthetics.</returns>
        /// <exception cref="Amazon.Synthetics.Model.InternalServerException">
        /// An unknown internal error occurred.
        /// </exception>
        /// <exception cref="Amazon.Synthetics.Model.ValidationException">
        /// A parameter could not be validated.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/synthetics-2017-10-11/DescribeCanariesLastRun">REST API Reference for DescribeCanariesLastRun Operation</seealso>
        public virtual Task <DescribeCanariesLastRunResponse> DescribeCanariesLastRunAsync(DescribeCanariesLastRunRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DescribeCanariesLastRunRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DescribeCanariesLastRunResponseUnmarshaller.Instance;

            return(InvokeAsync <DescribeCanariesLastRunResponse>(request, options, cancellationToken));
        }