/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the internetmonitor-2021-06-03.normal.json service model. */ using System; using System.Runtime.ExceptionServices; using System.Threading; using System.Threading.Tasks; using System.Collections.Generic; using System.Net; using Amazon.InternetMonitor.Model; using Amazon.InternetMonitor.Model.Internal.MarshallTransformations; using Amazon.InternetMonitor.Internal; using Amazon.Runtime; using Amazon.Runtime.Internal; using Amazon.Runtime.Internal.Auth; using Amazon.Runtime.Internal.Transform; namespace Amazon.InternetMonitor { /// /// Implementation for accessing InternetMonitor /// /// Amazon CloudWatch Internet Monitor provides visibility into how internet issues impact /// the performance and availability between your applications hosted on Amazon Web Services /// and your end users. It reduces the time it takes for you to diagnose internet issues /// from days to minutes. Internet Monitor uses the connectivity data that Amazon Web /// Services captures from its global networking footprint to calculate a baseline of /// performance and availability for internet traffic. This is the same data that Amazon /// Web Services uses to monitor internet uptime and availability. With those measurements /// as a baseline, Internet Monitor raises awareness for you when there are significant /// problems for your end users in the different geographic locations where your application /// runs. /// /// /// /// Internet Monitor publishes internet measurements to CloudWatch Logs and CloudWatch /// Metrics, to easily support using CloudWatch tools with health information for geographies /// and networks specific to your application. Internet Monitor sends health events to /// Amazon EventBridge so that you can set up notifications. If an issue is caused by /// the Amazon Web Services network, you also automatically receive an Amazon Web Services /// Health Dashboard notification with the steps that Amazon Web Services is taking to /// mitigate the problem. /// /// /// /// To use Internet Monitor, you create a monitor and associate your application's /// resources with it, VPCs, CloudFront distributions, or WorkSpaces directories, to enable /// Internet Monitor to know where your application's internet traffic is. Internet Monitor /// then provides internet measurements from Amazon Web Services that are specific to /// the locations and networks that communicate with your application. /// /// /// /// For more information, see Using /// Amazon CloudWatch Internet Monitor in the Amazon CloudWatch User Guide. /// /// public partial class AmazonInternetMonitorClient : AmazonServiceClient, IAmazonInternetMonitor { private static IServiceMetadata serviceMetadata = new AmazonInternetMonitorMetadata(); #region Constructors /// /// Constructs AmazonInternetMonitorClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// /// <?xml version="1.0" encoding="utf-8" ?> /// <configuration> /// <appSettings> /// <add key="AWSProfileName" value="AWS Default"/> /// </appSettings> /// </configuration> /// /// /// public AmazonInternetMonitorClient() : base(FallbackCredentialsFactory.GetCredentials(), new AmazonInternetMonitorConfig()) { } /// /// Constructs AmazonInternetMonitorClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// /// <?xml version="1.0" encoding="utf-8" ?> /// <configuration> /// <appSettings> /// <add key="AWSProfileName" value="AWS Default"/> /// </appSettings> /// </configuration> /// /// /// /// The region to connect. public AmazonInternetMonitorClient(RegionEndpoint region) : base(FallbackCredentialsFactory.GetCredentials(), new AmazonInternetMonitorConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonInternetMonitorClient with the credentials loaded from the application's /// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// /// <?xml version="1.0" encoding="utf-8" ?> /// <configuration> /// <appSettings> /// <add key="AWSProfileName" value="AWS Default"/> /// </appSettings> /// </configuration> /// /// /// /// The AmazonInternetMonitorClient Configuration Object public AmazonInternetMonitorClient(AmazonInternetMonitorConfig config) : base(FallbackCredentialsFactory.GetCredentials(config), config){} /// /// Constructs AmazonInternetMonitorClient with AWS Credentials /// /// AWS Credentials public AmazonInternetMonitorClient(AWSCredentials credentials) : this(credentials, new AmazonInternetMonitorConfig()) { } /// /// Constructs AmazonInternetMonitorClient with AWS Credentials /// /// AWS Credentials /// The region to connect. public AmazonInternetMonitorClient(AWSCredentials credentials, RegionEndpoint region) : this(credentials, new AmazonInternetMonitorConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonInternetMonitorClient with AWS Credentials and an /// AmazonInternetMonitorClient Configuration object. /// /// AWS Credentials /// The AmazonInternetMonitorClient Configuration Object public AmazonInternetMonitorClient(AWSCredentials credentials, AmazonInternetMonitorConfig clientConfig) : base(credentials, clientConfig) { } /// /// Constructs AmazonInternetMonitorClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key public AmazonInternetMonitorClient(string awsAccessKeyId, string awsSecretAccessKey) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonInternetMonitorConfig()) { } /// /// Constructs AmazonInternetMonitorClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// The region to connect. public AmazonInternetMonitorClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, new AmazonInternetMonitorConfig() {RegionEndpoint=region}) { } /// /// Constructs AmazonInternetMonitorClient with AWS Access Key ID, AWS Secret Key and an /// AmazonInternetMonitorClient Configuration object. /// /// AWS Access Key ID /// AWS Secret Access Key /// The AmazonInternetMonitorClient Configuration Object public AmazonInternetMonitorClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonInternetMonitorConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, clientConfig) { } /// /// Constructs AmazonInternetMonitorClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token public AmazonInternetMonitorClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonInternetMonitorConfig()) { } /// /// Constructs AmazonInternetMonitorClient with AWS Access Key ID and AWS Secret Key /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token /// The region to connect. public AmazonInternetMonitorClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region) : this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonInternetMonitorConfig{RegionEndpoint = region}) { } /// /// Constructs AmazonInternetMonitorClient with AWS Access Key ID, AWS Secret Key and an /// AmazonInternetMonitorClient Configuration object. /// /// AWS Access Key ID /// AWS Secret Access Key /// AWS Session Token /// The AmazonInternetMonitorClient Configuration Object public AmazonInternetMonitorClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonInternetMonitorConfig clientConfig) : base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig) { } #endregion #if AWS_ASYNC_ENUMERABLES_API private IInternetMonitorPaginatorFactory _paginators; /// /// Paginators for the service /// public IInternetMonitorPaginatorFactory Paginators { get { if (this._paginators == null) { this._paginators = new InternetMonitorPaginatorFactory(this); } return this._paginators; } } #endif #region Overrides /// /// Creates the signer for the service. /// protected override AbstractAWSSigner CreateSigner() { return new AWS4Signer(); } /// /// Customizes the runtime pipeline. /// /// Runtime pipeline for the current client. protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline) { pipeline.RemoveHandler(); pipeline.AddHandlerAfter(new AmazonInternetMonitorEndpointResolver()); } /// /// Capture metadata for the service. /// protected override IServiceMetadata ServiceMetadata { get { return serviceMetadata; } } #endregion #region Dispose /// /// Disposes the service client. /// protected override void Dispose(bool disposing) { base.Dispose(disposing); } #endregion #region CreateMonitor internal virtual CreateMonitorResponse CreateMonitor(CreateMonitorRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateMonitorRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateMonitorResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Creates a monitor in Amazon CloudWatch Internet Monitor. A monitor is built based /// on information from the application resources that you add: Amazon Virtual Private /// Clouds (VPCs), Amazon CloudFront distributions, and WorkSpaces directories. Internet /// Monitor then publishes internet measurements from Amazon Web Services that are specific /// to the city-networks, that is, the locations and ASNs (typically internet service /// providers or ISPs), where clients access your application. For more information, see /// Using /// Amazon CloudWatch Internet Monitor in the Amazon CloudWatch User Guide. /// /// /// /// When you create a monitor, you set a maximum limit for the number of city-networks /// where client traffic is monitored. The city-network maximum that you choose is the /// limit, but you only pay for the number of city-networks that are actually monitored. /// You can change the maximum at any time by updating your monitor. For more information, /// see Choosing /// a city-network maximum value in the Amazon CloudWatch User Guide. /// /// /// Container for the necessary parameters to execute the CreateMonitor service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the CreateMonitor service method, as returned by InternetMonitor. /// /// You don't have sufficient permission to perform this action. /// /// /// The requested resource is in use. /// /// /// An internal error occurred. /// /// /// The request exceeded a service quota. /// /// /// The request was denied due to request throttling. /// /// /// Invalid request. /// /// REST API Reference for CreateMonitor Operation public virtual Task CreateMonitorAsync(CreateMonitorRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateMonitorRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateMonitorResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region DeleteMonitor internal virtual DeleteMonitorResponse DeleteMonitor(DeleteMonitorRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteMonitorRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteMonitorResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Deletes a monitor in Amazon CloudWatch Internet Monitor. /// /// Container for the necessary parameters to execute the DeleteMonitor service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the DeleteMonitor service method, as returned by InternetMonitor. /// /// You don't have sufficient permission to perform this action. /// /// /// An internal error occurred. /// /// /// The request was denied due to request throttling. /// /// /// Invalid request. /// /// REST API Reference for DeleteMonitor Operation public virtual Task DeleteMonitorAsync(DeleteMonitorRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DeleteMonitorRequestMarshaller.Instance; options.ResponseUnmarshaller = DeleteMonitorResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region GetHealthEvent internal virtual GetHealthEventResponse GetHealthEvent(GetHealthEventRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetHealthEventRequestMarshaller.Instance; options.ResponseUnmarshaller = GetHealthEventResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Gets information the Amazon CloudWatch Internet Monitor has created and stored about /// a health event for a specified monitor. This information includes the impacted locations, /// and all of the information related to the event by location. /// /// /// /// The information returned includes the performance, availability, and round-trip time /// impact, information about the network providers, the event type, and so on. /// /// /// /// Information rolled up at the global traffic level is also returned, including the /// impact type and total traffic impact. /// /// /// Container for the necessary parameters to execute the GetHealthEvent service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the GetHealthEvent service method, as returned by InternetMonitor. /// /// You don't have sufficient permission to perform this action. /// /// /// An internal error occurred. /// /// /// The request was denied due to request throttling. /// /// /// Invalid request. /// /// REST API Reference for GetHealthEvent Operation public virtual Task GetHealthEventAsync(GetHealthEventRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetHealthEventRequestMarshaller.Instance; options.ResponseUnmarshaller = GetHealthEventResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region GetMonitor internal virtual GetMonitorResponse GetMonitor(GetMonitorRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = GetMonitorRequestMarshaller.Instance; options.ResponseUnmarshaller = GetMonitorResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Gets information about a monitor in Amazon CloudWatch Internet Monitor based on a /// monitor name. The information returned includes the Amazon Resource Name (ARN), create /// time, modified time, resources included in the monitor, and status information. /// /// Container for the necessary parameters to execute the GetMonitor service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the GetMonitor service method, as returned by InternetMonitor. /// /// You don't have sufficient permission to perform this action. /// /// /// An internal error occurred. /// /// /// The request was denied due to request throttling. /// /// /// Invalid request. /// /// REST API Reference for GetMonitor Operation public virtual Task GetMonitorAsync(GetMonitorRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = GetMonitorRequestMarshaller.Instance; options.ResponseUnmarshaller = GetMonitorResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region ListHealthEvents internal virtual ListHealthEventsResponse ListHealthEvents(ListHealthEventsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListHealthEventsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListHealthEventsResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Lists all health events for a monitor in Amazon CloudWatch Internet Monitor. Returns /// all information for health events including the client location information the network /// cause and status, event start and end time, percentage of total traffic impacted, /// and status. /// /// /// /// Health events that have start times during the time frame that is requested are not /// included in the list of health events. /// /// /// /// Container for the necessary parameters to execute the ListHealthEvents service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the ListHealthEvents service method, as returned by InternetMonitor. /// /// You don't have sufficient permission to perform this action. /// /// /// An internal error occurred. /// /// /// The request was denied due to request throttling. /// /// /// Invalid request. /// /// REST API Reference for ListHealthEvents Operation public virtual Task ListHealthEventsAsync(ListHealthEventsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListHealthEventsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListHealthEventsResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region ListMonitors internal virtual ListMonitorsResponse ListMonitors(ListMonitorsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListMonitorsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListMonitorsResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Lists all of your monitors for Amazon CloudWatch Internet Monitor and their statuses, /// along with the Amazon Resource Name (ARN) and name of each monitor. /// /// Container for the necessary parameters to execute the ListMonitors service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the ListMonitors service method, as returned by InternetMonitor. /// /// You don't have sufficient permission to perform this action. /// /// /// An internal error occurred. /// /// /// The request was denied due to request throttling. /// /// /// Invalid request. /// /// REST API Reference for ListMonitors Operation public virtual Task ListMonitorsAsync(ListMonitorsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListMonitorsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListMonitorsResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region ListTagsForResource internal virtual ListTagsForResourceResponse ListTagsForResource(ListTagsForResourceRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListTagsForResourceRequestMarshaller.Instance; options.ResponseUnmarshaller = ListTagsForResourceResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Lists the tags for a resource. Tags are supported only for monitors in Amazon CloudWatch /// Internet Monitor. /// /// Container for the necessary parameters to execute the ListTagsForResource service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the ListTagsForResource service method, as returned by InternetMonitor. /// /// You don't have sufficient permission to perform this action. /// /// /// A bad request was received. /// /// /// There was an internal server error. /// /// /// The request specifies something that doesn't exist. /// /// /// There were too many requests. /// /// REST API Reference for ListTagsForResource Operation public virtual Task ListTagsForResourceAsync(ListTagsForResourceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListTagsForResourceRequestMarshaller.Instance; options.ResponseUnmarshaller = ListTagsForResourceResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region TagResource internal virtual TagResourceResponse TagResource(TagResourceRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = TagResourceRequestMarshaller.Instance; options.ResponseUnmarshaller = TagResourceResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Adds a tag to a resource. Tags are supported only for monitors in Amazon CloudWatch /// Internet Monitor. You can add a maximum of 50 tags in Internet Monitor. /// /// /// /// A minimum of one tag is required for this call. It returns an error if you use the /// TagResource request with 0 tags. /// /// /// Container for the necessary parameters to execute the TagResource service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the TagResource service method, as returned by InternetMonitor. /// /// You don't have sufficient permission to perform this action. /// /// /// A bad request was received. /// /// /// There was an internal server error. /// /// /// The request specifies something that doesn't exist. /// /// /// There were too many requests. /// /// REST API Reference for TagResource Operation public virtual Task TagResourceAsync(TagResourceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = TagResourceRequestMarshaller.Instance; options.ResponseUnmarshaller = TagResourceResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region UntagResource internal virtual UntagResourceResponse UntagResource(UntagResourceRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UntagResourceRequestMarshaller.Instance; options.ResponseUnmarshaller = UntagResourceResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Removes a tag from a resource. /// /// Container for the necessary parameters to execute the UntagResource service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the UntagResource service method, as returned by InternetMonitor. /// /// You don't have sufficient permission to perform this action. /// /// /// A bad request was received. /// /// /// There was an internal server error. /// /// /// The request specifies something that doesn't exist. /// /// /// There were too many requests. /// /// REST API Reference for UntagResource Operation public virtual Task UntagResourceAsync(UntagResourceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UntagResourceRequestMarshaller.Instance; options.ResponseUnmarshaller = UntagResourceResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion #region UpdateMonitor internal virtual UpdateMonitorResponse UpdateMonitor(UpdateMonitorRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateMonitorRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateMonitorResponseUnmarshaller.Instance; return Invoke(request, options); } /// /// Updates a monitor. You can update a monitor to change the maximum number of city-networks /// (locations and ASNs or internet service providers), to add or remove resources, or /// to change the status of the monitor. Note that you can't change the name of a monitor. /// /// /// /// The city-network maximum that you choose is the limit, but you only pay for the number /// of city-networks that are actually monitored. For more information, see Choosing /// a city-network maximum value in the Amazon CloudWatch User Guide. /// /// /// Container for the necessary parameters to execute the UpdateMonitor service method. /// /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// /// /// The response from the UpdateMonitor service method, as returned by InternetMonitor. /// /// You don't have sufficient permission to perform this action. /// /// /// An internal error occurred. /// /// /// The request exceeded a service quota. /// /// /// The request specifies a resource that doesn't exist. /// /// /// The request was denied due to request throttling. /// /// /// Invalid request. /// /// REST API Reference for UpdateMonitor Operation public virtual Task UpdateMonitorAsync(UpdateMonitorRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = UpdateMonitorRequestMarshaller.Instance; options.ResponseUnmarshaller = UpdateMonitorResponseUnmarshaller.Instance; return InvokeAsync(request, options, cancellationToken); } #endregion } }