clients/client-lightsail/README.md
AWS SDK for JavaScript Lightsail Client for Node.js, Browser and React Native.
<p>Amazon Lightsail is the easiest way to get started with Amazon Web Services (Amazon Web Services) for developers who need to build websites or web applications. It includes everything you need to launch your project quickly - instances (virtual private servers), container services, storage buckets, managed databases, SSD-based block storage, static IP addresses, load balancers, content delivery network (CDN) distributions, DNS management of registered domains, and resource snapshots (backups) - for a low, predictable monthly price.</p> <p>You can manage your Lightsail resources using the Lightsail console, Lightsail API, Command Line Interface (CLI), or SDKs. For more information about Lightsail concepts and tasks, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/lightsail-how-to-set-up-and-configure-aws-cli">Amazon Lightsail Developer Guide</a>.</p> <p>This API Reference provides detailed information about the actions, data types, parameters, and errors of the Lightsail service. For more information about the supported Amazon Web Services Regions, endpoints, and service quotas of the Lightsail service, see <a href="https://docs.aws.amazon.com/general/latest/gr/lightsail.html">Amazon Lightsail Endpoints and Quotas</a> in the <i>Amazon Web Services General Reference</i>.</p>To install this package, use the CLI of your favorite package manager:
npm install @aws-sdk/client-lightsailyarn add @aws-sdk/client-lightsailpnpm add @aws-sdk/client-lightsailThe AWS SDK is modulized by clients and commands.
To send a request, you only need to import the LightsailClient and
the commands you need, for example GetAlarmsCommand:
// ES5 example
const { LightsailClient, GetAlarmsCommand } = require("@aws-sdk/client-lightsail");
// ES6+ example
import { LightsailClient, GetAlarmsCommand } from "@aws-sdk/client-lightsail";
To send a request:
send operation on the client, providing the command object as input.const client = new LightsailClient({ region: "REGION" });
const params = { /** input parameters */ };
const command = new GetAlarmsCommand(params);
We recommend using the await operator to wait for the promise returned by send operation as follows:
// async/await.
try {
const data = await client.send(command);
// process data.
} catch (error) {
// error handling.
} finally {
// finally.
}
You can also use Promise chaining.
client
.send(command)
.then((data) => {
// process data.
})
.catch((error) => {
// error handling.
})
.finally(() => {
// finally.
});
The aggregated client class is exported from the same package, but without the "Client" suffix.
Lightsail extends LightsailClient and additionally supports all operations, waiters, and paginators as methods.
This style may be familiar to you from the AWS SDK for JavaScript v2.
If you are bundling the AWS SDK, we recommend using only the bare-bones client (LightsailClient).
More details are in the blog post on
modular packages in AWS SDK for JavaScript.
import { Lightsail } from "@aws-sdk/client-lightsail";
const client = new Lightsail({ region: "REGION" });
// async/await.
try {
const data = await client.getAlarms(params);
// process data.
} catch (error) {
// error handling.
}
// Promises.
client
.getAlarms(params)
.then((data) => {
// process data.
})
.catch((error) => {
// error handling.
});
// callbacks (not recommended).
client.getAlarms(params, (err, data) => {
// process err and data.
});
When the service returns an exception, the error will include the exception information, as well as response metadata (e.g. request id).
try {
const data = await client.send(command);
// process data.
} catch (error) {
const { requestId, cfId, extendedRequestId } = error.$metadata;
console.log({ requestId, cfId, extendedRequestId });
/**
* The keys within exceptions are also parsed.
* You can access them by specifying exception names:
* if (error.name === 'SomeServiceException') {
* const value = error.specialKeyInException;
* }
*/
}
See also docs/ERROR_HANDLING.
Please use these community resources for getting help. We use GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.
aws-sdk-js
on AWS Developer Blog.aws-sdk-js.To test your universal JavaScript code in Node.js, browser and react-native environments, visit our code samples repo.
This client code is generated automatically. Any modifications will be overwritten the next time the @aws-sdk/client-lightsail package is updated.
To contribute to client you can check our generate clients scripts.
This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.
Command API Reference / Input / Output
</details> <details> <summary> AttachCertificateToDistribution </summary>Command API Reference / Input / Output
</details> <details> <summary> AttachDisk </summary>Command API Reference / Input / Output
</details> <details> <summary> AttachInstancesToLoadBalancer </summary>Command API Reference / Input / Output
</details> <details> <summary> AttachLoadBalancerTlsCertificate </summary>Command API Reference / Input / Output
</details> <details> <summary> AttachStaticIp </summary>Command API Reference / Input / Output
</details> <details> <summary> CloseInstancePublicPorts </summary>Command API Reference / Input / Output
</details> <details> <summary> CopySnapshot </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateBucket </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateBucketAccessKey </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateCertificate </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateCloudFormationStack </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateContactMethod </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateContainerService </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateContainerServiceDeployment </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateContainerServiceRegistryLogin </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateDisk </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateDiskFromSnapshot </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateDiskSnapshot </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateDistribution </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateDomain </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateDomainEntry </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateGUISessionAccessDetails </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateInstances </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateInstancesFromSnapshot </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateInstanceSnapshot </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateKeyPair </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateLoadBalancer </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateLoadBalancerTlsCertificate </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateRelationalDatabase </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateRelationalDatabaseFromSnapshot </summary>Command API Reference / Input / Output
</details> <details> <summary> CreateRelationalDatabaseSnapshot </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteAlarm </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteAutoSnapshot </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteBucket </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteBucketAccessKey </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteCertificate </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteContactMethod </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteContainerImage </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteContainerService </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteDisk </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteDiskSnapshot </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteDistribution </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteDomain </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteDomainEntry </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteInstance </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteInstanceSnapshot </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteKeyPair </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteKnownHostKeys </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteLoadBalancer </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteLoadBalancerTlsCertificate </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteRelationalDatabase </summary>Command API Reference / Input / Output
</details> <details> <summary> DeleteRelationalDatabaseSnapshot </summary>Command API Reference / Input / Output
</details> <details> <summary> DetachCertificateFromDistribution </summary>Command API Reference / Input / Output
</details> <details> <summary> DetachDisk </summary>Command API Reference / Input / Output
</details> <details> <summary> DetachInstancesFromLoadBalancer </summary>Command API Reference / Input / Output
</details> <details> <summary> DetachStaticIp </summary>Command API Reference / Input / Output
</details> <details> <summary> DisableAddOn </summary>Command API Reference / Input / Output
</details> <details> <summary> DownloadDefaultKeyPair </summary>Command API Reference / Input / Output
</details> <details> <summary> EnableAddOn </summary>Command API Reference / Input / Output
</details> <details> <summary> ExportSnapshot </summary>Command API Reference / Input / Output
</details> <details> <summary> GetActiveNames </summary>Command API Reference / Input / Output
</details> <details> <summary> GetAlarms </summary>Command API Reference / Input / Output
</details> <details> <summary> GetAutoSnapshots </summary>Command API Reference / Input / Output
</details> <details> <summary> GetBlueprints </summary>Command API Reference / Input / Output
</details> <details> <summary> GetBucketAccessKeys </summary>Command API Reference / Input / Output
</details> <details> <summary> GetBucketBundles </summary>Command API Reference / Input / Output
</details> <details> <summary> GetBucketMetricData </summary>Command API Reference / Input / Output
</details> <details> <summary> GetBuckets </summary>Command API Reference / Input / Output
</details> <details> <summary> GetBundles </summary>Command API Reference / Input / Output
</details> <details> <summary> GetCertificates </summary>Command API Reference / Input / Output
</details> <details> <summary> GetCloudFormationStackRecords </summary>Command API Reference / Input / Output
</details> <details> <summary> GetContactMethods </summary>Command API Reference / Input / Output
</details> <details> <summary> GetContainerAPIMetadata </summary>Command API Reference / Input / Output
</details> <details> <summary> GetContainerImages </summary>Command API Reference / Input / Output
</details> <details> <summary> GetContainerLog </summary>Command API Reference / Input / Output
</details> <details> <summary> GetContainerServiceDeployments </summary>Command API Reference / Input / Output
</details> <details> <summary> GetContainerServiceMetricData </summary>Command API Reference / Input / Output
</details> <details> <summary> GetContainerServicePowers </summary>Command API Reference / Input / Output
</details> <details> <summary> GetContainerServices </summary>Command API Reference / Input / Output
</details> <details> <summary> GetCostEstimate </summary>Command API Reference / Input / Output
</details> <details> <summary> GetDisk </summary>Command API Reference / Input / Output
</details> <details> <summary> GetDisks </summary>Command API Reference / Input / Output
</details> <details> <summary> GetDiskSnapshot </summary>Command API Reference / Input / Output
</details> <details> <summary> GetDiskSnapshots </summary>Command API Reference / Input / Output
</details> <details> <summary> GetDistributionBundles </summary>Command API Reference / Input / Output
</details> <details> <summary> GetDistributionLatestCacheReset </summary>Command API Reference / Input / Output
</details> <details> <summary> GetDistributionMetricData </summary>Command API Reference / Input / Output
</details> <details> <summary> GetDistributions </summary>Command API Reference / Input / Output
</details> <details> <summary> GetDomain </summary>Command API Reference / Input / Output
</details> <details> <summary> GetDomains </summary>Command API Reference / Input / Output
</details> <details> <summary> GetExportSnapshotRecords </summary>Command API Reference / Input / Output
</details> <details> <summary> GetInstance </summary>Command API Reference / Input / Output
</details> <details> <summary> GetInstanceAccessDetails </summary>Command API Reference / Input / Output
</details> <details> <summary> GetInstanceMetricData </summary>Command API Reference / Input / Output
</details> <details> <summary> GetInstancePortStates </summary>Command API Reference / Input / Output
</details> <details> <summary> GetInstances </summary>Command API Reference / Input / Output
</details> <details> <summary> GetInstanceSnapshot </summary>Command API Reference / Input / Output
</details> <details> <summary> GetInstanceSnapshots </summary>Command API Reference / Input / Output
</details> <details> <summary> GetInstanceState </summary>Command API Reference / Input / Output
</details> <details> <summary> GetKeyPair </summary>Command API Reference / Input / Output
</details> <details> <summary> GetKeyPairs </summary>Command API Reference / Input / Output
</details> <details> <summary> GetLoadBalancer </summary>Command API Reference / Input / Output
</details> <details> <summary> GetLoadBalancerMetricData </summary>Command API Reference / Input / Output
</details> <details> <summary> GetLoadBalancers </summary>Command API Reference / Input / Output
</details> <details> <summary> GetLoadBalancerTlsCertificates </summary>Command API Reference / Input / Output
</details> <details> <summary> GetLoadBalancerTlsPolicies </summary>Command API Reference / Input / Output
</details> <details> <summary> GetOperation </summary>Command API Reference / Input / Output
</details> <details> <summary> GetOperations </summary>Command API Reference / Input / Output
</details> <details> <summary> GetOperationsForResource </summary>Command API Reference / Input / Output
</details> <details> <summary> GetRegions </summary>Command API Reference / Input / Output
</details> <details> <summary> GetRelationalDatabase </summary>Command API Reference / Input / Output
</details> <details> <summary> GetRelationalDatabaseBlueprints </summary>Command API Reference / Input / Output
</details> <details> <summary> GetRelationalDatabaseBundles </summary>Command API Reference / Input / Output
</details> <details> <summary> GetRelationalDatabaseEvents </summary>Command API Reference / Input / Output
</details> <details> <summary> GetRelationalDatabaseLogEvents </summary>Command API Reference / Input / Output
</details> <details> <summary> GetRelationalDatabaseLogStreams </summary>Command API Reference / Input / Output
</details> <details> <summary> GetRelationalDatabaseMasterUserPassword </summary>Command API Reference / Input / Output
</details> <details> <summary> GetRelationalDatabaseMetricData </summary>Command API Reference / Input / Output
</details> <details> <summary> GetRelationalDatabaseParameters </summary>Command API Reference / Input / Output
</details> <details> <summary> GetRelationalDatabases </summary>Command API Reference / Input / Output
</details> <details> <summary> GetRelationalDatabaseSnapshot </summary>Command API Reference / Input / Output
</details> <details> <summary> GetRelationalDatabaseSnapshots </summary>Command API Reference / Input / Output
</details> <details> <summary> GetSetupHistory </summary>Command API Reference / Input / Output
</details> <details> <summary> GetStaticIp </summary>Command API Reference / Input / Output
</details> <details> <summary> GetStaticIps </summary>Command API Reference / Input / Output
</details> <details> <summary> ImportKeyPair </summary>Command API Reference / Input / Output
</details> <details> <summary> IsVpcPeered </summary>Command API Reference / Input / Output
</details> <details> <summary> OpenInstancePublicPorts </summary>Command API Reference / Input / Output
</details> <details> <summary> PeerVpc </summary>Command API Reference / Input / Output
</details> <details> <summary> PutAlarm </summary>Command API Reference / Input / Output
</details> <details> <summary> PutInstancePublicPorts </summary>Command API Reference / Input / Output
</details> <details> <summary> RebootInstance </summary>Command API Reference / Input / Output
</details> <details> <summary> RebootRelationalDatabase </summary>Command API Reference / Input / Output
</details> <details> <summary> RegisterContainerImage </summary>Command API Reference / Input / Output
</details> <details> <summary> ReleaseStaticIp </summary>Command API Reference / Input / Output
</details> <details> <summary> ResetDistributionCache </summary>Command API Reference / Input / Output
</details> <details> <summary> SendContactMethodVerification </summary>Command API Reference / Input / Output
</details> <details> <summary> SetIpAddressType </summary>Command API Reference / Input / Output
</details> <details> <summary> SetResourceAccessForBucket </summary>Command API Reference / Input / Output
</details> <details> <summary> SetupInstanceHttps </summary>Command API Reference / Input / Output
</details> <details> <summary> StartGUISession </summary>Command API Reference / Input / Output
</details> <details> <summary> StartInstance </summary>Command API Reference / Input / Output
</details> <details> <summary> StartRelationalDatabase </summary>Command API Reference / Input / Output
</details> <details> <summary> StopGUISession </summary>Command API Reference / Input / Output
</details> <details> <summary> StopInstance </summary>Command API Reference / Input / Output
</details> <details> <summary> StopRelationalDatabase </summary>Command API Reference / Input / Output
</details> <details> <summary> TagResource </summary>Command API Reference / Input / Output
</details> <details> <summary> TestAlarm </summary>Command API Reference / Input / Output
</details> <details> <summary> UnpeerVpc </summary>Command API Reference / Input / Output
</details> <details> <summary> UntagResource </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateBucket </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateBucketBundle </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateContainerService </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateDistribution </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateDistributionBundle </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateDomainEntry </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateInstanceMetadataOptions </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateLoadBalancerAttribute </summary>Command API Reference / Input / Output
</details> <details> <summary> UpdateRelationalDatabase </summary> </details> <details> <summary> UpdateRelationalDatabaseParameters </summary> </details>