@GET @Path("mapi/trades/{pairs}") @Produces(MediaType.APPLICATION_JSON) DSXTradesWrapper getTrades( @PathParam("pairs") String pairs, @DefaultValue("150") @QueryParam("limit") int limit, @DefaultValue("1") @QueryParam("ignore_invalid") int ignoreInvalid, @DefaultValue("LIVE") @QueryParam("mode") String mode) throws IOException;
@POST @Path("trade_history/{ident}/{currency}/") CexIOTrade[] getTradesSince( @PathParam("ident") String tradeableIdentifier, @PathParam("currency") String currency, @DefaultValue("1") @FormParam("since") long since) throws IOException;
@GET @ApiOperation(value = "Get the cluster traffic stats") public TrafficCounterService.TrafficHistogram get(@ApiParam(name = "days", value = "For how many days the traffic stats should be returned") @QueryParam("days") @DefaultValue("30") int days, @ApiParam(name = "daily", value = "Whether the traffic should be aggregate to daily values") @QueryParam("daily") @DefaultValue("false") boolean daily) { final TrafficCounterService.TrafficHistogram trafficHistogram = trafficCounterService.clusterTrafficOfLastDays(Duration.standardDays(days), daily ? TrafficCounterService.Interval.DAILY : TrafficCounterService.Interval.HOURLY); return trafficHistogram; } }
@POST @Path("/config") @Produces({MediaType.APPLICATION_JSON, SmileMediaTypes.APPLICATION_JACKSON_SMILE}) @Consumes({MediaType.APPLICATION_JSON, SmileMediaTypes.APPLICATION_JACKSON_SMILE}) public Response updateAllLookups( InputStream in, @HeaderParam(AuditManager.X_DRUID_AUTHOR) @DefaultValue("") final String author, @HeaderParam(AuditManager.X_DRUID_COMMENT) @DefaultValue("") final String comment, @Context HttpServletRequest req
@Path("start") @POST public Response post(@DefaultValue("0") @QueryParam("testSources") int testSources, @Context Sse sse) { final Process process = new Process(testSources, sse); processes.put(process.getId(), process); Executors.newSingleThreadExecutor().execute(process); final URI processIdUri = UriBuilder.fromResource(DomainResource.class).path("process/{id}").build(process.getId()); return Response.created(processIdUri).build(); }
/** * Reload the graphs for all registered routerIds from disk. */ @RolesAllowed({ "ROUTERS" }) @PUT @Produces({ MediaType.APPLICATION_JSON }) public Response reloadGraphs(@QueryParam("path") String path, @QueryParam("preEvict") @DefaultValue("true") boolean preEvict, @QueryParam("force") @DefaultValue("true") boolean force) { otpServer.getGraphService().reloadGraphs(preEvict, force); return Response.status(Status.OK).build(); }
@Deprecated @POST @Path("dwapi") @FormParam("method") DSXCryptoDepositAddressReturn getCryptoDepositAddress( @HeaderParam("Key") String apiKey, @HeaderParam("Sign") ParamsDigest signer, @FormParam("nonce") SynchronizedValueFactory<Long> nonce, @FormParam("currency") String currency, @DefaultValue("0") @FormParam("newAddress") int newAddress) throws IOException;
@GET @Path("mapi/depth/{pairs}") @Produces(MediaType.APPLICATION_JSON) DSXOrderbookWrapper getOrderbook( @PathParam("pairs") String pairs, @DefaultValue("1") @QueryParam("ignore_invalid") int ignoreInvalid, @DefaultValue("LIVE") @QueryParam("mode") String mode) throws IOException;
@GET public Response getWav(@QueryParam("toneSequence") String toneSequence, @DefaultValue("300") @QueryParam("toneDuration") int toneDuration, @DefaultValue("300") @QueryParam("silenceDuration") int silenceDuration) { File file; try { file = new File(ToneGenerator.generate(toneSequence, toneDuration, silenceDuration)); } catch (LineUnavailableException e) { throw new WebApplicationException(e); } catch (IOException e) { throw new WebApplicationException(e); } return Response.ok(file, "audio/wav").build(); }
@POST @Path("/{dataSourceName}") @Consumes(MediaType.APPLICATION_JSON) @ResourceFilters(RulesResourceFilter.class) public Response setDatasourceRules( @PathParam("dataSourceName") final String dataSourceName, final List<Rule> rules, @HeaderParam(AuditManager.X_DRUID_AUTHOR) @DefaultValue("") final String author, @HeaderParam(AuditManager.X_DRUID_COMMENT) @DefaultValue("") final String comment, @Context HttpServletRequest req ) { if (databaseRuleManager.overrideRule( dataSourceName, rules, new AuditInfo(author, comment, req.getRemoteAddr()) )) { return Response.ok().build(); } return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); }
@Path("start") @POST public Response post(@DefaultValue("0") @QueryParam("testSources") int testSources) { final Process process = new Process(testSources); processes.put(process.getId(), process); Executors.newSingleThreadExecutor().execute(process); final URI processIdUri = UriBuilder.fromResource(DomainResource.class).path("process/{id}").build(process.getId()); return Response.created(processIdUri).build(); }
@GET @Path("api/3/depth/{pairs}") @Produces(MediaType.APPLICATION_JSON) WexDepthWrapper getDepth( @PathParam("pairs") String pairs, @DefaultValue("150") @QueryParam("limit") int limit, @DefaultValue("1") @QueryParam("ignore_invalid") int ignoreInvalid) throws IOException;
@GET @Timed @ApiOperation(value = "Get the most recent alarms of all streams.") @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid ObjectId.") }) public AlertListSummary listRecent(@ApiParam(name = "since", value = "Optional parameter to define a lower date boundary. (UNIX timestamp)", required = false) @QueryParam("since") @DefaultValue("0") @Min(0) int sinceTs, @ApiParam(name = "limit", value = "Maximum number of alerts to return.", required = false) @QueryParam("limit") @DefaultValue("300") @Min(1) int limit) throws NotFoundException { final DateTime since = new DateTime(sinceTs * 1000L, DateTimeZone.UTC); final List<AlertSummary> alerts = getAlertSummaries(alertService.loadRecentOfStreams(getAllowedStreamIds(), since, limit).stream()); return AlertListSummary.create(alerts.size(), alerts); }
@GET @Path("api/3/trades/{pairs}") @Produces(MediaType.APPLICATION_JSON) WexTradesWrapper getTrades( @PathParam("pairs") String pairs, @DefaultValue("1") @QueryParam("limit") int limit, @DefaultValue("1") @QueryParam("ignore_invalid") int ignoreInvalid) throws IOException; }
@GET public ItemsRepresentation query( @Context javax.ws.rs.core.UriInfo info, @QueryParam("offset") @DefaultValue("-1") int offset, @DefaultValue("-1") @QueryParam("limit") int limit) { if (offset == -1 || limit == -1) { offset = offset == -1 ? 0 : offset; limit = limit == -1 ? 10 : limit; throw new WebApplicationException( Response.seeOther(info.getRequestUriBuilder().queryParam("offset", offset) .queryParam("limit", limit).build()) .build() ); } return new ItemsRepresentation(itemsModel, offset, limit); }
@GET @Path("mapi/ticker/{pairs}") @Produces(MediaType.APPLICATION_JSON) DSXTickerWrapper getTicker( @PathParam("pairs") String pairs, @DefaultValue("1") @QueryParam("ignore_invalid") int ignoreInvalid, @DefaultValue("LIVE") @QueryParam("mode") String mode) throws IOException;
@GET @Timed public JsonTesterResponse get(@QueryParam("string") @NotEmpty String string, @QueryParam("flatten") @DefaultValue("false") boolean flatten, @QueryParam("list_separator") @NotEmpty String listSeparator, @QueryParam("key_separator") @NotEmpty String keySeparator, @QueryParam("replace_key_whitespace") boolean replaceKeyWhitespace, @QueryParam("key_whitespace_replacement") String keyWhitespaceReplacement, @QueryParam("key_prefix") String keyPrefix, @QueryParam("kv_separator") @NotEmpty String kvSeparator) { return testJsonExtractor(string, flatten, listSeparator, keySeparator, kvSeparator, replaceKeyWhitespace, keyWhitespaceReplacement, keyPrefix); }
@GET @Path("mapi/lastBars/{pairs}/{period}/{amount}") @Produces(MediaType.APPLICATION_JSON) DSXBarsWrapper getBars( @PathParam("pairs") String pairs, @PathParam("period") String period, @PathParam("amount") String amount, @DefaultValue("1") @QueryParam("ignore_invalid") int ignoreInvalid, @DefaultValue("LIVE") @QueryParam("mode") String mode) throws IOException; }
@GET public Response doGet(@QueryParam("point") GHPoint point, @QueryParam("elevation") @DefaultValue("false") boolean elevation) { QueryResult qr = index.findClosest(point.lat, point.lon, EdgeFilter.ALL_EDGES); if (qr.isValid()) { GHPoint3D snappedPoint = qr.getSnappedPoint(); double[] coordinates = hasElevation && elevation ? new double[]{snappedPoint.lon, snappedPoint.lat, snappedPoint.ele} : new double[]{snappedPoint.lon, snappedPoint.lat}; return new Response(coordinates, calc.calcDist(point.lat, point.lon, snappedPoint.lat, snappedPoint.lon)); } else { throw new WebApplicationException("Nearest point cannot be found!"); } }
@GET @Path("api/3/ticker/{pairs}") @Produces(MediaType.APPLICATION_JSON) WexTickerWrapper getTicker( @PathParam("pairs") String pairs, @DefaultValue("1") @QueryParam("ignore_invalid") int ignoreInvalid) throws IOException;