{"name":"reporting-api","description":"Reporting service which aggregates events from dedicated Kafka topics.","info":{"license":{"name":"MIT","url":"http://opensource.org/licenses/MIT"}},"imports":[{"uri":"https://app.apibuilder.io/nccloud/common/latest/service.json"}],"headers":[],"enums":{"scalar_type":{"description":"A type for a topic's schema field.","values":[{"name":"boolean"},{"name":"date-iso8601"},{"name":"date-time-iso8601"},{"name":"decimal"},{"name":"double"},{"name":"integer"},{"name":"long"},{"name":"string"},{"name":"uuid"},{"name":"object","description":"Note: when a type is set to `object`, the additional fields **must** be defined in the schema."}]}},"interfaces":{},"models":{"field":{"description":"Single field of a topic schema. A field can be used for projecting, filtering and sorting in reports.","fields":[{"name":"type","type":"scalar_type","description":"The (scalar) type of the field. Fields can only be primitive types."},{"name":"is_array","type":"boolean","description":"Setting this to `true` means the field is an array of given type."},{"name":"fields","type":"map[field]","required":false,"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."},{"name":"label","type":"string","required":false,"description":"A human-readable label for the field."},{"name":"description","type":"string","required":false,"description":"A human-readable description of the field."}]},"topic":{"description":"Represents a single topic, which will be consumed by the reporting service.","fields":[{"name":"name","type":"string"},{"name":"service","type":"de.nccloud.common.v0.models.service_info","description":"Info about the producing service."},{"name":"schema","type":"map[field]","description":"The schema of the topics' provided data."}]},"topic_response":{"fields":[{"name":"page","type":"de.nccloud.common.v0.models.page_response"},{"name":"data","type":"[topic]"}]},"filter":{"description":"Defines a condition for values.","fields":[{"name":"expression","type":"string","required":false,"description":"An SQL-like expression."},{"name":"variables","type":"map[json]","required":false,"description":"A map of values, which can be used in the expression. Variables can be access by prepending them with `$`."}]},"projection_field_source":{"description":"Represents the source for a single projection field from a topic's schema.","fields":[{"name":"topic","type":"string","description":"Name of the originating topic."},{"name":"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."},{"name":"filter","type":"string","description":"A conditional filter expression. The expression can contain variables, which will be passed in when evaluating the projection."}]},"projection_field":{"description":"A single field of a projection schema.","fields":[{"name":"label","type":"string","required":false,"description":"A human-readable label for the field."},{"name":"description","type":"string","required":false,"description":"A human-readable description for the field."},{"name":"source","type":"projection_field_source","required":false,"description":"The source of the field. Either `source` or `fields` must be set."},{"name":"fields","type":"map[projection_field]","required":false,"description":"Defines nested fields for this projection. Either `source` or `fields` must be set."}]},"view":{"description":"A stored view containing data from one or more topics.","fields":[{"name":"guid","type":"uuid","description":"Globally unique identifier of the projection."},{"name":"name","type":"string","description":"Name of this projection used to reference it in a human-friendly way. The name must be unique."},{"name":"projection","type":"map[projection_field]","description":"Projected fields of this view."},{"name":"variables","type":"map[scalar_type]","description":"Definition of variables which can be passed to the view. All `scalar_type`s are allowed, except `object`."}]},"view_form":{"description":"Form for creating a new `view`.","fields":[{"name":"name","type":"string","description":"Name of the view."},{"name":"projection","type":"map[projection_field]","description":"Projected fields of this view."},{"name":"variables","type":"map[scalar_type]","description":"Definition of variables which can be passed to the view. All `scalar_type`s are allowed, except `object`."}]},"view_response":{"fields":[{"name":"page","type":"de.nccloud.common.v0.models.page_response"},{"name":"data","type":"[view]"}]},"query_form":{"description":"Form for querying and projecting data.","fields":[{"name":"view","type":"string","required":false,"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."},{"name":"projection","type":"map[projection_field]","required":false,"description":"Projected fields to return. Either `view` or `projection` must be set."},{"name":"variables","type":"map[json]","description":"Variables to pass to the projection or the view."},{"name":"sort","type":"[de.nccloud.common.v0.models.sort]","required":false,"description":"The defined properties refer to the fields of the projection."}]},"query_response":{"description":"The result of a query, returning data in a projected form.","fields":[{"name":"page","type":"de.nccloud.common.v0.models.page_response"},{"name":"data","type":"object","description":"The returned data in the projected form."}]},"update_event":{"description":"Updates one or more data fields.","fields":[{"name":"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."},{"name":"payload","type":"object","description":"One or more fields defined in the reporting schema, which will be updated."},{"name":"audit","type":"de.nccloud.common.v0.models.audit","description":"Audit information about this event."}]},"delete_event":{"description":"Deletes a reporting entity defined by its `tracking_id`.","fields":[{"name":"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."},{"name":"audit","type":"de.nccloud.common.v0.models.audit","description":"Audit information about this event."}]}},"unions":{"reporting_event":{"discriminator":"type","types":[{"type":"update_event"},{"type":"delete_event"}]}},"resources":{"topic":{"operations":[{"method":"GET","parameters":[{"name":"offset","type":"integer","default":0,"location":"query"},{"name":"limit","type":"integer","default":25,"location":"query"},{"name":"sort_by","type":"string","default":"name","location":"query"},{"name":"direction","type":"de.nccloud.common.v0.enums.sort_direction","default":"asc","location":"query"}],"responses":{"200":{"type":"topic_response"}}},{"method":"GET","path":"/:guid","responses":{"200":{"type":"topic"},"404":{"type":"unit"}}}]},"view":{"operations":[{"method":"GET","parameters":[{"name":"offset","type":"integer","default":0,"location":"query"},{"name":"limit","type":"integer","default":25,"location":"query"},{"name":"sort_by","type":"string","default":"name","location":"query"},{"name":"direction","type":"de.nccloud.common.v0.enums.sort_direction","default":"asc","location":"query"}],"responses":{"200":{"type":"view_response"}}},{"method":"GET","path":"/:guid","responses":{"200":{"type":"view"},"404":{"type":"unit"}}},{"method":"POST","body":{"type":"view_form"},"responses":{"201":{"type":"view"},"400":{"type":"[de.nccloud.common.v0.models.generic_error]"}}},{"method":"PUT","path":"/:guid","body":{"type":"view_form"},"responses":{"200":{"type":"view"},"400":{"type":"[de.nccloud.common.v0.models.generic_error]"},"404":{"type":"unit"}}},{"method":"DELETE","path":"/:guid","responses":{"200":{"type":"unit"},"404":{"type":"unit"}}}]},"query_response":{"description":"Query data and display it with a given projection.","path":"/query","operations":[{"method":"POST","body":{"type":"query_form"},"responses":{"200":{"type":"query_response"},"400":{"type":"[de.nccloud.common.v0.models.generic_error]"}}}]}},"attributes":[],"annotations":{}}