From 00943f4ca3753f5ff478afd0c632b35ae2433d2b Mon Sep 17 00:00:00 2001 From: awstools Date: Thu, 7 Mar 2024 19:22:30 +0000 Subject: [PATCH] feat(client-grafana): Adds support for the new GrafanaToken as part of the Amazon Managed Grafana Enterprise plugins upgrade to associate your AWS account with a Grafana Labs account. --- .../src/commands/AssociateLicenseCommand.ts | 2 + .../src/commands/CreateWorkspaceCommand.ts | 1 + .../src/commands/DeleteWorkspaceCommand.ts | 1 + .../src/commands/DescribeWorkspaceCommand.ts | 1 + .../commands/DisassociateLicenseCommand.ts | 1 + .../src/commands/ListWorkspacesCommand.ts | 2 + .../src/commands/UpdateWorkspaceCommand.ts | 1 + clients/client-grafana/src/models/models_0.ts | 66 ++++++++++++++++--- .../src/protocols/Aws_restJson1.ts | 9 ++- codegen/sdk-codegen/aws-models/grafana.json | 52 ++++++++++++--- 10 files changed, 116 insertions(+), 20 deletions(-) diff --git a/clients/client-grafana/src/commands/AssociateLicenseCommand.ts b/clients/client-grafana/src/commands/AssociateLicenseCommand.ts index 77b2ae65fc7f..27e195c5ecf0 100644 --- a/clients/client-grafana/src/commands/AssociateLicenseCommand.ts +++ b/clients/client-grafana/src/commands/AssociateLicenseCommand.ts @@ -44,6 +44,7 @@ export interface AssociateLicenseCommandOutput extends AssociateLicenseResponse, * const input = { // AssociateLicenseRequest * workspaceId: "STRING_VALUE", // required * licenseType: "STRING_VALUE", // required + * grafanaToken: "STRING_VALUE", * }; * const command = new AssociateLicenseCommand(input); * const response = await client.send(command); @@ -100,6 +101,7 @@ export interface AssociateLicenseCommandOutput extends AssociateLicenseResponse, * // "STRING_VALUE", * // ], * // }, + * // grafanaToken: "STRING_VALUE", * // }, * // }; * diff --git a/clients/client-grafana/src/commands/CreateWorkspaceCommand.ts b/clients/client-grafana/src/commands/CreateWorkspaceCommand.ts index 818f4cde6c1c..15b807600e7f 100644 --- a/clients/client-grafana/src/commands/CreateWorkspaceCommand.ts +++ b/clients/client-grafana/src/commands/CreateWorkspaceCommand.ts @@ -142,6 +142,7 @@ export interface CreateWorkspaceCommandOutput extends CreateWorkspaceResponse, _ * // "STRING_VALUE", * // ], * // }, + * // grafanaToken: "STRING_VALUE", * // }, * // }; * diff --git a/clients/client-grafana/src/commands/DeleteWorkspaceCommand.ts b/clients/client-grafana/src/commands/DeleteWorkspaceCommand.ts index 33c1eb9673ce..f6abd950b1b1 100644 --- a/clients/client-grafana/src/commands/DeleteWorkspaceCommand.ts +++ b/clients/client-grafana/src/commands/DeleteWorkspaceCommand.ts @@ -97,6 +97,7 @@ export interface DeleteWorkspaceCommandOutput extends DeleteWorkspaceResponse, _ * // "STRING_VALUE", * // ], * // }, + * // grafanaToken: "STRING_VALUE", * // }, * // }; * diff --git a/clients/client-grafana/src/commands/DescribeWorkspaceCommand.ts b/clients/client-grafana/src/commands/DescribeWorkspaceCommand.ts index f5cecda62042..775c8fe8c627 100644 --- a/clients/client-grafana/src/commands/DescribeWorkspaceCommand.ts +++ b/clients/client-grafana/src/commands/DescribeWorkspaceCommand.ts @@ -97,6 +97,7 @@ export interface DescribeWorkspaceCommandOutput extends DescribeWorkspaceRespons * // "STRING_VALUE", * // ], * // }, + * // grafanaToken: "STRING_VALUE", * // }, * // }; * diff --git a/clients/client-grafana/src/commands/DisassociateLicenseCommand.ts b/clients/client-grafana/src/commands/DisassociateLicenseCommand.ts index da0e1d7a1347..50cb3d15dc20 100644 --- a/clients/client-grafana/src/commands/DisassociateLicenseCommand.ts +++ b/clients/client-grafana/src/commands/DisassociateLicenseCommand.ts @@ -98,6 +98,7 @@ export interface DisassociateLicenseCommandOutput extends DisassociateLicenseRes * // "STRING_VALUE", * // ], * // }, + * // grafanaToken: "STRING_VALUE", * // }, * // }; * diff --git a/clients/client-grafana/src/commands/ListWorkspacesCommand.ts b/clients/client-grafana/src/commands/ListWorkspacesCommand.ts index fb22fead442e..44cc5f5b8bf0 100644 --- a/clients/client-grafana/src/commands/ListWorkspacesCommand.ts +++ b/clients/client-grafana/src/commands/ListWorkspacesCommand.ts @@ -69,6 +69,8 @@ export interface ListWorkspacesCommandOutput extends ListWorkspacesResponse, __M * // tags: { // TagMap * // "": "STRING_VALUE", * // }, + * // licenseType: "STRING_VALUE", + * // grafanaToken: "STRING_VALUE", * // }, * // ], * // nextToken: "STRING_VALUE", diff --git a/clients/client-grafana/src/commands/UpdateWorkspaceCommand.ts b/clients/client-grafana/src/commands/UpdateWorkspaceCommand.ts index 168bd2b4f580..1986a990f187 100644 --- a/clients/client-grafana/src/commands/UpdateWorkspaceCommand.ts +++ b/clients/client-grafana/src/commands/UpdateWorkspaceCommand.ts @@ -137,6 +137,7 @@ export interface UpdateWorkspaceCommandOutput extends UpdateWorkspaceResponse, _ * // "STRING_VALUE", * // ], * // }, + * // grafanaToken: "STRING_VALUE", * // }, * // }; * diff --git a/clients/client-grafana/src/models/models_0.ts b/clients/client-grafana/src/models/models_0.ts index 01b2c00b60e1..902e0062cd0a 100644 --- a/clients/client-grafana/src/models/models_0.ts +++ b/clients/client-grafana/src/models/models_0.ts @@ -473,8 +473,18 @@ export interface AssociateLicenseRequest { /** * @public *

The type of license to associate with the workspace.

+ * + *

Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.

+ *
*/ licenseType: LicenseType | undefined; + + /** + * @public + *

A token from Grafana Labs that ties your Amazon Web Services account with a Grafana + * Labs account. For more information, see Register with Grafana Labs.

+ */ + grafanaToken?: string; } /** @@ -906,8 +916,10 @@ export interface WorkspaceDescription { /** * @public - *

Specifies whether this workspace has a full Grafana Enterprise license or a free trial - * license.

+ *

Specifies whether this workspace has a full Grafana Enterprise license.

+ * + *

Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.

+ *
*/ licenseType?: LicenseType; @@ -915,13 +927,19 @@ export interface WorkspaceDescription { * @public *

Specifies whether this workspace has already fully used its free trial for Grafana * Enterprise.

+ * + *

Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.

+ *
*/ freeTrialConsumed?: boolean; /** * @public - *

If this workspace has a full Grafana Enterprise license, this specifies when the - * license ends and will need to be renewed.

+ *

If this workspace has a full Grafana Enterprise license purchased through + * Amazon Web Services Marketplace, this specifies when the + * license ends and will need to be renewed. Purchasing the Enterprise plugins option + * through Amazon Managed Grafana does not have an expiration. It is valid until the + * license is removed.

*/ licenseExpiration?: Date; @@ -929,6 +947,9 @@ export interface WorkspaceDescription { * @public *

If this workspace is currently in the free trial period for Grafana Enterprise, this * value specifies when that free trial ends.

+ * + *

Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.

+ *
*/ freeTrialExpiration?: Date; @@ -956,6 +977,13 @@ export interface WorkspaceDescription { *

The configuration settings for network access to your workspace.

*/ networkAccessControl?: NetworkAccessConfiguration; + + /** + * @public + *

The token that ties this workspace to a Grafana Labs account. For more information, + * see Register with Grafana Labs.

+ */ + grafanaToken?: string; } /** @@ -1184,7 +1212,7 @@ export interface UpdateWorkspaceAuthenticationRequest { /** * @public - *

Specifies whether this workspace uses SAML 2.0, IAM Identity Center (successor to Single Sign-On), or both to + *

Specifies whether this workspace uses SAML 2.0, IAM Identity Center, or both to * authenticate users for using the Grafana console within a workspace. For more * information, see User authentication in * Amazon Managed Grafana.

@@ -1262,11 +1290,12 @@ export interface UpdateWorkspaceConfigurationRequest { /** * @public - *

Specifies the version of Grafana to support in the new workspace.

+ *

Specifies the version of Grafana to support in the workspace. If not specified, + * keeps the current version of the workspace.

*

Can only be used to upgrade (for example, from 8.4 to 9.4), not * downgrade (for example, from 9.4 to 8.4).

*

To know what versions are available to upgrade to for a specific workspace, see - * the ListVersions operation.

+ * the ListVersions operation.

*/ grafanaVersion?: string; } @@ -1763,7 +1792,7 @@ export interface CreateWorkspaceRequest { /** * @public - *

Specifies whether this workspace uses SAML 2.0, IAM Identity Center (successor to Single Sign-On), or both to + *

Specifies whether this workspace uses SAML 2.0, IAM Identity Center, or both to * authenticate users for using the Grafana console within a workspace. For more * information, see User authentication in * Amazon Managed Grafana.

@@ -1809,8 +1838,9 @@ export interface CreateWorkspaceRequest { /** * @public - *

Specifies the version of Grafana to support in the new workspace.

- *

To get a list of supported version, use the ListVersions + *

Specifies the version of Grafana to support in the new workspace. If not specified, + * defaults to the latest version (for example, 9.4).

+ *

To get a list of supported versions, use the ListVersions * operation.

*/ grafanaVersion?: string; @@ -1962,6 +1992,22 @@ export interface WorkspaceSummary { *

The list of tags associated with the workspace.

*/ tags?: Record; + + /** + * @public + *

Specifies whether this workspace has a full Grafana Enterprise license.

+ * + *

Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.

+ *
+ */ + licenseType?: LicenseType; + + /** + * @public + *

The token that ties this workspace to a Grafana Labs account. For more information, + * see Register with Grafana Labs.

+ */ + grafanaToken?: string; } /** diff --git a/clients/client-grafana/src/protocols/Aws_restJson1.ts b/clients/client-grafana/src/protocols/Aws_restJson1.ts index 5418f209a4a6..bff31e2e56ff 100644 --- a/clients/client-grafana/src/protocols/Aws_restJson1.ts +++ b/clients/client-grafana/src/protocols/Aws_restJson1.ts @@ -102,7 +102,9 @@ export const se_AssociateLicenseCommand = async ( context: __SerdeContext ): Promise<__HttpRequest> => { const b = rb(input, context); - const headers: any = {}; + const headers: any = map({}, isSerializableHeaderValue, { + [_gt]: input[_gT]!, + }); b.bp("/workspaces/{workspaceId}/licenses/{licenseType}"); b.p("workspaceId", () => input.workspaceId!, "{workspaceId}", false); b.p("licenseType", () => input.licenseType!, "{licenseType}", false); @@ -1202,6 +1204,7 @@ const de_WorkspaceDescription = (output: any, context: __SerdeContext): Workspac endpoint: __expectString, freeTrialConsumed: __expectBoolean, freeTrialExpiration: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + grafanaToken: __expectString, grafanaVersion: __expectString, id: __expectString, licenseExpiration: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), @@ -1242,8 +1245,10 @@ const de_WorkspaceSummary = (output: any, context: __SerdeContext): WorkspaceSum created: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), description: __expectString, endpoint: __expectString, + grafanaToken: __expectString, grafanaVersion: __expectString, id: __expectString, + licenseType: __expectString, modified: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), name: __expectString, notificationDestinations: _json, @@ -1272,6 +1277,8 @@ const isSerializableHeaderValue = (value: any): boolean => (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0); const _gI = "groupId"; +const _gT = "grafanaToken"; +const _gt = "grafana-token"; const _mR = "maxResults"; const _nT = "nextToken"; const _rAS = "retryAfterSeconds"; diff --git a/codegen/sdk-codegen/aws-models/grafana.json b/codegen/sdk-codegen/aws-models/grafana.json index 8b76c2437e5b..e5779beb6846 100644 --- a/codegen/sdk-codegen/aws-models/grafana.json +++ b/codegen/sdk-codegen/aws-models/grafana.json @@ -1003,10 +1003,17 @@ "licenseType": { "target": "com.amazonaws.grafana#LicenseType", "traits": { - "smithy.api#documentation": "

The type of license to associate with the workspace.

", + "smithy.api#documentation": "

The type of license to associate with the workspace.

\n \n

Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.

\n
", "smithy.api#httpLabel": {}, "smithy.api#required": {} } + }, + "grafanaToken": { + "target": "com.amazonaws.grafana#GrafanaToken", + "traits": { + "smithy.api#documentation": "

A token from Grafana Labs that ties your Amazon Web Services account with a Grafana \n Labs account. For more information, see Register with Grafana Labs.

", + "smithy.api#httpHeader": "Grafana-Token" + } } } }, @@ -1402,7 +1409,7 @@ "authenticationProviders": { "target": "com.amazonaws.grafana#AuthenticationProviders", "traits": { - "smithy.api#documentation": "

Specifies whether this workspace uses SAML 2.0, IAM Identity Center (successor to Single Sign-On), or both to\n authenticate users for using the Grafana console within a workspace. For more\n information, see User authentication in\n Amazon Managed Grafana.

", + "smithy.api#documentation": "

Specifies whether this workspace uses SAML 2.0, IAM Identity Center, or both to\n authenticate users for using the Grafana console within a workspace. For more\n information, see User authentication in\n Amazon Managed Grafana.

", "smithy.api#required": {} } }, @@ -1433,7 +1440,7 @@ "grafanaVersion": { "target": "com.amazonaws.grafana#GrafanaVersion", "traits": { - "smithy.api#documentation": "

Specifies the version of Grafana to support in the new workspace.

\n

To get a list of supported version, use the ListVersions\n operation.

" + "smithy.api#documentation": "

Specifies the version of Grafana to support in the new workspace. If not specified, \n defaults to the latest version (for example, 9.4).

\n

To get a list of supported versions, use the ListVersions\n operation.

" } } } @@ -1916,6 +1923,15 @@ } } }, + "com.amazonaws.grafana#GrafanaToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 36 + } + } + }, "com.amazonaws.grafana#GrafanaVersion": { "type": "string", "traits": { @@ -3260,7 +3276,7 @@ "authenticationProviders": { "target": "com.amazonaws.grafana#AuthenticationProviders", "traits": { - "smithy.api#documentation": "

Specifies whether this workspace uses SAML 2.0, IAM Identity Center (successor to Single Sign-On), or both to\n authenticate users for using the Grafana console within a workspace. For more\n information, see User authentication in\n Amazon Managed Grafana.

", + "smithy.api#documentation": "

Specifies whether this workspace uses SAML 2.0, IAM Identity Center, or both to\n authenticate users for using the Grafana console within a workspace. For more\n information, see User authentication in\n Amazon Managed Grafana.

", "smithy.api#required": {} } }, @@ -3342,7 +3358,7 @@ "grafanaVersion": { "target": "com.amazonaws.grafana#GrafanaVersion", "traits": { - "smithy.api#documentation": "

Specifies the version of Grafana to support in the new workspace.

\n

Can only be used to upgrade (for example, from 8.4 to 9.4), not\n downgrade (for example, from 9.4 to 8.4).

\n

To know what versions are available to upgrade to for a specific workspace, see \n the ListVersions operation.

" + "smithy.api#documentation": "

Specifies the version of Grafana to support in the workspace. If not specified, \n keeps the current version of the workspace.

\n

Can only be used to upgrade (for example, from 8.4 to 9.4), not\n downgrade (for example, from 9.4 to 8.4).

\n

To know what versions are available to upgrade to for a specific workspace, see \n the ListVersions operation.

" } } } @@ -3761,25 +3777,25 @@ "licenseType": { "target": "com.amazonaws.grafana#LicenseType", "traits": { - "smithy.api#documentation": "

Specifies whether this workspace has a full Grafana Enterprise license or a free trial\n license.

" + "smithy.api#documentation": "

Specifies whether this workspace has a full Grafana Enterprise license.

\n \n

Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.

\n
" } }, "freeTrialConsumed": { "target": "smithy.api#Boolean", "traits": { - "smithy.api#documentation": "

Specifies whether this workspace has already fully used its free trial for Grafana\n Enterprise.

" + "smithy.api#documentation": "

Specifies whether this workspace has already fully used its free trial for Grafana\n Enterprise.

\n \n

Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.

\n
" } }, "licenseExpiration": { "target": "smithy.api#Timestamp", "traits": { - "smithy.api#documentation": "

If this workspace has a full Grafana Enterprise license, this specifies when the\n license ends and will need to be renewed.

" + "smithy.api#documentation": "

If this workspace has a full Grafana Enterprise license purchased through \n Amazon Web Services Marketplace, this specifies when the\n license ends and will need to be renewed. Purchasing the Enterprise plugins option \n through Amazon Managed Grafana does not have an expiration. It is valid until the \n license is removed.

" } }, "freeTrialExpiration": { "target": "smithy.api#Timestamp", "traits": { - "smithy.api#documentation": "

If this workspace is currently in the free trial period for Grafana Enterprise, this\n value specifies when that free trial ends.

" + "smithy.api#documentation": "

If this workspace is currently in the free trial period for Grafana Enterprise, this\n value specifies when that free trial ends.

\n \n

Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.

\n
" } }, "authentication": { @@ -3806,6 +3822,12 @@ "traits": { "smithy.api#documentation": "

The configuration settings for network access to your workspace.

" } + }, + "grafanaToken": { + "target": "com.amazonaws.grafana#GrafanaToken", + "traits": { + "smithy.api#documentation": "

The token that ties this workspace to a Grafana Labs account. For more information, \n see Register with Grafana Labs.

" + } } }, "traits": { @@ -3978,6 +4000,18 @@ "traits": { "smithy.api#documentation": "

The list of tags associated with the workspace.

" } + }, + "licenseType": { + "target": "com.amazonaws.grafana#LicenseType", + "traits": { + "smithy.api#documentation": "

Specifies whether this workspace has a full Grafana Enterprise license.

\n \n

Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.

\n
" + } + }, + "grafanaToken": { + "target": "com.amazonaws.grafana#GrafanaToken", + "traits": { + "smithy.api#documentation": "

The token that ties this workspace to a Grafana Labs account. For more information, \n see Register with Grafana Labs.

" + } } }, "traits": {