Skip to content

Commit

Permalink
feat(client-amp): This release adds support for the Amazon Managed Se…
Browse files Browse the repository at this point in the history
…rvice for Prometheus collector, a fully managed, agentless Prometheus metrics scraping capability.
  • Loading branch information
awstools committed Nov 27, 2023
1 parent 842884c commit 09743d7
Show file tree
Hide file tree
Showing 17 changed files with 3,658 additions and 169 deletions.
54 changes: 47 additions & 7 deletions clients/client-amp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,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 `AmpClient` and
the commands you need, for example `ListWorkspacesCommand`:
the commands you need, for example `ListScrapersCommand`:

```js
// ES5 example
const { AmpClient, ListWorkspacesCommand } = require("@aws-sdk/client-amp");
const { AmpClient, ListScrapersCommand } = require("@aws-sdk/client-amp");
```

```ts
// ES6+ example
import { AmpClient, ListWorkspacesCommand } from "@aws-sdk/client-amp";
import { AmpClient, ListScrapersCommand } from "@aws-sdk/client-amp";
```

### Usage
Expand All @@ -51,7 +51,7 @@ const client = new AmpClient({ region: "REGION" });
const params = {
/** input parameters */
};
const command = new ListWorkspacesCommand(params);
const command = new ListScrapersCommand(params);
```

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

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

// Promises.
client
.listWorkspaces(params)
.listScrapers(params)
.then((data) => {
// process data.
})
Expand All @@ -147,7 +147,7 @@ client
});

// callbacks.
client.listWorkspaces(params, (err, data) => {
client.listScrapers(params, (err, data) => {
// process err and data.
});
```
Expand Down Expand Up @@ -226,6 +226,14 @@ CreateRuleGroupsNamespace

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/amp/command/CreateRuleGroupsNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/CreateRuleGroupsNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/CreateRuleGroupsNamespaceCommandOutput/)

</details>
<details>
<summary>
CreateScraper
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/amp/command/CreateScraperCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/CreateScraperCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/CreateScraperCommandOutput/)

</details>
<details>
<summary>
Expand Down Expand Up @@ -258,6 +266,14 @@ DeleteRuleGroupsNamespace

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/amp/command/DeleteRuleGroupsNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/DeleteRuleGroupsNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/DeleteRuleGroupsNamespaceCommandOutput/)

</details>
<details>
<summary>
DeleteScraper
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/amp/command/DeleteScraperCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/DeleteScraperCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/DeleteScraperCommandOutput/)

</details>
<details>
<summary>
Expand Down Expand Up @@ -290,6 +306,14 @@ DescribeRuleGroupsNamespace

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/amp/command/DescribeRuleGroupsNamespaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/DescribeRuleGroupsNamespaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/DescribeRuleGroupsNamespaceCommandOutput/)

</details>
<details>
<summary>
DescribeScraper
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/amp/command/DescribeScraperCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/DescribeScraperCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/DescribeScraperCommandOutput/)

</details>
<details>
<summary>
Expand All @@ -298,6 +322,14 @@ DescribeWorkspace

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/amp/command/DescribeWorkspaceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/DescribeWorkspaceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/DescribeWorkspaceCommandOutput/)

</details>
<details>
<summary>
GetDefaultScraperConfiguration
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/amp/command/GetDefaultScraperConfigurationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/GetDefaultScraperConfigurationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/GetDefaultScraperConfigurationCommandOutput/)

</details>
<details>
<summary>
Expand All @@ -306,6 +338,14 @@ ListRuleGroupsNamespaces

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/amp/command/ListRuleGroupsNamespacesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/ListRuleGroupsNamespacesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/ListRuleGroupsNamespacesCommandOutput/)

</details>
<details>
<summary>
ListScrapers
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/amp/command/ListScrapersCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/ListScrapersCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-amp/Interface/ListScrapersCommandOutput/)

