view services/jvm-gc/src/main/resources/jvm-gc-swagger.yaml @ 278:0e78f20b300f

Add descriptions for 'metric' types in API specs throughout. Reviewed-by: jkang Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-October/025342.html
author Miloslav Zezulka <mzezulka@redhat.com>
date Tue, 10 Oct 2017 11:58:42 +0200
parents fe616d82ac59
children 45826353de65
line wrap: on
line source

swagger: '2.0'
info:
  version: 0.0.2
  title: Thermostat Web Gateway JVM GC API
  license:
    name: GPL v2 with Classpath Exception
    url: 'http://www.gnu.org/licenses'
consumes:
  - application/json
produces:
  - application/json
  - text/html; charset=utf-8
basePath: /jvm-gc/0.0.3
paths:
  /jvms/{jvmId}:
    parameters:
      - $ref: '#/parameters/thermostat-realms'
      - $ref: '#/parameters/jvm-id'
    get:
      description: Get jvm gc information.
      parameters:
        - $ref: '#/parameters/limit'
        - $ref: '#/parameters/offset'
        - $ref: '#/parameters/sort'
        - $ref: '#/parameters/include'
        - $ref: '#/parameters/exclude'
        - $ref: '#/parameters/query'
        - $ref: '#/parameters/metadata'
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/jvm-gc-stats-response'
  /systems/{systemId}/jvms/{jvmId}:
    parameters:
      - $ref: '#/parameters/thermostat-realms'
      - $ref: '#/parameters/system-id'
      - $ref: '#/parameters/jvm-id'
    get:
      description: Get jvm gc information.
      parameters:
        - $ref: '#/parameters/limit'
        - $ref: '#/parameters/offset'
        - $ref: '#/parameters/sort'
        - $ref: '#/parameters/include'
        - $ref: '#/parameters/exclude'
        - $ref: '#/parameters/query'
        - $ref: '#/parameters/metadata'
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/jvm-gc-stats-response'
    put:
      description: Update jvm gc information.
      parameters:
        - $ref: '#/parameters/put-body'
        - $ref: '#/parameters/query'
        - $ref: '#/parameters/metadata'
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/metadata'
    post:
      description: Add jvm gc information
      parameters:
        - $ref: '#/parameters/jvm-gc-stats'
        - $ref: '#/parameters/metadata'
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/metadata'
    delete:
      description: Delete jvm gc information.
      parameters:
        - $ref: '#/parameters/query'
        - $ref: '#/parameters/metadata'
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/metadata'
  /delta/{jvmId}:
    parameters:
      - $ref: '#/parameters/jvm-id'
    get:
      description: Get jvm gc information for jvm {jvmId} with deltas for wallTime. Always sorted by timeStamp ascending
      parameters:
        - $ref: '#/parameters/limit'
        - $ref: '#/parameters/offset'
        - $ref: '#/parameters/before'
        - $ref: '#/parameters/after'
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/jvm-gc-delta-response'
definitions:
  jvm-gc-stats-response:
    type: object
    properties:
      response:
          $ref: '#/definitions/jvm-gc-stats'
      metadata:
        $ref: '#/definitions/metadata'
  jvm-gc-stats:
    type: array
    items:
      $ref: '#/definitions/jvm-gc-stat'
  jvm-gc-stat:
    type: object
    properties:
      agentId:
        type: string
      jvmId:
        type: string
      timeStamp:
        allOf:
          - $ref: '#/definitions/metric'
          - description: UNIX timestamp in milliseconds
      collectorName:
        type: string
      runCount:
        $ref: '#/definitions/metric'
      wallTimeInMicros:
        $ref: '#/definitions/metric'
  jvm-gc-delta-response:
    type: object
    properties:
      response:
        $ref: '#/definitions/jvm-gc-delta-stats'
  jvm-gc-delta-stats:
    type: array
    items:
      $ref: '#/definitions/jvm-gc-delta-stat'
  jvm-gc-delta-stat:
      type: object
      properties:
        agentId:
          type: string
        jvmId:
          type: string
        timeStamp:
          allOf:
            - $ref: '#/definitions/metric'
            - description: UNIX timestamp in milliseconds
        collectorName:
          type: string
        runCount:
          $ref: '#/definitions/metric'
        wallTimeInMicros:
          $ref: '#/definitions/metric'
        wallTimeDelta:
          $ref: '#/definitions/metric'
  metric:
    type: object
    properties:
      $numberLong:
        type: string
  metadata:
    type: object
    properties:
      payloadCount:
        type: integer
      count:
        type: integer
      prev:
        type: string
      next:
        type: string
      first:
        type: string
      last:
        type: string
      insertCount:
        type: integer
      matchCount:
        type: integer
      elapsed:
        type: integer
        format: int64
  put-body:
    type: object
    properties:
      "set":
        type: object
