jcp0wermac
Enthusiast
Enthusiast

Updating Advanced Host Options, using shutter

Does anyone know of a better way to do this?  If I just assign vcOptionValue.value with value (number) I get the error "A specified parameter was not correct."  Looks like value needs to be a Int64/long: http://tech.zsoldier.com/2012/01/uservarscimoemproviderenabled-changing.html

The below code using java.lang.Long(value) works without issue.  Are there any negatives to using shutter file?

var changedValue = new Array(); var vcOptionValue = new VcOptionValue(); vcOptionValue.key = key; vcOptionValue.value = new java.lang.Long(value); try {      changedValue.push(vcOptionValue);      host.configManager.advancedOption.updateOptions(changedValue); } catch(err) {      System.log(err); }

Thanks,
Joe
0 Kudos
1 Reply
tschoergez
Leadership
Leadership

Hi!

Thanks for posting your solution for that!

I don't think there is another way besides the shutter file to do that, because the type-translation between javascript and the (Java-based) vCenter-Plugin seems to be hardcoded in the vCO-platform (or even in the used Rhino engine). See some other discussions touching that topic here:

http://communities.vmware.com/message/1404592

http://communities.vmware.com/thread/332211

http://communities.vmware.com/message/1810464

However, I don't know any drawbacks when using a shutter-file, besides maybe some decreased security if you open access to too many classes in that file 🙂

Cheers,

Joerg