Skip to content

Commit

Permalink
feat(client-grafana): This release adds new ServiceAccount and Servic…
Browse files Browse the repository at this point in the history
…eAccountToken APIs.
  • Loading branch information
awstools committed May 15, 2024
1 parent ef2c2a5 commit 6c98871
Show file tree
Hide file tree
Showing 20 changed files with 2,621 additions and 37 deletions.
48 changes: 48 additions & 0 deletions clients/client-grafana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,22 @@ CreateWorkspaceApiKey

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/grafana/command/CreateWorkspaceApiKeyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-grafana/Interface/CreateWorkspaceApiKeyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-grafana/Interface/CreateWorkspaceApiKeyCommandOutput/)

</details>
<details>
<summary>
CreateWorkspaceServiceAccount
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/grafana/command/CreateWorkspaceServiceAccountCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-grafana/Interface/CreateWorkspaceServiceAccountCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-grafana/Interface/CreateWorkspaceServiceAccountCommandOutput/)

</details>
<details>
<summary>
CreateWorkspaceServiceAccountToken
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/grafana/command/CreateWorkspaceServiceAccountTokenCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-grafana/Interface/CreateWorkspaceServiceAccountTokenCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-grafana/Interface/CreateWorkspaceServiceAccountTokenCommandOutput/)

</details>
<details>
<summary>
Expand All @@ -250,6 +266,22 @@ DeleteWorkspaceApiKey

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/grafana/command/DeleteWorkspaceApiKeyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-grafana/Interface/DeleteWorkspaceApiKeyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-grafana/Interface/DeleteWorkspaceApiKeyCommandOutput/)

</details>
<details>
<summary>
DeleteWorkspaceServiceAccount
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/grafana/command/DeleteWorkspaceServiceAccountCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-grafana/Interface/DeleteWorkspaceServiceAccountCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-grafana/Interface/DeleteWorkspaceServiceAccountCommandOutput/)

</details>
<details>
<summary>
DeleteWorkspaceServiceAccountToken
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/grafana/command/DeleteWorkspaceServiceAccountTokenCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-grafana/Interface/DeleteWorkspaceServiceAccountTokenCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-grafana/Interface/DeleteWorkspaceServiceAccountTokenCommandOutput/)

</details>
<details>
<summary>
Expand Down Expand Up @@ -314,6 +346,22 @@ ListWorkspaces

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/grafana/command/ListWorkspacesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-grafana/Interface/ListWorkspacesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-grafana/Interface/ListWorkspacesCommandOutput/)

</details>
<details>
<summary>
ListWorkspaceServiceAccounts
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/grafana/command/ListWorkspaceServiceAccountsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-grafana/Interface/ListWorkspaceServiceAccountsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-grafana/Interface/ListWorkspaceServiceAccountsCommandOutput/)

</details>
<details>
<summary>
ListWorkspaceServiceAccountTokens
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/grafana/command/ListWorkspaceServiceAccountTokensCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-grafana/Interface/ListWorkspaceServiceAccountTokensCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-grafana/Interface/ListWorkspaceServiceAccountTokensCommandOutput/)