</details>
<details>
<summary>
Expand Down
94 changes: 94 additions & 0 deletions clients/client-amp/src/Amp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ import {
CreateRuleGroupsNamespaceCommandInput,
CreateRuleGroupsNamespaceCommandOutput,
} from "./commands/CreateRuleGroupsNamespaceCommand";
import {
CreateScraperCommand,
CreateScraperCommandInput,
CreateScraperCommandOutput,
} from "./commands/CreateScraperCommand";
import {
CreateWorkspaceCommand,
CreateWorkspaceCommandInput,
Expand All @@ -38,6 +43,11 @@ import {
DeleteRuleGroupsNamespaceCommandInput,
DeleteRuleGroupsNamespaceCommandOutput,
} from "./commands/DeleteRuleGroupsNamespaceCommand";
import {
DeleteScraperCommand,
DeleteScraperCommandInput,
DeleteScraperCommandOutput,
} from "./commands/DeleteScraperCommand";
import {
DeleteWorkspaceCommand,
DeleteWorkspaceCommandInput,
Expand All @@ -58,16 +68,31 @@ import {
DescribeRuleGroupsNamespaceCommandInput,
DescribeRuleGroupsNamespaceCommandOutput,
} from "./commands/DescribeRuleGroupsNamespaceCommand";
import {
DescribeScraperCommand,
DescribeScraperCommandInput,
DescribeScraperCommandOutput,
} from "./commands/DescribeScraperCommand";
import {
DescribeWorkspaceCommand,
DescribeWorkspaceCommandInput,
DescribeWorkspaceCommandOutput,
} from "./commands/DescribeWorkspaceCommand";
import {
GetDefaultScraperConfigurationCommand,
GetDefaultScraperConfigurationCommandInput,
GetDefaultScraperConfigurationCommandOutput,
} from "./commands/GetDefaultScraperConfigurationCommand";
import {
ListRuleGroupsNamespacesCommand,
ListRuleGroupsNamespacesCommandInput,
ListRuleGroupsNamespacesCommandOutput,
} from "./commands/ListRuleGroupsNamespacesCommand";
import {
ListScrapersCommand,
ListScrapersCommandInput,
ListScrapersCommandOutput,
} from "./commands/ListScrapersCommand";
import {
ListTagsForResourceCommand,
ListTagsForResourceCommandInput,
Expand Down Expand Up @@ -109,16 +134,21 @@ const commands = {
CreateAlertManagerDefinitionCommand,
CreateLoggingConfigurationCommand,
CreateRuleGroupsNamespaceCommand,
CreateScraperCommand,
CreateWorkspaceCommand,
DeleteAlertManagerDefinitionCommand,
DeleteLoggingConfigurationCommand,
DeleteRuleGroupsNamespaceCommand,
DeleteScraperCommand,
DeleteWorkspaceCommand,
DescribeAlertManagerDefinitionCommand,
DescribeLoggingConfigurationCommand,
DescribeRuleGroupsNamespaceCommand,
DescribeScraperCommand,
DescribeWorkspaceCommand,
GetDefaultScraperConfigurationCommand,
ListRuleGroupsNamespacesCommand,
ListScrapersCommand,
ListTagsForResourceCommand,
ListWorkspacesCommand,
PutAlertManagerDefinitionCommand,
Expand Down Expand Up @@ -181,6 +211,17 @@ export interface Amp {
cb: (err: any, data?: CreateRuleGroupsNamespaceCommandOutput) => void
): void;

/**
* @see {@link CreateScraperCommand}
*/
createScraper(args: CreateScraperCommandInput, options?: __HttpHandlerOptions): Promise<CreateScraperCommandOutput>;
createScraper(args: CreateScraperCommandInput, cb: (err: any, data?: CreateScraperCommandOutput) => void): void;
createScraper(
args: CreateScraperCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: CreateScraperCommandOutput) => void
): void;

/**
* @see {@link CreateWorkspaceCommand}
*/
Expand Down Expand Up @@ -246,6 +287,17 @@ export interface Amp {
cb: (err: any, data?: DeleteRuleGroupsNamespaceCommandOutput) => void
): void;

/**
* @see {@link DeleteScraperCommand}
*/
deleteScraper(args: DeleteScraperCommandInput, options?: __HttpHandlerOptions): Promise<DeleteScraperCommandOutput>;
deleteScraper(args: DeleteScraperCommandInput, cb: (err: any, data?: DeleteScraperCommandOutput) => void): void;
deleteScraper(
args: DeleteScraperCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DeleteScraperCommandOutput) => void
): void;

/**
* @see {@link DeleteWorkspaceCommand}
*/
Expand Down Expand Up @@ -311,6 +363,20 @@ export interface Amp {
cb: (err: any, data?: DescribeRuleGroupsNamespaceCommandOutput) => void
): void;

/**
* @see {@link DescribeScraperCommand}
*/
describeScraper(
args: DescribeScraperCommandInput,
options?: __HttpHandlerOptions
): Promise<DescribeScraperCommandOutput>;
describeScraper(args: DescribeScraperCommandInput, cb: (err: any, data?: DescribeScraperCommandOutput) => void): void;
describeScraper(
args: DescribeScraperCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DescribeScraperCommandOutput) => void
): void;

/**
* @see {@link DescribeWorkspaceCommand}
*/
Expand All @@ -328,6 +394,23 @@ export interface Amp {
cb: (err: any, data?: DescribeWorkspaceCommandOutput) => void
): void;

/**
* @see {@link GetDefaultScraperConfigurationCommand}
*/
getDefaultScraperConfiguration(
args: GetDefaultScraperConfigurationCommandInput,
options?: __HttpHandlerOptions
): Promise<GetDefaultScraperConfigurationCommandOutput>;
getDefaultScraperConfiguration(
args: GetDefaultScraperConfigurationCommandInput,
cb: (err: any, data?: GetDefaultScraperConfigurationCommandOutput) => void
): void;
getDefaultScraperConfiguration(
args: GetDefaultScraperConfigurationCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetDefaultScraperConfigurationCommandOutput) => void
): void;

/**
* @see {@link ListRuleGroupsNamespacesCommand}
*/
Expand All @@ -345,6 +428,17 @@ export interface Amp {
cb: (err: any, data?: ListRuleGroupsNamespacesCommandOutput) => void
): void;

