Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Children Display
alltrue
styleh3
pageSuperb Cloud API

POST /virtual_machines/:virtual_machine_id/recipe_joins 

Assigns a recipe to a virtual server

Sections:

Table of Contents
maxLevel4
minLevel2
includeResponse.*|JSON.*|XML.*

Request Parameters

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
    • vm_disk_resize - run the recipe when resizing a VS disk
    • vm_resize - run the recipe when resizing a VS

Response Parameters

Returns recipe join details

JSON Request example

Code Block
languagebash
themeRDark
 curl -i -X POST -H "Accept: application/json" -H "Content-type:application/json" -d '{"recipe_join":{"recipe_id":"6", "event_type":"vm_provisioning"}}' -u user:userpass <api_url>/virtual_machines/:virtual_machine_id/recipe_joins.json

JSON Response

Code Block
themeRDark
 {
    "recipe_join": {
        "created_at": "2015-08-31T18:32:02+00:00",
        "event_type": "vm_provisioning",
        "id": 1,
        "recipe_id": 8,
        "target_join_id": 511,
        "target_join_type": "VirtualMachine",
        "updated_at": "2015-08-31T18:32:02+00:00"
    }
}

XML Request example

Code Block
languagebash
themeRDark
 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></recipe_join>' -u user:userpass <api_url>/virtual_machines/:virtual_machine_id/recipe_joins.xml