/*
* 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 arc-zonal-shift-2022-10-30.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.ARCZonalShift.Model;
using Amazon.ARCZonalShift.Model.Internal.MarshallTransformations;
using Amazon.ARCZonalShift.Internal;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Auth;
using Amazon.Runtime.Internal.Transform;
namespace Amazon.ARCZonalShift
{
///
/// Implementation for accessing ARCZonalShift
///
/// This is the API Reference Guide for the zonal shift feature of Amazon Route 53 Application
/// Recovery Controller. This guide is for developers who need detailed information about
/// zonal shift API actions, data types, and errors.
///
///
///
/// Zonal shift is in preview release for Amazon Route 53 Application Recovery Controller
/// and is subject to change.
///
///
///
/// Zonal shift in Route 53 ARC enables you to move traffic for a load balancer resource
/// away from an Availability Zone. Starting a zonal shift helps your application recover
/// immediately, for example, from a developer's bad code deployment or from an AWS infrastructure
/// failure in a single Availability Zone, reducing the impact and time lost from an issue
/// in one zone.
///
///
///
/// Supported AWS resources are automatically registered with Route 53 ARC. Resources
/// that are registered for zonal shifts in Route 53 ARC are managed resources in Route
/// 53 ARC. You can start a zonal shift for any managed resource in your account in a
/// Region. At this time, you can only start a zonal shift for Network Load Balancers
/// and Application Load Balancers with cross-zone load balancing turned off.
///
///
///
/// Zonal shifts are temporary. You must specify an expiration when you start a zonal
/// shift, of up to three days initially. If you want to still keep traffic away from
/// an Availability Zone, you can update the zonal shift and set a new expiration. You
/// can also cancel a zonal shift, before it expires, for example, if you're ready to
/// restore traffic to the Availability Zone.
///
///
///
/// For more information about using zonal shift, see the Amazon
/// Route 53 Application Recovery Controller Developer Guide.
///
///
public partial class AmazonARCZonalShiftClient : AmazonServiceClient, IAmazonARCZonalShift
{
private static IServiceMetadata serviceMetadata = new AmazonARCZonalShiftMetadata();
private IARCZonalShiftPaginatorFactory _paginators;
///
/// Paginators for the service
///
public IARCZonalShiftPaginatorFactory Paginators
{
get
{
if (this._paginators == null)
{
this._paginators = new ARCZonalShiftPaginatorFactory(this);
}
return this._paginators;
}
}
#region Constructors
///
/// Constructs AmazonARCZonalShiftClient 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 AmazonARCZonalShiftClient()
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonARCZonalShiftConfig()) { }
///
/// Constructs AmazonARCZonalShiftClient 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 AmazonARCZonalShiftClient(RegionEndpoint region)
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonARCZonalShiftConfig{RegionEndpoint = region}) { }
///
/// Constructs AmazonARCZonalShiftClient 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 AmazonARCZonalShiftClient Configuration Object
public AmazonARCZonalShiftClient(AmazonARCZonalShiftConfig config)
: base(FallbackCredentialsFactory.GetCredentials(config), config){}
///
/// Constructs AmazonARCZonalShiftClient with AWS Credentials
///
/// AWS Credentials
public AmazonARCZonalShiftClient(AWSCredentials credentials)
: this(credentials, new AmazonARCZonalShiftConfig())
{
}
///
/// Constructs AmazonARCZonalShiftClient with AWS Credentials
///
/// AWS Credentials
/// The region to connect.
public AmazonARCZonalShiftClient(AWSCredentials credentials, RegionEndpoint region)
: this(credentials, new AmazonARCZonalShiftConfig{RegionEndpoint = region})
{
}
///
/// Constructs AmazonARCZonalShiftClient with AWS Credentials and an
/// AmazonARCZonalShiftClient Configuration object.
///
/// AWS Credentials
/// The AmazonARCZonalShiftClient Configuration Object
public AmazonARCZonalShiftClient(AWSCredentials credentials, AmazonARCZonalShiftConfig clientConfig)
: base(credentials, clientConfig)
{
}
///
/// Constructs AmazonARCZonalShiftClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
public AmazonARCZonalShiftClient(string awsAccessKeyId, string awsSecretAccessKey)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonARCZonalShiftConfig())
{
}
///
/// Constructs AmazonARCZonalShiftClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// The region to connect.
public AmazonARCZonalShiftClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonARCZonalShiftConfig() {RegionEndpoint=region})
{
}
///
/// Constructs AmazonARCZonalShiftClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonARCZonalShiftClient Configuration object.
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// The AmazonARCZonalShiftClient Configuration Object
public AmazonARCZonalShiftClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonARCZonalShiftConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, clientConfig)
{
}
///
/// Constructs AmazonARCZonalShiftClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
public AmazonARCZonalShiftClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonARCZonalShiftConfig())
{
}
///
/// Constructs AmazonARCZonalShiftClient 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 AmazonARCZonalShiftClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonARCZonalShiftConfig{RegionEndpoint = region})
{
}
///
/// Constructs AmazonARCZonalShiftClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonARCZonalShiftClient Configuration object.
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
/// The AmazonARCZonalShiftClient Configuration Object
public AmazonARCZonalShiftClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonARCZonalShiftConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig)
{
}
#endregion
#region Overrides
///
/// Creates the signer for the service.
///
protected override AbstractAWSSigner CreateSigner()
{
return new AWS4Signer();
}
///
/// Customize the pipeline
///
///
protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
{
pipeline.RemoveHandler();
pipeline.AddHandlerAfter(new AmazonARCZonalShiftEndpointResolver());
}
///
/// 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 CancelZonalShift
///
/// Cancel a zonal shift in Amazon Route 53 Application Recovery Controller that you've
/// started for a resource in your AWS account in an AWS Region.
///
/// Container for the necessary parameters to execute the CancelZonalShift service method.
///
/// The response from the CancelZonalShift service method, as returned by ARCZonalShift.
///
/// You do not have sufficient access to perform this action.
///
///
/// The request could not be processed because of conflict in the current state of the
/// resource.
///
///
/// There was an internal server error.
///
///
/// The input requested a resource that was not found.
///
///
/// The request was denied due to request throttling.
///
///
/// The input fails to satisfy the constraints specified by an AWS service.
///
/// REST API Reference for CancelZonalShift Operation
public virtual CancelZonalShiftResponse CancelZonalShift(CancelZonalShiftRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = CancelZonalShiftRequestMarshaller.Instance;
options.ResponseUnmarshaller = CancelZonalShiftResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Cancel a zonal shift in Amazon Route 53 Application Recovery Controller that you've
/// started for a resource in your AWS account in an AWS Region.
///
/// Container for the necessary parameters to execute the CancelZonalShift service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the CancelZonalShift service method, as returned by ARCZonalShift.
///
/// You do not have sufficient access to perform this action.
///
///
/// The request could not be processed because of conflict in the current state of the
/// resource.
///
///
/// There was an internal server error.
///
///
/// The input requested a resource that was not found.
///
///
/// The request was denied due to request throttling.
///
///
/// The input fails to satisfy the constraints specified by an AWS service.
///
/// REST API Reference for CancelZonalShift Operation
public virtual Task CancelZonalShiftAsync(CancelZonalShiftRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = CancelZonalShiftRequestMarshaller.Instance;
options.ResponseUnmarshaller = CancelZonalShiftResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region GetManagedResource
///
/// Get information about a resource that's been registered for zonal shifts with Amazon
/// Route 53 Application Recovery Controller in this AWS Region. Resources that are registered
/// for zonal shifts are managed resources in Route 53 ARC.
///
///
///
/// At this time, you can only start a zonal shift for Network Load Balancers and Application
/// Load Balancers with cross-zone load balancing turned off.
///
///
/// Container for the necessary parameters to execute the GetManagedResource service method.
///
/// The response from the GetManagedResource service method, as returned by ARCZonalShift.
///
/// You do not have sufficient access to perform this action.
///
///
/// There was an internal server error.
///
///
/// The input requested a resource that was not found.
///
///
/// The request was denied due to request throttling.
///
///
/// The input fails to satisfy the constraints specified by an AWS service.
///
/// REST API Reference for GetManagedResource Operation
public virtual GetManagedResourceResponse GetManagedResource(GetManagedResourceRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetManagedResourceRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetManagedResourceResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Get information about a resource that's been registered for zonal shifts with Amazon
/// Route 53 Application Recovery Controller in this AWS Region. Resources that are registered
/// for zonal shifts are managed resources in Route 53 ARC.
///
///
///
/// At this time, you can only start a zonal shift for Network Load Balancers and Application
/// Load Balancers with cross-zone load balancing turned off.
///
///
/// Container for the necessary parameters to execute the GetManagedResource service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the GetManagedResource service method, as returned by ARCZonalShift.
///
/// You do not have sufficient access to perform this action.
///
///
/// There was an internal server error.
///
///
/// The input requested a resource that was not found.
///
///
/// The request was denied due to request throttling.
///
///
/// The input fails to satisfy the constraints specified by an AWS service.
///
/// REST API Reference for GetManagedResource Operation
public virtual Task GetManagedResourceAsync(GetManagedResourceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = GetManagedResourceRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetManagedResourceResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region ListManagedResources
///
/// Lists all the resources in your AWS account in this AWS Region that are managed for
/// zonal shifts in Amazon Route 53 Application Recovery Controller, and information about
/// them. The information includes their Amazon Resource Names (ARNs), the Availability
/// Zones the resources are deployed in, and the resource name.
///
/// Container for the necessary parameters to execute the ListManagedResources service method.
///
/// The response from the ListManagedResources service method, as returned by ARCZonalShift.
///
/// You do not have sufficient access to perform this action.
///
///
/// There was an internal server error.
///
///
/// The request was denied due to request throttling.
///
///
/// The input fails to satisfy the constraints specified by an AWS service.
///
/// REST API Reference for ListManagedResources Operation
public virtual ListManagedResourcesResponse ListManagedResources(ListManagedResourcesRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListManagedResourcesRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListManagedResourcesResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Lists all the resources in your AWS account in this AWS Region that are managed for
/// zonal shifts in Amazon Route 53 Application Recovery Controller, and information about
/// them. The information includes their Amazon Resource Names (ARNs), the Availability
/// Zones the resources are deployed in, and the resource name.
///
/// Container for the necessary parameters to execute the ListManagedResources service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the ListManagedResources service method, as returned by ARCZonalShift.
///
/// You do not have sufficient access to perform this action.
///
///
/// There was an internal server error.
///
///
/// The request was denied due to request throttling.
///
///
/// The input fails to satisfy the constraints specified by an AWS service.
///
/// REST API Reference for ListManagedResources Operation
public virtual Task ListManagedResourcesAsync(ListManagedResourcesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = ListManagedResourcesRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListManagedResourcesResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region ListZonalShifts
///
/// Lists all the active zonal shifts in Amazon Route 53 Application Recovery Controller
/// in your AWS account in this AWS Region.
///
/// Container for the necessary parameters to execute the ListZonalShifts service method.
///
/// The response from the ListZonalShifts service method, as returned by ARCZonalShift.
///
/// You do not have sufficient access to perform this action.
///
///
/// There was an internal server error.
///
///
/// The request was denied due to request throttling.
///
///
/// The input fails to satisfy the constraints specified by an AWS service.
///
/// REST API Reference for ListZonalShifts Operation
public virtual ListZonalShiftsResponse ListZonalShifts(ListZonalShiftsRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListZonalShiftsRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListZonalShiftsResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Lists all the active zonal shifts in Amazon Route 53 Application Recovery Controller
/// in your AWS account in this AWS Region.
///
/// Container for the necessary parameters to execute the ListZonalShifts service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the ListZonalShifts service method, as returned by ARCZonalShift.
///
/// You do not have sufficient access to perform this action.
///
///
/// There was an internal server error.
///
///
/// The request was denied due to request throttling.
///
///
/// The input fails to satisfy the constraints specified by an AWS service.
///
/// REST API Reference for ListZonalShifts Operation
public virtual Task ListZonalShiftsAsync(ListZonalShiftsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = ListZonalShiftsRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListZonalShiftsResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region StartZonalShift
///
/// You start a zonal shift to temporarily move load balancer traffic away from an Availability
/// Zone in a AWS Region, to help your application recover immediately, for example, from
/// a developer's bad code deployment or from an AWS infrastructure failure in a single
/// Availability Zone. You can start a zonal shift in Route 53 ARC only for managed resources
/// in your account in an AWS Region. Resources are automatically registered with Route
/// 53 ARC by AWS services.
///
///
///
/// At this time, you can only start a zonal shift for Network Load Balancers and Application
/// Load Balancers with cross-zone load balancing turned off.
///
///
///
/// When you start a zonal shift, traffic for the resource is no longer routed to the
/// Availability Zone. The zonal shift is created immediately in Route 53 ARC. However,
/// it can take a short time, typically up to a few minutes, for existing, in-progress
/// connections in the Availability Zone to complete.
///
///
///
/// For more information, see Zonal
/// shift in the Amazon Route 53 Application Recovery Controller Developer Guide.
///
///
/// Container for the necessary parameters to execute the StartZonalShift service method.
///
/// The response from the StartZonalShift service method, as returned by ARCZonalShift.
///
/// You do not have sufficient access to perform this action.
///
///
/// The request could not be processed because of conflict in the current state of the
/// resource.
///
///
/// There was an internal server error.
///
///
/// The input requested a resource that was not found.
///
///
/// The request was denied due to request throttling.
///
///
/// The input fails to satisfy the constraints specified by an AWS service.
///
/// REST API Reference for StartZonalShift Operation
public virtual StartZonalShiftResponse StartZonalShift(StartZonalShiftRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = StartZonalShiftRequestMarshaller.Instance;
options.ResponseUnmarshaller = StartZonalShiftResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// You start a zonal shift to temporarily move load balancer traffic away from an Availability
/// Zone in a AWS Region, to help your application recover immediately, for example, from
/// a developer's bad code deployment or from an AWS infrastructure failure in a single
/// Availability Zone. You can start a zonal shift in Route 53 ARC only for managed resources
/// in your account in an AWS Region. Resources are automatically registered with Route
/// 53 ARC by AWS services.
///
///
///
/// At this time, you can only start a zonal shift for Network Load Balancers and Application
/// Load Balancers with cross-zone load balancing turned off.
///
///
///
/// When you start a zonal shift, traffic for the resource is no longer routed to the
/// Availability Zone. The zonal shift is created immediately in Route 53 ARC. However,
/// it can take a short time, typically up to a few minutes, for existing, in-progress
/// connections in the Availability Zone to complete.
///
///
///
/// For more information, see Zonal
/// shift in the Amazon Route 53 Application Recovery Controller Developer Guide.
///
///
/// Container for the necessary parameters to execute the StartZonalShift service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the StartZonalShift service method, as returned by ARCZonalShift.
///
/// You do not have sufficient access to perform this action.
///
///
/// The request could not be processed because of conflict in the current state of the
/// resource.
///
///
/// There was an internal server error.
///
///
/// The input requested a resource that was not found.
///
///
/// The request was denied due to request throttling.
///
///
/// The input fails to satisfy the constraints specified by an AWS service.
///
/// REST API Reference for StartZonalShift Operation
public virtual Task StartZonalShiftAsync(StartZonalShiftRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = StartZonalShiftRequestMarshaller.Instance;
options.ResponseUnmarshaller = StartZonalShiftResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region UpdateZonalShift
///
/// Update an active zonal shift in Amazon Route 53 Application Recovery Controller in
/// your AWS account. You can update a zonal shift to set a new expiration, or edit or
/// replace the comment for the zonal shift.
///
/// Container for the necessary parameters to execute the UpdateZonalShift service method.
///
/// The response from the UpdateZonalShift service method, as returned by ARCZonalShift.
///
/// You do not have sufficient access to perform this action.
///
///
/// The request could not be processed because of conflict in the current state of the
/// resource.
///
///
/// There was an internal server error.
///
///
/// The input requested a resource that was not found.
///
///
/// The request was denied due to request throttling.
///
///
/// The input fails to satisfy the constraints specified by an AWS service.
///
/// REST API Reference for UpdateZonalShift Operation
public virtual UpdateZonalShiftResponse UpdateZonalShift(UpdateZonalShiftRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateZonalShiftRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateZonalShiftResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Update an active zonal shift in Amazon Route 53 Application Recovery Controller in
/// your AWS account. You can update a zonal shift to set a new expiration, or edit or
/// replace the comment for the zonal shift.
///
/// Container for the necessary parameters to execute the UpdateZonalShift service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the UpdateZonalShift service method, as returned by ARCZonalShift.
///
/// You do not have sufficient access to perform this action.
///
///
/// The request could not be processed because of conflict in the current state of the
/// resource.
///
///
/// There was an internal server error.
///
///
/// The input requested a resource that was not found.
///
///
/// The request was denied due to request throttling.
///
///
/// The input fails to satisfy the constraints specified by an AWS service.
///
/// REST API Reference for UpdateZonalShift Operation
public virtual Task UpdateZonalShiftAsync(UpdateZonalShiftRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateZonalShiftRequestMarshaller.Instance;
options.ResponseUnmarshaller = UpdateZonalShiftResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
}
}