use of co.cask.cdap.common.internal.remote.MethodArgument in project cdap by caskdata.
the class RemoteLineageWriterHandler method addDatasetAccess.
@POST
@Path("/addDatasetAccess")
public void addDatasetAccess(HttpRequest request, HttpResponder responder) throws Exception {
Iterator<MethodArgument> arguments = parseArguments(request);
ProgramRunId run = deserializeNext(arguments);
DatasetId datasetInstance = deserializeNext(arguments);
AccessType accessType = deserializeNext(arguments);
NamespacedEntityId component = deserializeNext(arguments);
lineageWriter.addAccess(run, datasetInstance, accessType, component);
responder.sendStatus(HttpResponseStatus.OK);
}
use of co.cask.cdap.common.internal.remote.MethodArgument in project cdap by caskdata.
the class RemotePrivilegesHandler method grant.
@POST
@Path("/grant")
public void grant(HttpRequest request, HttpResponder responder) throws Exception {
Iterator<MethodArgument> arguments = parseArguments(request);
EntityId entityId = deserializeNext(arguments);
Principal principal = deserializeNext(arguments);
Set<Action> actions = deserializeNext(arguments, SET_OF_ACTIONS);
LOG.trace("Granting {} on {} to {}", actions, entityId, principal);
privilegesManager.grant(entityId, principal, actions);
LOG.info("Granted {} on {} to {} successfully", actions, entityId, principal);
responder.sendStatus(HttpResponseStatus.OK);
}
use of co.cask.cdap.common.internal.remote.MethodArgument in project cdap by caskdata.
the class RemotePrivilegesHandler method revoke.
@POST
@Path("/revoke")
public void revoke(HttpRequest request, HttpResponder responder) throws Exception {
Iterator<MethodArgument> arguments = parseArguments(request);
EntityId entityId = deserializeNext(arguments);
Principal principal = deserializeNext(arguments);
Set<Action> actions = deserializeNext(arguments, SET_OF_ACTIONS);
LOG.trace("Revoking {} on {} from {}", actions, entityId, principal);
privilegesManager.revoke(entityId, principal, actions);
LOG.info("Revoked {} on {} from {} successfully", actions, entityId, principal);
responder.sendStatus(HttpResponseStatus.OK);
}
use of co.cask.cdap.common.internal.remote.MethodArgument in project cdap by caskdata.
the class RemotePrivilegesHandler method revokeAll.
@POST
@Path("/revokeAll")
public void revokeAll(HttpRequest request, HttpResponder responder) throws Exception {
Iterator<MethodArgument> arguments = parseArguments(request);
EntityId entityId = deserializeNext(arguments);
LOG.trace("Revoking all actions on {}", entityId);
privilegesManager.revoke(entityId);
LOG.info("Revoked all actions on {} successfully", entityId);
responder.sendStatus(HttpResponseStatus.OK);
}
use of co.cask.cdap.common.internal.remote.MethodArgument in project cdap by caskdata.
the class RemoteUsageRegistryHandler method registerDataset.
@POST
@Path("/registerDataset")
public void registerDataset(HttpRequest request, HttpResponder responder) throws Exception {
Iterator<MethodArgument> arguments = parseArguments(request);
ProgramId programId = deserializeNext(arguments);
DatasetId datasetInstance = deserializeNext(arguments);
usageRegistry.register(programId, datasetInstance);
responder.sendStatus(HttpResponseStatus.OK);
}
Aggregations