create_workspace_api_key
¶
create_workspace_api_key(
key_name: ApiKeyName,
key_role: str,
seconds_to_live: int,
workspace_id: WorkspaceId,
*,
config_overrides: Optional[grafanaClientConfig] = None,
) -> CreateWorkspaceApiKeyResponse
Creates a Grafana API key for the workspace. This key can be used to authenticate requests sent to the workspace's HTTP API. See https://docs.aws.amazon.com/grafana/latest/userguide/Using-Grafana-APIs.html for available APIs and example requests.
In workspaces compatible with Grafana version 9 or above, use workspace service accounts instead of API keys. API keys will be removed in a future release.
Parameters:
-
key_name(ApiKeyName) –Specifies the name of the key. Keynames must be unique to the workspace.
-
key_role(str) –Specifies the permission level of the key.
Valid values:
ADMIN|EDITOR|VIEWER -
seconds_to_live(int) –Specifies the time in seconds until the key expires. Keys can be valid for up to 30 days.
-
workspace_id(WorkspaceId) –The ID of the workspace to create an API key.
Raises:
-
AccessDeniedException–You do not have sufficient permissions to perform this action.
-
ConflictException–A resource was in an inconsistent state during an update or a deletion.
-
InternalServerException–Unexpected error while processing the request. Retry the request.
-
ResourceNotFoundException–The request references a resource that does not exist.
-
ServiceQuotaExceededException–The request would cause a service quota to be exceeded.
-
ThrottlingException–The request was denied because of request throttling. Retry the request.
-
ValidationException–The value of a parameter in the request caused an error.
-
UnknownServiceError–The service returned an error code this client does not model.