clients/client-pi/README.md
AWS SDK for JavaScript PI Client for Node.js, Browser and React Native.
<fullname>Amazon RDS Performance Insights</fullname>
<p>Amazon RDS Performance Insights enables you to monitor and explore different dimensions of database load based on data captured from a running DB instance. The guide provides detailed information about Performance Insights data types, parameters and errors.</p> <p>When Performance Insights is enabled, the Amazon RDS Performance Insights API provides visibility into the performance of your DB instance. Amazon CloudWatch provides the authoritative source for Amazon Web Services service-vended monitoring metrics. Performance Insights offers a domain-specific view of DB load.</p> <p>DB load is measured as average active sessions. Performance Insights provides the data to API consumers as a two-dimensional time-series dataset. The time dimension provides DB load data for each time point in the queried time range. Each time point decomposes overall load in relation to the requested dimensions, measured at that time point. Examples include SQL, Wait event, User, and Host.</p> <ul> <li> <p>To learn more about Performance Insights and Amazon Aurora DB instances, go to the <i> <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_PerfInsights.html"> Amazon Aurora User Guide</a> </i>. </p> </li> <li> <p>To learn more about Performance Insights and Amazon RDS DB instances, go to the <i> <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.html"> Amazon RDS User Guide</a> </i>. </p> </li> <li> <p>To learn more about Performance Insights and Amazon DocumentDB clusters, go to the <i> <a href="https://docs.aws.amazon.com/documentdb/latest/developerguide/performance-insights.html"> Amazon DocumentDB Developer Guide</a> </i>.</p> </li> </ul>To install this package, use the CLI of your favorite package manager:
npm install @aws-sdk/client-piyarn add @aws-sdk/client-pipnpm add @aws-sdk/client-piThe AWS SDK is modulized by clients and commands.
To send a request, you only need to import the PIClient and
the commands you need, for example ListTagsForResourceCommand:
// ES5 example
const { PIClient, ListTagsForResourceCommand } = require("@aws-sdk/client-pi");
// ES6+ example
import { PIClient, ListTagsForResourceCommand } from "@aws-sdk/client-pi";
To send a request:
send operation on the client, providing the command object as input.const client = new PIClient({ region: "REGION" });
const params = { /** input parameters */ };
const command = new ListTagsForResourceCommand(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.
PI extends PIClient 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 (PIClient).
More details are in the blog post on
modular packages in AWS SDK for JavaScript.
import { PI } from "@aws-sdk/client-pi";
const client = new PI({ region: "REGION" });
// async/await.
try {
const data = await client.listTagsForResource(params);
// process data.
} catch (error) {
// error handling.
}
// Promises.
client
.listTagsForResource(params)
.then((data) => {
// process data.
})
.catch((error) => {
// error handling.
});
// callbacks (not recommended).
client.listTagsForResource(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-pi 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> DeletePerformanceAnalysisReport </summary>Command API Reference / Input / Output
</details> <details> <summary> DescribeDimensionKeys </summary>Command API Reference / Input / Output
</details> <details> <summary> GetDimensionKeyDetails </summary>Command API Reference / Input / Output
</details> <details> <summary> GetPerformanceAnalysisReport </summary>Command API Reference / Input / Output
</details> <details> <summary> GetResourceMetadata </summary>Command API Reference / Input / Output
</details> <details> <summary> GetResourceMetrics </summary>Command API Reference / Input / Output
</details> <details> <summary> ListAvailableResourceDimensions </summary>Command API Reference / Input / Output
</details> <details> <summary> ListAvailableResourceMetrics </summary>Command API Reference / Input / Output
</details> <details> <summary> ListPerformanceAnalysisReports </summary>Command API Reference / Input / Output
</details> <details> <summary> ListTagsForResource </summary>Command API Reference / Input / Output
</details> <details> <summary> TagResource </summary> </details> <details> <summary> UntagResource </summary> </details>