{
    "swagger": "2.0",
    "info": {
        "contact": {}
    },
    "paths": {
        "/event": {
            "post": {
                "description": "store events",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Events"
                ],
                "summary": "write event to db",
                "parameters": [
                    {
                        "description": "Event body data",
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.EventModel"
                        }
                    }
                ],
                "responses": {
                    "202": {
                        "description": "Accepted",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        },
        "/event/get": {
            "post": {
                "description": "retrieve events in the specified time window",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Events"
                ],
                "summary": "Get the events From ... and To when present",
                "parameters": [
                    {
                        "description": "Event query filters",
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.EventSearchRequest"
                        }
                    },
                    {
                        "description": "Event response",
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/model.EventModel"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        },
        "/metric": {
            "post": {
                "description": "store metric",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Metrics"
                ],
                "summary": "write metric to db",
                "parameters": [
                    {
                        "description": "Metric request body",
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.MetricModel"
                        }
                    }
                ],
                "responses": {
                    "202": {
                        "description": "Accepted",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        },
        "/metric/get": {
            "post": {
                "description": "retrieve metric in the specified time window",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Metrics"
                ],
                "summary": "Get the metrics From ... and To when present",
                "parameters": [
                    {
                        "description": "Metric query filters",
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/model.MetricSearchRequest"
                        }
                    },
                    {
                        "description": "Metric response",
                        "name": "data",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/model.MetricModel"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "string"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "model.EventModel": {
            "type": "object",
            "properties": {
                "etime": {
                    "type": "integer"
                },
                "id_client": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "model.EventSearchRequest": {
            "type": "object",
            "properties": {
                "from": {
                    "type": "integer"
                },
                "id_client": {
                    "type": "string"
                },
                "to": {
                    "type": "integer"
                }
            }
        },
        "model.MetricModel": {
            "type": "object",
            "properties": {
                "id_client": {
                    "type": "string"
                },
                "mtime": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                },
                "value": {
                    "type": "string"
                }
            }
        },
        "model.MetricSearchRequest": {
            "type": "object",
            "properties": {
                "from": {
                    "type": "integer"
                },
                "id_client": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "to": {
                    "type": "integer"
                }
            }
        }
    }
}