parameters:
  system-id:
    name: systemId
    in: path
    required: true
    type: string
  jvm-id:
    name: jvmId
    in: path
    required: true
    type: string
  jvm-gc-stats:
    name: jvm-gc-stats
    in: body
    description: The jvm gc statistics
    required: true
    schema:
      $ref: '#/definitions/jvm-gc-stats'
  put-body:
    name: putBody
    in: body
    description: "The JSON object containing a 'set' object. This contains single item JSON objects that specify the field to replace and the JSON value to replace with. Example { \"set\" : { \"field\" : \"value\", \"field2\":{\"object\":\"item\"} }"
    required: true
    schema:
      $ref: '#/definitions/put-body'
  limit:
    name: limit
    in: query
    description: Limit of items to return. Example '1'
    required: false
    default: 1
    type: integer
  offset:
    name: offset
    in: query
    description: Offset of items to return. Example '0'
    required: false
    default: 0
    type: integer
  sort:
    name: sort
    in: query
    description: Sort string. Comma separated list of fields prefixed with '+' for ascending or '-' for descending. Example '?s=+a,-b' Fields use dot notation for embedded documents. Example 'outer.inner' refers to field inner contained in field outer.
    required: false
    type: string
  query:
    name: query
    in: query
    description: Query string. Comma separated list of key, comparator, value pairs. Comparator supports '==', '<=', '>=', '<', '>', '!='. Example '?q=a==b,c!=d'. Keys are fields in documents and use dot notation for embedded documents. Example 'outer.inner' refers to field inner contained in field outer.
    required: false
    type: string
  include:
    name: include
    in: query
    description: >-
      Inclusion string. Comma separated list of fields to include in the
      response. Example '?include=a,b' Fields use dot notation for embedded
      documents. Example 'outer.inner' refers to field inner contained in field
      outer. Cannot be used in combination with 'exclude' parameter. Overriden by
      'exclude' parameter
    type: string
    required: false
  exclude:
    name: exclude
    in: query
    description: >-
      Exclusion string. Comma separated list of fields to exclude in the
      response. Example '?exclude=a,b' Fields use dot notation for embedded
      documents. Example 'outer.inner' refers to field inner contained in field
      outer. Cannot be used in combination with 'include' parameter; takes
      precedence over 'include' parameter
    type: string
    required: false
  before:
    name: b
    in: query
    description: Before timeStamp. A long that specifies to return documents before the timeStamp.
    type: integer
    format: int64
  after:
    name: a
    in: query
    description: After timeStamp. A long that specifies to return documents after the timeStamp.
    type: integer
    format: int64
  metadata:
    name: metadata
    type: boolean
    in: query
    description: "Metadata flag. If set to 'true', the subsequent request response will return metadata information. If set to 'false', such metadata information will be omitted."
  thermostat-realms:
    name: X-Thermostat-Realms
    type: string
    in: header
    description: "Realms Header used to specify a subset of roles to use for Keycloak authorization. Attempts to specify realms that the client does not have, or no valiod realms at all will result in a 400 Bad Request response. Expects a space separated list of realms. Example 'X-Thermostat-Realms: realm-one realm-two'"