This document will provide endpoints available inside Shimenawa
None (Left blank intentionally for flexibility).
Gets root document describing major api endpoints/links.
GET /api/v1
No request parameters required.
Returns a root document.
Content type: application/hal+json
- 200 (successful)
{
"_links": {
"self": {
"href": "http://localhost:5311/api/v1"
},
"create_request": {
"href": "http://localhost:5311/api/v1/requests",
"title": "Create Sumo Log Search Request",
"type": "application/json"
},
"request_id": {
"href": "http://localhost:5311/api/v1/requests{?request_uuid}",
"templated": true
}
}
}
Creates a Sumo Log Search Request.
POST /api/v1/requests
Request body contains the details for the search job request.
- `query` : sumo logic query string
- `from` : start date time to analyze. The format should be ISO 8601.
- `to` : end date time to analyze. The format should be ISO 8601.
- `callback_endpoint`(optional) : POST api endpoint to receive notification if request search is finished.
Content type: application/json
{
"query": "b490ab294b0f0838",
"from": "2016-09-06T00:00:10Z",
"to": "2016-09-07T23:59:59Z",
"callback_endpoint" : "http://abc.xyz.com/api/v1/request_search"
}
Returns a HAL document that contains the request uuid and request parameters.
Content type: application/hal+json
- 201 (for successful creation of request)
- 200 (if same request parameters are found in Shimenawa DB)
- 400 (for invalid request body, comes with an error message)
{
"request_uuid": "00000000-0000-0000-0000-000000000012",
"query": "b490ab294b0f0838",
"from": "2016-09-06T00:00:10Z",
"to": "2016-09-07T23:59:59Z",
"callback_endpoint" : "http://abc.xyz.com/api/v1/request_search",
"_links": {
"self": {
"href": "http://localhost:5311/api/v1/requests/00000000-0000-0000-0000-000000000012"
}
}
}
Gets full information about a request.
GET /api/v1/requests{/?request_uuid}
- `request_uuid` : request uuid.
Returns a HAL document of the request.
Content type: application/hal+json
- 200 (for successful fetch)
- 404 (request not found)
{
"request_uuid": "00000000-0000-0000-0000-000000000012",
"query": "b490ab294b0f0838",
"from": "2016-09-06T00:00:10Z",
"to": "2016-09-07T23:59:59Z",
"success": true,
"status_message": "Done",
"request_time": "2016-09-07T23:59:59Z",
"completed_request_time": "2016-09-08T00:01:00Z",
"apps": [],
"exceptionApps": [],
"callback_endpoint" : "http://abc.xyz.com/api/v1/request_search",
"_links": {
"self": {
"href": "http://localhost:5311/api/v1/requests/00000000-0000-0000-0000-000000000012"
},
"logs": {
"href": "http://localhost:5311/api/v1/requests/00000000-0000-0000-0000-000000000012/logs"
}
}
}
Get Logs of a request.
GET /api/v1/requests{/?request_uuid}/logs
- `request_uuid` : request uuid.
Returns a json array that lists logs for the request.
Content type: application/json
- 200 (for successful fetch)
- 404 (request not found)
[
{ "timestamp": "01", "message": "help" },
{ "timestamp": "02", "message": "exception" }
]
After request is done and callback_endpoint is specified, Shimenawa will POST the request information through the specified callback_endpoint
POST {callback_endpoint}
Remote endpoint should be expecting this Request body that contains the details for the Sumo Log search request.
Content type: application/hal+json
{
"request_uuid": "00000000-0000-0000-0000-000000000012",
"query": "b490ab294b0f0838",
"from": "2016-09-06T00:00:10Z",
"to": "2016-09-07T23:59:59Z",
"success": true,
"status_message": "Done",
"request_time": "2016-09-07T23:59:59Z",
"completed_request_time": "2016-09-08T00:01:00Z",
"apps": [],
"exceptionApps": [],
"callback_endpoint" : "http://abc.xyz.com/api/v1/request_search",
"_links": {
"self": {
"href": "http://localhost:5311/api/v1/requests/00000000-0000-0000-0000-000000000012"
},
"logs": {
"href": "http://localhost:5311/api/v1/requests/00000000-0000-0000-0000-000000000012/logs"
}
}
}
Response must be 200 (OK) to consider it as successful.