associateLicense method

Future<AssociateLicenseResponse> associateLicense({
  1. required LicenseType licenseType,
  2. required String workspaceId,
  3. String? grafanaToken,
})

Assigns a Grafana Enterprise license to a workspace. To upgrade, you must use ENTERPRISE for the licenseType, and pass in a valid Grafana Labs token for the grafanaToken. Upgrading to Grafana Enterprise incurs additional fees. For more information, see Upgrade a workspace to Grafana Enterprise.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter licenseType : The type of license to associate with the workspace.

Parameter workspaceId : The ID of the workspace to associate the license with.

Parameter grafanaToken : A token from Grafana Labs that ties your Amazon Web Services account with a Grafana Labs account. For more information, see Link your account with Grafana Labs.

Implementation

Future<AssociateLicenseResponse> associateLicense({
  required LicenseType licenseType,
  required String workspaceId,
  String? grafanaToken,
}) async {
  final headers = <String, String>{
    if (grafanaToken != null) 'Grafana-Token': grafanaToken.toString(),
  };
  final response = await _protocol.send(
    payload: null,
    method: 'POST',
    requestUri:
        '/workspaces/${Uri.encodeComponent(workspaceId)}/licenses/${Uri.encodeComponent(licenseType.value)}',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  return AssociateLicenseResponse.fromJson(response);
}