Data Object Types Overview

All data object types are listed in the frame at the left of this page. Click a name to display the reference documentation for the data object. Reference documentation for data object types typically includes:

To quickly find any entry, start typing its name in the Quick Index.

Property Names

The name of a property is a commonly used value in View API. It is used in update methods, query filters, and query sorting. This will be the dotted path from the root object (either the Info object for the service or the queryable data object) to the property.

Client Library

Included in the client library are the helper classes which simplify client code development. For each data object named FooData, there is corresponding helper class FooDataHelper.
Example -> VirtualCenterSpec object has VirtualCenterSpecHelper class.
Data helper objects can be obtained from enclosing helper Service objects(VirtualCenterService) provided by client library.

Syntax

$<YourService>.get<YourDataObjectName>Helper

Example: VirtualCenterSpecHelper can be obtained from VirtualCenterService object

$vcSpecHelper = $vcService.getVirtualCenterSpecHelper()

View API objects creating using Helper objects have default value populated

[VMware.Hv.VirtualCenterSpec]$vcSpec = $vcSpecHelper.getDataObject()
# All the defaults are auto-populated in object created with this approach
# $vcSpec.limits.vcProvisioningLimit = 10
# $vcSpec.limits.vcPowerOperationsLimit = 10
# $vcSpec.StorageAcceleratorData.enabled = $false
#
...
# And all other default values will be already populated, no need to set them manually.

Get DesktopSpec object from DesktopSpecHelper object.

$desktopService = New-Object VMware.Hv.DesktopService
$desktopSpecHelper = $desktopService.getDesktopSpecHelper()
$desktopSpec = $desktopSpecHelper.getDataObject()

Get FarmSpec object from FarmSpecHelper object.

$farmService = New-Object VMware.Hv.FarmService
$farmSpecHelper = $farmService.getFarmSpecHelper()
$farmSpec = $farmSpecHelper.getDataObject()

# get AutomatedFarmSpec object using helper library. This will have default values populated.
$farmAutomatedSpecHelper = $farmService.getFarmAutomatedFarmSpecHelper()
$farmAutomatedSpec = $farmAutomatedSpecHelper.getDataObject()

# set $automatedFarmSpec object
$farmSpec.Type = $farmSpecHelper.TYPE_AUTOMATED
$farmSpec.automatedFarmSpec = $farmAutomatedSpec

Examples

Here are a few examples using the Client library for various operations.

Example: Add Vcenter to Connection Server

This example demonstrates how to use client library's helper object.

$hvServer = Connect-HVServer -server 'serverName' -user 'admin' -password 'passwd' -domain 'addomain'
$Global:hvServices = $hvServer.ExtensionData

$vcService = New-Object VMware.Hv.VirtualCenterService
$certService = New-Object VMware.Hv.CertificateService
$vcSpecHelper = $vcService.getVirtualCenterSpecHelper()

$vcPassword = New-Object VMware.Hv.SecureString
$enc = [system.Text.Encoding]::UTF8
$vcPassword.Utf8String = $enc.GetBytes('passwd')

$serverSpec = $vcSpecHelper.getDataObject().serverSpec
$serverSpec.serverName = 'serverName'
$serverSpec.port = 443
$serverSpec.useSSL = $true
$serverSpec.userName = 'administrator'
$serverSpec.password = $vcPassword
$serverSpec.serverType = $certService.getServerSpecHelper().SERVER_TYPE_VIRTUAL_CENTER

$certData = $certService.Certificate_Validate($hvServices, $serverSpec)
$certificateOverride = New-Object VMware.Hv.CertificateThumbprint
$certificateOverride.sslCertThumbprint = $certData.thumbprint.sslCertThumbprint
$certificateOverride.sslCertThumbprintAlgorithm = $certData.thumbprint.sslCertThumbprintAlgorithm

$vcSpecHelper.getDataObject().CertificateOverride = $certificateOverride

# Make service call
$vcId = $vcService.VirtualCenter_Create($hvServices, $vcSpecHelper.getDataObject())

Example: Create Global Entitlement

This example demonstrates how to create Global Entitlement using client library's helper object.

$hvServer = Connect-HVServer -server 'serverName' -user 'admin' -password 'passwd' -domain 'addomain'
$Global:services = $hvServer.ExtensionData
$geService = New-Object VMware.Hv.GlobalEntitlementService

$geBaseHelper = $geService.getGlobalEntitlementBaseHelper()
$geBase = $geBaseHelper.getDataObject()
$geBase.displayName = "GESetting1"
$geBase.allowUsersToChooseProtocol = $false
$geBase.allowUsersToResetMachines = $true

$geId = $geService.GlobalEntitlement_Create($services, $geBase)
$geId
Back to Home