Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add guest operating system to perform a reboot #38

Merged
merged 1 commit into from
May 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions src/Traits/Rest/VmApis.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ public function startPower(string $vmId)

public function stopPower(string $vmId)
{
$a = 5;

return $this->request(
'post',
$this->version >= 7 ? "/api/vcenter/vm/$vmId/power?action=stop" : "/rest/vcenter/vm/$vmId/power/stop"
Expand Down Expand Up @@ -132,14 +130,17 @@ public function getGuestOperations()
// TODO:
}

public function getGuestPower()
public function getGuestPower(string $vmId)
{
// TODO:
return $this->request('get', "$this->apiUrlPrefix/vcenter/vm/$vmId/guest/power");
}

public function rebootGuestPower()
public function rebootGuestPower(string $vmId)
{
// TODO:
return $this->request(
'post',
"/api/vcenter/vm/$vmId/guest/power?action=reboot"
);
}

public function shutdownGuestPower(string $vmId)
Expand Down Expand Up @@ -284,11 +285,12 @@ public function getHardwareCpu()

public function updateHardwareCpu(
string $vmId,
int $coresPerSocket,
int $count,
bool $hotAddEnabled = false,
bool $hotRemoveEnabled = false
) {
int $coresPerSocket,
int $count,
bool $hotAddEnabled = false,
bool $hotRemoveEnabled = false
)
{
$requestBody = [
'cores_per_socket' => $coresPerSocket,
'count' => $count,
Expand Down
Loading