[GH-ISSUE #15] Call to undefined method Corsinvest\ProxmoxVE\Api\PVEClusterNextid::getResponse() #14

Closed
opened 2026-02-26 17:32:06 +03:00 by kerem · 7 comments
Owner

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

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
kerem closed this issue 2026-02-26 17:32:06 +03:00
Author
Owner

@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:

$result = $client->create("/nodes/bad/qemu/102/clone/")->params(['newid' => 109,
            'bwlimit' => null,
            'description' => 'Bad',
            'format' => null,
            'full' => null,
            'name' => 'Bad',
            'pool' => null,
            'snapname' => null,
            'storage' => null,
            'target' => null]);

Thanks so much :)

<!-- gh-comment-id:870211483 --> @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: $result = $client->create("/nodes/bad/qemu/102/clone/")->params(['newid' => 109, 'bwlimit' => null, 'description' => 'Bad', 'format' => null, 'full' => null, 'name' => 'Bad', 'pool' => null, 'snapname' => null, 'storage' => null, 'target' => null]); Thanks so much :)
Author
Owner

@franklupo commented on GitHub (Jun 29, 2021):

Hi,

image

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

<!-- gh-comment-id:870672012 --> @franklupo commented on GitHub (Jun 29, 2021): Hi, ![image](https://user-images.githubusercontent.com/6276309/123819989-83d30380-d8fa-11eb-8031-4cfb1864bc77.png) 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
Author
Owner

@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!

<!-- gh-comment-id:870715638 --> @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!
Author
Owner

@franklupo commented on GitHub (Jun 29, 2021):

The clone accept parameter
github.com/Corsinvest/cv4pve-api-php@5014a23d55/src/PveClient.php (L12036)

<!-- gh-comment-id:870961356 --> @franklupo commented on GitHub (Jun 29, 2021): The clone accept parameter https://github.com/Corsinvest/cv4pve-api-php/blob/5014a23d5519871f00fb45a599796916d567cc93/src/PveClient.php#L12036
Author
Owner

@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:

$result = $client->getNodes()->get("bog1")->getQemu()->get(101)->getClone()->cloneVm(106, 0, 'test', null, null, 'test', null, null, null, null)->getResponse()->data;

print_r($result);

<!-- gh-comment-id:870977426 --> @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: $result = $client->getNodes()->get("bog1")->getQemu()->get(101)->getClone()->cloneVm(106, 0, 'test', null, null, 'test', null, null, null, null)->getResponse()->data; print_r($result);
Author
Owner

@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 :)

<!-- gh-comment-id:871088334 --> @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 :)
Author
Owner
<!-- gh-comment-id:871121503 --> @franklupo commented on GitHub (Jun 30, 2021): https://github.com/Corsinvest/cv4pve-api-php/blob/5014a23d5519871f00fb45a599796916d567cc93/src/PveClientBase.php#L137
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cv4pve-api-php#14
No description provided.