use of co.cask.cdap.proto.id.StreamViewId in project cdap by caskdata.
the class MetadataHttpHandler method removeViewTags.
@DELETE
@Path("/namespaces/{namespace-id}/streams/{stream-id}/views/{view-id}/metadata/tags")
public void removeViewTags(HttpRequest request, HttpResponder responder, @PathParam("namespace-id") String namespaceId, @PathParam("stream-id") String streamId, @PathParam("view-id") String viewId) throws NotFoundException {
StreamViewId view = new StreamViewId(namespaceId, streamId, viewId);
metadataAdmin.removeTags(view);
responder.sendString(HttpResponseStatus.OK, String.format("Tags for view %s deleted successfully.", view));
}
use of co.cask.cdap.proto.id.StreamViewId in project cdap by caskdata.
the class MetadataHttpHandler method getViewTags.
@GET
@Path("/namespaces/{namespace-id}/streams/{stream-id}/views/{view-id}/metadata/tags")
public void getViewTags(HttpRequest request, HttpResponder responder, @PathParam("namespace-id") String namespaceId, @PathParam("stream-id") String streamId, @PathParam("view-id") String viewId, @QueryParam("scope") String scope) throws NotFoundException, BadRequestException {
StreamViewId view = new StreamViewId(namespaceId, streamId, viewId);
responder.sendJson(HttpResponseStatus.OK, getTags(view, scope));
}
use of co.cask.cdap.proto.id.StreamViewId in project cdap by caskdata.
the class MetadataHttpHandler method getViewMetadata.
@GET
@Path("/namespaces/{namespace-id}/streams/{stream-id}/views/{view-id}/metadata")
public void getViewMetadata(HttpRequest request, HttpResponder responder, @PathParam("namespace-id") String namespaceId, @PathParam("stream-id") String streamId, @PathParam("view-id") String viewId, @QueryParam("scope") String scope) throws NotFoundException, BadRequestException {
StreamViewId view = new StreamViewId(namespaceId, streamId, viewId);
responder.sendJson(HttpResponseStatus.OK, getMetadata(view, scope), SET_METADATA_RECORD_TYPE, GSON);
}
use of co.cask.cdap.proto.id.StreamViewId in project cdap by caskdata.
the class MetadataHttpHandler method removeViewProperties.
@DELETE
@Path("/namespaces/{namespace-id}/streams/{stream-id}/views/{view-id}/metadata/properties")
public void removeViewProperties(HttpRequest request, HttpResponder responder, @PathParam("namespace-id") String namespaceId, @PathParam("stream-id") String streamId, @PathParam("view-id") String viewId) throws NotFoundException {
StreamViewId view = new StreamViewId(namespaceId, streamId, viewId);
metadataAdmin.removeProperties(view);
responder.sendString(HttpResponseStatus.OK, String.format("Metadata properties for view %s deleted successfully.", view));
}
use of co.cask.cdap.proto.id.StreamViewId in project cdap by caskdata.
the class MetadataHttpHandler method addViewProperties.
@POST
@Path("/namespaces/{namespace-id}/streams/{stream-id}/views/{view-id}/metadata/properties")
@AuditPolicy(AuditDetail.REQUEST_BODY)
public void addViewProperties(HttpRequest request, HttpResponder responder, @PathParam("namespace-id") String namespaceId, @PathParam("stream-id") String streamId, @PathParam("view-id") String viewId) throws NotFoundException, BadRequestException {
StreamViewId view = new StreamViewId(namespaceId, streamId, viewId);
metadataAdmin.addProperties(view, readMetadata(request));
responder.sendString(HttpResponseStatus.OK, "Metadata added successfully to " + view);
}
Aggregations