Parses a query string for annotation information. Note that custom key/values are not supported via query string. Users must issue a POST or PUT with content data. @param query The query to parse @return An annotation object if parsing was successful @throws IllegalArgumentException - if the
(final HttpQuery query)
| 309 | * @throws IllegalArgumentException - if the request was malformed |
| 310 | */ |
| 311 | private Annotation parseQS(final HttpQuery query) { |
| 312 | final Annotation note = new Annotation(); |
| 313 | |
| 314 | final String tsuid = query.getQueryStringParam("tsuid"); |
| 315 | if (tsuid != null) { |
| 316 | note.setTSUID(tsuid); |
| 317 | } |
| 318 | |
| 319 | final String start = query.getQueryStringParam("start_time"); |
| 320 | final Long start_time = DateTime.parseDateTimeString(start, ""); |
| 321 | if (start_time < 1) { |
| 322 | throw new BadRequestException("Missing start time"); |
| 323 | } |
| 324 | // TODO - fix for ms support in the future |
| 325 | note.setStartTime(start_time / 1000); |
| 326 | |
| 327 | final String end = query.getQueryStringParam("end_time"); |
| 328 | final Long end_time = DateTime.parseDateTimeString(end, ""); |
| 329 | // TODO - fix for ms support in the future |
| 330 | note.setEndTime(end_time / 1000); |
| 331 | |
| 332 | final String description = query.getQueryStringParam("description"); |
| 333 | if (description != null) { |
| 334 | note.setDescription(description); |
| 335 | } |
| 336 | |
| 337 | final String notes = query.getQueryStringParam("notes"); |
| 338 | if (notes != null) { |
| 339 | note.setNotes(notes); |
| 340 | } |
| 341 | |
| 342 | return note; |
| 343 | } |
| 344 | |
| 345 | private void fetchSingleAnnotation(final TSDB tsdb, final Annotation note, |
| 346 | final HttpQuery query) throws Exception { |
no test coverage detected