mirror of
https://github.com/Corsinvest/cv4pve-api-php.git
synced 2026-04-25 04:25:48 +03:00
[GH-ISSUE #15] Call to undefined method Corsinvest\ProxmoxVE\Api\PVEClusterNextid::getResponse() #14
Labels
No labels
enhancement
needs investigation
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cv4pve-api-php#14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @TheBadalaMaster on GitHub (Jun 28, 2021).
Original GitHub issue: https://github.com/Corsinvest/cv4pve-api-php/issues/15
Hello. I am feeling a little dumb with how to get responses from methods like Nextid or for example "shutdown"
(To shutdown a machine i ended up using the Base Cliente like so:
$client->setResponseType('json');
$result = $client->create('/nodes/qindev/qemu/105/status/shutdown')->getResponse()->data;
return $result;
Could i please get an example of this? Thanks :D
@TheBadalaMaster commented on GitHub (Jun 29, 2021):
Also, this definitely wouldn't work but i am confused as to how to pass parameters in the function:
Thanks so much :)
@franklupo commented on GitHub (Jun 29, 2021):
Hi,
or
$nodeId="node01";
$vmId=100;
$newid=102;
$client->getNodes()->get($nodeId)->getQemu()->get($vmId)->getClone()->cloneVm($newid)
If you are using an IDE it shows the method with parameters
best regards
@TheBadalaMaster commented on GitHub (Jun 29, 2021):
Thanks for your answer!
The first question in the issue is understood. About the second, if i am going to clone a VM and i want to specify options (i took this array from your code) how would i pass it down? as a parameter to cloneVm?
['newid' => 109,
'bwlimit' => null,
'description' => 'Bad',
'format' => null,
'full' => null,
'name' => 'Bad',
'pool' => null,
'snapname' => null,
'storage' => null,
'target' => null])
Thanks and sorry to bother!
@franklupo commented on GitHub (Jun 29, 2021):
The clone accept parameter
github.com/Corsinvest/cv4pve-api-php@5014a23d55/src/PveClient.php (L12036)@TheBadalaMaster commented on GitHub (Jun 29, 2021):
Thanks so much! everything working when doing a full clone. Still got to figure out how to do a linked clone. For future reference it ended up working like this:
print_r($result);
@TheBadalaMaster commented on GitHub (Jun 30, 2021):
Sorry, last question. How can I increase the debug level from the api side so I can see what error I'm getting (your java api has this but this one doesn't.
Thanks for all your help :)
@franklupo commented on GitHub (Jun 30, 2021):
github.com/Corsinvest/cv4pve-api-php@5014a23d55/src/PveClientBase.php (L137)