{ "swagger": "2.0", "info": { "description": "For the administration of analytics exports.", "title": "Analytics Serving Service API", "contact": {}, "license": { "name": "Apache-2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, "version": "{version}" }, "basePath": "/", "paths": { "/admin/instance": { "get": { "security": [ { "Bearer": [] } ], "description": "Get all exports", "produces": [ "application/json" ], "tags": [ "Export" ], "summary": "Get exports", "responses": { "200": { "description": "exports", "schema": { "type": "array", "items": { "$ref": "#/definitions/lib.Instance" } } }, "400": { "description": "error data", "schema": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } } } }, "500": { "description": "Internal Server Error" } } } }, "/admin/instance/{id}": { "delete": { "security": [ { "Bearer": [] } ], "description": "Remove an export.", "produces": [ "application/json", "text/plain" ], "tags": [ "Export" ], "summary": "Delete export", "parameters": [ { "type": "string", "description": "export id", "name": "id", "in": "path", "required": true } ], "responses": { "204": { "description": "No Content" }, "207": { "description": "Multi-Status", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found" }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/databases": { "get": { "security": [ { "Bearer": [] } ], "description": "List all export databases", "consumes": [ "application/json", "text/plain" ], "produces": [ "application/json", "text/plain" ], "tags": [ "Export Database" ], "summary": "Get databases", "parameters": [ { "type": "string", "description": "limit", "name": "limit", "in": "query" }, { "type": "string", "description": "offset", "name": "offset", "in": "query" }, { "type": "string", "description": "order", "name": "order", "in": "query" }, { "type": "string", "description": "search", "name": "search", "in": "query" }, { "type": "string", "description": "deployment", "name": "deployment", "in": "query" }, { "type": "string", "description": "owner", "name": "owner", "in": "query" } ], "responses": { "200": { "description": "databases", "schema": { "type": "array", "items": { "$ref": "#/definitions/lib.ExportDatabase" } } }, "400": { "description": "error data", "schema": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } } } }, "500": { "description": "error message", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "post": { "security": [ { "Bearer": [] } ], "description": "Create an export database.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Export Database" ], "summary": "Create database", "parameters": [ { "description": "export database data", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/lib.ExportDatabaseRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/lib.ExportDatabase" } }, "400": { "description": "error message", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "error message", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/databases/{id}": { "get": { "security": [ { "Bearer": [] } ], "description": "Get an export database.", "produces": [ "application/json" ], "tags": [ "Export Database" ], "summary": "Get database", "parameters": [ { "type": "string", "description": "database id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "database", "schema": { "$ref": "#/definitions/lib.ExportDatabase" } }, "400": { "description": "error message", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "error message", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "error message", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "put": { "security": [ { "Bearer": [] } ], "description": "Update an export database.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Export Database" ], "summary": "Update database", "parameters": [ { "type": "string", "description": "database id", "name": "id", "in": "path", "required": true }, { "description": "export database data", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/lib.ExportDatabaseRequest" } } ], "responses": { "200": { "description": "export database", "schema": { "$ref": "#/definitions/lib.ExportDatabase" } }, "400": { "description": "error message", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "error message", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "error message", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } }, "delete": { "security": [ { "Bearer": [] } ], "description": "Remove an export database.", "produces": [ "application/json" ], "tags": [ "Export Database" ], "summary": "Delete database", "parameters": [ { "type": "string", "description": "database id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK" }, "400": { "description": "error message", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "error message", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "500": { "description": "error message", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/instance": { "get": { "security": [ { "Bearer": [] } ], "description": "Get all exports.", "produces": [ "application/json" ], "tags": [ "Export" ], "summary": "Get exports", "parameters": [ { "type": "string", "description": "limit", "name": "limit", "in": "query" }, { "type": "string", "description": "offset", "name": "offset", "in": "query" }, { "type": "string", "description": "order", "name": "order", "in": "query" }, { "type": "string", "description": "search", "name": "search", "in": "query" }, { "type": "string", "description": "generated", "name": "generated", "in": "query" }, { "type": "string", "description": "export_database_id", "name": "export_database_id", "in": "query" }, { "type": "string", "description": "internal_only", "name": "internal_only", "in": "query" } ], "responses": { "200": { "description": "exports", "schema": { "type": "array", "items": { "$ref": "#/definitions/lib.Instance" } } }, "400": { "description": "error data", "schema": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } } } }, "500": { "description": "Internal Server Error" } } }, "post": { "security": [ { "Bearer": [] } ], "description": "Create an export to the serving layer.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Export" ], "summary": "Create export", "parameters": [ { "description": "request data", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/lib.ServingRequest" } } ], "responses": { "201": { "description": "export", "schema": { "$ref": "#/definitions/lib.Instance" } }, "400": { "description": "error data", "schema": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } } } }, "500": { "description": "Internal Server Error" } } } }, "/instance/{id}": { "get": { "security": [ { "Bearer": [] } ], "description": "Retrieve an export.", "produces": [ "application/json" ], "tags": [ "Export" ], "summary": "Get export", "parameters": [ { "type": "string", "description": "export id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "export", "schema": { "$ref": "#/definitions/lib.Instance" } }, "500": { "description": "Internal Server Error" } } }, "put": { "security": [ { "Bearer": [] } ], "description": "Update an export.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Export" ], "summary": "Update export", "parameters": [ { "type": "string", "description": "export id", "name": "id", "in": "path", "required": true }, { "description": "request data", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/lib.ServingRequest" } } ], "responses": { "200": { "description": "export", "schema": { "$ref": "#/definitions/lib.Instance" } }, "400": { "description": "error data", "schema": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" } } } } }, "500": { "description": "Internal Server Error" } } }, "delete": { "security": [ { "Bearer": [] } ], "description": "Remove an export.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Export" ], "summary": "Delete export", "parameters": [ { "type": "string", "description": "export id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK" }, "204": { "description": "No Content" }, "207": { "description": "Multi-Status", "schema": { "type": "object", "additionalProperties": { "type": "string" } } }, "404": { "description": "Not Found" }, "500": { "description": "Internal Server Error", "schema": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "/instances": { "delete": { "security": [ { "Bearer": [] } ], "description": "Remove multiple exports.", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Export" ], "summary": "Delete exports", "parameters": [ { "description": "export ids", "name": "ids", "in": "body", "required": true, "schema": { "type": "array", "items": { "type": "string" } } } ], "responses": { "200": { "description": "OK" }, "204": { "description": "No Content" }, "207": { "description": "Multi-Status", "schema": { "$ref": "#/definitions/lib.Response" } } } } } }, "definitions": { "lib.ExportDatabase": { "type": "object", "properties": { "deployment": { "type": "string" }, "description": { "type": "string" }, "ewFilterTopic": { "type": "string" }, "id": { "type": "string" }, "name": { "type": "string" }, "public": { "type": "boolean" }, "type": { "type": "string" }, "url": { "type": "string" }, "userId": { "type": "string" } } }, "lib.ExportDatabaseRequest": { "type": "object", "required": [ "EwFilterTopic", "Name", "Type", "Url", "deployment" ], "properties": { "Description": { "type": "string" }, "EwFilterTopic": { "type": "string" }, "Name": { "type": "string" }, "Public": { "type": "boolean" }, "Type": { "type": "string" }, "Url": { "type": "string" }, "deployment": { "type": "string" } } }, "lib.Instance": { "type": "object", "properties": { "applicationId": { "type": "string" }, "createdAt": { "type": "string" }, "database": { "type": "string" }, "description": { "type": "string" }, "entityName": { "type": "string" }, "exportDatabase": { "$ref": "#/definitions/lib.ExportDatabase" }, "exportDatabaseID": { "type": "string" }, "filter": { "type": "string" }, "filterType": { "type": "string" }, "generated": { "type": "boolean" }, "id": { "type": "string" }, "measurement": { "type": "string" }, "name": { "type": "string" }, "offset": { "type": "string" }, "rancherServiceId": { "type": "string" }, "serviceName": { "type": "string" }, "timePath": { "type": "string" }, "timePrecision": { "type": "string" }, "timestampFormat": { "type": "string" }, "timestampUnique": { "type": "boolean" }, "topic": { "type": "string" }, "updatedAt": { "type": "string" }, "userId": { "type": "string" }, "values": { "type": "array", "items": { "$ref": "#/definitions/lib.Value" } } } }, "lib.Response": { "type": "object", "required": [ "message" ], "properties": { "message": { "type": "string" } } }, "lib.ServingRequest": { "type": "object", "required": [ "EntityName", "Filter", "FilterType", "Name", "Offset", "ServiceName", "Topic" ], "properties": { "Description": { "type": "string" }, "EntityName": { "type": "string" }, "ExportDatabaseID": { "type": "string" }, "Filter": { "type": "string" }, "FilterType": { "type": "string" }, "ForceUpdate": { "type": "boolean" }, "Name": { "type": "string" }, "Offset": { "type": "string" }, "ServiceName": { "type": "string" }, "TimePath": { "type": "string" }, "TimePrecision": { "type": "string" }, "TimestampFormat": { "type": "string" }, "TimestampUnique": { "type": "boolean" }, "Topic": { "type": "string" }, "Values": { "type": "array", "items": { "$ref": "#/definitions/lib.ServingRequestValue" } }, "generated": { "type": "boolean" } } }, "lib.ServingRequestValue": { "type": "object", "properties": { "Name": { "type": "string" }, "Path": { "type": "string" }, "Tag": { "type": "boolean" }, "Type": { "type": "string" } } }, "lib.Value": { "type": "object", "properties": { "instanceID": { "type": "string" }, "name": { "type": "string" }, "path": { "type": "string" }, "tag": { "type": "boolean" }, "type": { "type": "string" } } } } }