ManagedGrafana / Client / list_workspace_service_account_tokens

list_workspace_service_account_tokens#

ManagedGrafana.Client.list_workspace_service_account_tokens(**kwargs)#

Returns a list of tokens for a workspace service account.

Note

This does not return the key for each token. You cannot access keys after they are created. To create a new key, delete the token and recreate it.

Service accounts are only available for workspaces that are compatible with Grafana version 9 and above.

See also: AWS API Documentation

Request Syntax

response = client.list_workspace_service_account_tokens(
    maxResults=123,
    nextToken='string',
    serviceAccountId='string',
    workspaceId='string'
)
Parameters:
  • maxResults (integer) – The maximum number of tokens to include in the results.

  • nextToken (string) – The token for the next set of service accounts to return. (You receive this token from a previous ListWorkspaceServiceAccountTokens operation.)

  • serviceAccountId (string) –

    [REQUIRED]

    The ID of the service account for which to return tokens.

  • workspaceId (string) –

    [REQUIRED]

    The ID of the workspace for which to return tokens.

Return type:

dict

Returns:

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.

Exceptions

  • ManagedGrafana.Client.exceptions.ResourceNotFoundException

  • ManagedGrafana.Client.exceptions.ThrottlingException

  • ManagedGrafana.Client.exceptions.ConflictException

  • ManagedGrafana.Client.exceptions.ValidationException

  • ManagedGrafana.Client.exceptions.AccessDeniedException

  • ManagedGrafana.Client.exceptions.InternalServerException