Skip to content

Commit

Permalink
Merge pull request #38 from Xelon-AG/feat/upgrade-client-for-php-8
Browse files Browse the repository at this point in the history
feat: add guest operating system to perform a reboot
  • Loading branch information
tonkoshkurik authored May 7, 2024
2 parents da1ad22 + 7ec1745 commit adbb0ad
Showing 1 changed file with 13 additions and 11 deletions.
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

0 comments on commit adbb0ad

Please sign in to comment.