def ListGrrBinaries( context: api_context.GrrApiContext) -> utils.ItemsIterator[GrrBinary]: """Lists all registered Grr binaries.""" items = context.SendIteratorRequest("ListGrrBinaries", None) return utils.MapItemsIterator( lambda data: GrrBinary(data=data, context=context), items)
def ListHunts(context: context_lib.GrrApiContext) -> utils.ItemsIterator[Hunt]: """List all GRR hunts.""" items = context.SendIteratorRequest("ListHunts", hunt_pb2.ApiListHuntsArgs()) return utils.MapItemsIterator( lambda data: Hunt(data=data, context=context), items)
def ListArtifacts( context: api_context.GrrApiContext) -> utils.ItemsIterator[Artifact]: """Lists all registered Grr artifacts.""" args = api_artifact_pb2.ApiListArtifactsArgs() items = context.SendIteratorRequest("ListArtifacts", args) return utils.MapItemsIterator( lambda data: Artifact(data=data, context=context), items)
def ListHuntApprovals( context: context_lib.GrrApiContext ) -> utils.ItemsIterator[HuntApproval]: """List all hunt approvals belonging to requesting user.""" items = context.SendIteratorRequest("ListHuntApprovals", user_pb2.ApiListHuntApprovalsArgs()) def MapHuntApproval(data): return HuntApproval(data=data, username=context.username, context=context) return utils.MapItemsIterator(MapHuntApproval, items)