Arguments=$TEMPLATE isn´t working on a Hook with the type api

Hello everybody,

I created my first hook for sending an email to a creator of a new VM.
Unfortunately the argument “create” is no longer available on a Hook with the type “state”.
I changed the Hook type to “api”. This runs fine with Call = “one.template.instantiate” but now Arguments = “$TEMPLATE” isn´t working on the type api. I need $TEMPLATE for the value UNAME. I checked Arguments = “$API” but there is no value UNAME available.

This is my Hook template:

NAME = send_mail_vm_creation
TYPE = api
COMMAND = send_mail_vm_creation.sh
ARGUMENTS = “$TEMPLATE”
CALL = “one.template.instantiate”

Does anyone have a hint for me?

Greets,
Heiko

Just following an official docs:

xml = Nokogiri::XML(Base64::decode64(ARGV.first))
vm = VirtualMachine.new xml.xpath('//EXTRA/VM'), Client.new
vm.info!
vm['//UNAME']

This works for me

Sorry for the late reply. Thank you for the hint. I will try this.

Greets,
Heiko