Search in sources :

Example 26 with StreamViewId

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));
}
Also used : StreamViewId(co.cask.cdap.proto.id.StreamViewId) Path(javax.ws.rs.Path) DELETE(javax.ws.rs.DELETE)

Example 27 with StreamViewId

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));
}
Also used : StreamViewId(co.cask.cdap.proto.id.StreamViewId) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET)

Example 28 with StreamViewId

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);
}
Also used : StreamViewId(co.cask.cdap.proto.id.StreamViewId) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET)

Example 29 with StreamViewId

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));
}
Also used : StreamViewId(co.cask.cdap.proto.id.StreamViewId) Path(javax.ws.rs.Path) DELETE(javax.ws.rs.DELETE)

Example 30 with StreamViewId

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);
}
Also used : StreamViewId(co.cask.cdap.proto.id.StreamViewId) Path(javax.ws.rs.Path) AuditPolicy(co.cask.cdap.common.security.AuditPolicy) POST(javax.ws.rs.POST)

Aggregations

StreamViewId (co.cask.cdap.proto.id.StreamViewId)32 StreamId (co.cask.cdap.proto.id.StreamId)16 Path (javax.ws.rs.Path)14 ViewSpecification (co.cask.cdap.proto.ViewSpecification)12 FormatSpecification (co.cask.cdap.api.data.format.FormatSpecification)11 DatasetId (co.cask.cdap.proto.id.DatasetId)9 Test (org.junit.Test)9 NamespaceId (co.cask.cdap.proto.id.NamespaceId)7 ApplicationId (co.cask.cdap.proto.id.ApplicationId)6 DELETE (javax.ws.rs.DELETE)6 ArtifactId (co.cask.cdap.proto.id.ArtifactId)5 ProgramId (co.cask.cdap.proto.id.ProgramId)5 MetadataSearchResultRecord (co.cask.cdap.proto.metadata.MetadataSearchResultRecord)5 NamespaceMeta (co.cask.cdap.proto.NamespaceMeta)4 GET (javax.ws.rs.GET)4 Schema (co.cask.cdap.api.data.schema.Schema)3 AuditPolicy (co.cask.cdap.common.security.AuditPolicy)3 WordCountApp (co.cask.cdap.WordCountApp)2 NotFoundException (co.cask.cdap.common.NotFoundException)2 DatasetInstanceConfiguration (co.cask.cdap.proto.DatasetInstanceConfiguration)2