</details>
<details>
<summary>
Expand Down
138 changes: 138 additions & 0 deletions clients/client-grafana/src/Grafana.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ import {
CreateWorkspaceCommandInput,
CreateWorkspaceCommandOutput,
} from "./commands/CreateWorkspaceCommand";
import {
CreateWorkspaceServiceAccountCommand,
CreateWorkspaceServiceAccountCommandInput,
CreateWorkspaceServiceAccountCommandOutput,
} from "./commands/CreateWorkspaceServiceAccountCommand";
import {
CreateWorkspaceServiceAccountTokenCommand,
CreateWorkspaceServiceAccountTokenCommandInput,
CreateWorkspaceServiceAccountTokenCommandOutput,
} from "./commands/CreateWorkspaceServiceAccountTokenCommand";
import {
DeleteWorkspaceApiKeyCommand,
DeleteWorkspaceApiKeyCommandInput,
Expand All @@ -27,6 +37,16 @@ import {
DeleteWorkspaceCommandInput,
DeleteWorkspaceCommandOutput,
} from "./commands/DeleteWorkspaceCommand";
import {
DeleteWorkspaceServiceAccountCommand,
DeleteWorkspaceServiceAccountCommandInput,
DeleteWorkspaceServiceAccountCommandOutput,
} from "./commands/DeleteWorkspaceServiceAccountCommand";
import {
DeleteWorkspaceServiceAccountTokenCommand,
DeleteWorkspaceServiceAccountTokenCommandInput,
DeleteWorkspaceServiceAccountTokenCommandOutput,
} from "./commands/DeleteWorkspaceServiceAccountTokenCommand";
import {
DescribeWorkspaceAuthenticationCommand,
DescribeWorkspaceAuthenticationCommandInput,
Expand Down Expand Up @@ -67,6 +87,16 @@ import {
ListWorkspacesCommandInput,
ListWorkspacesCommandOutput,
} from "./commands/ListWorkspacesCommand";
import {
ListWorkspaceServiceAccountsCommand,
ListWorkspaceServiceAccountsCommandInput,
ListWorkspaceServiceAccountsCommandOutput,
} from "./commands/ListWorkspaceServiceAccountsCommand";
import {
ListWorkspaceServiceAccountTokensCommand,
ListWorkspaceServiceAccountTokensCommandInput,
ListWorkspaceServiceAccountTokensCommandOutput,
} from "./commands/ListWorkspaceServiceAccountTokensCommand";
import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
import {
UntagResourceCommand,
Expand Down Expand Up @@ -99,8 +129,12 @@ const commands = {
AssociateLicenseCommand,
CreateWorkspaceCommand,
CreateWorkspaceApiKeyCommand,
CreateWorkspaceServiceAccountCommand,
CreateWorkspaceServiceAccountTokenCommand,
DeleteWorkspaceCommand,
DeleteWorkspaceApiKeyCommand,
DeleteWorkspaceServiceAccountCommand,
DeleteWorkspaceServiceAccountTokenCommand,
DescribeWorkspaceCommand,
DescribeWorkspaceAuthenticationCommand,
DescribeWorkspaceConfigurationCommand,
Expand All @@ -109,6 +143,8 @@ const commands = {
ListTagsForResourceCommand,
ListVersionsCommand,
ListWorkspacesCommand,
ListWorkspaceServiceAccountsCommand,
ListWorkspaceServiceAccountTokensCommand,
TagResourceCommand,
UntagResourceCommand,
UpdatePermissionsCommand,
Expand Down Expand Up @@ -166,6 +202,40 @@ export interface Grafana {
cb: (err: any, data?: CreateWorkspaceApiKeyCommandOutput) => void
): void;

/**
* @see {@link CreateWorkspaceServiceAccountCommand}
*/
createWorkspaceServiceAccount(
args: CreateWorkspaceServiceAccountCommandInput,
options?: __HttpHandlerOptions
): Promise<CreateWorkspaceServiceAccountCommandOutput>;
createWorkspaceServiceAccount(
args: CreateWorkspaceServiceAccountCommandInput,
cb: (err: any, data?: CreateWorkspaceServiceAccountCommandOutput) => void
): void;
createWorkspaceServiceAccount(
args: CreateWorkspaceServiceAccountCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: CreateWorkspaceServiceAccountCommandOutput) => void
): void;

/**
* @see {@link CreateWorkspaceServiceAccountTokenCommand}
*/
createWorkspaceServiceAccountToken(
args: CreateWorkspaceServiceAccountTokenCommandInput,
options?: __HttpHandlerOptions
): Promise<CreateWorkspaceServiceAccountTokenCommandOutput>;
createWorkspaceServiceAccountToken(
args: CreateWorkspaceServiceAccountTokenCommandInput,
cb: (err: any, data?: CreateWorkspaceServiceAccountTokenCommandOutput) => void
): void;
createWorkspaceServiceAccountToken(
args: CreateWorkspaceServiceAccountTokenCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: CreateWorkspaceServiceAccountTokenCommandOutput) => void
): void;

/**
* @see {@link DeleteWorkspaceCommand}
*/
Expand Down Expand Up @@ -197,6 +267,40 @@ export interface Grafana {
cb: (err: any, data?: DeleteWorkspaceApiKeyCommandOutput) => void
): void;

/**
* @see {@link DeleteWorkspaceServiceAccountCommand}
*/
deleteWorkspaceServiceAccount(
args: DeleteWorkspaceServiceAccountCommandInput,
options?: __HttpHandlerOptions
): Promise<DeleteWorkspaceServiceAccountCommandOutput>;
deleteWorkspaceServiceAccount(
args: DeleteWorkspaceServiceAccountCommandInput,
cb: (err: any, data?: DeleteWorkspaceServiceAccountCommandOutput) => void
): void;
deleteWorkspaceServiceAccount(
args: DeleteWorkspaceServiceAccountCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DeleteWorkspaceServiceAccountCommandOutput) => void
): void;

/**
* @see {@link DeleteWorkspaceServiceAccountTokenCommand}
*/
deleteWorkspaceServiceAccountToken(
args: DeleteWorkspaceServiceAccountTokenCommandInput,
options?: __HttpHandlerOptions
): Promise<DeleteWorkspaceServiceAccountTokenCommandOutput>;
deleteWorkspaceServiceAccountToken(
args: DeleteWorkspaceServiceAccountTokenCommandInput,
cb: (err: any, data?: DeleteWorkspaceServiceAccountTokenCommandOutput) => void
): void;
deleteWorkspaceServiceAccountToken(
args: DeleteWorkspaceServiceAccountTokenCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DeleteWorkspaceServiceAccountTokenCommandOutput) => void
): void;

/**
* @see {@link DescribeWorkspaceCommand}
*/
Expand Down Expand Up @@ -323,6 +427,40 @@ export interface Grafana {
cb: (err: any, data?: ListWorkspacesCommandOutput) => void
): void;

/**
* @see {@link ListWorkspaceServiceAccountsCommand}
*/
listWorkspaceServiceAccounts(
args: ListWorkspaceServiceAccountsCommandInput,
options?: __HttpHandlerOptions
): Promise<ListWorkspaceServiceAccountsCommandOutput>;
listWorkspaceServiceAccounts(
args: ListWorkspaceServiceAccountsCommandInput,
cb: (err: any, data?: ListWorkspaceServiceAccountsCommandOutput) => void
): void;
listWorkspaceServiceAccounts(
args: ListWorkspaceServiceAccountsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListWorkspaceServiceAccountsCommandOutput) => void
): void;

/**
* @see {@link ListWorkspaceServiceAccountTokensCommand}
*/
listWorkspaceServiceAccountTokens(
args: ListWorkspaceServiceAccountTokensCommandInput,
options?: __HttpHandlerOptions
): Promise<ListWorkspaceServiceAccountTokensCommandOutput>;
listWorkspaceServiceAccountTokens(
args: ListWorkspaceServiceAccountTokensCommandInput,
cb: (err: any, data?: ListWorkspaceServiceAccountTokensCommandOutput) => void
): void;
listWorkspaceServiceAccountTokens(
args: ListWorkspaceServiceAccountTokensCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListWorkspaceServiceAccountTokensCommandOutput) => void
): void;

/**
* @see {@link TagResourceCommand}
*/
Expand Down
36 changes: 36 additions & 0 deletions clients/client-grafana/src/GrafanaClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,27 @@ import {
CreateWorkspaceApiKeyCommandOutput,
} from "./commands/CreateWorkspaceApiKeyCommand";
import { CreateWorkspaceCommandInput, CreateWorkspaceCommandOutput } from "./commands/CreateWorkspaceCommand";
import {
CreateWorkspaceServiceAccountCommandInput,
CreateWorkspaceServiceAccountCommandOutput,
} from "./commands/CreateWorkspaceServiceAccountCommand";
import {
CreateWorkspaceServiceAccountTokenCommandInput,
CreateWorkspaceServiceAccountTokenCommandOutput,
} from "./commands/CreateWorkspaceServiceAccountTokenCommand";
import {
DeleteWorkspaceApiKeyCommandInput,
DeleteWorkspaceApiKeyCommandOutput,
} from "./commands/DeleteWorkspaceApiKeyCommand";
import { DeleteWorkspaceCommandInput, DeleteWorkspaceCommandOutput } from "./commands/DeleteWorkspaceCommand";
import {
DeleteWorkspaceServiceAccountCommandInput,
DeleteWorkspaceServiceAccountCommandOutput,
} from "./commands/DeleteWorkspaceServiceAccountCommand";
import {
DeleteWorkspaceServiceAccountTokenCommandInput,
DeleteWorkspaceServiceAccountTokenCommandOutput,
} from "./commands/DeleteWorkspaceServiceAccountTokenCommand";
import {
DescribeWorkspaceAuthenticationCommandInput,
DescribeWorkspaceAuthenticationCommandOutput,
Expand All @@ -84,6 +100,14 @@ import {
} from "./commands/ListTagsForResourceCommand";
import { ListVersionsCommandInput, ListVersionsCommandOutput } from "./commands/ListVersionsCommand";
import { ListWorkspacesCommandInput, ListWorkspacesCommandOutput } from "./commands/ListWorkspacesCommand";
import {
ListWorkspaceServiceAccountsCommandInput,
ListWorkspaceServiceAccountsCommandOutput,
} from "./commands/ListWorkspaceServiceAccountsCommand";
import {
ListWorkspaceServiceAccountTokensCommandInput,
ListWorkspaceServiceAccountTokensCommandOutput,
} from "./commands/ListWorkspaceServiceAccountTokensCommand";
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
import { UpdatePermissionsCommandInput, UpdatePermissionsCommandOutput } from "./commands/UpdatePermissionsCommand";
Expand Down Expand Up @@ -114,15 +138,21 @@ export type ServiceInputTypes =
| AssociateLicenseCommandInput
| CreateWorkspaceApiKeyCommandInput
| CreateWorkspaceCommandInput
| CreateWorkspaceServiceAccountCommandInput
| CreateWorkspaceServiceAccountTokenCommandInput
| DeleteWorkspaceApiKeyCommandInput
| DeleteWorkspaceCommandInput
| DeleteWorkspaceServiceAccountCommandInput
| DeleteWorkspaceServiceAccountTokenCommandInput
| DescribeWorkspaceAuthenticationCommandInput
| DescribeWorkspaceCommandInput
| DescribeWorkspaceConfigurationCommandInput
| DisassociateLicenseCommandInput
| ListPermissionsCommandInput
| ListTagsForResourceCommandInput
| ListVersionsCommandInput
| ListWorkspaceServiceAccountTokensCommandInput
| ListWorkspaceServiceAccountsCommandInput
| ListWorkspacesCommandInput
| TagResourceCommandInput
| UntagResourceCommandInput
Expand All @@ -138,15 +168,21 @@ export type ServiceOutputTypes =
| AssociateLicenseCommandOutput
| CreateWorkspaceApiKeyCommandOutput
| CreateWorkspaceCommandOutput
| CreateWorkspaceServiceAccountCommandOutput
| CreateWorkspaceServiceAccountTokenCommandOutput
| DeleteWorkspaceApiKeyCommandOutput
| DeleteWorkspaceCommandOutput
| DeleteWorkspaceServiceAccountCommandOutput
| DeleteWorkspaceServiceAccountTokenCommandOutput
| DescribeWorkspaceAuthenticationCommandOutput
| DescribeWorkspaceCommandOutput
| DescribeWorkspaceConfigurationCommandOutput
| DisassociateLicenseCommandOutput
| ListPermissionsCommandOutput
| ListTagsForResourceCommandOutput
| ListVersionsCommandOutput
| ListWorkspaceServiceAccountTokensCommandOutput
| ListWorkspaceServiceAccountsCommandOutput
| ListWorkspacesCommandOutput
| TagResourceCommandOutput
| UntagResourceCommandOutput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ export interface AssociateLicenseCommandInput extends AssociateLicenseRequest {}
export interface AssociateLicenseCommandOutput extends AssociateLicenseResponse, __MetadataBearer {}

/**
* <p>Assigns a Grafana Enterprise license to a workspace. Upgrading to Grafana Enterprise
* <p>Assigns a Grafana Enterprise license to a workspace. To upgrade, you must use
* <code>ENTERPRISE</code> for the <code>licenseType</code>, and pass in a valid
* Grafana Labs token for the <code>grafanaToken</code>. Upgrading to Grafana Enterprise
* incurs additional fees. For more information, see <a href="https://docs.aws.amazon.com/grafana/latest/userguide/upgrade-to-Grafana-Enterprise.html">Upgrade a
* workspace to Grafana Enterprise</a>.</p>
* @example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ export interface CreateWorkspaceApiKeyCommandOutput extends CreateWorkspaceApiKe
* <p>Creates a Grafana API key for the workspace. This key can be used to authenticate
* requests sent to the workspace's HTTP API. See <a href="https://docs.aws.amazon.com/grafana/latest/userguide/Using-Grafana-APIs.html">https://docs.aws.amazon.com/grafana/latest/userguide/Using-Grafana-APIs.html</a>
* for available APIs and example requests.</p>
* <note>
* <p>In workspaces compatible with Grafana version 9 or above, use workspace service
* accounts instead of API keys. API keys will be removed in a future release.</p>
* </note>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Loading

0 comments on commit 6c98871

Please sign in to comment.