docstr: Manually stop a query with client_id.
  ---
  post:
    summary: Manually stop a query with client_id
    requestBody:
      description: Stop query schema
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StopQuerySchema'
    responses:
      200:
        description: Query stopped
        content:
          application/json:
            schema:
              type: object
              properties:
                  result:
                      type: string
      400:
        $ref: '#/components/responses/400'
      401:
        $ref: '#/components/responses/401'
      404:
        $ref: '#/components/responses/404'
      500:
        $ref: '#/components/responses/500'
docstr_tok: ["Manually","stop","a","query","with","client_id",".","--","-","post",":","summary",":","Manually","stop","a","query","with","client_id","requestBody",":","description",":","Stop","query","schema","required",":","true","content",":","application\/json",":","schema",":","$","ref",":","'","#","\/components\/schemas\/StopQuerySchema'","responses",":","200",":","description",":","Query","stopped","content",":","application\/json",":","schema",":","type",":","object","properties",":","result",":","type",":","string","400",":","$","ref",":","'","#","\/components\/responses\/400'","401",":","$","ref",":","'","#","\/components\/responses\/401'","404",":","$","ref",":","'","#","\/components\/responses\/404'","500",":","$","ref",":","'","#","\/components\/responses\/500","'"]
code: def stop_query(self) -> FlaskResponse:
      """Manually stop a query with client_id.
      ---
      post:
        summary: Manually stop a query with client_id
        requestBody:
          description: Stop query schema
          required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StopQuerySchema'
        responses:
          200:
            description: Query stopped
            content:
              application/json:
                schema:
                  type: object
                  properties:
                      result:
                          type: string
          400:
            $ref: '#/components/responses/400'
          401:
            $ref: '#/components/responses/401'
          404:
            $ref: '#/components/responses/404'
          500:
            $ref: '#/components/responses/500'
      """
      try:
          body = self.stop_query_schema.load(request.json)
          QueryDAO.stop_query(body["client_id"])
          return self.response(200, result="OK")
      except SupersetException as ex:
          return self.response(ex.status, message=ex.message)
  
file_path: superset/superset/queries/api.py
imports: import logging
  from typing import Any
  import backoff
  from flask_appbuilder.api import expose, protect, request, rison, safe
  from flask_appbuilder.models.sqla.interface import SQLAInterface
  from superset import db, event_logger
  from superset.constants import MODEL_API_RW_METHOD_PERMISSION_MAP, RouteMethod
  from superset.daos.query import QueryDAO
  from superset.databases.filters import DatabaseFilter
  from superset.exceptions import SupersetException
  from superset.models.sql_lab import Query
  from superset.queries.filters import QueryFilter
  from superset.queries.schemas import openapi_spec_methods_override, queries_get_updated_since_schema, QuerySchema, StopQuerySchema
  from superset.superset_typing import FlaskResponse
  from superset.views.base_api import BaseSupersetModelRestApi, RelatedFieldFilter, requires_json, statsd_metrics
  from superset.views.filters import BaseFilterRelatedUsers, FilterRelatedOwners
label_desc: Use image node_id 2 for calling the QueryRestApi obj's underlying member method code with example usage: obj.stop_query() and returns: self, self