def addCommands(connection, sessionUrl, commandDict): ''' This method is used to add commands to a certain list of provided agents. Args: - connection is the connection object that manages the HTTP data transfers between the client and the REST API - sessionUrl is the address of the session that should run the test - commandDict is the Python dict that holds the mapping between agent name and specific commands. (commandDict format -> { agent name : [ { field : value } ] }) ''' for agentName in list(commandDict): commandListUrl = getCommandListUrlForAgentName(connection, sessionUrl, agentName) if commandListUrl: for commandParamDict in commandDict[agentName]: performGenericPost(connection, commandListUrl, commandParamDict)