{
    "components": {
        "schemas": {
            "model.EventModel": {
                "properties": {
                    "etime": {
                        "type": "integer"
                    },
                    "id_client": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "model.EventSearchRequest": {
                "properties": {
                    "from": {
                        "type": "integer"
                    },
                    "id_client": {
                        "type": "string"
                    },
                    "to": {
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "model.MetricModel": {
                "properties": {
                    "id_client": {
                        "type": "string"
                    },
                    "mtime": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "value": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "model.MetricSearchRequest": {
                "properties": {
                    "from": {
                        "type": "integer"
                    },
                    "id_client": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "to": {
                        "type": "integer"
                    }
                },
                "type": "object"
            }
        }
    },
    "externalDocs": {
        "description": "OpenAPI",
        "url": "https://swagger.io/resources/open-api/"
    },
    "info": {
        "contact": {
            "name": "API Support",
            "url": "https://"
        },
        "description": "Yet Another Time Serie",
        "license": {
            "name": "Affero GPL",
            "url": "https://www.gnu.org/licenses/agpl-3.0.en.html#license-text"
        },
        "termsOfService": "https://kevwe.com/",
        "title": "Yats Server",
        "version": "1.0"
    },
    "openapi": "3.0.3",
    "paths": {
        "/event": {
            "post": {
                "description": "store events",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/model.EventModel"
                            }
                        }
                    },
                    "description": "Event body data",
                    "required": true,
                    "x-originalParamName": "event1"
                },
                "responses": {
                    "202": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        },
                        "description": "Accepted"
                    }
                },
                "summary": "write event to db",
                "tags": [
                    "Events"
                ]
            }
        },
        "/event/get": {
            "post": {
                "description": "retrieve events in the specified time window",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/model.EventSearchRequest"
                            }
                        }
                    },
                    "description": "Event query filters",
                    "required": true,
                    "x-originalParamName": "event2"
                },
                "responses": {
                    "200": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        },
                        "description": "OK"
                    }
                },
                "summary": "Get the events From ... and To when present",
                "tags": [
                    "Events"
                ]
            }
        },
        "/event/get/{from}": {
            "get": {
                "description": "retrieve events  from timestamp {from}",
                "parameters": [
                    {
                        "description": "Starting from timestamp :from",
                        "in": "path",
                        "name": "from",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/model.EventSearchRequest"
                            }
                        }
                    },
                    "description": "Event query filters",
                    "required": true,
                    "x-originalParamName": "event2"
                },
                "responses": {
                    "200": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        },
                        "description": "OK"
                    }
                },
                "summary": "Get the events from timestamp {from}",
                "tags": [
                    "Events"
                ]
            }
        },
        "/metric": {
            "post": {
                "description": "store metric",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/model.MetricModel"
                            }
                        }
                    },
                    "description": "Metric request body",
                    "required": true,
                    "x-originalParamName": "metric2"
                },
                "responses": {
                    "202": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        },
                        "description": "Accepted"
                    }
                },
                "summary": "write metric to db",
                "tags": [
                    "Metrics"
                ]
            }
        },
        "/metric/get": {
            "post": {
                "description": "retrieve metric in the specified time window",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/model.MetricSearchRequest"
                            }
                        }
                    },
                    "description": "Metric query filters",
                    "required": true,
                    "x-originalParamName": "metric1"
                },
                "responses": {
                    "200": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        },
                        "description": "OK"
                    }
                },
                "summary": "Get the metrics From ... and To when present",
                "tags": [
                    "Metrics"
                ]
            }
        },
        "/metric/get/{name}/{from}": {
            "get": {
                "description": "retrieve metric in the specified time window",
                "parameters": [
                    {
                        "description": "Metric Name :name",
                        "in": "path",
                        "name": "name",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "Starting from epoch :from",
                        "in": "path",
                        "name": "from",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        },
                        "description": "OK"
                    }
                },
                "summary": "Get the spcific metric {name} starting from the epoch {from}",
                "tags": [
                    "Metrics"
                ]
            }
        }
    }
}