Search in sources :

Example 86 with AuditPolicy

use of co.cask.cdap.common.security.AuditPolicy in project cdap by caskdata.

the class MetadataHttpHandler method addDatasetTags.

@POST
@Path("/namespaces/{namespace-id}/datasets/{dataset-id}/metadata/tags")
@AuditPolicy(AuditDetail.REQUEST_BODY)
public void addDatasetTags(FullHttpRequest request, HttpResponder responder, @PathParam("namespace-id") String namespaceId, @PathParam("dataset-id") String datasetId) throws BadRequestException, NotFoundException {
    DatasetId dataset = new DatasetId(namespaceId, datasetId);
    metadataAdmin.addTags(dataset, readArray(request));
    responder.sendString(HttpResponseStatus.OK, String.format("Added tags to dataset %s successfully.", dataset));
}
Also used : DatasetId(co.cask.cdap.proto.id.DatasetId) Path(javax.ws.rs.Path) AuditPolicy(co.cask.cdap.common.security.AuditPolicy) POST(javax.ws.rs.POST)

Aggregations

AuditPolicy (co.cask.cdap.common.security.AuditPolicy)86 Path (javax.ws.rs.Path)86 POST (javax.ws.rs.POST)47 PUT (javax.ws.rs.PUT)38 BadRequestException (co.cask.cdap.common.BadRequestException)25 ProgramId (co.cask.cdap.proto.id.ProgramId)22 NamespaceId (co.cask.cdap.proto.id.NamespaceId)17 IOException (java.io.IOException)14 NotFoundException (co.cask.cdap.common.NotFoundException)13 JsonSyntaxException (com.google.gson.JsonSyntaxException)13 NamespaceNotFoundException (co.cask.cdap.common.NamespaceNotFoundException)11 ArtifactId (co.cask.cdap.proto.id.ArtifactId)11 ArrayList (java.util.ArrayList)11 StreamId (co.cask.cdap.proto.id.StreamId)10 ApplicationId (co.cask.cdap.proto.id.ApplicationId)9 Constraint (co.cask.cdap.internal.schedule.constraint.Constraint)8 DatasetId (co.cask.cdap.proto.id.DatasetId)8 InputStreamReader (java.io.InputStreamReader)8 Reader (java.io.Reader)8 ArtifactNotFoundException (co.cask.cdap.common.ArtifactNotFoundException)5