Skip to content

Commit

Permalink
feat(client-grafana): Adds support for the new GrafanaToken as part o…
Browse files Browse the repository at this point in the history
…f the Amazon Managed Grafana Enterprise plugins upgrade to associate your AWS account with a Grafana Labs account.
  • Loading branch information
awstools committed Mar 7, 2024
1 parent 9cbbeba commit 00943f4
Show file tree
Hide file tree
Showing 10 changed files with 116 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -100,6 +101,7 @@ export interface AssociateLicenseCommandOutput extends AssociateLicenseResponse,
* // "STRING_VALUE",
* // ],
* // },
* // grafanaToken: "STRING_VALUE",
* // },
* // };
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ export interface CreateWorkspaceCommandOutput extends CreateWorkspaceResponse, _
* // "STRING_VALUE",
* // ],
* // },
* // grafanaToken: "STRING_VALUE",
* // },
* // };
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export interface DeleteWorkspaceCommandOutput extends DeleteWorkspaceResponse, _
* // "STRING_VALUE",
* // ],
* // },
* // grafanaToken: "STRING_VALUE",
* // },
* // };
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export interface DescribeWorkspaceCommandOutput extends DescribeWorkspaceRespons
* // "STRING_VALUE",
* // ],
* // },
* // grafanaToken: "STRING_VALUE",
* // },
* // };
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export interface DisassociateLicenseCommandOutput extends DisassociateLicenseRes
* // "STRING_VALUE",
* // ],
* // },
* // grafanaToken: "STRING_VALUE",
* // },
* // };
*
Expand Down
2 changes: 2 additions & 0 deletions clients/client-grafana/src/commands/ListWorkspacesCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ export interface ListWorkspacesCommandOutput extends ListWorkspacesResponse, __M
* // tags: { // TagMap
* // "<keys>": "STRING_VALUE",
* // },
* // licenseType: "STRING_VALUE",
* // grafanaToken: "STRING_VALUE",
* // },
* // ],
* // nextToken: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export interface UpdateWorkspaceCommandOutput extends UpdateWorkspaceResponse, _
* // "STRING_VALUE",
* // ],
* // },
* // grafanaToken: "STRING_VALUE",
* // },
* // };
*
Expand Down
66 changes: 56 additions & 10 deletions clients/client-grafana/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,18 @@ export interface AssociateLicenseRequest {
/**
* @public
* <p>The type of license to associate with the workspace.</p>
* <note>
* <p>Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.</p>
* </note>
*/
licenseType: LicenseType | undefined;

/**
* @public
* <p>A token from Grafana Labs that ties your Amazon Web Services account with a Grafana
* Labs account. For more information, see <a href="https://docs.aws.amazon.com/grafana/latest/userguide/upgrade-to-Grafana-Enterprise.html#AMG-workspace-register-enterprise">Register with Grafana Labs</a>.</p>
*/
grafanaToken?: string;
}

/**
Expand Down Expand Up @@ -906,29 +916,40 @@ export interface WorkspaceDescription {

/**
* @public
* <p>Specifies whether this workspace has a full Grafana Enterprise license or a free trial
* license.</p>
* <p>Specifies whether this workspace has a full Grafana Enterprise license.</p>
* <note>
* <p>Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.</p>
* </note>
*/
licenseType?: LicenseType;

/**
* @public
* <p>Specifies whether this workspace has already fully used its free trial for Grafana
* Enterprise.</p>
* <note>
* <p>Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.</p>
* </note>
*/
freeTrialConsumed?: boolean;

/**
* @public
* <p>If this workspace has a full Grafana Enterprise license, this specifies when the
* license ends and will need to be renewed.</p>
* <p>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.</p>
*/
licenseExpiration?: Date;

/**
* @public
* <p>If this workspace is currently in the free trial period for Grafana Enterprise, this
* value specifies when that free trial ends.</p>
* <note>
* <p>Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.</p>
* </note>
*/
freeTrialExpiration?: Date;

Expand Down Expand Up @@ -956,6 +977,13 @@ export interface WorkspaceDescription {
* <p>The configuration settings for network access to your workspace.</p>
*/
networkAccessControl?: NetworkAccessConfiguration;

/**
* @public
* <p>The token that ties this workspace to a Grafana Labs account. For more information,
* see <a href="https://docs.aws.amazon.com/grafana/latest/userguide/upgrade-to-Grafana-Enterprise.html#AMG-workspace-register-enterprise">Register with Grafana Labs</a>.</p>
*/
grafanaToken?: string;
}

