AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Implementation for accessing Lightsail Amazon Lightsail is the easiest way to get started with AWS for developers who just need virtual private servers. Lightsail includes everything you need to launch your project quickly - a virtual machine, SSD-based storage, data transfer, DNS management, and a static IP - for a low, predictable price. You manage those Lightsail servers through the Lightsail console or by using the API or command-line interface (CLI).

For more information about Lightsail concepts and tasks, see the Lightsail Dev Guide.

To use the Lightsail API or the CLI, you will need to use AWS Identity and Access Management (IAM) to generate access keys. For details about how to set this up, see the Lightsail Dev Guide.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonServiceClient
    Amazon.Lightsail.AmazonLightsailClient

Namespace: Amazon.Lightsail
Assembly: AWSSDK.Lightsail.dll
Version: 3.x.y.z

Syntax

C#
public class AmazonLightsailClient : AmazonServiceClient
         IAmazonLightsail, IAmazonService, IDisposable

The AmazonLightsailClient type exposes the following members

Constructors

NameDescription
Public Method AmazonLightsailClient()

Constructs AmazonLightsailClient 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.



    
        
    

             

Public Method AmazonLightsailClient(RegionEndpoint)

Constructs AmazonLightsailClient 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.



    
        
    

             

Public Method AmazonLightsailClient(AmazonLightsailConfig)

Constructs AmazonLightsailClient 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.



    
        
    

             

Public Method AmazonLightsailClient(AWSCredentials)

Constructs AmazonLightsailClient with AWS Credentials

Public Method AmazonLightsailClient(AWSCredentials, RegionEndpoint)

Constructs AmazonLightsailClient with AWS Credentials

Public Method AmazonLightsailClient(AWSCredentials, AmazonLightsailConfig)

Constructs AmazonLightsailClient with AWS Credentials and an AmazonLightsailClient Configuration object.

Public Method AmazonLightsailClient(string, string)

Constructs AmazonLightsailClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonLightsailClient(string, string, RegionEndpoint)

Constructs AmazonLightsailClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonLightsailClient(string, string, AmazonLightsailConfig)

Constructs AmazonLightsailClient with AWS Access Key ID, AWS Secret Key and an AmazonLightsailClient Configuration object.

Public Method AmazonLightsailClient(string, string, string)

Constructs AmazonLightsailClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonLightsailClient(string, string, string, RegionEndpoint)

Constructs AmazonLightsailClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonLightsailClient(string, string, string, AmazonLightsailConfig)

Constructs AmazonLightsailClient with AWS Access Key ID, AWS Secret Key and an AmazonLightsailClient Configuration object.

Properties

NameTypeDescription
Public Property Config Amazon.Runtime.IClientConfig Inherited from Amazon.Runtime.AmazonServiceClient.

Methods

Note:

Asynchronous operations (methods ending with Async) in the table below are for .NET 4.5 or higher. For .NET 3.5 the SDK follows the standard naming convention of BeginMethodName and EndMethodName to indicate asynchronous operations - these method pairs are not shown in the table below.

NameDescription
Public Method AllocateStaticIp(AllocateStaticIpRequest)

Allocates a static IP address.

Public Method AllocateStaticIpAsync(AllocateStaticIpRequest, CancellationToken)

Initiates the asynchronous execution of the AllocateStaticIp operation.

Public Method AttachStaticIp(AttachStaticIpRequest)

Attaches a static IP address to a specific Amazon Lightsail instance.

Public Method AttachStaticIpAsync(AttachStaticIpRequest, CancellationToken)

Initiates the asynchronous execution of the AttachStaticIp operation.

Public Method CloseInstancePublicPorts(CloseInstancePublicPortsRequest)

Closes the public ports on a specific Amazon Lightsail instance.

Public Method CloseInstancePublicPortsAsync(CloseInstancePublicPortsRequest, CancellationToken)

Initiates the asynchronous execution of the CloseInstancePublicPorts operation.

Public Method CreateDomain(CreateDomainRequest)

Creates a domain resource for the specified domain (e.g., example.com).

Public Method CreateDomainAsync(CreateDomainRequest, CancellationToken)

Initiates the asynchronous execution of the CreateDomain operation.

Public Method CreateDomainEntry(CreateDomainEntryRequest)

Creates one of the following entry records associated with the domain: A record, CNAME record, TXT record, or MX record.

Public Method CreateDomainEntryAsync(CreateDomainEntryRequest, CancellationToken)

