def CreateRecursiveListFlow(self, client_id, token): flow_args = filesystem.RecursiveListDirectoryArgs() return flow.GRRFlow.StartFlow(client_id=client_id, flow_name="RecursiveListDirectory", args=flow_args, token=token)
def Handle(self, args, token=None): ValidateVfsPath(args.file_path) aff4_path = args.client_id.ToClientURN().Add(args.file_path) fd = aff4.FACTORY.Open(aff4_path, token=token) if args.max_depth == 1: flow_args = filesystem.ListDirectoryArgs(pathspec=fd.real_pathspec) flow_urn = flow.GRRFlow.StartFlow( client_id=args.client_id.ToClientURN(), flow_name=filesystem.ListDirectory.__name__, args=flow_args, notify_to_user=args.notify_user, token=token) else: flow_args = filesystem.RecursiveListDirectoryArgs( pathspec=fd.real_pathspec, max_depth=args.max_depth) flow_urn = flow.GRRFlow.StartFlow( client_id=args.client_id.ToClientURN(), flow_name=filesystem.RecursiveListDirectory.__name__, args=flow_args, notify_to_user=args.notify_user, token=token) return ApiCreateVfsRefreshOperationResult(operation_id=str(flow_urn))
def Handle(self, args, token=None): aff4_path = args.client_id.Add(args.vfs_path) fd = aff4.FACTORY.Open(aff4_path, token=token) flow_args = filesystem.RecursiveListDirectoryArgs( pathspec=fd.real_pathspec, max_depth=args.max_depth) flow.GRRFlow.StartFlow(client_id=args.client_id, flow_name="RecursiveListDirectory", args=flow_args, notify_to_user=True, token=token)
def Handle(self, args, token=None): aff4_path = args.client_id.Add(args.file_path) fd = aff4.FACTORY.Open(aff4_path, token=token) flow_args = filesystem.RecursiveListDirectoryArgs( pathspec=fd.real_pathspec, max_depth=args.max_depth) flow_urn = flow.GRRFlow.StartFlow(client_id=args.client_id, flow_name="RecursiveListDirectory", args=flow_args, notify_to_user=args.notify_user, token=token) return ApiCreateVfsRefreshOperationResult(operation_id=str(flow_urn))
def RenderAjax(self, request, response): aff4_path = rdfvalue.RDFURN(request.REQ.get("aff4_path")) args = forms.SemanticProtoFormRenderer( filesystem.RecursiveListDirectoryArgs()).ParseArgs(request) fd = aff4.FACTORY.Open(aff4_path, token=request.token) args.pathspec = fd.real_pathspec flow.GRRFlow.StartFlow(client_id=aff4_path.Split()[0], flow_name="RecursiveListDirectory", args=args, notify_to_user=True, token=request.token) return self.RenderFromTemplate(self.ajax_template, response)
def Render(self, args, token=None): aff4_path = args.client_id.Add(args.vfs_path) fd = aff4.FACTORY.Open(aff4_path, aff4_type="VFSDirectory", token=token) flow_args = filesystem.RecursiveListDirectoryArgs( pathspec=fd.real_pathspec, max_depth=args.max_depth) flow.GRRFlow.StartFlow(client_id=args.client_id, flow_name="RecursiveListDirectory", args=flow_args, notify_to_user=True, token=token) return dict(status="OK")
def Layout(self, request, response): args = filesystem.RecursiveListDirectoryArgs() self.recursive_refresh_form = forms.SemanticProtoFormRenderer( args, supressions=["pathspec"]).RawHTML(request) return super(RecursiveRefreshDialog, self).Layout(request, response)