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 ability to set connected/disconnected state of network adapter #40

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
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
8 changes: 5 additions & 3 deletions src/Data/SoapData.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ public function editNetworkSpec(
int $key,
?string $macAddress = null,
string $addressType = 'generated',
bool $forceConnected = false
bool $forceConnected = false,
bool $startConnected = true,
bool $connected = true
): VirtualVmxnet3 {
return new VirtualVmxnet3([
'key' => $key,
Expand All @@ -155,9 +157,9 @@ public function editNetworkSpec(
]),
'connectable' => $forceConnected
? new VirtualDeviceConnectInfo([
'startConnected' => true,
'startConnected' => $startConnected,
'allowGuestControl' => true,
'connected' => true,
'connected' => $connected,
])
: null,
'addressType' => $addressType,
Expand Down
8 changes: 6 additions & 2 deletions src/Traits/Soap/SoapVmApis.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@ public function editNetwork(
string $macAddress,
int $key,
string $addressType = 'generated',
bool $forceConnected = false
bool $forceConnected = false,
bool $startConnected = true,
bool $connected = true,
) {
$body = [
'spec' => new VirtualMachineConfigSpec([
Expand All @@ -306,7 +308,9 @@ public function editNetwork(
$key,
$macAddress,
$addressType,
$forceConnected
$forceConnected,
$startConnected,
$connected,
),
]),
]),
Expand Down
Loading