Hello all, I'm trying to modify the netboot_enabled value on a system using the remote api.
I've tried to use the modify_system function however it seems to require the actual object rather than the name of the system. This is rather expensive to serialize. (may be quick in python, but using perl's XMLRPC::Lite it takes a long time).
Can modify_system be changed to take the system name rather than the system object?
In the interim I've added a call that does the reverse of what already exists for kickstart files... however, this is somewhat of an issue because *anyone* can call this (and reinstall your machine) http://cobbler.example.com/cblr/svc/op/pxeon/system/cobbler-test.example.com
Comments, suggestions?
Thanks, Gordon Child
Hi Gordon,
I don't see it taking a long time in perl:
real 0m0.473s user 0m0.133s sys 0m0.021s
I used the demo code here (search for bonus example): https://fedorahosted.org/cobbler/wiki/CobblerXmlrpc
-Kevin
Gordon Child wrote:
Hello all, I'm trying to modify the netboot_enabled value on a system using the remote api.
I've tried to use the modify_system function however it seems to require the actual object rather than the name of the system. This is rather expensive to serialize. (may be quick in python, but using perl's XMLRPC::Lite it takes a long time).
Can modify_system be changed to take the system name rather than the system object?
In the interim I've added a call that does the reverse of what already exists for kickstart files... however, this is somewhat of an issue because *anyone* can call this (and reinstall your machine) http://cobbler.example.com/cblr/svc/op/*pxeon*/system/cobbler-test.example.c...
Comments, suggestions?
Thanks, Gordon Child
cobbler-devel mailing list cobbler-devel@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler-devel
Kevin, Thank you for your response. I was actually trying to edit an existing system. But it looks like I was doing this wrong. I was calling get_item_handle and then calling modify_system. I just found the xapi_object_edit method. I can edit a system easily this way without the expensive serialization of the item handle.
my $result = $xmlrpc->xapi_object_edit("system", "system-name", "edit", {netboot_enabled=>1}, $token)->result();
I didn't see the xapi_object_edit method in the wiki... can it be added or is it hidden functionality? (I did see some FIXME's in there)
-Gordon
On Jan 26, 2010, at 4:55 PM, Kevin Connor wrote:
Hi Gordon,
I don't see it taking a long time in perl:
real 0m0.473s user 0m0.133s sys 0m0.021s
I used the demo code here (search for bonus example): https://fedorahosted.org/cobbler/wiki/CobblerXmlrpc
-Kevin
Gordon Child wrote:
Hello all, I'm trying to modify the netboot_enabled value on a system using the remote api.
I've tried to use the modify_system function however it seems to require the actual object rather than the name of the system. This is rather expensive to serialize. (may be quick in python, but using perl's XMLRPC::Lite it takes a long time).
Can modify_system be changed to take the system name rather than the system object?
In the interim I've added a call that does the reverse of what already exists for kickstart files... however, this is somewhat of an issue because *anyone* can call this (and reinstall your machine) http://cobbler.example.com/cblr/svc/op/*pxeon*/system/cobbler-test.example.c...
Comments, suggestions?
Thanks, Gordon Child
cobbler-devel mailing list cobbler-devel@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler-devel
cobbler-devel mailing list cobbler-devel@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler-devel
Hi Gordon,
I'm not on the cobbler team, just another user. So I can't give any info about xapi_object_edit. Cool find though.
The timing I gave before was for modifying an existing system, I didn't look at the sample code close enough to see it was doing a new system. Sorry about that.
You probably don't need it but this is what I did. It does the serialization, it just doesn't seem expensive in the scheme of things.
my $xmlrpc = XMLRPC::Lite -> proxy('https://<host>/cobbler_api');
# Login to cobbler xmlrpm and get session token back. my $system = "linux5.2"; my $token = $xmlrpc->login("user", "pwd")->result();
my $test_machine = $xmlrpc->get_system_handle($system, $token)->result(); die "test machine $system not found" if !$test_machine;
$xmlrpc->modify_system($test_machine, "netboot_enabled", "1", $token);
my $result = $xmlrpc->save_system($test_machine, $token)->result();
-Kevin
Gordon Child wrote:
Kevin, Thank you for your response. I was actually trying to edit an existing system. But it looks like I was doing this wrong. I was calling get_item_handle and then calling modify_system. I just found the xapi_object_edit method. I can edit a system easily this way without the expensive serialization of the item handle.
my $result = $xmlrpc->xapi_object_edit("system", "system-name", "edit", {netboot_enabled=>1}, $token)->result();
I didn't see the xapi_object_edit method in the wiki... can it be added or is it hidden functionality? (I did see some FIXME's in there)
-Gordon
On Jan 26, 2010, at 4:55 PM, Kevin Connor wrote:
Hi Gordon,
I don't see it taking a long time in perl:
real 0m0.473s user 0m0.133s sys 0m0.021s
I used the demo code here (search for bonus example): https://fedorahosted.org/cobbler/wiki/CobblerXmlrpc
-Kevin
Gordon Child wrote:
Hello all, I'm trying to modify the netboot_enabled value on a system using the remote api.
I've tried to use the modify_system function however it seems to require the actual object rather than the name of the system. This is rather expensive to serialize. (may be quick in python, but using perl's XMLRPC::Lite it takes a long time).
Can modify_system be changed to take the system name rather than the system object?
In the interim I've added a call that does the reverse of what already exists for kickstart files... however, this is somewhat of an issue because *anyone* can call this (and reinstall your machine) http://cobbler.example.com/cblr/svc/op/*pxeon*/system/cobbler-test.example.c...
Comments, suggestions?
Thanks, Gordon Child
cobbler-devel mailing list cobbler-devel@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler-devel
cobbler-devel mailing list cobbler-devel@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler-devel
cobbler-devel mailing list cobbler-devel@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/cobbler-devel
cobbler-devel@lists.fedorahosted.org