1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-11 05:17:41 +03:00

Feature #1103: Add xmlrpc optional param to instantiate templates on hold

This commit is contained in:
Carlos Martín 2012-12-20 17:45:27 +01:00
parent 8d8da16758
commit 7aff914bf9
3 changed files with 10 additions and 3 deletions

View File

@ -109,7 +109,7 @@ public:
VirtualMachineAllocate():
RequestManagerAllocate("VirtualMachineAllocate",
"Allocates a new virtual machine",
"A:ss",
"A:ssb",
true)
{
Nebula& nd = Nebula::instance();

View File

@ -57,7 +57,7 @@ public:
VMTemplateInstantiate():
RequestManagerVMTemplate("TemplateInstantiate",
"Instantiates a new virtual machine using a template",
"A:sis")
"A:sisb")
{
auth_op = AuthRequest::USE;
};

View File

@ -27,6 +27,13 @@ void VMTemplateInstantiate::request_execute(xmlrpc_c::paramList const& paramList
int id = xmlrpc_c::value_int(paramList.getInt(1));
string name = xmlrpc_c::value_string(paramList.getString(2));
bool on_hold = false;
if ( paramList.size() > 3 )
{
on_hold = xmlrpc_c::value_boolean(paramList.getBoolean(3));
}
int rc, vid;
PoolObjectAuth perms;
@ -109,7 +116,7 @@ void VMTemplateInstantiate::request_execute(xmlrpc_c::paramList const& paramList
Template tmpl_back(*tmpl);
rc = vmpool->allocate(att.uid, att.gid, att.uname, att.gname, tmpl, &vid,
error_str, false);
error_str, on_hold);
if ( rc < 0 )
{