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 new soap data for OPNsense #36

Merged
merged 1 commit into from
Feb 19, 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
51 changes: 51 additions & 0 deletions src/Data/SoapData.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Xelon\VmWareClient\Types\VirtualDeviceConnectInfo;
use Xelon\VmWareClient\Types\VirtualDisk;
use Xelon\VmWareClient\Types\VirtualDiskFlatVer2BackingInfo;
use Xelon\VmWareClient\Types\VirtualE1000e;
use Xelon\VmWareClient\Types\VirtualEthernetCardDistributedVirtualPortBackingInfo;
use Xelon\VmWareClient\Types\VirtualLsiLogicSASController;
use Xelon\VmWareClient\Types\VirtualVmxnet3;
Expand Down Expand Up @@ -137,6 +138,27 @@ public function addNetworkSpec(
]);
}

public function addNetworkOPNsenseSpec(
string $switchUuid,
string $portgroupKey,
int $unitNumber,
int $controllerKey = 100,
int $key = -1
): VirtualE1000e {
return new VirtualE1000e([
'key' => $key,
'backing' => new VirtualEthernetCardDistributedVirtualPortBackingInfo([
'port' => new DistributedVirtualSwitchPortConnection([
'switchUuid' => $switchUuid,
'portgroupKey' => $portgroupKey,
]),
]),
'controllerKey' => $controllerKey,
'unitNumber' => $unitNumber,
'uptCompatibilityEnabled' => false
]);
}

public function editNetworkSpec(
string $switchUuid,
string $portgroupKey,
Expand Down Expand Up @@ -165,6 +187,35 @@ public function editNetworkSpec(
]);
}

public function editNetworkOPNsenseSpec(
string $switchUuid,
string $portgroupKey,
int $key,
?string $macAddress = null,
string $addressType = 'generated',
bool $forceConnected = false
): VirtualE1000e {
return new VirtualE1000e([
'key' => $key,
'backing' => new VirtualEthernetCardDistributedVirtualPortBackingInfo([
'port' => new DistributedVirtualSwitchPortConnection([
'switchUuid' => $switchUuid,
'portgroupKey' => $portgroupKey,
]),
]),
'connectable' => $forceConnected
? new VirtualDeviceConnectInfo([
'startConnected' => true,
'allowGuestControl' => true,
'connected' => true,
])
: null,
'addressType' => $addressType,
'macAddress' => $macAddress,
'uptCompatibilityEnabled' => false
]);
}

public function addSasControllerSpec(): VirtualLsiLogicSASController
{
return new VirtualLsiLogicSASController([
Expand Down
Loading