@Path(Constants.Gateway.API_VERSION_3 + "/system/services/{service-name}/status") @GET public void status(HttpRequest request, HttpResponder responder) { // ignore the service-name, since we don't need it. its only used for routing responder.sendJson(HttpResponseStatus.OK, OK_JSON.toString()); } }
@GET @Path("/status") public void getUpgradeStatus(HttpRequest request, HttpResponder responder) throws Exception { upgradeStatus.put("runCount", runCountUpgradeService.isRunning()); responder.sendJson(HttpResponseStatus.OK, GSON.toJson(upgradeStatus)); } }
@Path("/preferences") @GET public void getInstancePrefs(HttpRequest request, HttpResponder responder) throws Exception { responder.sendJson(HttpResponseStatus.OK, GSON.toJson(preferencesService.getProperties())); }
@Override public Void call() throws Exception { responder.sendJson(HttpResponseStatus.OK, GSON.toJson(exploreService.getTables(namespaceId))); return null; } });
@Path("/transactions/invalid/size") @GET public void invalidTxSize(HttpRequest request, HttpResponder responder) { int invalidSize = txClient.getInvalidSize(); responder.sendJson(HttpResponseStatus.OK, GSON.toJson(Collections.singletonMap("size", invalidSize))); }
@GET @Path("/provisioners/{provisioner-name}") public void getProvisioner(HttpRequest request, HttpResponder responder, @PathParam("provisioner-name") String provisionerName) throws NotFoundException { ProvisionerDetail provisionerDetail = provisioningService.getProvisionerDetail(provisionerName); if (provisionerDetail == null) { throw new NotFoundException(String.format("Provisioner %s not found", provisionerName)); } responder.sendJson(HttpResponseStatus.OK, GSON.toJson(provisionerDetail)); } }
@GET @Path("data/explore/queries/count") public void getActiveQueryCount(HttpRequest request, HttpResponder responder, @PathParam("namespace-id") String namespaceId) throws ExploreException { // this operation doesn't interact with hive, so doesn't require impersonation int count = exploreService.getActiveQueryCount(new NamespaceId(namespaceId)); responder.sendJson(HttpResponseStatus.OK, GSON.toJson(Collections.singletonMap("count", count))); } }
@Path("/{key-name}/metadata") @GET public void getMetadata(HttpRequest httpRequest, HttpResponder httpResponder, @PathParam("namespace-id") String namespace, @PathParam("key-name") String name) throws Exception { SecureStoreData secureStoreData = secureStore.get(namespace, name); httpResponder.sendJson(HttpResponseStatus.OK, GSON.toJson(secureStoreData.getMetadata())); }
/** * Returns the info associated with the application. */ @GET @Path("/apps/{app-id}") public void getAppInfo(HttpRequest request, HttpResponder responder, @PathParam("namespace-id") final String namespaceId, @PathParam("app-id") final String appId) throws Exception { ApplicationId applicationId = validateApplicationId(namespaceId, appId); responder.sendJson(HttpResponseStatus.OK, GSON.toJson(applicationLifecycleService.getAppDetail(applicationId))); }
@GET @Path("/topics") public void listTopics(HttpRequest request, HttpResponder responder, @PathParam("namespace") String namespace) throws Exception { responder.sendJson(HttpResponseStatus.OK, GSON.toJson( Lists.transform(messagingService.listTopics(new NamespaceId(namespace)), TOPIC_TO_NAME), TOPIC_LIST_TYPE)); }
@GET @Path("/profiles/{profile-name}") public void getSystemProfile(HttpRequest request, HttpResponder responder, @PathParam("profile-name") String profileName) throws NotFoundException, BadRequestException { ProfileId profileId = getValidatedProfile(NamespaceId.SYSTEM, profileName); responder.sendJson(HttpResponseStatus.OK, GSON.toJson(profileService.getProfile(profileId))); }
/** * Returns a list of map/reduces associated with a namespace. */ @GET @Path("/mapreduce") public void getAllMapReduce(HttpRequest request, HttpResponder responder, @PathParam("namespace-id") String namespaceId) throws Exception { responder.sendJson(HttpResponseStatus.OK, GSON.toJson(lifecycleService.list(validateAndGetNamespace(namespaceId), ProgramType.MAPREDUCE))); }
@GET @Path("/namespaces/{namespace-id}/profiles/{profile-name}/status") public void getProfileStatus(HttpRequest request, HttpResponder responder, @PathParam("namespace-id") String namespaceId, @PathParam("profile-name") String profileName) throws NotFoundException, BadRequestException, MethodNotAllowedException { responder.sendJson(HttpResponseStatus.OK, GSON.toJson(profileService.getProfile(getValidatedProfile(namespaceId, profileName)).getStatus())); }
@GET @Path("/data/types/{name}") public void getTypeInfo(HttpRequest request, HttpResponder responder, @PathParam("namespace-id") String namespaceId, @PathParam("name") String name) throws Exception { responder.sendJson(HttpResponseStatus.OK, GSON.toJson(typeService.getType(new NamespaceId(namespaceId).datasetType(name)))); } }
@GET @Path("/data/modules/{name}") public void getModuleInfo(HttpRequest request, HttpResponder responder, @PathParam("namespace-id") String namespaceId, @PathParam("name") String name) throws Exception { responder.sendJson(HttpResponseStatus.OK, GSON.toJson(typeService.getModule(new NamespaceId(namespaceId).datasetModule(name)))); }
@GET @Path("/topics/{topic}") public void getTopic(HttpRequest request, HttpResponder responder, @PathParam("namespace") String namespace, @PathParam("topic") String topic) throws Exception { TopicId topicId = new NamespaceId(namespace).topic(topic); TopicMetadata metadata = messagingService.getTopic(topicId); responder.sendJson(HttpResponseStatus.OK, GSON.toJson(metadata.getProperties(), TOPIC_PROPERTY_TYPE)); }
@GET @Path("/previews/{preview-id}/status") public void getStatus(HttpRequest request, HttpResponder responder, @PathParam("namespace-id") String namespaceId, @PathParam("preview-id") String previewId) throws Exception { NamespaceId namespace = new NamespaceId(namespaceId); ApplicationId application = namespace.app(previewId); responder.sendJson(HttpResponseStatus.OK, GSON.toJson(previewManager.getRunner(application).getStatus())); }
@Path("{principal-type}/{principal-name}/roles") @GET public void listRoles(HttpRequest httpRequest, HttpResponder httpResponder, @PathParam("principal-type") String principalType, @PathParam("principal-name") String principalName) throws Exception { ensureSecurityEnabled(); Principal principal = new Principal(principalName, Principal.PrincipalType.valueOf(principalType.toUpperCase())); httpResponder.sendJson(HttpResponseStatus.OK, GSON.toJson(authorizer.listRoles(principal))); createLogEntry(httpRequest, HttpResponseStatus.OK); }
@GET @Path("/namespaces/{namespace-id}") public void getNamespace(HttpRequest request, HttpResponder responder, @PathParam("namespace-id") String namespaceId) throws Exception { // return keytab URI without version NamespaceMeta ns = new NamespaceMeta.Builder(namespaceAdmin.get(new NamespaceId(namespaceId))).buildWithoutKeytabURIVersion(); responder.sendJson(HttpResponseStatus.OK, GSON.toJson(ns)); }
private void doGetSchedule(HttpResponder responder, String namespace, String app, String version, String scheduleName) throws Exception { ScheduleId scheduleId = new ApplicationId(namespace, app, version).schedule(scheduleName); ProgramSchedule schedule = programScheduleService.get(scheduleId); ScheduleDetail detail = schedule.toScheduleDetail(); responder.sendJson(HttpResponseStatus.OK, GSON.toJson(detail, ScheduleDetail.class)); }