updateWorkspaceConfiguration method

Future<void> updateWorkspaceConfiguration({
  1. required Object configuration,
  2. required String workspaceId,
  3. String? grafanaVersion,
})

Updates the configuration string for the given workspace

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

Parameter configuration : The new configuration string for the workspace. For more information about the format and configuration options available, see Working in your Grafana workspace.

Parameter workspaceId : The ID of the workspace to update.

Parameter grafanaVersion : 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.

Implementation

Future<void> updateWorkspaceConfiguration({
  required Object configuration,
  required String workspaceId,
  String? grafanaVersion,
}) async {
  final $payload = <String, dynamic>{
    'configuration': jsonEncode(configuration),
    if (grafanaVersion != null) 'grafanaVersion': grafanaVersion,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/workspaces/${Uri.encodeComponent(workspaceId)}/configuration',
    exceptionFnMap: _exceptionFns,
  );
}