ServerMania logo

Assign Recipe to Smart Server

To assign recipe to a smart server, use the following request:

POST /smart_servers/:smart_server_id/recipe_joins.xml
POST /smart_servers/:smart_server_id/recipe_joins.json

XML Request Example

curl -i -X POST -H "Accept: application/xml" -H "Content-type:application/xml" -d '<recipe_join><recipe_id>6</recipe_id><event_type>vm_provisioning</event_type><smart_server_id>h76rawyvwphxk6</smart_server_id></recipe_join>' -u user:userpass http://test/smart_servers/h76rawyvwphxk6/recipe_joins.xml

JSON Request Example

curl -i -X POST -H "Accept: application/json" -H "Content-type:application/json" -d '{"recipe_join":{"recipe_id":"6", "event_type":"vm_provisioning"}, "smart_server_id":"h76rawyvwphxk6"}' -u user:userpass http://test/smart_servers/h76rawyvwphxk6/recipe_joins.json

Where:

recipe_join - an array of recipe join details:

  • recipe_id - ID of a recipe you want to assign
  • event_type - type of the event you want to assign the recipe to:
    • vm_provisioning - run the recipe during VS provisioning
    • vm_network_rebuild - run the recipe when rebuilding a network
    • vm_disk_add - run the recipe when adding a disk
    • vm_nic_add - run the recipe when adding a network interface
    • (lightbulb)ip_allocated_to_vm_nic - run the recipe when adding an IP address to the VS network interface
    • (lightbulb)ip_revoked_from_vm_nic - run the recipe when removing an IP address from the VS network interface

    • (lightbulb) vm_nic_remove run the recipe while deleting a network interface 
    • vm_disk_resize - run the recipe when resizing a VS disk
    • vm_resize - run the recipe when resizing a VS
    • (lightbulb) vm_ip_address_add - run the recipe when adding an IP address to a VS
    • (lightbulb) vm_ip_address_remove - run the recipe when removing an IP address from a VS
    • (lightbulb) vm_start - run the recipe while starting the virtual server
    • (lightbulb) vm_reboot - run the recipe while rebooting the virtual server
    • (lightbulb) vm_hot_migrate - run the recipe during the hot migration of the virtual server
    • (lightbulb) vm_hot_full_migrate - run the recipe during the hot migration of the virtual server with disk
    • (lightbulb) vm_failover - run the recipe during the failover process
  • smart_server_id - ID of a smart server you want to assign the recipe to


Page History 

v. 6.1 

  • added the following parameters: 
    • ip_allocated_to_vm_nic
    • ip_revoked_from_vm_nic
    • vm_nic_remove
    • vm_ip_address_add
    • vm_ip_address_remove
    • vm_start 
    • vm_reboot 
    • vm_hot_migrate
    • vm_hot_full_migrate 
    • vm_failover