Mercurial > hg > thermostat-ng > web-gateway
changeset 187:8f0bcc7a9677
Fix /system-cpu/0.0.1 responding with 404 by removing the path from swagger
Reviewed-by: jerboaa
Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2017-June/023926.html
author | Christopher Koehler <chkoehle@redhat.com> |
---|---|
date | Wed, 28 Jun 2017 09:07:14 -0400 |
parents | 69076d3867be |
children | 96db1ee35432 |
files | services/system-cpu/src/main/resources/cpu-info-swagger.yaml services/system-cpu/src/main/resources/system-cpu-swagger.yaml |
diffstat | 2 files changed, 155 insertions(+), 170 deletions(-) [+] |
line wrap: on
line diff
--- a/services/system-cpu/src/main/resources/cpu-info-swagger.yaml Mon Jun 26 08:55:20 2017 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,170 +0,0 @@ -swagger: '2.0' -info: - version: 0.0.1 - title: Thermostat Web Gateway CPU Info 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: /system-cpu/0.0.1 -paths: - /: - get: - description: Get all CPU information for all systems. - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/sort' - - $ref: '#/parameters/include' - - $ref: '#/parameters/exclude' - - $ref: '#/parameters/query' - responses: - '200': - description: OK - schema: - $ref: '#/definitions/cpu-info-get-response' - /systems/{systemId}: - parameters: - - $ref: '#/parameters/system-id' - get: - description: Get CPU information for system {systemId}. - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/sort' - - $ref: '#/parameters/include' - - $ref: '#/parameters/exclude' - - $ref: '#/parameters/query' - responses: - '200': - description: OK - schema: - $ref: '#/definitions/cpu-info-get-response' - put: - description: Update CPU information for system {systemId}. - parameters: - - $ref: '#/parameters/cpu-info-put-body' - - $ref: '#/parameters/query' - responses: - '200': - description: OK - post: - description: Add CPU information for system {systemId} - parameters: - - $ref: '#/parameters/cpu-info-array' - responses: - '200': - description: OK - delete: - description: Delete CPU information for system ID {systemId}. - parameters: - - $ref: '#/parameters/query' - responses: - '200': - description: OK -definitions: - cpu-info-get-response: - type: object - properties: - response: - $ref: '#/definitions/cpu-info-array' - cpu-info-array: - type: array - items: - $ref: '#/definitions/cpu-info' - cpu-info: - type: object - properties: - systemId: - type: string - agentId: - type: string - timestamp: - type: integer - format: int64 - perProcessorUsage: - type: array - items: - type: integer - format: int64 - cpu-info-put-body: - type: object - properties: - "set": - type: object -parameters: - system-id: - name: systemId - in: path - required: true - type: string - cpu-info-array: - name: cpu-info-array - in: body - description: The system CPU information - required: true - schema: - $ref: '#/definitions/cpu-info-array' - cpu-info-put-body: - name: body - 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. - Must not include 'systemId' field. Example { "set" : { - "field" : "value", "field2":{"object":"item"} } - required: true - schema: - $ref: '#/definitions/cpu-info-put-body' - limit: - name: limit - in: query - description: Limit of items to return. Example '1' - type: integer - required: false - default: 1 - offset: - name: offset - in: query - description: Offset of items to return. Example '0' - type: integer - required: true - default: 0 - sort: - name: sort - in: query - description: Sort string. Comma separated list of fields prefixed with '+' for ascending or '-' for descending. Example '?sort=+a,-b' Fields use dot notation for embedded documents. Example 'outer.inner' refers to field inner contained in field outer. - type: string - required: false - query: - name: query - in: query - description: Query string. Comma separated list of key, comparator, value pairs. Comparator supports '==', '<=', '>=', '<', '>', '!='. Example '?query=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. - type: string - required: false - 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/services/system-cpu/src/main/resources/system-cpu-swagger.yaml Wed Jun 28 09:07:14 2017 -0400 @@ -0,0 +1,155 @@ +swagger: '2.0' +info: + version: 0.0.1 + title: Thermostat Web Gateway CPU Info 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: /system-cpu/0.0.1 +paths: + /systems/{systemId}: + parameters: + - $ref: '#/parameters/system-id' + get: + description: Get CPU information for system {systemId}. + parameters: + - $ref: '#/parameters/limit' + - $ref: '#/parameters/offset' + - $ref: '#/parameters/sort' + - $ref: '#/parameters/include' + - $ref: '#/parameters/exclude' + - $ref: '#/parameters/query' + responses: + '200': + description: OK + schema: + $ref: '#/definitions/cpu-info-get-response' + put: + description: Update CPU information for system {systemId}. + parameters: + - $ref: '#/parameters/cpu-info-put-body' + - $ref: '#/parameters/query' + responses: + '200': + description: OK + post: + description: Add CPU information for system {systemId} + parameters: + - $ref: '#/parameters/cpu-info-array' + responses: + '200': + description: OK + delete: + description: Delete CPU information for system ID {systemId}. + parameters: + - $ref: '#/parameters/query' + responses: + '200': + description: OK +definitions: + cpu-info-get-response: + type: object + properties: + response: + $ref: '#/definitions/cpu-info-array' + cpu-info-array: + type: array + items: + $ref: '#/definitions/cpu-info' + cpu-info: + type: object + properties: + systemId: + type: string + agentId: + type: string + timestamp: + type: integer + format: int64 + perProcessorUsage: + type: array + items: + type: integer + format: int64 + cpu-info-put-body: + type: object + properties: + "set": + type: object +parameters: + system-id: + name: systemId + in: path + required: true + type: string + cpu-info-array: + name: cpu-info-array + in: body + description: The system CPU information + required: true + schema: + $ref: '#/definitions/cpu-info-array' + cpu-info-put-body: + name: body + 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. + Must not include 'systemId' field. Example { "set" : { + "field" : "value", "field2":{"object":"item"} } + required: true + schema: + $ref: '#/definitions/cpu-info-put-body' + limit: + name: limit + in: query + description: Limit of items to return. Example '1' + type: integer + required: false + default: 1 + offset: + name: offset + in: query + description: Offset of items to return. Example '0' + type: integer + required: true + default: 0 + sort: + name: sort + in: query + description: Sort string. Comma separated list of fields prefixed with '+' for ascending or '-' for descending. Example '?sort=+a,-b' Fields use dot notation for embedded documents. Example 'outer.inner' refers to field inner contained in field outer. + type: string + required: false + query: + name: query + in: query + description: Query string. Comma separated list of key, comparator, value pairs. Comparator supports '==', '<=', '>=', '<', '>', '!='. Example '?query=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. + type: string + required: false + 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