Skip to content

list_versions

list_versions(
    *,
    config_overrides: Optional[grafanaClientConfig] = None,
    max_results: Optional[int] = None,
    next_token: Optional[PaginationToken] = None,
    workspace_id: Optional[WorkspaceId] = None,
) -> ListVersionsResponse

Lists available versions of Grafana. These are available when calling CreateWorkspace. Optionally, include a workspace to list the versions to which it can be upgraded.

Parameters:

  • max_results (Optional[int], default: None ) –

    The maximum number of results to include in the response.

  • next_token (Optional[PaginationToken], default: None ) –

    The token to use when requesting the next set of results. You receive this token from a previous ListVersions operation.

  • workspace_id (Optional[WorkspaceId], default: None ) –

    The ID of the workspace to list the available upgrade versions. If not included, lists all versions of Grafana that are supported for CreateWorkspace.

Raises:

Source code in docs_src/capo_grafana/_services/grafana.py
def list_versions(
    self,
    *,
    config_overrides: Optional[grafanaClientConfig] = None,
    max_results: Optional[int] = None,
    next_token: Optional[
        "capo_grafana.types.pagination_token.PaginationToken"
    ] = None,
    workspace_id: Optional["capo_grafana.types.workspace_id.WorkspaceId"] = None,
) -> "capo_grafana.types.list_versions_response.ListVersionsResponse":
    """<p>Lists available versions of Grafana. These are available when calling <code>CreateWorkspace</code>. Optionally, include a workspace to list the versions to which it can be upgraded.</p>

    Args:
        max_results: <p>The maximum number of results to include in the response.</p>
        next_token: <p>The token to use when requesting the next set of results. You receive this token from a previous <code>ListVersions</code> operation.</p>
        workspace_id: <p>The ID of the workspace to list the available upgrade versions. If not included, lists all versions of Grafana that are supported for <code>CreateWorkspace</code>.</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.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.
    """

    def _handler(
        req: "OperationRequest[capo_grafana.types.list_versions_request.ListVersionsRequest]",
    ) -> OperationResponse[
        "capo_grafana.types.list_versions_response.ListVersionsResponse"
    ]:
        import capo_grafana._operations.aws_grafana_control_plane.list_versions

        output, http_response = (
            capo_grafana._operations.aws_grafana_control_plane.list_versions.list_versions(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListVersions")
    )
    input_: capo_grafana.types.list_versions_request.ListVersionsRequest = {}
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if workspace_id is not None:
        input_["workspace_id"] = workspace_id

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output