mirror of
https://github.com/ClusterCockpit/cc-metric-store.git
synced 2024-12-26 16:59:07 +01:00
398 lines
12 KiB
JSON
398 lines
12 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "API for cc-metric-store",
|
|
"title": "cc-metric-store REST API",
|
|
"contact": {
|
|
"name": "ClusterCockpit Project",
|
|
"url": "https://clustercockpit.org",
|
|
"email": "support@clustercockpit.org"
|
|
},
|
|
"license": {
|
|
"name": "MIT License",
|
|
"url": "https://opensource.org/licenses/MIT"
|
|
},
|
|
"version": "1.0.0"
|
|
},
|
|
"host": "localhost:8082",
|
|
"basePath": "/api/",
|
|
"paths": {
|
|
"/debug/": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Write metrics to store",
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"debug"
|
|
],
|
|
"summary": "Debug endpoint",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "Selector",
|
|
"name": "selector",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Debug dump",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/api.ErrorResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/api.ErrorResponse"
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"schema": {
|
|
"$ref": "#/definitions/api.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/api.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/free/": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"free"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "up to timestamp",
|
|
"name": "to",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "ok",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/api.ErrorResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/api.ErrorResponse"
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"schema": {
|
|
"$ref": "#/definitions/api.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/api.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/query/": {
|
|
"get": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"description": "Query metrics.",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"query"
|
|
],
|
|
"summary": "Query metrics",
|
|
"parameters": [
|
|
{
|
|
"description": "API query payload object",
|
|
"name": "request",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/api.ApiQueryRequest"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "API query response object",
|
|
"schema": {
|
|
"$ref": "#/definitions/api.ApiQueryResponse"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/api.ErrorResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/api.ErrorResponse"
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"schema": {
|
|
"$ref": "#/definitions/api.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/api.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/write/": {
|
|
"post": {
|
|
"security": [
|
|
{
|
|
"ApiKeyAuth": []
|
|
}
|
|
],
|
|
"consumes": [
|
|
"text/plain"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "If the lines in the body do not have a cluster tag, use this value instead.",
|
|
"name": "cluster",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "ok",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/api.ErrorResponse"
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized",
|
|
"schema": {
|
|
"$ref": "#/definitions/api.ErrorResponse"
|
|
}
|
|
},
|
|
"403": {
|
|
"description": "Forbidden",
|
|
"schema": {
|
|
"$ref": "#/definitions/api.ErrorResponse"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/api.ErrorResponse"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"api.ApiMetricData": {
|
|
"type": "object",
|
|
"properties": {
|
|
"avg": {
|
|
"type": "number"
|
|
},
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "number"
|
|
}
|
|
},
|
|
"error": {
|
|
"type": "string"
|
|
},
|
|
"from": {
|
|
"type": "integer"
|
|
},
|
|
"max": {
|
|
"type": "number"
|
|
},
|
|
"min": {
|
|
"type": "number"
|
|
},
|
|
"resolution": {
|
|
"type": "integer"
|
|
},
|
|
"to": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"api.ApiQuery": {
|
|
"type": "object",
|
|
"properties": {
|
|
"aggreg": {
|
|
"type": "boolean"
|
|
},
|
|
"host": {
|
|
"type": "string"
|
|
},
|
|
"metric": {
|
|
"type": "string"
|
|
},
|
|
"resolution": {
|
|
"type": "integer"
|
|
},
|
|
"scale-by": {
|
|
"type": "number"
|
|
},
|
|
"subtype": {
|
|
"type": "string"
|
|
},
|
|
"subtype-ids": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"type": {
|
|
"type": "string"
|
|
},
|
|
"type-ids": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"api.ApiQueryRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"cluster": {
|
|
"type": "string"
|
|
},
|
|
"for-all-nodes": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"from": {
|
|
"type": "integer"
|
|
},
|
|
"queries": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/api.ApiQuery"
|
|
}
|
|
},
|
|
"to": {
|
|
"type": "integer"
|
|
},
|
|
"with-data": {
|
|
"type": "boolean"
|
|
},
|
|
"with-padding": {
|
|
"type": "boolean"
|
|
},
|
|
"with-stats": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"api.ApiQueryResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"queries": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/api.ApiQuery"
|
|
}
|
|
},
|
|
"results": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/api.ApiMetricData"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"api.ErrorResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"error": {
|
|
"description": "Error Message",
|
|
"type": "string"
|
|
},
|
|
"status": {
|
|
"description": "Statustext of Errorcode",
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"securityDefinitions": {
|
|
"ApiKeyAuth": {
|
|
"type": "apiKey",
|
|
"name": "X-Auth-Token",
|
|
"in": "header"
|
|
}
|
|
}
|
|
} |