use of co.cask.cdap.common.security.AuditPolicy in project cdap by caskdata.
the class MetadataHttpHandler method addAppTags.
@POST
@Path("/namespaces/{namespace-id}/apps/{app-id}/metadata/tags")
@AuditPolicy(AuditDetail.REQUEST_BODY)
public void addAppTags(HttpRequest request, HttpResponder responder, @PathParam("namespace-id") String namespaceId, @PathParam("app-id") String appId) throws BadRequestException, NotFoundException {
ApplicationId app = new ApplicationId(namespaceId, appId);
metadataAdmin.addTags(app, readArray(request));
responder.sendString(HttpResponseStatus.OK, String.format("Added tags to application %s successfully.", app));
}
use of co.cask.cdap.common.security.AuditPolicy in project cdap by caskdata.
the class MetadataHttpHandler method addAppProperties.
@POST
@Path("/namespaces/{namespace-id}/apps/{app-id}/metadata/properties")
@AuditPolicy(AuditDetail.REQUEST_BODY)
public void addAppProperties(HttpRequest request, HttpResponder responder, @PathParam("namespace-id") String namespaceId, @PathParam("app-id") String appId) throws BadRequestException, NotFoundException {
ApplicationId app = new ApplicationId(namespaceId, appId);
metadataAdmin.addProperties(app, readMetadata(request));
responder.sendString(HttpResponseStatus.OK, "Metadata added successfully to " + app);
}
use of co.cask.cdap.common.security.AuditPolicy in project cdap by caskdata.
the class MetadataHttpHandler method addStreamProperties.
@POST
@Path("/namespaces/{namespace-id}/streams/{stream-id}/metadata/properties")
@AuditPolicy(AuditDetail.REQUEST_BODY)
public void addStreamProperties(HttpRequest request, HttpResponder responder, @PathParam("namespace-id") String namespaceId, @PathParam("stream-id") String streamId) throws BadRequestException, NotFoundException {
StreamId stream = new StreamId(namespaceId, streamId);
metadataAdmin.addProperties(stream, readMetadata(request));
responder.sendString(HttpResponseStatus.OK, "Metadata added successfully to " + stream);
}
use of co.cask.cdap.common.security.AuditPolicy 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);
}
use of co.cask.cdap.common.security.AuditPolicy in project cdap by caskdata.
the class DatasetInstanceHandler method update.
/**
* Updates an existing dataset specification properties.
*
* @param namespaceId namespace of the dataset instance
* @param name name of the dataset instance
* @throws Exception
*/
@PUT
@Path("/data/datasets/{name}/properties")
@AuditPolicy(AuditDetail.REQUEST_BODY)
public void update(HttpRequest request, HttpResponder responder, @PathParam("namespace-id") String namespaceId, @PathParam("name") String name) throws Exception {
DatasetId instance = ConversionHelpers.toDatasetInstanceId(namespaceId, name);
Map<String, String> properties = ConversionHelpers.getProperties(request);
instanceService.update(instance, properties);
responder.sendStatus(HttpResponseStatus.OK);
}
Aggregations