/**
* @see {@link ListScrapersCommand}
*/
listScrapers(args: ListScrapersCommandInput, options?: __HttpHandlerOptions): Promise<ListScrapersCommandOutput>;
listScrapers(args: ListScrapersCommandInput, cb: (err: any, data?: ListScrapersCommandOutput) => void): void;
listScrapers(
args: ListScrapersCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListScrapersCommandOutput) => void
): void;

/**
* @see {@link ListTagsForResourceCommand}
*/
Expand Down
18 changes: 18 additions & 0 deletions clients/client-amp/src/AmpClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ import {
CreateRuleGroupsNamespaceCommandInput,
CreateRuleGroupsNamespaceCommandOutput,
} from "./commands/CreateRuleGroupsNamespaceCommand";
import { CreateScraperCommandInput, CreateScraperCommandOutput } from "./commands/CreateScraperCommand";
import { CreateWorkspaceCommandInput, CreateWorkspaceCommandOutput } from "./commands/CreateWorkspaceCommand";
import {
DeleteAlertManagerDefinitionCommandInput,
Expand All @@ -75,6 +76,7 @@ import {
DeleteRuleGroupsNamespaceCommandInput,
DeleteRuleGroupsNamespaceCommandOutput,
} from "./commands/DeleteRuleGroupsNamespaceCommand";
import { DeleteScraperCommandInput, DeleteScraperCommandOutput } from "./commands/DeleteScraperCommand";
import { DeleteWorkspaceCommandInput, DeleteWorkspaceCommandOutput } from "./commands/DeleteWorkspaceCommand";
import {
DescribeAlertManagerDefinitionCommandInput,
Expand All @@ -88,11 +90,17 @@ import {
DescribeRuleGroupsNamespaceCommandInput,
DescribeRuleGroupsNamespaceCommandOutput,
} from "./commands/DescribeRuleGroupsNamespaceCommand";
import { DescribeScraperCommandInput, DescribeScraperCommandOutput } from "./commands/DescribeScraperCommand";
import { DescribeWorkspaceCommandInput, DescribeWorkspaceCommandOutput } from "./commands/DescribeWorkspaceCommand";
import {
GetDefaultScraperConfigurationCommandInput,
GetDefaultScraperConfigurationCommandOutput,
} from "./commands/GetDefaultScraperConfigurationCommand";
import {
ListRuleGroupsNamespacesCommandInput,
ListRuleGroupsNamespacesCommandOutput,
} from "./commands/ListRuleGroupsNamespacesCommand";
import { ListScrapersCommandInput, ListScrapersCommandOutput } from "./commands/ListScrapersCommand";
import {
ListTagsForResourceCommandInput,
ListTagsForResourceCommandOutput,
Expand Down Expand Up @@ -134,16 +142,21 @@ export type ServiceInputTypes =
| CreateAlertManagerDefinitionCommandInput
| CreateLoggingConfigurationCommandInput
| CreateRuleGroupsNamespaceCommandInput
| CreateScraperCommandInput
| CreateWorkspaceCommandInput
| DeleteAlertManagerDefinitionCommandInput
| DeleteLoggingConfigurationCommandInput
| DeleteRuleGroupsNamespaceCommandInput
| DeleteScraperCommandInput
| DeleteWorkspaceCommandInput
| DescribeAlertManagerDefinitionCommandInput
| DescribeLoggingConfigurationCommandInput
| DescribeRuleGroupsNamespaceCommandInput
| DescribeScraperCommandInput
| DescribeWorkspaceCommandInput
| GetDefaultScraperConfigurationCommandInput
| ListRuleGroupsNamespacesCommandInput
| ListScrapersCommandInput
| ListTagsForResourceCommandInput
| ListWorkspacesCommandInput
| PutAlertManagerDefinitionCommandInput
Expand All @@ -160,16 +173,21 @@ export type ServiceOutputTypes =
| CreateAlertManagerDefinitionCommandOutput
| CreateLoggingConfigurationCommandOutput
| CreateRuleGroupsNamespaceCommandOutput
| CreateScraperCommandOutput
| CreateWorkspaceCommandOutput
| DeleteAlertManagerDefinitionCommandOutput
| DeleteLoggingConfigurationCommandOutput
| DeleteRuleGroupsNamespaceCommandOutput
| DeleteScraperCommandOutput
| DeleteWorkspaceCommandOutput
| DescribeAlertManagerDefinitionCommandOutput
| DescribeLoggingConfigurationCommandOutput
| DescribeRuleGroupsNamespaceCommandOutput
| DescribeScraperCommandOutput
| DescribeWorkspaceCommandOutput
| GetDefaultScraperConfigurationCommandOutput
| ListRuleGroupsNamespacesCommandOutput
| ListScrapersCommandOutput
| ListTagsForResourceCommandOutput
| ListWorkspacesCommandOutput
| PutAlertManagerDefinitionCommandOutput
Expand Down
Loading

0 comments on commit 09743d7

Please sign in to comment.