Initiates the asynchronous execution of the CreateDomainEntry operation.

Public Method CreateInstances(CreateInstancesRequest)

Creates one or more Amazon Lightsail virtual private servers, or instances.

Public Method CreateInstancesAsync(CreateInstancesRequest, CancellationToken)

Initiates the asynchronous execution of the CreateInstances operation.

Public Method CreateInstancesFromSnapshot(CreateInstancesFromSnapshotRequest)

Uses a specific snapshot as a blueprint for creating one or more new instances that are based on that identical configuration.

Public Method CreateInstancesFromSnapshotAsync(CreateInstancesFromSnapshotRequest, CancellationToken)

Initiates the asynchronous execution of the CreateInstancesFromSnapshot operation.

Public Method CreateInstanceSnapshot(CreateInstanceSnapshotRequest)

Creates a snapshot of a specific virtual private server, or instance. You can use a snapshot to create a new instance that is based on that snapshot.

Public Method CreateInstanceSnapshotAsync(CreateInstanceSnapshotRequest, CancellationToken)

Initiates the asynchronous execution of the CreateInstanceSnapshot operation.

Public Method CreateKeyPair(CreateKeyPairRequest)

Creates sn SSH key pair.

Public Method CreateKeyPairAsync(CreateKeyPairRequest, CancellationToken)

Initiates the asynchronous execution of the CreateKeyPair operation.

Public Method DeleteDomain(DeleteDomainRequest)

Deletes the specified domain recordset and all of its domain records.

Public Method DeleteDomainAsync(DeleteDomainRequest, CancellationToken)

Initiates the asynchronous execution of the DeleteDomain operation.

Public Method DeleteDomainEntry(DeleteDomainEntryRequest)

Deletes a specific domain entry.

Public Method DeleteDomainEntryAsync(DeleteDomainEntryRequest, CancellationToken)

Initiates the asynchronous execution of the DeleteDomainEntry operation.

Public Method DeleteInstance(DeleteInstanceRequest)

Deletes a specific Amazon Lightsail virtual private server, or instance.

Public Method DeleteInstanceAsync(DeleteInstanceRequest, CancellationToken)

Initiates the asynchronous execution of the DeleteInstance operation.

Public Method DeleteInstanceSnapshot(DeleteInstanceSnapshotRequest)

Deletes a specific snapshot of a virtual private server (or instance).

Public Method DeleteInstanceSnapshotAsync(DeleteInstanceSnapshotRequest, CancellationToken)

Initiates the asynchronous execution of the DeleteInstanceSnapshot operation.

Public Method DeleteKeyPair(DeleteKeyPairRequest)

Deletes a specific SSH key pair.

Public Method DeleteKeyPairAsync(DeleteKeyPairRequest, CancellationToken)

Initiates the asynchronous execution of the DeleteKeyPair operation.

Public Method DetachStaticIp(DetachStaticIpRequest)

Detaches a static IP from the Amazon Lightsail instance to which it is attached.

Public Method DetachStaticIpAsync(DetachStaticIpRequest, CancellationToken)

Initiates the asynchronous execution of the DetachStaticIp operation.

Public Method Dispose() Inherited from Amazon.Runtime.AmazonServiceClient.
Public Method DownloadDefaultKeyPair(DownloadDefaultKeyPairRequest)

Downloads the default SSH key pair from the user's account.

Public Method DownloadDefaultKeyPairAsync(DownloadDefaultKeyPairRequest, CancellationToken)

Initiates the asynchronous execution of the DownloadDefaultKeyPair operation.

Public Method GetActiveNames(GetActiveNamesRequest)

Returns the names of all active (not deleted) resources.

Public Method GetActiveNamesAsync(GetActiveNamesRequest, CancellationToken)

Initiates the asynchronous execution of the GetActiveNames operation.

Public Method GetBlueprints(GetBlueprintsRequest)

Returns the list of available instance images, or blueprints. You can use a blueprint to create a new virtual private server already running a specific operating system, as well as a preinstalled app or development stack. The software each instance is running depends on the blueprint image you choose.

Public Method GetBlueprintsAsync(GetBlueprintsRequest, CancellationToken)

Initiates the asynchronous execution of the GetBlueprints operation.

Public Method GetBundles(GetBundlesRequest)

Returns the list of bundles that are available for purchase. A bundle describes the specs for your virtual private server (or instance).

Public Method GetBundlesAsync(GetBundlesRequest, CancellationToken)

Initiates the asynchronous execution of the GetBundles operation.

