'Deploy OVF file with custom properties using java sdk

I have an ovf file with a ProductSection element:

<ProductSection>
 <Property ovf:key="guestinfo.ipaddress" ovf:type="string" ovf:userConfigurable="true" ovf:value="">
    <Label>Static IP Address</Label>
 </Property>
 <Property ovf:key="guestinfo.netmask" ovf:type="string" ovf:userConfigurable="true" ovf:value="">
    <Label>Netmask</Label>
 </Property>
 <Property ovf:key="guestinfo.gateway" ovf:type="string" ovf:userConfigurable="true" ovf:value="">
    <Label>Gateway</Label>
 </Property>
 <Property ovf:key="guestinfo.dns" ovf:type="string" ovf:userConfigurable="true" ovf:value="">
    <Label>DNS Server</Label>
 </Property>
</ProductSection>

I'm trying to read and set those properties using vCenter REST APIs with the follwing code snipet

OvfSummary ovfSummary = libraryItemService.filter(applianceItemId, deploymentTarget);
        
for (Structure s : ovfSummary.getAdditionalParams()) {
    DataValue d = s._getDataValue();
    System.out.println(d);
}

However, I'm not able to get ProductSection properties.

Is there a way to accomplish this task?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source