I’m trying to use the REST API to execute a method I’ve created on a specific VM. If I run the method from a Custom Button I have no problems since:
vm = $evm.root[‘vm’]
Returns a VM object and the commands I later run ( set custom ems attributes, add disks etc) work with no problems on the target vm.
If I try to use the REST API, I can see the method being called, but the vm in the code above is nil, even though I’m setting one of my parameters for my vm name, thus it fails. I See the main difference when calling from a custom button and using the rest API is as follows:
From custom button call in the logs:
Automate_RubyTemplate - Root:<$evm.root> Attribute - object_name: Request
Automate_RubyTemplate - Root:<$evm.root> Attribute - vmdb_object_type: vm
From my REST API call in the logs:
AEMethod tag_vm> Automate_RubyTemplate - Root:<$evm.root> Attribute - object_name: add_disk
Root:<$evm.root> Attribute - vmdb_object_type: automation_task
Question is how do I access the vm object I need from an automation_request?
Thanks in advance