@aws-sdk/client-redshift
Description
AWS SDK for JavaScript Redshift Client for Node.js, Browser and React Native.
Amazon Redshift
Overview
This is an interface reference for Amazon Redshift. It contains documentation for one of the programming or command line interfaces you can use to manage Amazon Redshift clusters. Note that Amazon Redshift is asynchronous, which means that some interfaces may require techniques, such as polling or asynchronous callback handlers, to determine when a command has been applied. In this reference, the parameter descriptions indicate whether a change is applied immediately, on the next instance reboot, or during the next maintenance window. For a summary of the Amazon Redshift cluster management interfaces, go to Using the Amazon Redshift Management Interfaces.
Amazon Redshift manages all the work of setting up, operating, and scaling a data warehouse: provisioning capacity, monitoring and backing up the cluster, and applying patches and upgrades to the Amazon Redshift engine. You can focus on using your data to acquire new insights for your business and customers.
If you are a first-time user of Amazon Redshift, we recommend that you begin by reading the Amazon Redshift Getting Started Guide.
If you are a database developer, the Amazon Redshift Database Developer Guide explains how to design, build, query, and maintain the databases that make up your data warehouse.
Installing
To install this package, use the CLI of your favorite package manager:
npm install @aws-sdk/client-redshiftyarn add @aws-sdk/client-redshiftpnpm add @aws-sdk/client-redshift
Getting Started
Import
The AWS SDK is modulized by clients and commands.
To send a request, you only need to import the RedshiftClient and
the commands you need, for example ListRecommendationsCommand:
// ES5 example
const { RedshiftClient, ListRecommendationsCommand } = require("@aws-sdk/client-redshift");
// ES6+ example
import { RedshiftClient, ListRecommendationsCommand } from "@aws-sdk/client-redshift";
Usage
To send a request:
- Instantiate a client with configuration (e.g. credentials, region).
- See docs/CLIENTS for configuration details.
- See @aws-sdk/config for additional options.
- Instantiate a command with input parameters.
- Call the
sendoperation on the client, providing the command object as input.
const client = new RedshiftClient({ region: "REGION" });
const params = { /** input parameters */ };
const command = new ListRecommendationsCommand(params);
Async/await
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.
}
Promises
You can also use Promise chaining.
client
.send(command)
.then((data) => {
// process data.
})
.catch((error) => {
// error handling.
})
.finally(() => {
// finally.
});
Aggregated client
The aggregated client class is exported from the same package, but without the "Client" suffix.
Redshift extends RedshiftClient 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 (RedshiftClient).
More details are in the blog post on
modular packages in AWS SDK for JavaScript.
import { Redshift } from "@aws-sdk/client-redshift";
const client = new Redshift({ region: "REGION" });
// async/await.
try {
const data = await client.listRecommendations(params);
// process data.
} catch (error) {
// error handling.
}
// Promises.
client
.listRecommendations(params)
.then((data) => {
// process data.
})
.catch((error) => {
// error handling.
});
// callbacks (not recommended).
client.listRecommendations(params, (err, data) => {
// process err and data.
});
Troubleshooting
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.
Getting Help
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.
- Visit the Developer Guide or API Reference.
- Check out the blog posts tagged with
aws-sdk-json AWS Developer Blog. - Ask a question on StackOverflow and tag it with
aws-sdk-js. - Join the AWS JavaScript community on gitter.
- If it turns out that you may have found a bug, please open an issue.
To test your universal JavaScript code in Node.js, browser and react-native environments, visit our code samples repo.
Contributing
This client code is generated automatically. Any modifications will be overwritten the next time the @aws-sdk/client-redshift package is updated.
To contribute to client you can check our generate clients scripts.
License
This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.
Client Commands (Operations List)
AcceptReservedNodeExchange
AddPartner
AssociateDataShareConsumer
AuthorizeClusterSecurityGroupIngress
AuthorizeDataShare
AuthorizeEndpointAccess
AuthorizeSnapshotAccess
BatchDeleteClusterSnapshots
BatchModifyClusterSnapshots
CancelResize
CopyClusterSnapshot
CreateAuthenticationProfile
CreateCluster
CreateClusterParameterGroup
CreateClusterSecurityGroup
CreateClusterSnapshot
CreateClusterSubnetGroup
CreateCustomDomainAssociation
CreateEndpointAccess
CreateEventSubscription
CreateHsmClientCertificate
CreateHsmConfiguration
CreateIntegration
CreateQev2IdcApplication
CreateRedshiftIdcApplication
CreateScheduledAction
CreateSnapshotCopyGrant
CreateSnapshotSchedule
CreateTags
CreateUsageLimit
DeauthorizeDataShare
DeleteAuthenticationProfile
DeleteCluster
DeleteClusterParameterGroup
DeleteClusterSecurityGroup
DeleteClusterSnapshot
DeleteClusterSubnetGroup
DeleteCustomDomainAssociation
DeleteEndpointAccess
DeleteEventSubscription
DeleteHsmClientCertificate
DeleteHsmConfiguration
DeleteIntegration
DeletePartner
DeleteQev2IdcApplication
DeleteRedshiftIdcApplication
DeleteResourcePolicy
DeleteScheduledAction
DeleteSnapshotCopyGrant
DeleteSnapshotSchedule
DeleteTags
DeleteUsageLimit
DeregisterNamespace
DescribeAccountAttributes
DescribeAuthenticationProfiles
DescribeClusterDbRevisions
DescribeClusterParameterGroups
DescribeClusterParameters
DescribeClusters
DescribeClusterSecurityGroups
DescribeClusterSnapshots
DescribeClusterSubnetGroups
DescribeClusterTracks
DescribeClusterVersions
DescribeCustomDomainAssociations
DescribeDataShares
DescribeDataSharesForConsumer
DescribeDataSharesForProducer
DescribeDefaultClusterParameters
DescribeEndpointAccess
DescribeEndpointAuthorization
DescribeEventCategories
DescribeEvents
DescribeEventSubscriptions
DescribeHsmClientCertificates
DescribeHsmConfigurations
DescribeInboundIntegrations
DescribeIntegrations
DescribeLoggingStatus
DescribeNodeConfigurationOptions
DescribeOrderableClusterOptions
DescribePartners
DescribeQev2IdcApplications
DescribeRedshiftIdcApplications
DescribeReservedNodeExchangeStatus
DescribeReservedNodeOfferings
DescribeReservedNodes
DescribeResize
DescribeScheduledActions
DescribeSnapshotCopyGrants
DescribeSnapshotSchedules
DescribeStorage
DescribeTableRestoreStatus
DescribeTags
DescribeUsageLimits
DisableLogging
DisableSnapshotCopy
DisassociateDataShareConsumer
EnableLogging
EnableSnapshotCopy
FailoverPrimaryCompute
GetClusterCredentials
GetClusterCredentialsWithIAM
GetIdentityCenterAuthToken
GetReservedNodeExchangeConfigurationOptions
GetReservedNodeExchangeOfferings
GetResourcePolicy
ListRecommendations
ModifyAquaConfiguration
ModifyAuthenticationProfile
ModifyCluster
ModifyClusterDbRevision
ModifyClusterIamRoles
ModifyClusterMaintenance
ModifyClusterParameterGroup
ModifyClusterSnapshot
ModifyClusterSnapshotSchedule
ModifyClusterSubnetGroup
Command API Reference / [Input](https://docs.aws.amazon.com/AWSJavaScriptS