openapi: 3.0.0
info:
  title: SAP API
  version: 1.0.0
servers:
- url: http://localhost:8080
paths:
  /rfc/MSS_GET_SQLREQUESTS:
    post:
      tags:
      - SFMSS_SQLREQUESTS
      summary: retrieve the contents of sys.dm_exe_query_stats
      operationId: /rfc/MSS_GET_SQLREQUESTS
      requestBody:
        content:
          application/json:
            schema:
              properties:
                BY_WHAT:
                  type: integer
                  format: int32
                  default: 15
                  description: total logical reads
                CON_NAME:
                  type: string
                  default: DEFAULT
                  maxLength: 30
                  description: Logical name of a database connection
                NROWS:
                  type: integer
                  format: int32
                  default: 50
                  description: Top n rows
                SCHEMA:
                  type: string
                  default: ' '
                  maxLength: 128
                  description: Target schema
                QUERYSTATS:
                  type: array
                  items:
                    type: object
                    properties:
                      SQLHANDLE:
                        type: string
                        maxLength: 128
                        description: handle pointing to sql statment  or procedure
                      OBJECT_NAME:
                        type: string
                        maxLength: 30
                        description: MS SQL Server object name
                      EXEC_COUNT:
                        type: integer
                        format: int64
                        description: Number of plan executions since last compile
                      PCT_EXEC_COUNT:
                        type: integer
                        format: int64
                        description: Percentage of server total execution counts
                      TTL_LOGICAL_READS:
                        type: integer
                        format: int64
                        description: Total logical reads for this plan since compiled
                      PCT_LOGICAL_READS:
                        type: integer
                        format: int64
                        description: Percent of server wide logical reads
                      AVG_LOGICAL_READS:
                        type: integer
                        format: int64
                        description: Average logical reads for this plan since compiled
                      MAX_LOGICAL_READS:
                        type: integer
                        format: int64
                        description: Maximum number of logical reads this plan has ever performed
                      MIN_LOGICAL_READS:
                        type: integer
                        format: int64
                        description: Minimum number of logical reads this plan has ever performed
                      LAST_LOGICAL_READS:
                        type: integer
                        format: int64
                        description: Last logical reads for this plan since compiled
                      TTL_ELAPSED_TIME:
                        type: integer
                        format: int64
                        description: Total elapsed time in microseconds
                      PCT_ELAPSED_TIME:
                        type: integer
                        format: int64
                        description: Percentage of all server elapsed times
                      AVG_ELAPSED_TIME:
                        type: integer
                        format: int64
                        description: Average elapsed time in microseconds
                      MAX_ELAPSED_TIME:
                        type: integer
                        format: int64
                        description: Maximum elapsed time in microseconds
                      MIN_ELAPSED_TIME:
                        type: integer
                        format: int64
                        description: Minimum elapsed time in microseconds
                      LAST_ELAPSED_TIME:
                        type: integer
                        format: int64
                        description: Last elapsed time in microseconds
                      TTL_CPU_TIME:
                        type: integer
                        format: int64
                        description: Total amount of CPU time consumed by executions of this plan
                      PCT_CPU_TIME:
                        type: integer
                        format: int64
                        description: Percent of total worker time
                      AVG_CPU_TIME:
                        type: integer
                        format: int64
                        description: Average amount of CPU time consumed by executions
                      MAX_CPU_TIME:
                        type: integer
                        format: int64
                        description: Maximum CPU time consumed by this plan
                      MIN_CPU_TIME:
                        type: integer
                        format: int64
                        description: Minimum CPU time consumed by this plan
                      LAST_CPU_TIME:
                        type: integer
                        format: int64
                        description: CPU time consumed by last execution of this plan
                      TTL_PHYS_READS:
                        type: integer
                        format: int64
                        description: Total physical reads for this plan
                      PCT_PHYS_READS:
                        type: integer
                        format: int64
                        description: Percent of all physical reads
                      AVG_PHYS_READS:
                        type: integer
                        format: int64
                        description: Total physical reads for this plan
                      MAX_PHYS_READS:
                        type: integer
                        format: int64
                        description: Maximum number of physical reads for this plan
                      MIN_PHYS_READS:
                        type: integer
                        format: int64
                        description: Minimum number of physical reads for this plan
                      LAST_PHYS_READS:
                        type: integer
                        format: int64
                        description: Physical reads last time this plan executed
                      TTL_LOG_WRITES:
                        type: integer
                        format: int64
                        description: Total logical writes for this plan since compiled
                      PCT_LOG_WRITES:
                        type: integer
                        format: int64
                        description: Percentage of all logical writes
                      AVG_LOG_WRITES:
                        type: integer
                        format: int64
                        description: Average logical writes for this plan since compiled
                      MAX_LOG_WRITES:
                        type: integer
                        format: int64
                        description: Maximum logical writes for this plan for a single execution
                      MIN_LOG_WRITES:
                        type: integer
                        format: int64
                        description: Minimum logical writes for this plan for a single execution
                      LAST_LOG_WRITES:
                        type: integer
                        format: int64
                        description: Total logical writes for this plan since compiled
                      TTL_CLR_TIME:
                        type: integer
                        format: int64
                        description: Total amount of CLR time consumed by executions of this plan
                      PCT_CLR_TIME:
                        type: integer
                        format: int64
                        description: Percentage of overall CLR time
                      AVG_CLR_TIME:
                        type: integer
                        format: int64
                        description: Average amount of CLR time consumed by this plan
                      MAX_CLR_TIME:
                        type: integer
                        format: int64
                        description: Maximum CLR time consumed by this plan
                      MIN_CLR_TIME:
                        type: integer
                        format: int64
                        description: Minimum CLR time consumed by this plan
                      LAST_CLR_TIME:
                        type: integer
                        format: int64
                        description: CLR time consumed by last execution of this plan
                      WAIT_FACTOR:
                        type: integer
                        format: int64
                        description: Elapsed time/CPU time
                      STMT_START_OFFSET:
                        type: integer
                        format: int32
                        description: Start statement offset
                      STMT_END_OFFSET:
                        type: integer
                        format: int32
                        description: Statement end offset
                      SQLTEXT:
                        type: string
                        maxLength: 50
                        description: First 50 characters of a SQL Server statement
                      ABAP_NAME:
                        type: string
                        maxLength: 40
                        description: Name of the ABAP report
                      ABAP_LOC:
                        type: integer
                        format: int32
                        description: Offset of a Processing Control Block
                      PLAN_GEN_NUM:
                        type: integer
                        format: int64
                        description: Number of times this plan has been recompiled
                      PLAN_HANDLE:
                        type: string
                        maxLength: 128
                        description: handle pointing to plan used in execution of sql stmt/proc
                      CREATION_TIME:
                        type: string
                        maxLength: 20
                        description: MS SQL Server time at which the plan was compiled.
                      LAST_EXEC_TIME:
                        type: string
                        maxLength: 20
                        description: 'MS SQL Server: Last time at which the plan was executed.'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                properties:
                  QUERYSTATS:
                    type: array
                    items:
                      type: object
                      properties:
                        SQLHANDLE:
                          type: string
                          maxLength: 128
                          description: handle pointing to sql statment  or procedure
                        OBJECT_NAME:
                          type: string
                          maxLength: 30
                          description: MS SQL Server object name
                        EXEC_COUNT:
                          type: integer
                          format: int64
                          description: Number of plan executions since last compile
                        PCT_EXEC_COUNT:
                          type: integer
                          format: int64
                          description: Percentage of server total execution counts
                        TTL_LOGICAL_READS:
                          type: integer
                          format: int64
                          description: Total logical reads for this plan since compiled
                        PCT_LOGICAL_READS:
                          type: integer
                          format: int64
                          description: Percent of server wide logical reads
                        AVG_LOGICAL_READS:
                          type: integer
                          format: int64
                          description: Average logical reads for this plan since compiled
                        MAX_LOGICAL_READS:
                          type: integer
                          format: int64
                          description: Maximum number of logical reads this plan has ever performed
                        MIN_LOGICAL_READS:
                          type: integer
                          format: int64
                          description: Minimum number of logical reads this plan has ever performed
                        LAST_LOGICAL_READS:
                          type: integer
                          format: int64
                          description: Last logical reads for this plan since compiled
                        TTL_ELAPSED_TIME:
                          type: integer
                          format: int64
                          description: Total elapsed time in microseconds
                        PCT_ELAPSED_TIME:
                          type: integer
                          format: int64
                          description: Percentage of all server elapsed times
                        AVG_ELAPSED_TIME:
                          type: integer
                          format: int64
                          description: Average elapsed time in microseconds
                        MAX_ELAPSED_TIME:
                          type: integer
                          format: int64
                          description: Maximum elapsed time in microseconds
                        MIN_ELAPSED_TIME:
                          type: integer
                          format: int64
                          description: Minimum elapsed time in microseconds
                        LAST_ELAPSED_TIME:
                          type: integer
                          format: int64
                          description: Last elapsed time in microseconds
                        TTL_CPU_TIME:
                          type: integer
                          format: int64
                          description: Total amount of CPU time consumed by executions of this plan
                        PCT_CPU_TIME:
                          type: integer
                          format: int64
                          description: Percent of total worker time
                        AVG_CPU_TIME:
                          type: integer
                          format: int64
                          description: Average amount of CPU time consumed by executions
                        MAX_CPU_TIME:
                          type: integer
                          format: int64
                          description: Maximum CPU time consumed by this plan
                        MIN_CPU_TIME:
                          type: integer
                          format: int64
                          description: Minimum CPU time consumed by this plan
                        LAST_CPU_TIME:
                          type: integer
                          format: int64
                          description: CPU time consumed by last execution of this plan
                        TTL_PHYS_READS:
                          type: integer
                          format: int64
                          description: Total physical reads for this plan
                        PCT_PHYS_READS:
                          type: integer
                          format: int64
                          description: Percent of all physical reads
                        AVG_PHYS_READS:
                          type: integer
                          format: int64
                          description: Total physical reads for this plan
                        MAX_PHYS_READS:
                          type: integer
                          format: int64
                          description: Maximum number of physical reads for this plan
                        MIN_PHYS_READS:
                          type: integer
                          format: int64
                          description: Minimum number of physical reads for this plan
                        LAST_PHYS_READS:
                          type: integer
                          format: int64
                          description: Physical reads last time this plan executed
                        TTL_LOG_WRITES:
                          type: integer
                          format: int64
                          description: Total logical writes for this plan since compiled
                        PCT_LOG_WRITES:
                          type: integer
                          format: int64
                          description: Percentage of all logical writes
                        AVG_LOG_WRITES:
                          type: integer
                          format: int64
                          description: Average logical writes for this plan since compiled
                        MAX_LOG_WRITES:
                          type: integer
                          format: int64
                          description: Maximum logical writes for this plan for a single execution
                        MIN_LOG_WRITES:
                          type: integer
                          format: int64
                          description: Minimum logical writes for this plan for a single execution
                        LAST_LOG_WRITES:
                          type: integer
                          format: int64
                          description: Total logical writes for this plan since compiled
                        TTL_CLR_TIME:
                          type: integer
                          format: int64
                          description: Total amount of CLR time consumed by executions of this plan
                        PCT_CLR_TIME:
                          type: integer
                          format: int64
                          description: Percentage of overall CLR time
                        AVG_CLR_TIME:
                          type: integer
                          format: int64
                          description: Average amount of CLR time consumed by this plan
                        MAX_CLR_TIME:
                          type: integer
                          format: int64
                          description: Maximum CLR time consumed by this plan
                        MIN_CLR_TIME:
                          type: integer
                          format: int64
                          description: Minimum CLR time consumed by this plan
                        LAST_CLR_TIME:
                          type: integer
                          format: int64
                          description: CLR time consumed by last execution of this plan
                        WAIT_FACTOR:
                          type: integer
                          format: int64
                          description: Elapsed time/CPU time
                        STMT_START_OFFSET:
                          type: integer
                          format: int32
                          description: Start statement offset
                        STMT_END_OFFSET:
                          type: integer
                          format: int32
                          description: Statement end offset
                        SQLTEXT:
                          type: string
                          maxLength: 50
                          description: First 50 characters of a SQL Server statement
                        ABAP_NAME:
                          type: string
                          maxLength: 40
                          description: Name of the ABAP report
                        ABAP_LOC:
                          type: integer
                          format: int32
                          description: Offset of a Processing Control Block
                        PLAN_GEN_NUM:
                          type: integer
                          format: int64
                          description: Number of times this plan has been recompiled
                        PLAN_HANDLE:
                          type: string
                          maxLength: 128
                          description: handle pointing to plan used in execution of sql stmt/proc
                        CREATION_TIME:
                          type: string
                          maxLength: 20
                          description: MS SQL Server time at which the plan was compiled.
                        LAST_EXEC_TIME:
                          type: string
                          maxLength: 20
                          description: 'MS SQL Server: Last time at which the plan was executed.'
        '400':
          description: Bad request.
        5XX:
          description: Unexpected error.
