{ "components": { "schemas": { "delete_event": { "description": "Deletes a reporting entity defined by its `tracking_id`.", "properties": { "tracking_id": { "type": "string", "description": "A unique id, which identifies the association of multiple events. This can i.e. be a user guid, for events related to a user. It is important, that this id is unique and immutable." }, "audit": { "description": "Audit information about this event." } }, "required": [ "tracking_id", "audit" ], "type": "object" }, "field": { "description": "Single field of a topic schema. A field can be used for projecting, filtering and sorting in reports.", "properties": { "type": { "$ref": "#/components/schemas/scalar_type", "description": "The (scalar) type of the field. Fields can only be primitive types." }, "is_array": { "type": "boolean", "description": "Setting this to `true` means the field is an array of given type." }, "fields": { "description": "Nested fields for type `object`. When defining fields but not having set the type to `object`, the fields will be ignored. When setting the type to `object`, the fields need to be defined." }, "label": { "type": "string", "description": "A human-readable label for the field." }, "description": { "type": "string", "description": "A human-readable description of the field." } }, "required": [ "type", "is_array" ], "type": "object" }, "filter": { "description": "Defines a condition for values.", "properties": { "expression": { "type": "string", "description": "An SQL-like expression." }, "variables": { "description": "A map of values, which can be used in the expression. Variables can be access by prepending them with `$`." } }, "type": "object" }, "projection_field": { "description": "A single field of a projection schema.", "properties": { "label": { "type": "string", "description": "A human-readable label for the field." }, "description": { "type": "string", "description": "A human-readable description for the field." }, "source": { "$ref": "#/components/schemas/projection_field_source", "description": "The source of the field. Either `source` or `fields` must be set." }, "fields": { "description": "Defines nested fields for this projection. Either `source` or `fields` must be set." } }, "type": "object" }, "projection_field_source": { "description": "Represents the source for a single projection field from a topic's schema.", "properties": { "topic": { "type": "string", "description": "Name of the originating topic." }, "path": { "type": "string", "description": "A slimmed down variant of [JSON Path](https://gregsdennis.github.io/Manatee.Json/usage/path.html) to point to a specific field in a topic's schema." }, "filter": { "type": "string", "description": "A conditional filter expression. The expression can contain variables, which will be passed in when evaluating the projection." } }, "required": [ "topic", "path", "filter" ], "type": "object" }, "query_form": { "description": "Form for querying and projecting data.", "properties": { "view": { "type": "string", "description": "The name of a defined `view` used for projecting. If the view defines variables, they must be provided as well. Either `view` or `projection` must be set." }, "projection": { "description": "Projected fields to return. Either `view` or `projection` must be set." }, "variables": { "description": "Variables to pass to the projection or the view." }, "sort": { "items": {}, "type": "array", "description": "The defined properties refer to the fields of the projection." } }, "required": [ "variables" ], "type": "object" }, "query_response": { "description": "The result of a query, returning data in a projected form.", "properties": { "page": {}, "data": { "type": "object", "description": "The returned data in the projected form." } }, "required": [ "page", "data" ], "type": "object" }, "topic": { "description": "Represents a single topic, which will be consumed by the reporting service.", "properties": { "name": { "type": "string" }, "service": { "description": "Info about the producing service." }, "schema": { "description": "The schema of the topics' provided data." } }, "required": [ "name", "service", "schema" ], "type": "object" }, "topic_response": { "properties": { "page": {}, "data": { "items": { "$ref": "#/components/schemas/topic" }, "type": "array" } }, "required": [ "page", "data" ], "type": "object" }, "update_event": { "description": "Updates one or more data fields.", "properties": { "tracking_id": { "type": "string", "description": "A unique id, which identifies the association of multiple events. This can i.e. be a user guid, for events related to a user. It is important, that this id is unique and immutable." }, "payload": { "type": "object", "description": "One or more fields defined in the reporting schema, which will be updated." }, "audit": { "description": "Audit information about this event." } }, "required": [ "tracking_id", "payload", "audit" ], "type": "object" }, "view": { "description": "A stored view containing data from one or more topics.", "properties": { "guid": { "type": "string", "format": "uuid", "description": "Globally unique identifier of the projection." }, "name": { "type": "string", "description": "Name of this projection used to reference it in a human-friendly way. The name must be unique." }, "projection": { "description": "Projected fields of this view." }, "variables": { "description": "Definition of variables which can be passed to the view. All `scalar_type`s are allowed, except `object`." } }, "required": [ "guid", "name", "projection", "variables" ], "type": "object" }, "view_form": { "description": "Form for creating a new `view`.", "properties": { "name": { "type": "string", "description": "Name of the view." }, "projection": { "description": "Projected fields of this view." }, "variables": { "description": "Definition of variables which can be passed to the view. All `scalar_type`s are allowed, except `object`." } }, "required": [ "name", "projection", "variables" ], "type": "object" }, "view_response": { "properties": { "page": {}, "data": { "items": { "$ref": "#/components/schemas/view" }, "type": "array" } }, "required": [ "page", "data" ], "type": "object" }, "scalar_type": { "description": "A type for a topic's schema field. Possible values: boolean,date-iso8601,date-time-iso8601,decimal,double,integer,long,string,uuid,object.", "enum": [ "boolean", "date-iso8601", "date-time-iso8601", "decimal", "double", "integer", "long", "string", "uuid", "object" ], "type": "string" }, "reporting_event": { "oneOf": [ { "$ref": "#/components/schemas/update_event" }, { "$ref": "#/components/schemas/delete_event" } ], "discriminator": { "mapping": { "update_event": "#/components/schemas/update_event", "delete_event": "#/components/schemas/delete_event" }, "propertyName": "type" } } } }, "info": { "contact": {}, "description": "Reporting service which aggregates events from dedicated Kafka topics.", "license": { "name": "MIT", "url": "http://opensource.org/licenses/MIT" }, "termsOfService": "", "title": "reporting-api", "version": "0.0.1" }, "openapi": "3.0.2", "paths": { "/query": { "post": { "operationId": "post--query", "parameters": [], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/query_form" } } } }, "responses": { "200": { "description": "de.nccloud.reporting.api.v0.models.query_response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/query_response" } } }, "headers": {} }, "400": { "description": "[de.nccloud.common.v0.models.generic_error]", "content": { "application/json": { "schema": { "items": {}, "type": "array" } } }, "headers": {} } }, "tags": [ "query_response" ] } }, "/topics": { "get": { "operationId": "get--topics", "parameters": [ { "deprecated": false, "example": "0", "in": "query", "required": true, "schema": { "type": "integer" }, "name": "offset" }, { "deprecated": false, "example": "25", "in": "query", "required": true, "schema": { "type": "integer" }, "name": "limit" }, { "deprecated": false, "example": "name", "in": "query", "required": true, "schema": { "type": "string" }, "name": "sort_by" }, { "deprecated": false, "example": "asc", "in": "query", "required": true, "schema": {}, "name": "direction" } ], "responses": { "200": { "description": "de.nccloud.reporting.api.v0.models.topic_response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/topic_response" } } }, "headers": {} } }, "tags": [ "topic" ] } }, "/topics/:guid": { "get": { "operationId": "get--topics-guid", "parameters": [ { "deprecated": false, "in": "path", "required": true, "schema": { "type": "string" }, "name": "guid" } ], "responses": { "200": { "description": "de.nccloud.reporting.api.v0.models.topic", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/topic" } } }, "headers": {} }, "404": { "description": "unit", "content": { "application/json": { "schema": { "type": "integer", "nullable": true } } }, "headers": {} } }, "tags": [ "topic" ] } }, "/views": { "get": { "operationId": "get--views", "parameters": [ { "deprecated": false, "example": "0", "in": "query", "required": true, "schema": { "type": "integer" }, "name": "offset" }, { "deprecated": false, "example": "25", "in": "query", "required": true, "schema": { "type": "integer" }, "name": "limit" }, { "deprecated": false, "example": "name", "in": "query", "required": true, "schema": { "type": "string" }, "name": "sort_by" }, { "deprecated": false, "example": "asc", "in": "query", "required": true, "schema": {}, "name": "direction" } ], "responses": { "200": { "description": "de.nccloud.reporting.api.v0.models.view_response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/view_response" } } }, "headers": {} } }, "tags": [ "view" ] }, "post": { "operationId": "post--views", "parameters": [], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/view_form" } } } }, "responses": { "201": { "description": "de.nccloud.reporting.api.v0.models.view", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/view" } } }, "headers": {} }, "400": { "description": "[de.nccloud.common.v0.models.generic_error]", "content": { "application/json": { "schema": { "items": {}, "type": "array" } } }, "headers": {} } }, "tags": [ "view" ] } }, "/views/:guid": { "get": { "operationId": "get--views-guid", "parameters": [ { "deprecated": false, "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "name": "guid" } ], "responses": { "200": { "description": "de.nccloud.reporting.api.v0.models.view", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/view" } } }, "headers": {} }, "404": { "description": "unit", "content": { "application/json": { "schema": { "type": "integer", "nullable": true } } }, "headers": {} } }, "tags": [ "view" ] }, "put": { "operationId": "put--views-guid", "parameters": [ { "deprecated": false, "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "name": "guid" } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/view_form" } } } }, "responses": { "200": { "description": "de.nccloud.reporting.api.v0.models.view", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/view" } } }, "headers": {} }, "400": { "description": "[de.nccloud.common.v0.models.generic_error]", "content": { "application/json": { "schema": { "items": {}, "type": "array" } } }, "headers": {} }, "404": { "description": "unit", "content": { "application/json": { "schema": { "type": "integer", "nullable": true } } }, "headers": {} } }, "tags": [ "view" ] }, "delete": { "operationId": "delete--views-guid", "parameters": [ { "deprecated": false, "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" }, "name": "guid" } ], "responses": { "200": { "description": "unit", "content": { "application/json": { "schema": { "type": "integer", "nullable": true } } }, "headers": {} }, "404": { "description": "unit", "content": { "application/json": { "schema": { "type": "integer", "nullable": true } } }, "headers": {} } }, "tags": [ "view" ] } } }, "servers": [ {} ] }