Skip to content

Commit b6cf732

Browse files
author
awstools
committed
feat(client-grafana): This release includes support for configuring a Grafana workspace to connect to a datasource within a VPC as well as new APIs for configuring Grafana settings.
1 parent 3a5313a commit b6cf732

19 files changed

+1326
-375
lines changed

clients/client-grafana/src/Grafana.ts

Lines changed: 107 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ import {
3636
DescribeWorkspaceCommandInput,
3737
DescribeWorkspaceCommandOutput,
3838
} from "./commands/DescribeWorkspaceCommand";
39+
import {
40+
DescribeWorkspaceConfigurationCommand,
41+
DescribeWorkspaceConfigurationCommandInput,
42+
DescribeWorkspaceConfigurationCommandOutput,
43+
} from "./commands/DescribeWorkspaceConfigurationCommand";
3944
import {
4045
DisassociateLicenseCommand,
4146
DisassociateLicenseCommandInput,
@@ -77,6 +82,11 @@ import {
7782
UpdateWorkspaceCommandInput,
7883
UpdateWorkspaceCommandOutput,
7984
} from "./commands/UpdateWorkspaceCommand";
85+
import {
86+
UpdateWorkspaceConfigurationCommand,
87+
UpdateWorkspaceConfigurationCommandInput,
88+
UpdateWorkspaceConfigurationCommandOutput,
89+
} from "./commands/UpdateWorkspaceConfigurationCommand";
8090
import { GrafanaClient } from "./GrafanaClient";
8191

8292
/**
@@ -91,8 +101,8 @@ import { GrafanaClient } from "./GrafanaClient";
91101
export class Grafana extends GrafanaClient {
92102
/**
93103
* <p>Assigns a Grafana Enterprise license to a workspace. Upgrading to Grafana Enterprise
94-
* 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
95-
* Grafana Enterprise</a>.</p>
104+
* 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
105+
* Grafana Enterprise</a>.</p>
96106
*/
97107
public associateLicense(
98108
args: AssociateLicenseCommandInput,
@@ -125,10 +135,10 @@ export class Grafana extends GrafanaClient {
125135

126136
/**
127137
* <p>Creates a <i>workspace</i>. In a workspace, you can create Grafana
128-
* dashboards and visualizations to analyze your metrics, logs, and traces. You don't have to
129-
* build, package, or deploy any hardware to run the Grafana server.</p>
130-
* <p>Don't use <code>CreateWorkspace</code> to modify an existing workspace. Instead,
131-
* use <a href="https://docs.aws.amazon.com/grafana/latest/APIReference/API_UpdateWorkspace.html">UpdateWorkspace</a>.</p>
138+
* dashboards and visualizations to analyze your metrics, logs, and traces. You don't have to
139+
* build, package, or deploy any hardware to run the Grafana server.</p>
140+
* <p>Don't use <code>CreateWorkspace</code> to modify an existing workspace. Instead,
141+
* use <a href="https://docs.aws.amazon.com/grafana/latest/APIReference/API_UpdateWorkspace.html">UpdateWorkspace</a>.</p>
132142
*/
133143
public createWorkspace(
134144
args: CreateWorkspaceCommandInput,
@@ -160,10 +170,10 @@ export class Grafana extends GrafanaClient {
160170
}
161171

162172
/**
163-
* <p>Creates an API key for the workspace. This key can be used to authenticate
164-
* requests sent to the workspace's HTTP API. See
165-
* <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>
166-
* for available APIs and example requests.</p>
173+
* <p>Creates a Grafana API key for the workspace. This key can be used to
174+
* authenticate requests sent to the workspace's HTTP API.
175+
* 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>
176+
* for available APIs and example requests.</p>
167177
*/
168178
public createWorkspaceApiKey(
169179
args: CreateWorkspaceApiKeyCommandInput,
@@ -227,7 +237,7 @@ export class Grafana extends GrafanaClient {
227237
}
228238

229239
/**
230-
* <p>Deletes an API key for a workspace.</p>
240+
* <p>Deletes a Grafana API key for the workspace.</p>
231241
*/
232242
public deleteWorkspaceApiKey(
233243
args: DeleteWorkspaceApiKeyCommandInput,
@@ -322,6 +332,38 @@ export class Grafana extends GrafanaClient {
322332
}
323333
}
324334

335+
/**
336+
* <p>Gets the current configuration string for the given workspace.</p>
337+
*/
338+
public describeWorkspaceConfiguration(
339+
args: DescribeWorkspaceConfigurationCommandInput,
340+
options?: __HttpHandlerOptions
341+
): Promise<DescribeWorkspaceConfigurationCommandOutput>;
342+
public describeWorkspaceConfiguration(
343+
args: DescribeWorkspaceConfigurationCommandInput,
344+
cb: (err: any, data?: DescribeWorkspaceConfigurationCommandOutput) => void
345+
): void;
346+
public describeWorkspaceConfiguration(
347+
args: DescribeWorkspaceConfigurationCommandInput,
348+
options: __HttpHandlerOptions,
349+
cb: (err: any, data?: DescribeWorkspaceConfigurationCommandOutput) => void
350+
): void;
351+
public describeWorkspaceConfiguration(
352+
args: DescribeWorkspaceConfigurationCommandInput,
353+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DescribeWorkspaceConfigurationCommandOutput) => void),
354+
cb?: (err: any, data?: DescribeWorkspaceConfigurationCommandOutput) => void
355+
): Promise<DescribeWorkspaceConfigurationCommandOutput> | void {
356+
const command = new DescribeWorkspaceConfigurationCommand(args);
357+
if (typeof optionsOrCb === "function") {
358+
this.send(command, optionsOrCb);
359+
} else if (typeof cb === "function") {
360+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
361+
this.send(command, optionsOrCb || {}, cb);
362+
} else {
363+
return this.send(command, optionsOrCb);
364+
}
365+
}
366+
325367
/**
326368
* <p>Removes the Grafana Enterprise license from a workspace.</p>
327369
*/
@@ -356,12 +398,12 @@ export class Grafana extends GrafanaClient {
356398

357399
/**
358400
* <p>Lists the users and groups who have the Grafana <code>Admin</code> and
359-
* <code>Editor</code> roles in this workspace. If you use this
360-
* operation without specifying <code>userId</code> or <code>groupId</code>, the operation returns
361-
* the roles of all users
362-
* and groups. If you specify a <code>userId</code> or a <code>groupId</code>, only the roles
363-
* for that user or group are returned. If you do this, you can specify only one <code>userId</code> or
364-
* one <code>groupId</code>.</p>
401+
* <code>Editor</code> roles in this workspace. If you use this
402+
* operation without specifying <code>userId</code> or <code>groupId</code>, the operation returns
403+
* the roles of all users
404+
* and groups. If you specify a <code>userId</code> or a <code>groupId</code>, only the roles
405+
* for that user or group are returned. If you do this, you can specify only one <code>userId</code> or
406+
* one <code>groupId</code>.</p>
365407
*/
366408
public listPermissions(
367409
args: ListPermissionsCommandInput,
@@ -394,8 +436,8 @@ export class Grafana extends GrafanaClient {
394436

395437
/**
396438
* <p>The <code>ListTagsForResource</code> operation returns the tags that
397-
* are associated with the Amazon Managed Service for Grafana resource specified by the <code>resourceArn</code>.
398-
* Currently, the only resource that can be tagged is a workspace. </p>
439+
* are associated with the Amazon Managed Service for Grafana resource specified by the <code>resourceArn</code>.
440+
* Currently, the only resource that can be tagged is a workspace. </p>
399441
*/
400442
public listTagsForResource(
401443
args: ListTagsForResourceCommandInput,
@@ -428,7 +470,7 @@ export class Grafana extends GrafanaClient {
428470

429471
/**
430472
* <p>Returns a list of Amazon Managed Grafana workspaces in the account, with some information
431-
* about each workspace. For more complete information about one workspace, use <a href="https://docs.aws.amazon.com/AAMG/latest/APIReference/API_DescribeWorkspace.html">DescribeWorkspace</a>.</p>
473+
* about each workspace. For more complete information about one workspace, use <a href="https://docs.aws.amazon.com/AAMG/latest/APIReference/API_DescribeWorkspace.html">DescribeWorkspace</a>.</p>
432474
*/
433475
public listWorkspaces(
434476
args: ListWorkspacesCommandInput,
@@ -461,10 +503,10 @@ export class Grafana extends GrafanaClient {
461503

462504
/**
463505
* <p>The <code>TagResource</code> operation associates tags with an Amazon Managed Grafana resource.
464-
* Currently, the only resource that can be tagged is workspaces. </p>
465-
* <p>If you specify a new tag key for the resource, this tag is appended to the list of tags associated
466-
* with the resource. If you specify a tag key that is already associated with the resource, the new tag
467-
* value that you specify replaces the previous value for that tag.</p>
506+
* Currently, the only resource that can be tagged is workspaces. </p>
507+
* <p>If you specify a new tag key for the resource, this tag is appended to the list of tags associated
508+
* with the resource. If you specify a tag key that is already associated with the resource, the new tag
509+
* value that you specify replaces the previous value for that tag.</p>
468510
*/
469511
public tagResource(args: TagResourceCommandInput, options?: __HttpHandlerOptions): Promise<TagResourceCommandOutput>;
470512
public tagResource(args: TagResourceCommandInput, cb: (err: any, data?: TagResourceCommandOutput) => void): void;
@@ -491,7 +533,7 @@ export class Grafana extends GrafanaClient {
491533

492534
/**
493535
* <p>The <code>UntagResource</code> operation removes the association of the tag with the Amazon Managed Grafana resource.
494-
* </p>
536+
* </p>
495537
*/
496538
public untagResource(
497539
args: UntagResourceCommandInput,
@@ -556,11 +598,11 @@ export class Grafana extends GrafanaClient {
556598

557599
/**
558600
* <p>Modifies an existing Amazon Managed Grafana workspace. If you use this operation and omit any
559-
* optional parameters, the existing values of those parameters are not changed.</p>
560-
* <p>To modify the user authentication methods that the workspace uses, such as SAML or Amazon Web Services SSO,
561-
* use <a href="https://docs.aws.amazon.com/grafana/latest/APIReference/API_UpdateWorkspaceAuthentication.html">UpdateWorkspaceAuthentication</a>.</p>
562-
* <p>To modify which users in the workspace have the <code>Admin</code> and <code>Editor</code> Grafana roles,
563-
* use <a href="https://docs.aws.amazon.com/grafana/latest/APIReference/API_UpdatePermissions.html">UpdatePermissions</a>.</p>
601+
* optional parameters, the existing values of those parameters are not changed.</p>
602+
* <p>To modify the user authentication methods that the workspace uses, such as SAML or IAM Identity Center,
603+
* use <a href="https://docs.aws.amazon.com/grafana/latest/APIReference/API_UpdateWorkspaceAuthentication.html">UpdateWorkspaceAuthentication</a>.</p>
604+
* <p>To modify which users in the workspace have the <code>Admin</code> and <code>Editor</code> Grafana roles,
605+
* use <a href="https://docs.aws.amazon.com/grafana/latest/APIReference/API_UpdatePermissions.html">UpdatePermissions</a>.</p>
564606
*/
565607
public updateWorkspace(
566608
args: UpdateWorkspaceCommandInput,
@@ -593,9 +635,9 @@ export class Grafana extends GrafanaClient {
593635

594636
/**
595637
* <p>Use this operation to define the identity provider (IdP) that this workspace
596-
* authenticates users from, using SAML. You can also map SAML assertion attributes to
597-
* workspace user information and define which groups in the assertion attribute are to have
598-
* the <code>Admin</code> and <code>Editor</code> roles in the workspace.</p>
638+
* authenticates users from, using SAML. You can also map SAML assertion attributes to
639+
* workspace user information and define which groups in the assertion attribute are to have
640+
* the <code>Admin</code> and <code>Editor</code> roles in the workspace.</p>
599641
*/
600642
public updateWorkspaceAuthentication(
601643
args: UpdateWorkspaceAuthenticationCommandInput,
@@ -625,4 +667,36 @@ export class Grafana extends GrafanaClient {
625667
return this.send(command, optionsOrCb);
626668
}
627669
}
670+
671+
/**
672+
* <p>Updates the configuration string for the given workspace</p>
673+
*/
674+
public updateWorkspaceConfiguration(
675+
args: UpdateWorkspaceConfigurationCommandInput,
676+
options?: __HttpHandlerOptions
677+
): Promise<UpdateWorkspaceConfigurationCommandOutput>;
678+
public updateWorkspaceConfiguration(
679+
args: UpdateWorkspaceConfigurationCommandInput,
680+
cb: (err: any, data?: UpdateWorkspaceConfigurationCommandOutput) => void
681+
): void;
682+
public updateWorkspaceConfiguration(
683+
args: UpdateWorkspaceConfigurationCommandInput,
684+
options: __HttpHandlerOptions,
685+
cb: (err: any, data?: UpdateWorkspaceConfigurationCommandOutput) => void
686+
): void;
687+
public updateWorkspaceConfiguration(
688+
args: UpdateWorkspaceConfigurationCommandInput,
689+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdateWorkspaceConfigurationCommandOutput) => void),
690+
cb?: (err: any, data?: UpdateWorkspaceConfigurationCommandOutput) => void
691+
): Promise<UpdateWorkspaceConfigurationCommandOutput> | void {
692+
const command = new UpdateWorkspaceConfigurationCommand(args);
693+
if (typeof optionsOrCb === "function") {
694+
this.send(command, optionsOrCb);
695+
} else if (typeof cb === "function") {
696+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
697+
this.send(command, optionsOrCb || {}, cb);
698+
} else {
699+
return this.send(command, optionsOrCb);
700+
}
701+
}
628702
}

clients/client-grafana/src/GrafanaClient.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ import {
6363
DescribeWorkspaceAuthenticationCommandOutput,
6464
} from "./commands/DescribeWorkspaceAuthenticationCommand";
6565
import { DescribeWorkspaceCommandInput, DescribeWorkspaceCommandOutput } from "./commands/DescribeWorkspaceCommand";
66+
import {
67+
DescribeWorkspaceConfigurationCommandInput,
68+
DescribeWorkspaceConfigurationCommandOutput,
69+
} from "./commands/DescribeWorkspaceConfigurationCommand";
6670
import {
6771
DisassociateLicenseCommandInput,
6872
DisassociateLicenseCommandOutput,
@@ -81,6 +85,10 @@ import {
8185
UpdateWorkspaceAuthenticationCommandOutput,
8286
} from "./commands/UpdateWorkspaceAuthenticationCommand";
8387
import { UpdateWorkspaceCommandInput, UpdateWorkspaceCommandOutput } from "./commands/UpdateWorkspaceCommand";
88+
import {
89+
UpdateWorkspaceConfigurationCommandInput,
90+
UpdateWorkspaceConfigurationCommandOutput,
91+
} from "./commands/UpdateWorkspaceConfigurationCommand";
8492
import {
8593
ClientInputEndpointParameters,
8694
ClientResolvedEndpointParameters,
@@ -97,6 +105,7 @@ export type ServiceInputTypes =
97105
| DeleteWorkspaceCommandInput
98106
| DescribeWorkspaceAuthenticationCommandInput
99107
| DescribeWorkspaceCommandInput
108+
| DescribeWorkspaceConfigurationCommandInput
100109
| DisassociateLicenseCommandInput
101110
| ListPermissionsCommandInput
102111
| ListTagsForResourceCommandInput
@@ -105,7 +114,8 @@ export type ServiceInputTypes =
105114
| UntagResourceCommandInput
106115
| UpdatePermissionsCommandInput
107116
| UpdateWorkspaceAuthenticationCommandInput
108-
| UpdateWorkspaceCommandInput;
117+
| UpdateWorkspaceCommandInput
118+
| UpdateWorkspaceConfigurationCommandInput;
109119

110120
export type ServiceOutputTypes =
111121
| AssociateLicenseCommandOutput
@@ -115,6 +125,7 @@ export type ServiceOutputTypes =
115125
| DeleteWorkspaceCommandOutput
116126
| DescribeWorkspaceAuthenticationCommandOutput
117127
| DescribeWorkspaceCommandOutput
128+
| DescribeWorkspaceConfigurationCommandOutput
118129
| DisassociateLicenseCommandOutput
119130
| ListPermissionsCommandOutput
120131
| ListTagsForResourceCommandOutput
@@ -123,7 +134,8 @@ export type ServiceOutputTypes =
123134
| UntagResourceCommandOutput
124135
| UpdatePermissionsCommandOutput
125136
| UpdateWorkspaceAuthenticationCommandOutput
126-
| UpdateWorkspaceCommandOutput;
137+
| UpdateWorkspaceCommandOutput
138+
| UpdateWorkspaceConfigurationCommandOutput;
127139

128140
export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
129141
/**

clients/client-grafana/src/commands/AssociateLicenseCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ export interface AssociateLicenseCommandOutput extends AssociateLicenseResponse,
3030

3131
/**
3232
* <p>Assigns a Grafana Enterprise license to a workspace. Upgrading to Grafana Enterprise
33-
* 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
34-
* Grafana Enterprise</a>.</p>
33+
* 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
34+
* Grafana Enterprise</a>.</p>
3535
* @example
3636
* Use a bare-bones client and the command you need to make an API call.
3737
* ```javascript

clients/client-grafana/src/commands/CreateWorkspaceApiKeyCommand.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ export interface CreateWorkspaceApiKeyCommandInput extends CreateWorkspaceApiKey
2929
export interface CreateWorkspaceApiKeyCommandOutput extends CreateWorkspaceApiKeyResponse, __MetadataBearer {}
3030

3131
/**
32-
* <p>Creates an API key for the workspace. This key can be used to authenticate
33-
* requests sent to the workspace's HTTP API. See
34-
* <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>
35-
* for available APIs and example requests.</p>
32+
* <p>Creates a Grafana API key for the workspace. This key can be used to
33+
* authenticate requests sent to the workspace's HTTP API.
34+
* 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>
35+
* for available APIs and example requests.</p>
3636
* @example
3737
* Use a bare-bones client and the command you need to make an API call.
3838
* ```javascript

clients/client-grafana/src/commands/CreateWorkspaceCommand.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ export interface CreateWorkspaceCommandOutput extends CreateWorkspaceResponse, _
3030

3131
/**
3232
* <p>Creates a <i>workspace</i>. In a workspace, you can create Grafana
33-
* dashboards and visualizations to analyze your metrics, logs, and traces. You don't have to
34-
* build, package, or deploy any hardware to run the Grafana server.</p>
35-
* <p>Don't use <code>CreateWorkspace</code> to modify an existing workspace. Instead,
36-
* use <a href="https://docs.aws.amazon.com/grafana/latest/APIReference/API_UpdateWorkspace.html">UpdateWorkspace</a>.</p>
33+
* dashboards and visualizations to analyze your metrics, logs, and traces. You don't have to
34+
* build, package, or deploy any hardware to run the Grafana server.</p>
35+
* <p>Don't use <code>CreateWorkspace</code> to modify an existing workspace. Instead,
36+
* use <a href="https://docs.aws.amazon.com/grafana/latest/APIReference/API_UpdateWorkspace.html">UpdateWorkspace</a>.</p>
3737
* @example
3838
* Use a bare-bones client and the command you need to make an API call.
3939
* ```javascript

clients/client-grafana/src/commands/DeleteWorkspaceApiKeyCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export interface DeleteWorkspaceApiKeyCommandInput extends DeleteWorkspaceApiKey
2929
export interface DeleteWorkspaceApiKeyCommandOutput extends DeleteWorkspaceApiKeyResponse, __MetadataBearer {}
3030

3131
/**
32-
* <p>Deletes an API key for a workspace.</p>
32+
* <p>Deletes a Grafana API key for the workspace.</p>
3333
* @example
3434
* Use a bare-bones client and the command you need to make an API call.
3535
* ```javascript

0 commit comments

Comments
 (0)