2024/05/15 - Amazon Managed Grafana - 6 new api methods
Changes This release adds new ServiceAccount and ServiceAccountToken APIs.
Creates a service account for the workspace. A service account can be used to call Grafana HTTP APIs, and run automated workloads. After creating the service account with the correct GrafanaRole for your use case, use CreateWorkspaceServiceAccountToken to create a token that can be used to authenticate and authorize Grafana HTTP API calls.
You can only create service accounts for workspaces that are compatible with Grafana version 9 and above.
See also: AWS API Documentation
Request Syntax
client.create_workspace_service_account( grafanaRole='ADMIN'|'EDITOR'|'VIEWER', name='string', workspaceId='string' )
string
[REQUIRED]
The permission level to use for this service account.
string
[REQUIRED]
A name for the service account. The name must be unique within the workspace, as it determines the ID associated with the service account.
string
[REQUIRED]
The ID of the workspace within which to create the service account.
dict
Response Syntax
{ 'grafanaRole': 'ADMIN'|'EDITOR'|'VIEWER', 'id': 'string', 'name': 'string', 'workspaceId': 'string' }
Response Structure
(dict) --
grafanaRole (string) --
The permission level given to the service account.
id (string) --
The ID of the service account.
name (string) --
The name of the service account.
workspaceId (string) --
The workspace with which the service account is associated.
Deletes a workspace service account from the workspace.
This will delete any tokens created for the service account, as well. If the tokens are currently in use, the will fail to authenticate / authorize after they are deleted.
Service accounts are only available for workspaces that are compatible with Grafana version 9 and above.
See also: AWS API Documentation
Request Syntax
client.delete_workspace_service_account( serviceAccountId='string', workspaceId='string' )
string
[REQUIRED]
The ID of the service account to delete.
string
[REQUIRED]
The ID of the workspace where the service account resides.
dict
Response Syntax
{ 'serviceAccountId': 'string', 'workspaceId': 'string' }
Response Structure
(dict) --
serviceAccountId (string) --
The ID of the service account deleted.
workspaceId (string) --
The ID of the workspace where the service account was deleted.
Deletes a token for the workspace service account.
This will disable the key associated with the token. If any automation is currently using the key, it will no longer be authenticated or authorized to perform actions with the Grafana HTTP APIs.
Service accounts are only available for workspaces that are compatible with Grafana version 9 and above.
See also: AWS API Documentation
Request Syntax
client.delete_workspace_service_account_token( serviceAccountId='string', tokenId='string', workspaceId='string' )
string
[REQUIRED]
The ID of the service account from which to delete the token.
string
[REQUIRED]
The ID of the token to delete.
string
[REQUIRED]
The ID of the workspace from which to delete the token.
dict
Response Syntax
{ 'serviceAccountId': 'string', 'tokenId': 'string', 'workspaceId': 'string' }
Response Structure
(dict) --
serviceAccountId (string) --
The ID of the service account where the token was deleted.
tokenId (string) --
The ID of the token that was deleted.
workspaceId (string) --
The ID of the workspace where the token was deleted.
Returns a list of service accounts for a workspace.
Service accounts are only available for workspaces that are compatible with Grafana version 9 and above.
See also: AWS API Documentation
Request Syntax
client.list_workspace_service_accounts( maxResults=123, nextToken='string', workspaceId='string' )
integer
The maximum number of service accounts to include in the results.
string
The token for the next set of service accounts to return. (You receive this token from a previous ListWorkspaceServiceAccounts operation.)
string
[REQUIRED]
The workspace for which to list service accounts.
dict
Response Syntax
{ 'nextToken': 'string', 'serviceAccounts': [ { 'grafanaRole': 'ADMIN'|'EDITOR'|'VIEWER', 'id': 'string', 'isDisabled': 'string', 'name': 'string' }, ], 'workspaceId': 'string' }
Response Structure
(dict) --
nextToken (string) --
The token to use when requesting the next set of service accounts.
serviceAccounts (list) --
An array of structures containing information about the service accounts.
(dict) --
A structure that contains the information about one service account.
grafanaRole (string) --
The role of the service account, which sets the permission level used when calling Grafana APIs.
id (string) --
The unique ID of the service account.
isDisabled (string) --
Returns true if the service account is disabled. Service accounts can be disabled and enabled in the Amazon Managed Grafana console.
name (string) --
The name of the service account.
workspaceId (string) --
The workspace to which the service accounts are associated.
Creates a token that can be used to authenticate and authorize Grafana HTTP API operations for the given workspace service account. The service account acts as a user for the API operations, and defines the permissions that are used by the API.
Service accounts are only available for workspaces that are compatible with Grafana version 9 and above.
See also: AWS API Documentation
Request Syntax
client.create_workspace_service_account_token( name='string', secondsToLive=123, serviceAccountId='string', workspaceId='string' )
string
[REQUIRED]
A name for the token to create.
integer
[REQUIRED]
Sets how long the token will be valid, in seconds. You can set the time up to 30 days in the future.
string
[REQUIRED]
The ID of the service account for which to create a token.
string
[REQUIRED]
The ID of the workspace the service account resides within.
dict
Response Syntax
{ 'serviceAccountId': 'string', 'serviceAccountToken': { 'id': 'string', 'key': 'string', 'name': 'string' }, 'workspaceId': 'string' }
Response Structure
(dict) --
serviceAccountId (string) --
The ID of the service account where the token was created.
serviceAccountToken (dict) --
Information about the created token, including the key. Be sure to store the key securely.
id (string) --
The unique ID of the service account token.
key (string) --
The key for the service account token. Used when making calls to the Grafana HTTP APIs to authenticate and authorize the requests.
name (string) --
The name of the service account token.
workspaceId (string) --
The ID of the workspace where the token was created.
Returns a list of tokens for a workspace service account.
Service accounts are only available for workspaces that are compatible with Grafana version 9 and above.
See also: AWS API Documentation
Request Syntax
client.list_workspace_service_account_tokens( maxResults=123, nextToken='string', serviceAccountId='string', workspaceId='string' )
integer
The maximum number of tokens to include in the results.
string
The token for the next set of service accounts to return. (You receive this token from a previous ListWorkspaceServiceAccountTokens operation.)
string
[REQUIRED]
The ID of the service account for which to return tokens.
string
[REQUIRED]
The ID of the workspace for which to return tokens.
dict
Response Syntax
{ 'nextToken': 'string', 'serviceAccountId': 'string', 'serviceAccountTokens': [ { 'createdAt': datetime(2015, 1, 1), 'expiresAt': datetime(2015, 1, 1), 'id': 'string', 'lastUsedAt': datetime(2015, 1, 1), 'name': 'string' }, ], 'workspaceId': 'string' }
Response Structure
(dict) --
nextToken (string) --
The token to use when requesting the next set of service accounts.
serviceAccountId (string) --
The ID of the service account where the tokens reside.
serviceAccountTokens (list) --
An array of structures containing information about the tokens.
(dict) --
A structure that contains the information about a service account token.
createdAt (datetime) --
When the service account token was created.
expiresAt (datetime) --
When the service account token will expire.
id (string) --
The unique ID of the service account token.
lastUsedAt (datetime) --
The last time the token was used to authorize a Grafana HTTP API.
name (string) --
The name of the service account token.
workspaceId (string) --
The ID of the workspace where the tokens reside.