Public Method GetDomain(GetDomainRequest)

Returns information about a specific domain recordset.

Public Method GetDomainAsync(GetDomainRequest, CancellationToken)

Initiates the asynchronous execution of the GetDomain operation.

Public Method GetDomains(GetDomainsRequest)

Returns a list of all domains in the user's account.

Public Method GetDomainsAsync(GetDomainsRequest, CancellationToken)

Initiates the asynchronous execution of the GetDomains operation.

Public Method GetInstance(GetInstanceRequest)

Returns information about a specific Amazon Lightsail instance, which is a virtual private server.

Public Method GetInstanceAccessDetails(GetInstanceAccessDetailsRequest)

Returns temporary SSH keys you can use to connect to a specific virtual private server, or instance.

Public Method GetInstanceAccessDetailsAsync(GetInstanceAccessDetailsRequest, CancellationToken)

Initiates the asynchronous execution of the GetInstanceAccessDetails operation.

Public Method GetInstanceAsync(GetInstanceRequest, CancellationToken)

Initiates the asynchronous execution of the GetInstance operation.

Public Method GetInstanceMetricData(GetInstanceMetricDataRequest)

Returns the data points for the specified Amazon Lightsail instance metric, given an instance name.

Public Method GetInstanceMetricDataAsync(GetInstanceMetricDataRequest, CancellationToken)

Initiates the asynchronous execution of the GetInstanceMetricData operation.

Public Method GetInstancePortStates(GetInstancePortStatesRequest)

Returns the port states for a specific virtual private server, or instance.

Public Method GetInstancePortStatesAsync(GetInstancePortStatesRequest, CancellationToken)

Initiates the asynchronous execution of the GetInstancePortStates operation.

Public Method GetInstances(GetInstancesRequest)

Returns information about all Amazon Lightsail virtual private servers, or instances.

Public Method GetInstancesAsync(GetInstancesRequest, CancellationToken)

Initiates the asynchronous execution of the GetInstances operation.

Public Method GetInstanceSnapshot(GetInstanceSnapshotRequest)

Returns information about a specific instance snapshot.

Public Method GetInstanceSnapshotAsync(GetInstanceSnapshotRequest, CancellationToken)

Initiates the asynchronous execution of the GetInstanceSnapshot operation.

Public Method GetInstanceSnapshots(GetInstanceSnapshotsRequest)

Returns all instance snapshots for the user's account.

Public Method GetInstanceSnapshotsAsync(GetInstanceSnapshotsRequest, CancellationToken)

Initiates the asynchronous execution of the GetInstanceSnapshots operation.

Public Method GetInstanceState(GetInstanceStateRequest)

Returns the state of a specific instance. Works on one instance at a time.

Public Method GetInstanceStateAsync(GetInstanceStateRequest, CancellationToken)

Initiates the asynchronous execution of the GetInstanceState operation.

Public Method GetKeyPair(GetKeyPairRequest)

Returns information about a specific key pair.

Public Method GetKeyPairAsync(GetKeyPairRequest, CancellationToken)

Initiates the asynchronous execution of the GetKeyPair operation.

Public Method GetKeyPairs(GetKeyPairsRequest)

Returns information about all key pairs in the user's account.

Public Method GetKeyPairsAsync(GetKeyPairsRequest, CancellationToken)

Initiates the asynchronous execution of the GetKeyPairs operation.

Public Method GetOperation(GetOperationRequest)

Returns information about a specific operation. Operations include events such as when you create an instance, allocate a static IP, attach a static IP, and so on.

Public Method GetOperationAsync(GetOperationRequest, CancellationToken)

Initiates the asynchronous execution of the GetOperation operation.

Public Method GetOperations(GetOperationsRequest)

Returns information about all operations.

Results are returned from oldest to newest, up to a maximum of 200. Results can be paged by making each subsequent call to GetOperations use the maximum (last) statusChangedAt value from the previous request.

Public Method GetOperationsAsync(GetOperationsRequest, CancellationToken)

Initiates the asynchronous execution of the GetOperations operation.

Public Method GetOperationsForResource(GetOperationsForResourceRequest)

Gets operations for a specific resource (e.g., an instance or a static IP).

Public Method GetOperationsForResourceAsync(GetOperationsForResourceRequest, CancellationToken)

Initiates the asynchronous execution of the GetOperationsForResource operation.

Public Method GetRegions(GetRegionsRequest)

Returns a list of all valid regions for Amazon Lightsail. Use the

