Skip to content

Commit

Permalink
18.10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Itay4 committed Oct 19, 2018
1 parent 4c0dfa9 commit f420dc5
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 80 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
docker:
- image: circleci/node:9.11
environment:
CONTENT_VERSION: "18.10.1"
CONTENT_VERSION: "18.10.2"
GIT_SHA1: "3e41cb6ae5be2505b12055ceb31a043538c49823"
steps:
- checkout
Expand Down
115 changes: 36 additions & 79 deletions Integrations/integration-epo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -389,92 +389,57 @@ script:
}
}
function parseCommandArgs(command, commandArgs) {
//commandArgs should be in the format of: keyName1:keyValue1, keyName2:KeyValue2
if (!commandArgs) {
return null;
}
var commandArgsDict = {};
commandArgsDict["command"] = command;
var commandArgsList = commandArgs.split(',');
var temp;
for (i=0; i < commandArgsList.length; i++) {
//commandArgsVal in commandArgsList:
temp = commandArgsList[i].split(':');
commandArgsDict[temp[0]] = temp[1];
}
return commandArgsDict;
}
function epoCommand(parsedArgs) {
if (parsedArgs) {
args = parsedArgs;
}
if (!args.command) {
throw 'ePO error: command argument is missing';
}
var pArgs = {};
for (var key in args) {
if (key != 'command' && key != 'headers') {
pArgs[key] = args[key];
}
}
var result = callEpo(args.command,pArgs);
var md;
var contents;
if (typeof result === 'string') {
md = "#### ePO command *"+args.command+"* results:\n" + result;
contents = { result: result };
} else {
md = tableToMarkdown(
'ePO command *'+args.command+'* results:',
Object.keys(result || {}).map(function (k) { return result[k]}), // object keys
args.headers && args.headers.split(',')
);
contents = result;
}
return {
Type: entryTypes.note,
Contents: contents,
ContentsFormat: formats.json,
HumanReadable: md
};
}
switch (command) {
// This is the call made when pressing the integration test button.
case 'test-module':
epoHelp();
return 'ok';
case 'epo-help':
return epoHelp();
case 'epo-get-latest-dat':
return epoGetLatestDat();
case 'epo-get-current-dat':
return epoGetCurrentDat();
case 'epo-update-client-dat':
return epoUpdateClientDat();
case 'epo-update-repository':
return epoUpdateRepository();
case 'epo-get-system-tree-group':
return epoGetSystemTreeGroups();
case 'epo-find-systems':
return epoFindSystems();
case 'epo-command':
if (args.commandArgs) {
var parsedArgs = parseCommandArgs(args.command, args.commandArgs);
return epoCommand(parsedArgs)
if (!args.command) {
throw 'ePO error: command argument is missing';
}
return epoCommand();
var pArgs = {};
for (var key in args) {
if (key != 'command' && key != 'headers') {
pArgs[key] = args[key];
}
}
var result = callEpo(args.command,pArgs);
var md;
var contents;
if (typeof result === 'string') {
md = "#### ePO command *"+args.command+"* results:\n" + result;
contents = { result: result };
} else {
md = tableToMarkdown(
'ePO command *'+args.command+'* results:',
Object.keys(result || {}).map(function (k) { return result[k]; }), // object keys
args.headers && args.headers.split(',')
);
contents = result;
}
return {
Type: entryTypes.note,
Contents: contents,
ContentsFormat: formats.json,
HumanReadable: md
};
default:
throw 'ePO Error: unknown command';
}
Expand Down Expand Up @@ -608,20 +573,12 @@ script:
type: number
description: Find systems in the System Tree - by group ID or by search
- name: epo-command
arguments:
- name: command
description: Command to execute. Run a core.help command or !epo-help to identify
all possible commands.
- name: commandArgs
description: Comma separated key value pairs as additional arguments to pass. E.g.
argName1:argValue1,argName2:argValue2
outputs:
- contextPath: ePO.Command
description: EPO command output
description: 'Execute ePO command. Run ''epo-help'' command to see a list available
commands. e.g: !epo-command command="clienttask.find" commandArgs="searchText:On-demand".
You can also specify ''headers'' argument to filter tables headers. e.g: ''!epo-command
command=system.find searchText=10.0.0.1 headers=EPOBranchNode.AutoID,EPOComputerProperties.ComputerName''. '
arguments: []
description: Execute ePO command. Receives mandatory 'command' argument and other
specific commands other arguments - Run 'epo-help' command to see a list available
commands. You can also specify 'headers' argument to filter tables headers.
e.g. '!epo-command command=system.find searchText=10.0.0.1 headers=EPOBranchNode.AutoID,EPOComputerProperties.ComputerName'
runonce: false
tests:
- "Test Playbook McAfee ePO"
- Test Playbook McAfee ePO
releaseNotes: Fixes for epo-command

0 comments on commit f420dc5

Please sign in to comment.