/**
Expand Down Expand Up @@ -1184,7 +1212,7 @@ export interface UpdateWorkspaceAuthenticationRequest {

/**
* @public
* <p>Specifies whether this workspace uses SAML 2.0, IAM Identity Center (successor to Single Sign-On), or both to
* <p>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 <a href="https://docs.aws.amazon.com/grafana/latest/userguide/authentication-in-AMG.html">User authentication in
* Amazon Managed Grafana</a>.</p>
Expand Down Expand Up @@ -1262,11 +1290,12 @@ export interface UpdateWorkspaceConfigurationRequest {

/**
* @public
* <p>Specifies the version of Grafana to support in the new workspace.</p>
* <p>Specifies the version of Grafana to support in the workspace. If not specified,
* keeps the current version of the workspace.</p>
* <p>Can only be used to upgrade (for example, from 8.4 to 9.4), not
* downgrade (for example, from 9.4 to 8.4).</p>
* <p>To know what versions are available to upgrade to for a specific workspace, see
* the <code>ListVersions</code> operation.</p>
* the <a href="https://docs.aws.amazon.com/grafana/latest/APIReference/API_ListVersions.html">ListVersions</a> operation.</p>
*/
grafanaVersion?: string;
}
Expand Down Expand Up @@ -1763,7 +1792,7 @@ export interface CreateWorkspaceRequest {

/**
* @public
* <p>Specifies whether this workspace uses SAML 2.0, IAM Identity Center (successor to Single Sign-On), or both to
* <p>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 <a href="https://docs.aws.amazon.com/grafana/latest/userguide/authentication-in-AMG.html">User authentication in
* Amazon Managed Grafana</a>.</p>
Expand Down Expand Up @@ -1809,8 +1838,9 @@ export interface CreateWorkspaceRequest {

/**
* @public
* <p>Specifies the version of Grafana to support in the new workspace.</p>
* <p>To get a list of supported version, use the <code>ListVersions</code>
* <p>Specifies the version of Grafana to support in the new workspace. If not specified,
* defaults to the latest version (for example, 9.4).</p>
* <p>To get a list of supported versions, use the <code>ListVersions</code>
* operation.</p>
*/
grafanaVersion?: string;
Expand Down Expand Up @@ -1962,6 +1992,22 @@ export interface WorkspaceSummary {
* <p>The list of tags associated with the workspace.</p>
*/
tags?: Record<string, string>;

/**
* @public
* <p>Specifies whether this workspace has a full Grafana Enterprise license.</p>
* <note>
* <p>Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.</p>
* </note>
*/
licenseType?: LicenseType;

/**
* @public
* <p>The token that ties this workspace to a Grafana Labs account. For more information,
* see <a href="https://docs.aws.amazon.com/grafana/latest/userguide/upgrade-to-Grafana-Enterprise.html#AMG-workspace-register-enterprise">Register with Grafana Labs</a>.</p>
*/
grafanaToken?: string;
}

/**
Expand Down
9 changes: 8 additions & 1 deletion clients/client-grafana/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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(_))),
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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";
Expand Down
52 changes: 43 additions & 9 deletions codegen/sdk-codegen/aws-models/grafana.json
Original file line number Diff line number Diff line change
Expand Up @@ -1003,10 +1003,17 @@
"licenseType": {
"target": "com.amazonaws.grafana#LicenseType",
"traits": {
"smithy.api#documentation": "<p>The type of license to associate with the workspace.</p>",
"smithy.api#documentation": "<p>The type of license to associate with the workspace.</p>\n <note>\n <p>Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.</p>\n </note>",
"smithy.api#httpLabel": {},
"smithy.api#required": {}
}
},
"grafanaToken": {
"target": "com.amazonaws.grafana#GrafanaToken",
"traits": {
"smithy.api#documentation": "<p>A token from Grafana Labs that ties your Amazon Web Services account with a Grafana \n Labs account. For more information, see <a href=\"https://docs.aws.amazon.com/grafana/latest/userguide/upgrade-to-Grafana-Enterprise.html#AMG-workspace-register-enterprise\">Register with Grafana Labs</a>.</p>",
"smithy.api#httpHeader": "Grafana-Token"
}
}
}
},
Expand Down Expand Up @@ -1402,7 +1409,7 @@
"authenticationProviders": {
"target": "com.amazonaws.grafana#AuthenticationProviders",
"traits": {
"smithy.api#documentation": "<p>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 <a href=\"https://docs.aws.amazon.com/grafana/latest/userguide/authentication-in-AMG.html\">User authentication in\n Amazon Managed Grafana</a>.</p>",
"smithy.api#documentation": "<p>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 <a href=\"https://docs.aws.amazon.com/grafana/latest/userguide/authentication-in-AMG.html\">User authentication in\n Amazon Managed Grafana</a>.</p>",
"smithy.api#required": {}
}
},
Expand Down Expand Up @@ -1433,7 +1440,7 @@
"grafanaVersion": {
"target": "com.amazonaws.grafana#GrafanaVersion",
"traits": {
"smithy.api#documentation": "<p>Specifies the version of Grafana to support in the new workspace.</p>\n <p>To get a list of supported version, use the <code>ListVersions</code>\n operation.</p>"
"smithy.api#documentation": "<p>Specifies the version of Grafana to support in the new workspace. If not specified, \n defaults to the latest version (for example, 9.4).</p>\n <p>To get a list of supported versions, use the <code>ListVersions</code>\n operation.</p>"
}
}
}
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -3260,7 +3276,7 @@
"authenticationProviders": {
"target": "com.amazonaws.grafana#AuthenticationProviders",
"traits": {
"smithy.api#documentation": "<p>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 <a href=\"https://docs.aws.amazon.com/grafana/latest/userguide/authentication-in-AMG.html\">User authentication in\n Amazon Managed Grafana</a>.</p>",
"smithy.api#documentation": "<p>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 <a href=\"https://docs.aws.amazon.com/grafana/latest/userguide/authentication-in-AMG.html\">User authentication in\n Amazon Managed Grafana</a>.</p>",
"smithy.api#required": {}
}
},
Expand Down Expand Up @@ -3342,7 +3358,7 @@
"grafanaVersion": {
"target": "com.amazonaws.grafana#GrafanaVersion",
"traits": {
"smithy.api#documentation": "<p>Specifies the version of Grafana to support in the new workspace.</p>\n <p>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).</p>\n <p>To know what versions are available to upgrade to for a specific workspace, see \n the <code>ListVersions</code> operation.</p>"
"smithy.api#documentation": "<p>Specifies the version of Grafana to support in the workspace. If not specified, \n keeps the current version of the workspace.</p>\n <p>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).</p>\n <p>To know what versions are available to upgrade to for a specific workspace, see \n the <a href=\"https://docs.aws.amazon.com/grafana/latest/APIReference/API_ListVersions.html\">ListVersions</a> operation.</p>"
}
}
}
Expand Down Expand Up @@ -3761,25 +3777,25 @@
"licenseType": {
"target": "com.amazonaws.grafana#LicenseType",
"traits": {
"smithy.api#documentation": "<p>Specifies whether this workspace has a full Grafana Enterprise license or a free trial\n license.</p>"
"smithy.api#documentation": "<p>Specifies whether this workspace has a full Grafana Enterprise license.</p>\n <note>\n <p>Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.</p>\n </note>"
}
},
"freeTrialConsumed": {
"target": "smithy.api#Boolean",
"traits": {
"smithy.api#documentation": "<p>Specifies whether this workspace has already fully used its free trial for Grafana\n Enterprise.</p>"
"smithy.api#documentation": "<p>Specifies whether this workspace has already fully used its free trial for Grafana\n Enterprise.</p>\n <note>\n <p>Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.</p>\n </note>"
}
},
"licenseExpiration": {
"target": "smithy.api#Timestamp",
"traits": {
"smithy.api#documentation": "<p>If this workspace has a full Grafana Enterprise license, this specifies when the\n license ends and will need to be renewed.</p>"
"smithy.api#documentation": "<p>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.</p>"
}
},
"freeTrialExpiration": {
"target": "smithy.api#Timestamp",
"traits": {
"smithy.api#documentation": "<p>If this workspace is currently in the free trial period for Grafana Enterprise, this\n value specifies when that free trial ends.</p>"
"smithy.api#documentation": "<p>If this workspace is currently in the free trial period for Grafana Enterprise, this\n value specifies when that free trial ends.</p>\n <note>\n <p>Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.</p>\n </note>"
}
},
"authentication": {
Expand All @@ -3806,6 +3822,12 @@
"traits": {
"smithy.api#documentation": "<p>The configuration settings for network access to your workspace.</p>"
}
},
"grafanaToken": {
"target": "com.amazonaws.grafana#GrafanaToken",
"traits": {
"smithy.api#documentation": "<p>The token that ties this workspace to a Grafana Labs account. For more information, \n see <a href=\"https://docs.aws.amazon.com/grafana/latest/userguide/upgrade-to-Grafana-Enterprise.html#AMG-workspace-register-enterprise\">Register with Grafana Labs</a>.</p>"
}
}
},
"traits": {
Expand Down Expand Up @@ -3978,6 +4000,18 @@
"traits": {
"smithy.api#documentation": "<p>The list of tags associated with the workspace.</p>"
}
},
"licenseType": {
"target": "com.amazonaws.grafana#LicenseType",
"traits": {
"smithy.api#documentation": "<p>Specifies whether this workspace has a full Grafana Enterprise license.</p>\n <note>\n <p>Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.</p>\n </note>"
}
},
"grafanaToken": {
"target": "com.amazonaws.grafana#GrafanaToken",
"traits": {
"smithy.api#documentation": "<p>The token that ties this workspace to a Grafana Labs account. For more information, \n see <a href=\"https://docs.aws.amazon.com/grafana/latest/userguide/upgrade-to-Grafana-Enterprise.html#AMG-workspace-register-enterprise\">Register with Grafana Labs</a>.</p>"
}
}
},
"traits": {
Expand Down

0 comments on commit 00943f4

Please sign in to comment.