|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
import subprocess, json, psutil, time, os, win32security, sys #Get input argument
|
|
|
|
|
import subprocess, json, psutil, time, os, win32security, sys, base64 #Get input argument
|
|
|
|
|
from . import Server
|
|
|
|
|
from . import Timer
|
|
|
|
|
from . import Processor
|
|
|
|
@ -50,27 +50,51 @@ def AgentOSCMD(inGSettings, inHostNameStr, inUserStr, inCMDStr, inRunAsyncBool=T
|
|
|
|
|
#Send item in AgentDict for the futher data transmition
|
|
|
|
|
AgentActivityItemAdd(inGSettings=inGSettings, inHostNameStr=inHostNameStr, inUserStr=inUserStr, inActivityItemDict=lActivityItemDict)
|
|
|
|
|
|
|
|
|
|
# Send to agent activity item to OSCMD
|
|
|
|
|
def AgentOSFileDataBytesCreate(inGSettings, inHostNameStr, inUserStr, inFilePathStr, inFileDataBytes):
|
|
|
|
|
# pyOpenRPA.Agent: Send CMD to OS. Result return to log + Orchestrator by the A2O connection
|
|
|
|
|
# def OSFileBytesCreate(inFilePathStr, inFileDataBytes,inGSettings = None):
|
|
|
|
|
# Send binary file to Agent (Bytes)
|
|
|
|
|
def AgentOSFileBinaryDataBytesCreate(inGSettings, inHostNameStr, inUserStr, inFilePathStr, inFileDataBytes):
|
|
|
|
|
# pyOpenRPA.Agent: Create binary file by the base64 string (safe for JSON transmition)
|
|
|
|
|
# def OSFileBinaryDataBase64StrCreate(inFilePathStr, inFileDataBase64Str,inGSettings = None):
|
|
|
|
|
# Create Activity Item for the agent
|
|
|
|
|
lFileDataBase64Str = base64.b64encode(inFileDataBytes).decode("utf-8")
|
|
|
|
|
lActivityItemDict = {
|
|
|
|
|
"Def":"OSFileDataBytesCreate", # def alias (look pyOpeRPA.Agent gSettings["ProcessorDict"]["AliasDefDict"])
|
|
|
|
|
"Def":"OSFileBinaryDataBase64StrCreate", # def alias (look pyOpeRPA.Agent gSettings["ProcessorDict"]["AliasDefDict"])
|
|
|
|
|
"ArgList":[], # Args list
|
|
|
|
|
"ArgDict":{"inFilePathStr":inFilePathStr,"inFileDataBytes":inFileDataBytes}, # Args dictionary
|
|
|
|
|
"ArgDict":{"inFilePathStr":inFilePathStr,"inFileDataBase64Str":lFileDataBase64Str}, # Args dictionary
|
|
|
|
|
"ArgGSettings": "inGSettings", # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
|
|
|
|
|
"ArgLogger": None # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
|
|
|
|
|
}
|
|
|
|
|
#Send item in AgentDict for the futher data transmition
|
|
|
|
|
AgentActivityItemAdd(inGSettings=inGSettings, inHostNameStr=inHostNameStr, inUserStr=inUserStr, inActivityItemDict=lActivityItemDict)
|
|
|
|
|
|
|
|
|
|
# Send to agent activity item to OSCMD
|
|
|
|
|
def AgentOSFileDataStrCreate(inGSettings, inHostNameStr, inUserStr, inFilePathStr, inFileDataStr, inEncodingStr="utf-8"):
|
|
|
|
|
# pyOpenRPA.Agent: Send CMD to OS. Result return to log + Orchestrator by the A2O connection
|
|
|
|
|
# def OSFileBytesCreate(inFilePathStr, inFileDataBytes,inGSettings = None):
|
|
|
|
|
# Send binary file to Agent (base64 string)
|
|
|
|
|
def AgentOSFileBinaryDataBase64StrCreate(inGSettings, inHostNameStr, inUserStr, inFilePathStr, inFileDataBase64Str):
|
|
|
|
|
# pyOpenRPA.Agent: Create binary file by the base64 string (safe for JSON transmition)
|
|
|
|
|
# def OSFileBinaryDataBase64StrCreate(inFilePathStr, inFileDataBase64Str,inGSettings = None):
|
|
|
|
|
# Create Activity Item for the agent
|
|
|
|
|
lActivityItemDict = {
|
|
|
|
|
"Def":"OSFileBinaryDataBase64StrCreate", # def alias (look pyOpeRPA.Agent gSettings["ProcessorDict"]["AliasDefDict"])
|
|
|
|
|
"ArgList":[], # Args list
|
|
|
|
|
"ArgDict":{"inFilePathStr":inFilePathStr,"inFileDataBase64Str":inFileDataBase64Str}, # Args dictionary
|
|
|
|
|
"ArgGSettings": "inGSettings", # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
|
|
|
|
|
"ArgLogger": None # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
|
|
|
|
|
}
|
|
|
|
|
#Send item in AgentDict for the futher data transmition
|
|
|
|
|
AgentActivityItemAdd(inGSettings=inGSettings, inHostNameStr=inHostNameStr, inUserStr=inUserStr, inActivityItemDict=lActivityItemDict)
|
|
|
|
|
|
|
|
|
|
# Send text file to Agent (string)
|
|
|
|
|
def AgentOSFileTextDataStrCreate(inGSettings, inHostNameStr, inUserStr, inFilePathStr, inFileDataStr, inEncodingStr = "utf-8"):
|
|
|
|
|
# pyOpenRPA.Agent: Create text file by the string
|
|
|
|
|
# def OSFileTextDataStrCreate(inFilePathStr, inFileDataStr, inEncodingStr = "utf-8",inGSettings = None):
|
|
|
|
|
# Create Activity Item for the agent
|
|
|
|
|
AgentOSFileDataBytesCreate(inGSettings=inGSettings, inHostNameStr=inHostNameStr, inUserStr=inUserStr, inFilePathStr=inFilePathStr, inFileDataBytes=inFileDataStr.encode(inEncodingStr))
|
|
|
|
|
lActivityItemDict = {
|
|
|
|
|
"Def":"OSFileTextDataStrCreate", # def alias (look pyOpeRPA.Agent gSettings["ProcessorDict"]["AliasDefDict"])
|
|
|
|
|
"ArgList":[], # Args list
|
|
|
|
|
"ArgDict":{"inFilePathStr":inFilePathStr,"inFileDataStr":inFileDataStr, "inEncodingStr": inEncodingStr}, # Args dictionary
|
|
|
|
|
"ArgGSettings": "inGSettings", # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
|
|
|
|
|
"ArgLogger": None # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
|
|
|
|
|
}
|
|
|
|
|
#Send item in AgentDict for the futher data transmition
|
|
|
|
|
AgentActivityItemAdd(inGSettings=inGSettings, inHostNameStr=inHostNameStr, inUserStr=inUserStr, inActivityItemDict=lActivityItemDict)
|
|
|
|
|
|
|
|
|
|
# OS DEFS
|
|
|
|
|
# Defs to use in orchestrator
|
|
|
|
|