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.
Parameters:
-
max_results
(Optional[int], default:
None
)
–
The maximum number of service accounts to include in the results.
-
next_token
(Optional[PaginationToken], default:
None
)
–
The token for the next set of service accounts to return. (You receive this token from a previous ListWorkspaceServiceAccounts operation.)
-
workspace_id
(WorkspaceId)
–
The workspace for which to list service accounts.
Raises:
Source code in docs_src/capo_grafana/_services/async_grafana.py
| async def list_workspace_service_accounts(
self,
workspace_id: "capo_grafana.types.workspace_id.WorkspaceId",
*,
config_overrides: Optional[AsyncgrafanaClientConfig] = None,
max_results: Optional[int] = None,
next_token: Optional[
"capo_grafana.types.pagination_token.PaginationToken"
] = None,
) -> "capo_grafana.types.list_workspace_service_accounts_response.ListWorkspaceServiceAccountsResponse":
"""<p>Returns a list of service accounts for a workspace.</p> <p>Service accounts are only available for workspaces that are compatible with Grafana version 9 and above.</p>
Args:
max_results: <p>The maximum number of service accounts to include in the results.</p>
next_token: <p>The token for the next set of service accounts to return. (You receive this token from a previous <code>ListWorkspaceServiceAccounts</code> operation.)</p>
workspace_id: <p>The workspace for which to list service accounts.</p>
Raises:
capo_grafana.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action. </p>
capo_grafana.errors.conflict_exception.ConflictException: <p>A resource was in an inconsistent state during an update or a deletion.</p>
capo_grafana.errors.internal_server_exception.InternalServerException: <p>Unexpected error while processing the request. Retry the request.</p>
capo_grafana.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request references a resource that does not exist.</p>
capo_grafana.errors.throttling_exception.ThrottlingException: <p>The request was denied because of request throttling. Retry the request.</p>
capo_grafana.errors.validation_exception.ValidationException: <p>The value of a parameter in the request caused an error.</p>
capo_grafana.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_grafana.types.list_workspace_service_accounts_request.ListWorkspaceServiceAccountsRequest]",
) -> AsyncOperationResponse[
"capo_grafana.types.list_workspace_service_accounts_response.ListWorkspaceServiceAccountsResponse"
]:
import capo_grafana._operations.aws_grafana_control_plane.list_workspace_service_accounts
(
output,
http_response,
) = await capo_grafana._operations.aws_grafana_control_plane.list_workspace_service_accounts.async_list_workspace_service_accounts(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListWorkspaceServiceAccounts")
)
input_: capo_grafana.types.list_workspace_service_accounts_request.ListWorkspaceServiceAccountsRequest = {
"workspace_id": workspace_id
}
if max_results is not None:
input_["max_results"] = max_results
if next_token is not None:
input_["next_token"] = next_token
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|