Created
May 1, 2019 20:57
-
-
Save harageth/d3223a2892f309990ff6b4f00da55cd9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"swagger" : "2.0", | |
"info" : { | |
"version" : "0.1.0", | |
"title" : "Salus Monitor Management" | |
}, | |
"schemes" : [ "https", "http" ], | |
"paths" : { | |
"/api/boundMonitors/{envoyId}" : { | |
"get" : { | |
"summary" : "Gets all BoundMonitors attached to a particular Envoy", | |
"description" : "", | |
"operationId" : "getBoundMonitors", | |
"parameters" : [ { | |
"name" : "envoyId", | |
"in" : "path", | |
"required" : true, | |
"type" : "string" | |
} ], | |
"responses" : { | |
"200" : { | |
"description" : "successful operation", | |
"schema" : { | |
"type" : "array", | |
"items" : { | |
"$ref" : "#/definitions/BoundMonitorDTO" | |
} | |
} | |
} | |
}, | |
"security" : [ { | |
"repose_auth" : [ "write:monitor", "read:monitor", "delete:monitor" ] | |
} ] | |
} | |
}, | |
"/api/monitors" : { | |
"get" : { | |
"summary" : "Gets all Monitors irrespective of Tenant", | |
"description" : "", | |
"operationId" : "getAll", | |
"parameters" : [ { | |
"name" : "size", | |
"in" : "query", | |
"required" : false, | |
"type" : "integer", | |
"default" : 100, | |
"format" : "int32" | |
}, { | |
"name" : "page", | |
"in" : "query", | |
"required" : false, | |
"type" : "integer", | |
"default" : 0, | |
"format" : "int32" | |
} ], | |
"responses" : { | |
"200" : { | |
"description" : "successful operation", | |
"schema" : { | |
"$ref" : "#/definitions/PageDetailedMonitorOutput" | |
} | |
} | |
}, | |
"security" : [ { | |
"repose_auth" : [ "write:monitor", "read:monitor", "delete:monitor" ] | |
} ] | |
} | |
}, | |
"/api/monitorsAsStream" : { | |
"get" : { | |
"operationId" : "getAllAsStream", | |
"responses" : { | |
"200" : { | |
"description" : "successful operation", | |
"schema" : { | |
"$ref" : "#/definitions/SseEmitter" | |
} | |
} | |
}, | |
"security" : [ { | |
"repose_auth" : [ "write:monitor", "read:monitor", "delete:monitor" ] | |
} ] | |
} | |
}, | |
"/api/tenant/{tenantId}/monitorLabels" : { | |
"get" : { | |
"summary" : "Gets all Monitors that match labels. All labels must match to retrieve relevant Monitors.", | |
"description" : "", | |
"operationId" : "getMonitorsWithLabels", | |
"parameters" : [ { | |
"name" : "tenantId", | |
"in" : "path", | |
"required" : true, | |
"type" : "string" | |
}, { | |
"in" : "body", | |
"name" : "body", | |
"required" : false, | |
"schema" : { | |
"type" : "object", | |
"additionalProperties" : { | |
"type" : "string" | |
} | |
} | |
} ], | |
"responses" : { | |
"200" : { | |
"description" : "successful operation", | |
"schema" : { | |
"type" : "array", | |
"items" : { | |
"$ref" : "#/definitions/Monitor" | |
} | |
} | |
} | |
}, | |
"security" : [ { | |
"repose_auth" : [ "write:monitor", "read:monitor", "delete:monitor" ] | |
} ] | |
} | |
}, | |
"/api/tenant/{tenantId}/monitors" : { | |
"get" : { | |
"summary" : "Gets all Monitors for Tenant", | |
"description" : "", | |
"operationId" : "getAllForTenant", | |
"parameters" : [ { | |
"name" : "tenantId", | |
"in" : "path", | |
"required" : true, | |
"type" : "string" | |
}, { | |
"name" : "size", | |
"in" : "query", | |
"required" : false, | |
"type" : "integer", | |
"default" : 100, | |
"format" : "int32" | |
}, { | |
"name" : "page", | |
"in" : "query", | |
"required" : false, | |
"type" : "integer", | |
"default" : 0, | |
"format" : "int32" | |
} ], | |
"responses" : { | |
"200" : { | |
"description" : "successful operation", | |
"schema" : { | |
"$ref" : "#/definitions/PageDetailedMonitorOutput" | |
} | |
} | |
}, | |
"security" : [ { | |
"repose_auth" : [ "write:monitor", "read:monitor", "delete:monitor" ] | |
} ] | |
}, | |
"post" : { | |
"summary" : "Creates new Monitor for Tenant", | |
"description" : "", | |
"operationId" : "create", | |
"parameters" : [ { | |
"name" : "tenantId", | |
"in" : "path", | |
"required" : true, | |
"type" : "string" | |
}, { | |
"in" : "body", | |
"name" : "body", | |
"required" : false, | |
"schema" : { | |
"$ref" : "#/definitions/DetailedMonitorInput" | |
} | |
} ], | |
"responses" : { | |
"200" : { | |
"description" : "successful operation", | |
"schema" : { | |
"$ref" : "#/definitions/DetailedMonitorOutput" | |
} | |
}, | |
"201" : { | |
"description" : "Successfully Created Monitor" | |
} | |
}, | |
"security" : [ { | |
"repose_auth" : [ "write:monitor", "read:monitor", "delete:monitor" ] | |
} ] | |
} | |
}, | |
"/api/tenant/{tenantId}/monitors/{uuid}" : { | |
"get" : { | |
"summary" : "Gets specific Monitor for Tenant", | |
"description" : "", | |
"operationId" : "getById", | |
"parameters" : [ { | |
"name" : "tenantId", | |
"in" : "path", | |
"required" : true, | |
"type" : "string" | |
}, { | |
"name" : "uuid", | |
"in" : "path", | |
"required" : true, | |
"type" : "string", | |
"format" : "uuid" | |
} ], | |
"responses" : { | |
"200" : { | |
"description" : "successful operation", | |
"schema" : { | |
"$ref" : "#/definitions/DetailedMonitorOutput" | |
} | |
} | |
}, | |
"security" : [ { | |
"repose_auth" : [ "write:monitor", "read:monitor", "delete:monitor" ] | |
} ] | |
}, | |
"put" : { | |
"summary" : "Updates specific Monitor for Tenant", | |
"description" : "", | |
"operationId" : "update", | |
"parameters" : [ { | |
"name" : "tenantId", | |
"in" : "path", | |
"required" : true, | |
"type" : "string" | |
}, { | |
"name" : "uuid", | |
"in" : "path", | |
"required" : true, | |
"type" : "string", | |
"format" : "uuid" | |
}, { | |
"in" : "body", | |
"name" : "body", | |
"required" : false, | |
"schema" : { | |
"$ref" : "#/definitions/DetailedMonitorInput" | |
} | |
} ], | |
"responses" : { | |
"200" : { | |
"description" : "successful operation", | |
"schema" : { | |
"$ref" : "#/definitions/DetailedMonitorOutput" | |
} | |
} | |
}, | |
"security" : [ { | |
"repose_auth" : [ "write:monitor", "read:monitor", "delete:monitor" ] | |
} ] | |
}, | |
"delete" : { | |
"summary" : "Deletes specific Monitor for Tenant", | |
"description" : "", | |
"operationId" : "delete", | |
"parameters" : [ { | |
"name" : "tenantId", | |
"in" : "path", | |
"required" : true, | |
"type" : "string" | |
}, { | |
"name" : "uuid", | |
"in" : "path", | |
"required" : true, | |
"type" : "string", | |
"format" : "uuid" | |
} ], | |
"responses" : { | |
"204" : { | |
"description" : "Resource Deleted" | |
} | |
}, | |
"security" : [ { | |
"repose_auth" : [ "write:monitor", "read:monitor", "delete:monitor" ] | |
} ] | |
} | |
} | |
}, | |
"definitions" : { | |
"BoundMonitorDTO" : { | |
"type" : "object", | |
"properties" : { | |
"monitorId" : { | |
"type" : "string", | |
"format" : "uuid" | |
}, | |
"zoneTenantId" : { | |
"type" : "string" | |
}, | |
"zoneId" : { | |
"type" : "string" | |
}, | |
"resourceTenant" : { | |
"type" : "string" | |
}, | |
"resourceId" : { | |
"type" : "string" | |
}, | |
"agentType" : { | |
"type" : "string", | |
"enum" : [ "TELEGRAF", "FILEBEAT" ] | |
}, | |
"renderedContent" : { | |
"type" : "string" | |
}, | |
"envoyId" : { | |
"type" : "string" | |
} | |
} | |
}, | |
"Cpu" : { | |
"allOf" : [ { | |
"$ref" : "#/definitions/LocalPlugin" | |
}, { | |
"type" : "object", | |
"properties" : { | |
"percpu" : { | |
"type" : "boolean", | |
"description" : "This is a test" | |
}, | |
"totalcpu" : { | |
"type" : "boolean" | |
}, | |
"collectCpuTime" : { | |
"type" : "boolean" | |
}, | |
"reportActive" : { | |
"type" : "boolean" | |
} | |
} | |
} ] | |
}, | |
"DetailedMonitorInput" : { | |
"type" : "object", | |
"required" : [ "details" ], | |
"properties" : { | |
"name" : { | |
"type" : "string" | |
}, | |
"labelSelector" : { | |
"type" : "object", | |
"additionalProperties" : { | |
"type" : "string" | |
} | |
}, | |
"details" : { | |
"example" : "\"details\":{ \"type\": \"local|remote\",\"plugin\":{ \"type\":\"cpu\", \"collectCpuTime\": false, \"percpu\": false,\"reportActive\": false, \"totalcpu\": true}}", | |
"description" : "details", | |
"$ref" : "#/definitions/MonitorDetails" | |
} | |
} | |
}, | |
"DetailedMonitorOutput" : { | |
"type" : "object", | |
"required" : [ "details" ], | |
"properties" : { | |
"id" : { | |
"type" : "string" | |
}, | |
"name" : { | |
"type" : "string" | |
}, | |
"labelSelector" : { | |
"type" : "object", | |
"additionalProperties" : { | |
"type" : "string" | |
} | |
}, | |
"details" : { | |
"example" : "\"details\":{ \"type\": \"local|remote\", \"plugin\":{ \"type\":\"cpu\", \"collectCpuTime\": false, \"percpu\": false, \"reportActive\": false, \"totalcpu\": true} }", | |
"description" : "details", | |
"$ref" : "#/definitions/MonitorDetails" | |
} | |
} | |
}, | |
"Disk" : { | |
"allOf" : [ { | |
"$ref" : "#/definitions/LocalPlugin" | |
}, { | |
"type" : "object", | |
"properties" : { | |
"mountPoints" : { | |
"type" : "array", | |
"items" : { | |
"type" : "string" | |
} | |
}, | |
"ignoreFs" : { | |
"type" : "array", | |
"items" : { | |
"type" : "string" | |
} | |
} | |
} | |
} ] | |
}, | |
"DiskIo" : { | |
"allOf" : [ { | |
"$ref" : "#/definitions/LocalPlugin" | |
}, { | |
"type" : "object", | |
"properties" : { | |
"devices" : { | |
"type" : "array", | |
"items" : { | |
"type" : "string" | |
} | |
}, | |
"skipSerialNumber" : { | |
"type" : "boolean" | |
}, | |
"deviceTags" : { | |
"type" : "array", | |
"items" : { | |
"type" : "string" | |
} | |
}, | |
"nameTemplates" : { | |
"type" : "array", | |
"items" : { | |
"type" : "string" | |
} | |
} | |
} | |
} ] | |
}, | |
"LocalMonitorDetails" : { | |
"allOf" : [ { | |
"$ref" : "#/definitions/MonitorDetails" | |
}, { | |
"type" : "object", | |
"required" : [ "plugin" ], | |
"properties" : { | |
"plugin" : { | |
"$ref" : "#/definitions/LocalPlugin" | |
} | |
} | |
} ] | |
}, | |
"LocalPlugin" : { | |
"type" : "object", | |
"discriminator" : "type" | |
}, | |
"Mem" : { | |
"allOf" : [ { | |
"$ref" : "#/definitions/LocalPlugin" | |
}, { | |
"type" : "object" | |
} ] | |
}, | |
"Monitor" : { | |
"type" : "object", | |
"required" : [ "agentType", "content", "tenantId" ], | |
"properties" : { | |
"id" : { | |
"type" : "string", | |
"format" : "uuid" | |
}, | |
"monitorName" : { | |
"type" : "string" | |
}, | |
"labelSelector" : { | |
"type" : "object", | |
"additionalProperties" : { | |
"type" : "string" | |
} | |
}, | |
"tenantId" : { | |
"type" : "string", | |
"minLength" : 1 | |
}, | |
"content" : { | |
"type" : "string", | |
"minLength" : 1 | |
}, | |
"agentType" : { | |
"type" : "string", | |
"enum" : [ "TELEGRAF", "FILEBEAT" ] | |
}, | |
"selectorScope" : { | |
"type" : "string", | |
"enum" : [ "ALL_OF", "REMOTE" ] | |
}, | |
"zones" : { | |
"type" : "array", | |
"items" : { | |
"type" : "string" | |
} | |
} | |
} | |
}, | |
"MonitorDetails" : { | |
"type" : "object", | |
"discriminator" : "type" | |
}, | |
"Page" : { | |
"type" : "object", | |
"properties" : { | |
"totalPages" : { | |
"type" : "integer", | |
"format" : "int32" | |
}, | |
"totalElements" : { | |
"type" : "integer", | |
"format" : "int64" | |
}, | |
"size" : { | |
"type" : "integer", | |
"format" : "int32" | |
}, | |
"content" : { | |
"type" : "array", | |
"items" : { | |
"type" : "object" | |
} | |
}, | |
"number" : { | |
"type" : "integer", | |
"format" : "int32" | |
}, | |
"sort" : { | |
"$ref" : "#/definitions/Sort" | |
}, | |
"first" : { | |
"type" : "boolean" | |
}, | |
"numberOfElements" : { | |
"type" : "integer", | |
"format" : "int32" | |
}, | |
"last" : { | |
"type" : "boolean" | |
}, | |
"pageable" : { | |
"$ref" : "#/definitions/Pageable" | |
}, | |
"empty" : { | |
"type" : "boolean" | |
} | |
} | |
}, | |
"PageDetailedMonitorOutput" : { | |
"type" : "object", | |
"properties" : { | |
"totalPages" : { | |
"type" : "integer", | |
"format" : "int32" | |
}, | |
"totalElements" : { | |
"type" : "integer", | |
"format" : "int64" | |
}, | |
"size" : { | |
"type" : "integer", | |
"format" : "int32" | |
}, | |
"content" : { | |
"type" : "array", | |
"items" : { | |
"$ref" : "#/definitions/DetailedMonitorOutput" | |
} | |
}, | |
"number" : { | |
"type" : "integer", | |
"format" : "int32" | |
}, | |
"sort" : { | |
"$ref" : "#/definitions/Sort" | |
}, | |
"first" : { | |
"type" : "boolean" | |
}, | |
"numberOfElements" : { | |
"type" : "integer", | |
"format" : "int32" | |
}, | |
"last" : { | |
"type" : "boolean" | |
}, | |
"pageable" : { | |
"$ref" : "#/definitions/Pageable" | |
}, | |
"empty" : { | |
"type" : "boolean" | |
} | |
} | |
}, | |
"Pageable" : { | |
"type" : "object", | |
"properties" : { | |
"offset" : { | |
"type" : "integer", | |
"format" : "int64" | |
}, | |
"sort" : { | |
"$ref" : "#/definitions/Sort" | |
}, | |
"paged" : { | |
"type" : "boolean" | |
}, | |
"unpaged" : { | |
"type" : "boolean" | |
}, | |
"pageNumber" : { | |
"type" : "integer", | |
"format" : "int32" | |
}, | |
"pageSize" : { | |
"type" : "integer", | |
"format" : "int32" | |
} | |
} | |
}, | |
"Ping" : { | |
"allOf" : [ { | |
"$ref" : "#/definitions/RemotePlugin" | |
}, { | |
"type" : "object", | |
"properties" : { | |
"urls" : { | |
"type" : "array", | |
"items" : { | |
"type" : "string" | |
} | |
}, | |
"count" : { | |
"type" : "integer", | |
"format" : "int32" | |
}, | |
"pingInterval" : { | |
"type" : "integer", | |
"format" : "int32" | |
}, | |
"timeout" : { | |
"type" : "integer", | |
"format" : "int32" | |
}, | |
"deadline" : { | |
"type" : "integer", | |
"format" : "int32" | |
}, | |
"interfaceOrAddress" : { | |
"type" : "string" | |
} | |
} | |
} ] | |
}, | |
"RemoteMonitorDetails" : { | |
"allOf" : [ { | |
"$ref" : "#/definitions/MonitorDetails" | |
}, { | |
"type" : "object", | |
"required" : [ "plugin" ], | |
"properties" : { | |
"monitoringZones" : { | |
"type" : "array", | |
"items" : { | |
"type" : "string" | |
} | |
}, | |
"plugin" : { | |
"$ref" : "#/definitions/RemotePlugin" | |
} | |
} | |
} ] | |
}, | |
"RemotePlugin" : { | |
"type" : "object", | |
"discriminator" : "type" | |
}, | |
"Sort" : { | |
"type" : "object", | |
"properties" : { | |
"sorted" : { | |
"type" : "boolean" | |
}, | |
"unsorted" : { | |
"type" : "boolean" | |
}, | |
"empty" : { | |
"type" : "boolean" | |
} | |
} | |
}, | |
"SseEmitter" : { | |
"type" : "object", | |
"properties" : { | |
"timeout" : { | |
"type" : "integer", | |
"format" : "int64" | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment