Ejemplo n.º 1
0
        /// <summary>
        /// Creates a canary. Canaries are scripts that monitor your endpoints and APIs from the
        /// outside-in. Canaries help you check the availability and latency of your web services
        /// and troubleshoot anomalies by investigating load time data, screenshots of the UI,
        /// logs, and metrics. You can set up a canary to run continuously or just once.
        ///
        ///
        /// <para>
        /// Do not use <code>CreateCanary</code> to modify an existing canary. Use <a href="https://docs.aws.amazon.com/AmazonSynthetics/latest/APIReference/API_UpdateCanary.html">UpdateCanary</a>
        /// instead.
        /// </para>
        ///
        /// <para>
        /// To create canaries, you must have the <code>CloudWatchSyntheticsFullAccess</code>
        /// policy. If you are creating a new IAM role for the canary, you also need the the <code>iam:CreateRole</code>,
        /// <code>iam:CreatePolicy</code> and <code>iam:AttachRolePolicy</code> permissions. For
        /// more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Roles">Necessary
        /// Roles and Permissions</a>.
        /// </para>
        ///
        /// <para>
        /// Do not include secrets or proprietary information in your canary names. The canary
        /// name makes up part of the Amazon Resource Name (ARN) for the canary, and the ARN is
        /// included in outbound calls over the internet. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/servicelens_canaries_security.html">Security
        /// Considerations for Synthetics Canaries</a>.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the CreateCanary 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 CreateCanary service method, as returned by Synthetics.</returns>
        /// <exception cref="Amazon.Synthetics.Model.InternalServerException">
        /// An unknown internal error occurred.
        /// </exception>
        /// <exception cref="Amazon.Synthetics.Model.RequestEntityTooLargeException">
        /// One of the input resources is larger than is allowed.
        /// </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/CreateCanary">REST API Reference for CreateCanary Operation</seealso>
        public virtual Task <CreateCanaryResponse> CreateCanaryAsync(CreateCanaryRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = CreateCanaryRequestMarshaller.Instance;
            options.ResponseUnmarshaller = CreateCanaryResponseUnmarshaller.Instance;

            return(InvokeAsync <CreateCanaryResponse>(request, options, cancellationToken));
        }
Ejemplo n.º 2
0
        internal virtual CreateCanaryResponse CreateCanary(CreateCanaryRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = CreateCanaryRequestMarshaller.Instance;
            options.ResponseUnmarshaller = CreateCanaryResponseUnmarshaller.Instance;

            return(Invoke <CreateCanaryResponse>(request, options));
        }