vCloud API 5.1 Metadata
There has been very good coverage and code samples for working with Metadata in vCloud Director 1.5 (See posts from William, Alan, and Clinton), so this will simply be an update post for Metadata in vCloud Director 5.1.comments powered by Disqus
- Typed Values - Metadata must now be put into a certain type. No more throwing random junk into a single metadata entry. :D
- Domain and Visibility - Providers now have the ability to provide System metadata entries on objects, which is not editable by users. Providers can additionally make the metadata private, meaning the users cannot see the System metadata on the object at all.
- Objects - Metadata can now be added to new vCloud Director 5.1 objects, including disks and storage profiles. Additionally, I believe that because OrgVDC networks are now user manageable, vCloud users can add their own metadata to networks.
PowerCLI 5.1 R2 example:
$vapp = Get-CIVapp "MyVApp" $metadata = $vapp.extensiondata.GetMetadata() $metadata.MetadataEntry = New-Object VMware.VimAutomation.Cloud.Views.MetadataEntry # I don't have any other metadata, so index is . $metadata.MetadataEntry.Key = "Jake" $metadata.MetadataEntry.TypedValue = New-Object VMware.VimAutomation.Cloud.Views.MetadataStringValue $metadata.MetadataEntry.TypedValue.Value = "vCloudNerd" $vapp.ExtensionData.CreateMetadata($metadata)