Skip to content

delete_workspace_service_account

delete_workspace_service_account(
    service_account_id: str,
    workspace_id: WorkspaceId,
    *,
    config_overrides: Optional[grafanaClientConfig] = None,
) -> DeleteWorkspaceServiceAccountResponse

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.

Parameters:

  • service_account_id (str) –

    The ID of the service account to delete.

  • workspace_id (WorkspaceId) –

    The ID of the workspace where the service account resides.

Raises:

Source code in docs_src/capo_grafana/_services/grafana.py
def delete_workspace_service_account(
    self,
    service_account_id: str,
    workspace_id: "capo_grafana.types.workspace_id.WorkspaceId",
    *,
    config_overrides: Optional[grafanaClientConfig] = None,
) -> "capo_grafana.types.delete_workspace_service_account_response.DeleteWorkspaceServiceAccountResponse":
    """<p>Deletes a workspace service account from the workspace.</p> <p>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.</p> <p>Service accounts are only available for workspaces that are compatible with Grafana version 9 and above.</p>

    Args:
        service_account_id: <p>The ID of the service account to delete.</p>
        workspace_id: <p>The ID of the workspace where the service account resides.</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.
    """

    def _handler(
        req: "OperationRequest[capo_grafana.types.delete_workspace_service_account_request.DeleteWorkspaceServiceAccountRequest]",
    ) -> OperationResponse[
        "capo_grafana.types.delete_workspace_service_account_response.DeleteWorkspaceServiceAccountResponse"
    ]:
        import capo_grafana._operations.aws_grafana_control_plane.delete_workspace_service_account

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteWorkspaceServiceAccount")
    )
    input_: capo_grafana.types.delete_workspace_service_account_request.DeleteWorkspaceServiceAccountRequest = {
        "service_account_id": service_account_id,
        "workspace_id": workspace_id,
    }

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