Returns a list of Amazon Managed Grafana workspaces in the account, with some information about each workspace. For more complete information about one workspace, use DescribeWorkspace.
Parameters:
-
max_results
(Optional[int], default:
None
)
–
The maximum number of workspaces to include in the results.
-
next_token
(Optional[PaginationToken], default:
None
)
–
The token for the next set of workspaces to return. (You receive this token from a previous ListWorkspaces operation.)
Raises:
Source code in docs_src/capo_grafana/_services/grafana.py
| def list_workspaces(
self,
*,
config_overrides: Optional[grafanaClientConfig] = None,
max_results: Optional[int] = None,
next_token: Optional[
"capo_grafana.types.pagination_token.PaginationToken"
] = None,
) -> "capo_grafana.types.list_workspaces_response.ListWorkspacesResponse":
"""<p>Returns a list of Amazon Managed Grafana workspaces in the account, with some information about each workspace. For more complete information about one workspace, use <a href="https://docs.aws.amazon.com/grafana/latest/APIReference/API_DescribeWorkspace.html">DescribeWorkspace</a>.</p>
Args:
max_results: <p>The maximum number of workspaces to include in the results.</p>
next_token: <p>The token for the next set of workspaces to return. (You receive this token from a previous <code>ListWorkspaces</code> operation.)</p>
Raises:
capo_grafana.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action. </p>
capo_grafana.errors.internal_server_exception.InternalServerException: <p>Unexpected error while processing the request. Retry the request.</p>
capo_grafana.errors.throttling_exception.ThrottlingException: <p>The request was denied because of request throttling. Retry the request.</p>
capo_grafana.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_grafana.types.list_workspaces_request.ListWorkspacesRequest]",
) -> OperationResponse[
"capo_grafana.types.list_workspaces_response.ListWorkspacesResponse"
]:
import capo_grafana._operations.aws_grafana_control_plane.list_workspaces
output, http_response = (
capo_grafana._operations.aws_grafana_control_plane.list_workspaces.list_workspaces(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_grafana.types.list_workspaces_response.ListWorkspacesResponse",
) -> dict[str, Any]:
import capo_grafana.types.list_workspaces_response
return capo_grafana.types.list_workspaces_response.redact_sensitive(output)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("ListWorkspaces", redact_output=_redact_output),
)
input_: capo_grafana.types.list_workspaces_request.ListWorkspacesRequest = {}
if max_results is not None:
input_["max_results"] = max_results
if next_token is not None:
input_["next_token"] = next_token
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|