Skip to content
Adrian-St edited this page Nov 15, 2018 · 9 revisions

Elasticsearch Doku

API Routes for Elija

  • GET 'http://127.0.0.1:5000/', 
    Header: Content-Type: application/json`
    Body: {}
    
STATUS_CODE: 200
{
    "database status": "on",
    "service name": "artefact service"
}
  • GET 'http://127.0.0.1:5000/artefacts/image', 
    Header: Content-Type: application/json`, 
    Body: {
        "search": "class diagram",
        "date_range": {
            "start_date": "2018-11-14T12:24:54.601004",
        "end_date": "2018-11-14T12:54:54.601004"
        }
    }
    
STATUS_CODE: 200
[
    {
        "_id": "db20072d-38dc-4226-83ff-f204b4366118",
        "_index": "artefact",
        "_score": 0.5753642,
        "_source": {
            "created_at": "2018-11-14T12:41:26.754071",
            "file_url": "class_diagram.png",
            "tags": "uml, class diagram, architecture"
        },
        "_type": "image",
        "sort": [
            0.5753642,
            1542199286754
        ]
    }
]
  • GET 'http://127.0.0.1:5000/artefacts/image/db20072d-38dc-4226-83ff-f204b4366118', 
    Header: Content-Type: application/json`, 
    Body: {}
    
STATUS_CODE: 200
{
    "_id": "db20072d-38dc-4226-83ff-f204b4366118",
    "_index": "artefact",
    "_source": {
        "created_at": "2018-11-14T12:41:26.754071",
        "file_url": "class_diagram.png",
        "tags": "uml, class diagram, architecture"
    },
    "_type": "image",
    "_version": 1,
    "found": true
}
  • POST 'http://127.0.0.1:5000/artefacts/image', 
    Header: Content-Type: application/json`, 
    Body: {
        "id": "db20072d-38dc-4226-83ff-f204b4366118",
        "tags":"uml, class diagram, architecture",
        "file_url": "class_diagram.png"
    }
    
STATUS_CODE: 201
{
    "_id": "db20072d-38dc-4226-83ff-f204b4366118",
    "_index": "artefact",
    "_primary_term": 1,
    "_seq_no": 0,
    "_shards": {
        "failed": 0,
        "successful": 1,
        "total": 2
    },
    "_source": {
        "created_at": "2018-11-14T12:41:26.754071",
        "file_url": "class_diagram.png",
        "tags": "uml, class diagram, architecture"
    },
    "_type": "image",
    "_version": 1,
    "result": "created"
}
  • PUT 'http://127.0.0.1:5000/artefacts/image/db20072d-38dc-4226-83ff-f204b4366118', 
    Header: Content-Type: application/json`, 
    Body: {
        "id": "db20072d-38dc-4226-83ff-f204b4366118",
        "tags":"uml, class diagram, architecture",
        "file_url": "class_diagram.png"
    }
    
STATUS_CODE: 204
  • DELETE 'http://127.0.0.1:5000/artefacts/image/db20072d-38dc-4226-83ff-f204b4366118', 
    Header: Content-Type: application/json`, 
    Body: {}
    
STATUS_CODE: 204
Clone this wiki locally