include availability
            zones
parameter to also return the availability zones in a region.

Public Method GetRegionsAsync(GetRegionsRequest, CancellationToken)

Initiates the asynchronous execution of the GetRegions operation.

Public Method GetStaticIp(GetStaticIpRequest)

Returns information about a specific static IP.

Public Method GetStaticIpAsync(GetStaticIpRequest, CancellationToken)

Initiates the asynchronous execution of the GetStaticIp operation.

Public Method GetStaticIps(GetStaticIpsRequest)

Returns information about all static IPs in the user's account.

Public Method GetStaticIpsAsync(GetStaticIpsRequest, CancellationToken)

Initiates the asynchronous execution of the GetStaticIps operation.

Public Method ImportKeyPair(ImportKeyPairRequest)

Imports a public SSH key from a specific key pair.

Public Method ImportKeyPairAsync(ImportKeyPairRequest, CancellationToken)

Initiates the asynchronous execution of the ImportKeyPair operation.

Public Method IsVpcPeered(IsVpcPeeredRequest)

Returns a Boolean value indicating whether your Lightsail VPC is peered.

Public Method IsVpcPeeredAsync(IsVpcPeeredRequest, CancellationToken)

Initiates the asynchronous execution of the IsVpcPeered operation.

Public Method OpenInstancePublicPorts(OpenInstancePublicPortsRequest)

Adds public ports to an Amazon Lightsail instance.

Public Method OpenInstancePublicPortsAsync(OpenInstancePublicPortsRequest, CancellationToken)

Initiates the asynchronous execution of the OpenInstancePublicPorts operation.

Public Method PeerVpc(PeerVpcRequest)

Tries to peer the Lightsail VPC with the user's default VPC.

Public Method PeerVpcAsync(PeerVpcRequest, CancellationToken)

Initiates the asynchronous execution of the PeerVpc operation.

Public Method PutInstancePublicPorts(PutInstancePublicPortsRequest)

Sets the specified open ports for an Amazon Lightsail instance, and closes all ports for every protocol not included in the current request.

Public Method PutInstancePublicPortsAsync(PutInstancePublicPortsRequest, CancellationToken)

Initiates the asynchronous execution of the PutInstancePublicPorts operation.

Public Method RebootInstance(RebootInstanceRequest)

Restarts a specific instance. When your Amazon Lightsail instance is finished rebooting, Lightsail assigns a new public IP address. To use the same IP address after restarting, create a static IP address and attach it to the instance.

Public Method RebootInstanceAsync(RebootInstanceRequest, CancellationToken)

Initiates the asynchronous execution of the RebootInstance operation.

Public Method ReleaseStaticIp(ReleaseStaticIpRequest)

Deletes a specific static IP from your account.

Public Method ReleaseStaticIpAsync(ReleaseStaticIpRequest, CancellationToken)

Initiates the asynchronous execution of the ReleaseStaticIp operation.

Public Method StartInstance(StartInstanceRequest)

Starts a specific Amazon Lightsail instance from a stopped state. To restart an instance, use the reboot instance operation.

Public Method StartInstanceAsync(StartInstanceRequest, CancellationToken)

Initiates the asynchronous execution of the StartInstance operation.

Public Method StopInstance(StopInstanceRequest)

Stops a specific Amazon Lightsail instance that is currently running.

Public Method StopInstanceAsync(StopInstanceRequest, CancellationToken)

Initiates the asynchronous execution of the StopInstance operation.

Public Method UnpeerVpc(UnpeerVpcRequest)

Attempts to unpeer the Lightsail VPC from the user's default VPC.

Public Method UnpeerVpcAsync(UnpeerVpcRequest, CancellationToken)

Initiates the asynchronous execution of the UnpeerVpc operation.

Public Method UpdateDomainEntry(UpdateDomainEntryRequest)

Updates a domain recordset after it is created.

Public Method UpdateDomainEntryAsync(UpdateDomainEntryRequest, CancellationToken)

Initiates the asynchronous execution of the UpdateDomainEntry operation.

Events

NameDescription
Event AfterResponseEvent Inherited from Amazon.Runtime.AmazonServiceClient.
Event BeforeRequestEvent Inherited from Amazon.Runtime.AmazonServiceClient.
Event ExceptionEvent Inherited from Amazon.Runtime.AmazonServiceClient.

Version Information

.NET Standard:
Supported in: 1.3

.NET Framework:
Supported in: 4.5, 4.0, 3.5

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms