Skip to content

Commit

Permalink
feat(client-pi): AWS Performance Insights for Amazon RDS is launching…
Browse files Browse the repository at this point in the history
… Performance Analysis On Demand, a new feature that allows you to analyze database performance metrics and find out the performance issues. You can now use SDK to create, list, get, delete, and manage tags of performance analysis reports.
  • Loading branch information
awstools committed Aug 15, 2023
1 parent acaaadf commit a85e9d6
Show file tree
Hide file tree
Showing 17 changed files with 4,271 additions and 388 deletions.
70 changes: 63 additions & 7 deletions clients/client-pi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ using your favorite package manager:

The 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 `DescribeDimensionKeysCommand`:
the commands you need, for example `CreatePerformanceAnalysisReportCommand`:

```js
// ES5 example
const { PIClient, DescribeDimensionKeysCommand } = require("@aws-sdk/client-pi");
const { PIClient, CreatePerformanceAnalysisReportCommand } = require("@aws-sdk/client-pi");
```

```ts
// ES6+ example
import { PIClient, DescribeDimensionKeysCommand } from "@aws-sdk/client-pi";
import { PIClient, CreatePerformanceAnalysisReportCommand } from "@aws-sdk/client-pi";
```

### Usage
Expand All @@ -76,7 +76,7 @@ const client = new PIClient({ region: "REGION" });
const params = {
/** input parameters */
};
const command = new DescribeDimensionKeysCommand(params);
const command = new CreatePerformanceAnalysisReportCommand(params);
```

#### Async/await
Expand Down Expand Up @@ -155,15 +155,15 @@ const client = new AWS.PI({ region: "REGION" });

// async/await.
try {
const data = await client.describeDimensionKeys(params);
const data = await client.createPerformanceAnalysisReport(params);
// process data.
} catch (error) {
// error handling.
}

// Promises.
client
.describeDimensionKeys(params)
.createPerformanceAnalysisReport(params)
.then((data) => {
// process data.
})
Expand All @@ -172,7 +172,7 @@ client
});

// callbacks.
client.describeDimensionKeys(params, (err, data) => {
client.createPerformanceAnalysisReport(params, (err, data) => {
// process err and data.
});
```
Expand Down Expand Up @@ -228,6 +228,22 @@ see LICENSE for more information.

## Client Commands (Operations List)

<details>
<summary>
CreatePerformanceAnalysisReport
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/classes/createperformanceanalysisreportcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/interfaces/createperformanceanalysisreportcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/interfaces/createperformanceanalysisreportcommandoutput.html)

</details>
<details>
<summary>
DeletePerformanceAnalysisReport
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/classes/deleteperformanceanalysisreportcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/interfaces/deleteperformanceanalysisreportcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/interfaces/deleteperformanceanalysisreportcommandoutput.html)

</details>
<details>
<summary>
DescribeDimensionKeys
Expand All @@ -243,6 +259,14 @@ GetDimensionKeyDetails

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/classes/getdimensionkeydetailscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/interfaces/getdimensionkeydetailscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/interfaces/getdimensionkeydetailscommandoutput.html)

</details>
<details>
<summary>
GetPerformanceAnalysisReport
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/classes/getperformanceanalysisreportcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/interfaces/getperformanceanalysisreportcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/interfaces/getperformanceanalysisreportcommandoutput.html)

</details>
<details>
<summary>
Expand Down Expand Up @@ -276,3 +300,35 @@ ListAvailableResourceMetrics
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/classes/listavailableresourcemetricscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/interfaces/listavailableresourcemetricscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/interfaces/listavailableresourcemetricscommandoutput.html)

</details>
<details>
<summary>
ListPerformanceAnalysisReports
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/classes/listperformanceanalysisreportscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/interfaces/listperformanceanalysisreportscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/interfaces/listperformanceanalysisreportscommandoutput.html)

</details>
<details>
<summary>
ListTagsForResource
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/classes/listtagsforresourcecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/interfaces/listtagsforresourcecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/interfaces/listtagsforresourcecommandoutput.html)

</details>
<details>
<summary>
TagResource
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/classes/tagresourcecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/interfaces/tagresourcecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/interfaces/tagresourcecommandoutput.html)

</details>
<details>
<summary>
UntagResource
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/classes/untagresourcecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/interfaces/untagresourcecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-pi/interfaces/untagresourcecommandoutput.html)

</details>
145 changes: 145 additions & 0 deletions clients/client-pi/src/PI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
import { createAggregatedClient } from "@smithy/smithy-client";
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";

import {
CreatePerformanceAnalysisReportCommand,
CreatePerformanceAnalysisReportCommandInput,
CreatePerformanceAnalysisReportCommandOutput,
} from "./commands/CreatePerformanceAnalysisReportCommand";
import {
DeletePerformanceAnalysisReportCommand,
DeletePerformanceAnalysisReportCommandInput,
DeletePerformanceAnalysisReportCommandOutput,
} from "./commands/DeletePerformanceAnalysisReportCommand";
import {
DescribeDimensionKeysCommand,
DescribeDimensionKeysCommandInput,
Expand All @@ -12,6 +22,11 @@ import {
GetDimensionKeyDetailsCommandInput,
GetDimensionKeyDetailsCommandOutput,
} from "./commands/GetDimensionKeyDetailsCommand";
import {
GetPerformanceAnalysisReportCommand,
GetPerformanceAnalysisReportCommandInput,
GetPerformanceAnalysisReportCommandOutput,
} from "./commands/GetPerformanceAnalysisReportCommand";
import {
GetResourceMetadataCommand,
GetResourceMetadataCommandInput,
Expand All @@ -32,18 +47,75 @@ import {
ListAvailableResourceMetricsCommandInput,
ListAvailableResourceMetricsCommandOutput,
} from "./commands/ListAvailableResourceMetricsCommand";
import {
ListPerformanceAnalysisReportsCommand,
ListPerformanceAnalysisReportsCommandInput,
ListPerformanceAnalysisReportsCommandOutput,
} from "./commands/ListPerformanceAnalysisReportsCommand";
import {
ListTagsForResourceCommand,
ListTagsForResourceCommandInput,
ListTagsForResourceCommandOutput,
} from "./commands/ListTagsForResourceCommand";
import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
import {
UntagResourceCommand,
UntagResourceCommandInput,
UntagResourceCommandOutput,
} from "./commands/UntagResourceCommand";
import { PIClient, PIClientConfig } from "./PIClient";

const commands = {
CreatePerformanceAnalysisReportCommand,
DeletePerformanceAnalysisReportCommand,
DescribeDimensionKeysCommand,
GetDimensionKeyDetailsCommand,
GetPerformanceAnalysisReportCommand,
GetResourceMetadataCommand,
GetResourceMetricsCommand,
ListAvailableResourceDimensionsCommand,
ListAvailableResourceMetricsCommand,
ListPerformanceAnalysisReportsCommand,
ListTagsForResourceCommand,
TagResourceCommand,
UntagResourceCommand,
};

export interface PI {
/**
* @see {@link CreatePerformanceAnalysisReportCommand}
*/
createPerformanceAnalysisReport(
args: CreatePerformanceAnalysisReportCommandInput,
options?: __HttpHandlerOptions
): Promise<CreatePerformanceAnalysisReportCommandOutput>;
createPerformanceAnalysisReport(
args: CreatePerformanceAnalysisReportCommandInput,
cb: (err: any, data?: CreatePerformanceAnalysisReportCommandOutput) => void
): void;
createPerformanceAnalysisReport(
args: CreatePerformanceAnalysisReportCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: CreatePerformanceAnalysisReportCommandOutput) => void
): void;

/**
* @see {@link DeletePerformanceAnalysisReportCommand}
*/
deletePerformanceAnalysisReport(
args: DeletePerformanceAnalysisReportCommandInput,
options?: __HttpHandlerOptions
): Promise<DeletePerformanceAnalysisReportCommandOutput>;
deletePerformanceAnalysisReport(
args: DeletePerformanceAnalysisReportCommandInput,
cb: (err: any, data?: DeletePerformanceAnalysisReportCommandOutput) => void
): void;
deletePerformanceAnalysisReport(
args: DeletePerformanceAnalysisReportCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DeletePerformanceAnalysisReportCommandOutput) => void
): void;

/**
* @see {@link DescribeDimensionKeysCommand}
*/
Expand Down Expand Up @@ -78,6 +150,23 @@ export interface PI {
cb: (err: any, data?: GetDimensionKeyDetailsCommandOutput) => void
): void;

/**
* @see {@link GetPerformanceAnalysisReportCommand}
*/
getPerformanceAnalysisReport(
args: GetPerformanceAnalysisReportCommandInput,
options?: __HttpHandlerOptions
): Promise<GetPerformanceAnalysisReportCommandOutput>;
getPerformanceAnalysisReport(
args: GetPerformanceAnalysisReportCommandInput,
cb: (err: any, data?: GetPerformanceAnalysisReportCommandOutput) => void
): void;
getPerformanceAnalysisReport(
args: GetPerformanceAnalysisReportCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetPerformanceAnalysisReportCommandOutput) => void
): void;

/**
* @see {@link GetResourceMetadataCommand}
*/
Expand Down Expand Up @@ -145,6 +234,62 @@ export interface PI {
options: __HttpHandlerOptions,
cb: (err: any, data?: ListAvailableResourceMetricsCommandOutput) => void
): void;

/**
* @see {@link ListPerformanceAnalysisReportsCommand}
*/
listPerformanceAnalysisReports(
args: ListPerformanceAnalysisReportsCommandInput,
options?: __HttpHandlerOptions
): Promise<ListPerformanceAnalysisReportsCommandOutput>;
listPerformanceAnalysisReports(
args: ListPerformanceAnalysisReportsCommandInput,
cb: (err: any, data?: ListPerformanceAnalysisReportsCommandOutput) => void
): void;
listPerformanceAnalysisReports(
args: ListPerformanceAnalysisReportsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListPerformanceAnalysisReportsCommandOutput) => void
): void;

/**
* @see {@link ListTagsForResourceCommand}
*/
listTagsForResource(
args: ListTagsForResourceCommandInput,
options?: __HttpHandlerOptions
): Promise<ListTagsForResourceCommandOutput>;
listTagsForResource(
args: ListTagsForResourceCommandInput,
cb: (err: any, data?: ListTagsForResourceCommandOutput) => void
): void;
listTagsForResource(
args: ListTagsForResourceCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListTagsForResourceCommandOutput) => void
): void;

/**
* @see {@link TagResourceCommand}
*/
tagResource(args: TagResourceCommandInput, options?: __HttpHandlerOptions): Promise<TagResourceCommandOutput>;
tagResource(args: TagResourceCommandInput, cb: (err: any, data?: TagResourceCommandOutput) => void): void;
tagResource(
args: TagResourceCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: TagResourceCommandOutput) => void
): void;

/**
* @see {@link UntagResourceCommand}
*/
untagResource(args: UntagResourceCommandInput, options?: __HttpHandlerOptions): Promise<UntagResourceCommandOutput>;
untagResource(args: UntagResourceCommandInput, cb: (err: any, data?: UntagResourceCommandOutput) => void): void;
untagResource(
args: UntagResourceCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: UntagResourceCommandOutput) => void
): void;
}

/**
Expand Down
Loading

0 comments on commit a85e9d6

Please sign in to comment.