it expects a java.util.List - and it does not appear you are passing that. i don't believe putting  around a string makes it a list type object.
An approach I thought might help is:
1. Use Jython
connect to bl
define blcli_run method
2. Jython does support java.util.List
list = java.util.List()
blcli_run(jli,["ServerGroup","bulkAssignServersToGroup",groupid, keys, "false"])
The only problem this approach has is that Jython won't run Java methods which are protected or private.
So the java.util.List instantiation will return TypeError: No visible constructors for class (java.util.List).
Only way to resolve this is changing the jython settings:
# Setting this to false will allow Jython to provide access to
# non-public fields, methods, and constructors of Java objects.
python.security.respectJavaAccessibility = false
And that's something we won't be changing on all hosts running the script which uses the bulkAssignServersToGroup command. Does it have to be that tricky isn't there a smarter solution?
Also – why not just loop through and add individually? I don’t think it will be that much slower if you are using the perf commands.
When I pass an argument of type java.util.List I get a command found but with mismatching arguments error...
Firstly I run something that returns a java.util.List
% blcli_execute Server bulkAddServers /C/tmp TestServers.csv UTF-8 false
Then store it in a variable
% blcli_storeenv server_list
% echo $server_list
And pass it to the bulkAssignServersToGroup command
% blcli_execute ServerGroup bulkAssignServersToGroup DBKey:SBLGroupModelKeyImpl:2048065-5692050 $server_list false
Command execution failed. com.bladelogic.cli.factory.CommandNotFoundException: Found command 'ServerGroup.bulkAssignServersToGroup' but with mismatching arguments.
Guess I could try a different approach..
1 of 1 people found this helpful
you are not passing in the server list as an actual java list type. you're passing it as a string. there is currently no way to build a list object from scratch in the blcli.