37 lines
1023 B
YAML
37 lines
1023 B
YAML
# This example requires the following properties provided in execution context:
|
|
# - nova_url ## url to Nova service, e.g. http://0.0.0.0:8774/v3
|
|
# - server_name ## Name of the new instance
|
|
# - image_id ## image id from Glance service
|
|
# - flavor_id ## flavor id - type of instance hardware
|
|
|
|
Namespaces:
|
|
Nova:
|
|
class: std.http
|
|
actions:
|
|
create-vm:
|
|
base-parameters:
|
|
url: '{$.nova_url}/{$.openstack.project_id}/servers'
|
|
method: POST
|
|
headers:
|
|
X-Auth-Token: $.openstack.auth_token
|
|
Content-Type: application/json
|
|
body:
|
|
server:
|
|
name: $.server_name
|
|
imageRef: $.image_id
|
|
flavorRef: $.flavor_id
|
|
output:
|
|
vm_id: $.content.server.id
|
|
|
|
Workflow:
|
|
tasks:
|
|
create-vm:
|
|
action: Nova.create-vm
|
|
parameters:
|
|
server_name: $.server_name
|
|
image_id: $.image_id
|
|
flavor_id: $.flavor_id
|
|
nova_url: $.nova_url
|
|
publish:
|
|
vm_id: $.vm_id
|