/*
* 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 autoscaling-plans-2018-01-06.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.AutoScalingPlans.Model;
using Amazon.AutoScalingPlans.Model.Internal.MarshallTransformations;
using Amazon.AutoScalingPlans.Internal;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Auth;
using Amazon.Runtime.Internal.Transform;
namespace Amazon.AutoScalingPlans
{
///
/// Implementation for accessing AutoScalingPlans
///
/// AWS Auto Scaling
///
/// Use AWS Auto Scaling to create scaling plans for your applications to automatically
/// scale your scalable AWS resources.
///
///
///
/// API Summary
///
///
///
/// You can use the AWS Auto Scaling service API to accomplish the following tasks:
///
/// -
///
/// Create and manage scaling plans
///
///
-
///
/// Define target tracking scaling policies to dynamically scale your resources based
/// on utilization
///
///
-
///
/// Scale Amazon EC2 Auto Scaling groups using predictive scaling and dynamic scaling
/// to scale your Amazon EC2 capacity faster
///
///
-
///
/// Set minimum and maximum capacity limits
///
///
-
///
/// Retrieve information on existing scaling plans
///
///
-
///
/// Access current forecast data and historical forecast data for up to 56 days previous
///
///
///
/// To learn more about AWS Auto Scaling, including information about granting IAM users
/// required permissions for AWS Auto Scaling actions, see the AWS
/// Auto Scaling User Guide.
///
///
public partial class AmazonAutoScalingPlansClient : AmazonServiceClient, IAmazonAutoScalingPlans
{
private static IServiceMetadata serviceMetadata = new AmazonAutoScalingPlansMetadata();
#region Constructors
///
/// Constructs AmazonAutoScalingPlansClient 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 AmazonAutoScalingPlansClient()
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonAutoScalingPlansConfig()) { }
///
/// Constructs AmazonAutoScalingPlansClient 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 AmazonAutoScalingPlansClient(RegionEndpoint region)
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonAutoScalingPlansConfig{RegionEndpoint = region}) { }
///
/// Constructs AmazonAutoScalingPlansClient 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 AmazonAutoScalingPlansClient Configuration Object
public AmazonAutoScalingPlansClient(AmazonAutoScalingPlansConfig config)
: base(FallbackCredentialsFactory.GetCredentials(config), config){}
///
/// Constructs AmazonAutoScalingPlansClient with AWS Credentials
///
/// AWS Credentials
public AmazonAutoScalingPlansClient(AWSCredentials credentials)
: this(credentials, new AmazonAutoScalingPlansConfig())
{
}
///
/// Constructs AmazonAutoScalingPlansClient with AWS Credentials
///
/// AWS Credentials
/// The region to connect.
public AmazonAutoScalingPlansClient(AWSCredentials credentials, RegionEndpoint region)
: this(credentials, new AmazonAutoScalingPlansConfig{RegionEndpoint = region})
{
}
///
/// Constructs AmazonAutoScalingPlansClient with AWS Credentials and an
/// AmazonAutoScalingPlansClient Configuration object.
///
/// AWS Credentials
/// The AmazonAutoScalingPlansClient Configuration Object
public AmazonAutoScalingPlansClient(AWSCredentials credentials, AmazonAutoScalingPlansConfig clientConfig)
: base(credentials, clientConfig)
{
}
///
/// Constructs AmazonAutoScalingPlansClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
public AmazonAutoScalingPlansClient(string awsAccessKeyId, string awsSecretAccessKey)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonAutoScalingPlansConfig())
{
}
///
/// Constructs AmazonAutoScalingPlansClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// The region to connect.
public AmazonAutoScalingPlansClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonAutoScalingPlansConfig() {RegionEndpoint=region})
{
}
///
/// Constructs AmazonAutoScalingPlansClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonAutoScalingPlansClient Configuration object.
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// The AmazonAutoScalingPlansClient Configuration Object
public AmazonAutoScalingPlansClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonAutoScalingPlansConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, clientConfig)
{
}
///
/// Constructs AmazonAutoScalingPlansClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
public AmazonAutoScalingPlansClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonAutoScalingPlansConfig())
{
}
///
/// Constructs AmazonAutoScalingPlansClient 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 AmazonAutoScalingPlansClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonAutoScalingPlansConfig{RegionEndpoint = region})
{
}
///
/// Constructs AmazonAutoScalingPlansClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonAutoScalingPlansClient Configuration object.
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
/// The AmazonAutoScalingPlansClient Configuration Object
public AmazonAutoScalingPlansClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonAutoScalingPlansConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig)
{
}
#endregion
#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 AmazonAutoScalingPlansEndpointResolver());
}
///
/// 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 CreateScalingPlan
internal virtual CreateScalingPlanResponse CreateScalingPlan(CreateScalingPlanRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = CreateScalingPlanRequestMarshaller.Instance;
options.ResponseUnmarshaller = CreateScalingPlanResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Creates a scaling plan.
///
/// Container for the necessary parameters to execute the CreateScalingPlan service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the CreateScalingPlan service method, as returned by AutoScalingPlans.
///
/// Concurrent updates caused an exception, for example, if you request an update to a
/// scaling plan that already has a pending update.
///
///
/// The service encountered an internal error.
///
///
/// Your account exceeded a limit. This exception is thrown when a per-account resource
/// limit is exceeded.
///
///
/// An exception was thrown for a validation issue. Review the parameters provided.
///
/// REST API Reference for CreateScalingPlan Operation
public virtual Task CreateScalingPlanAsync(CreateScalingPlanRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = CreateScalingPlanRequestMarshaller.Instance;
options.ResponseUnmarshaller = CreateScalingPlanResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region DeleteScalingPlan
internal virtual DeleteScalingPlanResponse DeleteScalingPlan(DeleteScalingPlanRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteScalingPlanRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteScalingPlanResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Deletes the specified scaling plan.
///
///
///
/// Deleting a scaling plan deletes the underlying ScalingInstruction for all of
/// the scalable resources that are covered by the plan.
///
///
///
/// If the plan has launched resources or has scaling activities in progress, you must
/// delete those resources separately.
///
///
/// Container for the necessary parameters to execute the DeleteScalingPlan service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the DeleteScalingPlan service method, as returned by AutoScalingPlans.
///
/// Concurrent updates caused an exception, for example, if you request an update to a
/// scaling plan that already has a pending update.
///
///
/// The service encountered an internal error.
///
///
/// The specified object could not be found.
///
///
/// An exception was thrown for a validation issue. Review the parameters provided.
///
/// REST API Reference for DeleteScalingPlan Operation
public virtual Task DeleteScalingPlanAsync(DeleteScalingPlanRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteScalingPlanRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteScalingPlanResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region DescribeScalingPlanResources
internal virtual DescribeScalingPlanResourcesResponse DescribeScalingPlanResources(DescribeScalingPlanResourcesRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DescribeScalingPlanResourcesRequestMarshaller.Instance;
options.ResponseUnmarshaller = DescribeScalingPlanResourcesResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Describes the scalable resources in the specified scaling plan.
///
/// Container for the necessary parameters to execute the DescribeScalingPlanResources service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the DescribeScalingPlanResources service method, as returned by AutoScalingPlans.
///
/// Concurrent updates caused an exception, for example, if you request an update to a
/// scaling plan that already has a pending update.
///
///
/// The service encountered an internal error.
///
///
/// The token provided is not valid.
///
///
/// An exception was thrown for a validation issue. Review the parameters provided.
///
/// REST API Reference for DescribeScalingPlanResources Operation
public virtual Task DescribeScalingPlanResourcesAsync(DescribeScalingPlanResourcesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = DescribeScalingPlanResourcesRequestMarshaller.Instance;
options.ResponseUnmarshaller = DescribeScalingPlanResourcesResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region DescribeScalingPlans
internal virtual DescribeScalingPlansResponse DescribeScalingPlans(DescribeScalingPlansRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DescribeScalingPlansRequestMarshaller.Instance;
options.ResponseUnmarshaller = DescribeScalingPlansResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Describes one or more of your scaling plans.
///
/// Container for the necessary parameters to execute the DescribeScalingPlans service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the DescribeScalingPlans service method, as returned by AutoScalingPlans.
///
/// Concurrent updates caused an exception, for example, if you request an update to a
/// scaling plan that already has a pending update.
///
///
/// The service encountered an internal error.
///
///
/// The token provided is not valid.
///
///
/// An exception was thrown for a validation issue. Review the parameters provided.
///
/// REST API Reference for DescribeScalingPlans Operation
public virtual Task DescribeScalingPlansAsync(DescribeScalingPlansRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = DescribeScalingPlansRequestMarshaller.Instance;
options.ResponseUnmarshaller = DescribeScalingPlansResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region GetScalingPlanResourceForecastData
internal virtual GetScalingPlanResourceForecastDataResponse GetScalingPlanResourceForecastData(GetScalingPlanResourceForecastDataRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetScalingPlanResourceForecastDataRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetScalingPlanResourceForecastDataResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Retrieves the forecast data for a scalable resource.
///
///
///
/// Capacity forecasts are represented as predicted values, or data points, that are calculated
/// using historical data points from a specified CloudWatch load metric. Data points
/// are available for up to 56 days.
///
///
/// Container for the necessary parameters to execute the GetScalingPlanResourceForecastData service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the GetScalingPlanResourceForecastData service method, as returned by AutoScalingPlans.
///
/// The service encountered an internal error.
///
///
/// An exception was thrown for a validation issue. Review the parameters provided.
///
/// REST API Reference for GetScalingPlanResourceForecastData Operation
public virtual Task GetScalingPlanResourceForecastDataAsync(GetScalingPlanResourceForecastDataRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = GetScalingPlanResourceForecastDataRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetScalingPlanResourceForecastDataResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region UpdateScalingPlan
internal virtual UpdateScalingPlanResponse UpdateScalingPlan(UpdateScalingPlanRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateScalingPlanRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateScalingPlanResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Updates the specified scaling plan.
///
///
///
/// You cannot update a scaling plan if it is in the process of being created, updated,
/// or deleted.
///
///
/// Container for the necessary parameters to execute the UpdateScalingPlan service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the UpdateScalingPlan service method, as returned by AutoScalingPlans.
///
/// Concurrent updates caused an exception, for example, if you request an update to a
/// scaling plan that already has a pending update.
///
///
/// The service encountered an internal error.
///
///
/// The specified object could not be found.
///
///
/// An exception was thrown for a validation issue. Review the parameters provided.
///
/// REST API Reference for UpdateScalingPlan Operation
public virtual Task UpdateScalingPlanAsync(UpdateScalingPlanRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateScalingPlanRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateScalingPlanResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
}
}