Allow specifying arbitrary script_args on CLI

Allow the specifying of arbitrary provisioner script install() args on
the provisioner create CLI, either overriding or adding additional
per-VM arguments to those found in the profile. Reference example is
setting a "vm_fqdn" on a per-run basis.

Closes #100
This commit is contained in:
2020-07-08 13:18:12 -04:00
parent 8fc5299d38
commit a1ba9d2eeb
4 changed files with 33 additions and 10 deletions

View File

@ -557,19 +557,20 @@ def profile_remove(config, name):
return retvalue, response.json()['message']
def vm_create(config, name, profile, wait_flag, define_flag, start_flag):
def vm_create(config, name, profile, wait_flag, define_flag, start_flag, script_args):
"""
Create a new VM named {name} with profile {profile}
API endpoint: POST /api/v1/provisioner/create
API_arguments: name={name}, profile={profile}
API_arguments: name={name}, profile={profile}, arg={script_args}
API schema: {message}
"""
params = {
'name': name,
'profile': profile,
'start_vm': start_flag,
'define_vm': define_flag
'define_vm': define_flag,
'arg': script_args
}
response = call_api(config, 'post', '/provisioner/create', params=params)