@GET @Path("accounts/{accountId}/withdrawals") Map getWithdrawals( @HeaderParam(CB_VERSION) String apiVersion, @HeaderParam(CB_ACCESS_KEY) String apiKey, @HeaderParam(CB_ACCESS_SIGN) ParamsDigest signature, @HeaderParam(CB_ACCESS_TIMESTAMP) BigDecimal timestamp, @PathParam("accountId") String accountId) throws IOException, CoinbaseException;
@Override public String getValueOf(HeaderParam a) { return a.value(); }
@DELETE @Path("orders") @Produces(MediaType.TEXT_PLAIN) String deleteAllOrders( @HeaderParam("AC-ACCESS-KEY") String accessKey, @HeaderParam("AC-ACCESS-SIGN") ParamsDigest sign, @HeaderParam("AC-ACCESS-PASSPHRASE") String passphrase, @HeaderParam("AC-ACCESS-TIMESTAMP") String timestamp) throws IOException;
@POST @Produces(MediaType.APPLICATION_JSON) LiquiAccountInfoResult getInfo( @HeaderParam("Key") String key, @HeaderParam("Sign") ParamsDigest signer, @FormParam("nonce") SynchronizedValueFactory<Long> nonce, @FormParam("method") String method);
@GET @Path("/echo_token") public String echoToken(@HeaderParam(TRACETOKEN_HEADER) String token) { return token; } }
@POST @Path("/worker") @Consumes(MediaType.APPLICATION_JSON) @ResourceFilters(ConfigResourceFilter.class) public Response setWorkerConfig( final WorkerBehaviorConfig workerBehaviorConfig, @HeaderParam(AuditManager.X_DRUID_AUTHOR) @DefaultValue("") final String author, @HeaderParam(AuditManager.X_DRUID_COMMENT) @DefaultValue("") final String comment, @Context final HttpServletRequest req ) { final SetResult setResult = configManager.set( WorkerBehaviorConfig.CONFIG_KEY, workerBehaviorConfig, new AuditInfo(author, comment, req.getRemoteAddr()) ); if (setResult.isOk()) { log.info("Updating Worker configs: %s", workerBehaviorConfig); return Response.ok().build(); } else { return Response.status(Response.Status.BAD_REQUEST).build(); } }
/** * Changes the status information of the ASG. * * @param asgName the name of the ASG for which the status needs to be changed. * @param newStatus the new status {@link ASGStatus} of the ASG. * @param isReplication a header parameter containing information whether this is replicated from other nodes. * * @return response which indicates if the operation succeeded or not. */ @PUT @Path("{asgName}/status") public Response statusUpdate(@PathParam("asgName") String asgName, @QueryParam("value") String newStatus, @HeaderParam(PeerEurekaNode.HEADER_REPLICATION) String isReplication) { if (awsAsgUtil == null) { return Response.status(400).build(); } try { logger.info("Trying to update ASG Status for ASG {} to {}", asgName, newStatus); ASGStatus asgStatus = ASGStatus.valueOf(newStatus.toUpperCase()); awsAsgUtil.setStatus(asgName, (!ASGStatus.DISABLED.equals(asgStatus))); registry.statusUpdate(asgName, asgStatus, Boolean.valueOf(isReplication)); logger.debug("Updated ASG Status for ASG {} to {}", asgName, asgStatus); } catch (Throwable e) { logger.error("Cannot update the status {} for the ASG {}", newStatus, asgName, e); return Response.serverError().build(); } return Response.ok().build(); }
@GET public Response redirectIndexHtml( @HeaderParam(X_FORWARDED_PROTO) String proto, @Context UriInfo uriInfo) { if (isNullOrEmpty(proto)) { proto = uriInfo.getRequestUri().getScheme(); } return Response.status(MOVED_PERMANENTLY) .location(uriInfo.getRequestUriBuilder().scheme(proto).path("/ui/").build()) .build(); } }
/** * Derives member's name and type from it's annotations */ public static Optional<String> getParameterNameFromAnnotations(Annotation[] memberAnnotations) { for (Annotation a : memberAnnotations) { if (a instanceof QueryParam) { return Optional.of("query param " + ((QueryParam) a).value()); } else if (a instanceof PathParam) { return Optional.of("path param " + ((PathParam) a).value()); } else if (a instanceof HeaderParam) { return Optional.of("header " + ((HeaderParam) a).value()); } else if (a instanceof CookieParam) { return Optional.of("cookie " + ((CookieParam) a).value()); } else if (a instanceof FormParam) { return Optional.of("form field " + ((FormParam) a).value()); } else if (a instanceof Context) { return Optional.of("context"); } else if (a instanceof MatrixParam) { return Optional.of("matrix param " + ((MatrixParam) a).value()); } } return Optional.empty(); }
@OPTIONS @Produces(MediaType.APPLICATION_JSON + "; charset=UTF-8") @Path("/version") public Response corsPreflightVersion(@HeaderParam("Access-Control-Request-Headers") final String requestHeaders, @HeaderParam("Access-Control-Request-Method") final String requestMethod) { ResponseBuilder responseBuilder = getCorsPreflightResponseBuilder(requestHeaders, requestMethod); return (responseBuilder.build()); }
@POST @Produces(MediaType.APPLICATION_JSON) LiquiActiveOrdersResult activeOrders( @HeaderParam("Key") String key, @HeaderParam("Sign") ParamsDigest signer, @FormParam("nonce") SynchronizedValueFactory<Long> nonce, @FormParam("method") String method, @FormParam("pair") Pairs pair);
@POST @Path("/taskslots") @Consumes(MediaType.APPLICATION_JSON) public Response setCompactionTaskLimit( @QueryParam("ratio") Double compactionTaskSlotRatio, @QueryParam("max") Integer maxCompactionTaskSlots, @HeaderParam(AuditManager.X_DRUID_AUTHOR) @DefaultValue("") final String author, @HeaderParam(AuditManager.X_DRUID_COMMENT) @DefaultValue("") final String comment, @Context HttpServletRequest req ) { final CoordinatorCompactionConfig current = CoordinatorCompactionConfig.current(manager); final CoordinatorCompactionConfig newCompactionConfig = CoordinatorCompactionConfig.from( current, compactionTaskSlotRatio, maxCompactionTaskSlots ); final SetResult setResult = manager.set( CoordinatorCompactionConfig.CONFIG_KEY, newCompactionConfig, new AuditInfo(author, comment, req.getRemoteAddr()) ); if (setResult.isOk()) { return Response.ok().build(); } else { return Response.status(Response.Status.BAD_REQUEST) .entity(ImmutableMap.of("error", setResult.getException())) .build(); } }
@GET @Path("accounts/{account-id}") AbucoinsAccount getAccount( @PathParam("account-id") String accountID, @HeaderParam("AC-ACCESS-KEY") String accessKey, @HeaderParam("AC-ACCESS-SIGN") ParamsDigest sign, @HeaderParam("AC-ACCESS-PASSPHRASE") String passphrase, @HeaderParam("AC-ACCESS-TIMESTAMP") String timestamp) throws IOException;
@OPTIONS @Produces(MediaType.APPLICATION_JSON + "; charset=UTF-8") @Path("check") public Response corsPreflightCheck(@HeaderParam("Access-Control-Request-Headers") String requestHeaders, @HeaderParam("Access-Control-Request-Method") String requestMethod) { Response.ResponseBuilder responseBuilder = MetricsResource.getCorsPreflightResponseBuilder(requestHeaders, requestMethod); return (responseBuilder.build()); }
@POST @Produces(MediaType.APPLICATION_JSON) LiquiOrderInfoResult orderInfo( @HeaderParam("Key") String key, @HeaderParam("Sign") ParamsDigest signer, @FormParam("nonce") SynchronizedValueFactory<Long> nonce, @FormParam("method") String method, @FormParam("order_id") long orderId);
@Override public String getValueOf(HeaderParam a) { return a.value(); }
@GET @Path("orders/{id}") @Produces(MediaType.APPLICATION_JSON) CoinbaseProOrder getOrder( @PathParam("id") String id, @HeaderParam("CB-ACCESS-KEY") String apiKey, @HeaderParam("CB-ACCESS-SIGN") ParamsDigest signer, @HeaderParam("CB-ACCESS-TIMESTAMP") SynchronizedValueFactory<Long> nonce, @HeaderParam("CB-ACCESS-PASSPHRASE") String passphrase) throws CoinbaseProException, IOException;
@OPTIONS @Produces(MediaType.APPLICATION_JSON + "; charset=UTF-8") @Path("status") public Response corsPreflightStatus(@HeaderParam("Access-Control-Request-Headers") String requestHeaders, @HeaderParam("Access-Control-Request-Method") String requestMethod) { Response.ResponseBuilder responseBuilder = MetricsResource.getCorsPreflightResponseBuilder(requestHeaders, requestMethod); return (responseBuilder.build()); }
@POST @Produces(MediaType.APPLICATION_JSON) LiquiCancelOrderResult cancelOrder( @HeaderParam("Key") String key, @HeaderParam("Sign") ParamsDigest signer, @FormParam("nonce") SynchronizedValueFactory<Long> nonce, @FormParam("method") String method, @FormParam("order_id") long orderId);
@GET @Path("accounts/{accountId}/transactions") Map getTransactions( @HeaderParam(CB_VERSION) String apiVersion, @HeaderParam(CB_ACCESS_KEY) String apiKey, @HeaderParam(CB_ACCESS_SIGN) ParamsDigest signature, @HeaderParam(CB_ACCESS_TIMESTAMP) BigDecimal timestamp, @PathParam("accountId") String accountId) throws IOException, CoinbaseException;