com.vmware.vcloud.sdk
Class Metadata

java.lang.Object
  extended by com.vmware.vcloud.sdk.VcloudResource<com.vmware.vcloud.api.rest.schema.MetadataType>
      extended by com.vmware.vcloud.sdk.Metadata

public class Metadata
extends VcloudResource<com.vmware.vcloud.api.rest.schema.MetadataType>

Helper class for the Metadata resource in vCloud API. The metadata tagging is available only for some of the entities in the User and Admin API - Organization, Vdc, Catalog, CatalogItem, Media, VappTemplate, VappTemplate VM, Vapp, Vapp VM, OrgNetwork, AdminOrganization, AdminVdc, AdminCatalog, AdminOrgNetwork, External Network, ProviderVdc etc.

Since:
API 1.5, SDK 1.5
Author:
Ecosystem Engineering
See Also:
MetadataType

Constructor Summary
Metadata(VcloudClient client, com.vmware.vcloud.api.rest.schema.MetadataType metadataType)
          Default access constructor for creating a Metadata helper class
 
Method Summary
 Task deleteMetadataEntry(String key)
          Deletes a specific metadata entry.
static Task deleteMetadataEntry(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType entityRef, String key)
          Deletes a specific metadata entry.
 Task deleteTypedMetadataEntry(String key)
          Deletes a specific typed metadata entry.
 Task deleteTypedMetadataEntry(String key, MetadataDomain domain)
          Deletes a specific typed metadata entry.
 HashMap<String,String> getMetadataEntries()
          Retrieves a map of metadata entries for this vcloud resource.
static HashMap<String,String> getMetadataEntries(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType entityRef)
          Retrieves a map of metadata entries for this vcloud resource.
 String getMetadataEntry(String key)
          Returns a specific metadata entry.
static String getMetadataEntry(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType entityRef, String key)
          Returns a specific metadata entry.
 List<com.vmware.vcloud.api.rest.schema.MetadataEntryType> getTypedMetadataEntries()
          Returns a map of specific typed metadata entries.
 com.vmware.vcloud.api.rest.schema.MetadataEntryType getTypedMetadataEntry(String key)
          Returns the specific typed metadata entry for the specified key.
 com.vmware.vcloud.api.rest.schema.MetadataEntryType getTypedMetadataEntry(String key, MetadataDomain domain)
          Returns the specific typed metadata entry for the specified key and domain.
 Task updateMetadataEntries(HashMap<String,String> metadataEntries)
          Updates the provided map of metadata entries for this vcloud resource.
 Task updateMetadataEntry(String key, String value)
          Updates a specific metadata entry.
static Task updateMetadataEntry(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType entityRef, String key, String value)
          Updates a specific metadata entry.
 Task updateTypedMetadataEntries(List<com.vmware.vcloud.api.rest.schema.MetadataEntryType> metadataEntries)
          Updates the provided list of metadata entries.
 Task updateTypedMetadataEntry(com.vmware.vcloud.api.rest.schema.MetadataEntryType typedMetadataEntry)
          Updates a specific typed metadata entry.
 
Methods inherited from class com.vmware.vcloud.sdk.VcloudResource
getReference, getResource
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Metadata

public Metadata(VcloudClient client,
                com.vmware.vcloud.api.rest.schema.MetadataType metadataType)
Default access constructor for creating a Metadata helper class

Parameters:
client -
metadataType - MetadataType
Method Detail

getMetadataEntry

public String getMetadataEntry(String key)
                        throws VCloudException
Returns a specific metadata entry.

Returns:
String
Throws:
VCloudException

getTypedMetadataEntry

public com.vmware.vcloud.api.rest.schema.MetadataEntryType getTypedMetadataEntry(String key)
                                                                          throws VCloudException
Returns the specific typed metadata entry for the specified key.

Parameters:
key -
Returns:
MetadataEntryType
Throws:
VCloudException
Since:
API 5.1, SDK 5.1
See Also:
MetadataDomain, MetadataDomainVisibility

getTypedMetadataEntry

public com.vmware.vcloud.api.rest.schema.MetadataEntryType getTypedMetadataEntry(String key,
                                                                                 MetadataDomain domain)
                                                                          throws VCloudException
Returns the specific typed metadata entry for the specified key and domain.

Parameters:
key -
domain -
Returns:
MetadataEntryType
Throws:
VCloudException
Since:
API 5.1, SDK 5.1
See Also:
MetadataDomain, MetadataDomainVisibility

getMetadataEntries

public HashMap<String,String> getMetadataEntries()
Retrieves a map of metadata entries for this vcloud resource.

Returns:
HashMap<String,String>

getTypedMetadataEntries

public List<com.vmware.vcloud.api.rest.schema.MetadataEntryType> getTypedMetadataEntries()
Returns a map of specific typed metadata entries.

Returns:
List<MetadataEntryType>
Since:
API 5.1, SDK 5.1
See Also:
MetadataDomain, MetadataDomainVisibility

updateMetadataEntries

public Task updateMetadataEntries(HashMap<String,String> metadataEntries)
                           throws VCloudException
Updates the provided map of metadata entries for this vcloud resource. The update can be, a. updating old entries. b. adding new entries.

Parameters:
metadataEntries - HashMap<String,String>
Returns:
Task
Throws:
VCloudException

updateTypedMetadataEntries

public Task updateTypedMetadataEntries(List<com.vmware.vcloud.api.rest.schema.MetadataEntryType> metadataEntries)
                                throws VCloudException
Updates the provided list of metadata entries. The update can be 1. adding new entries 2. updating the old ones.

Parameters:
metadataEntries - List<MetadataEntryType>
Returns:
Task
Throws:
VCloudException
Since:
API 5.1, SDK 5.1
See Also:
MetadataDomain, MetadataDomainVisibility

updateMetadataEntry

public Task updateMetadataEntry(String key,
                                String value)
                         throws VCloudException
Updates a specific metadata entry.

Parameters:
key - String
value - String
Returns:
Task
Throws:
VCloudException

updateTypedMetadataEntry

public Task updateTypedMetadataEntry(com.vmware.vcloud.api.rest.schema.MetadataEntryType typedMetadataEntry)
                              throws VCloudException
Updates a specific typed metadata entry.

Parameters:
typedMetadataEntry - MetadataEntryType
Returns:
Task
Throws:
VCloudException
Since:
API 5.1, SDK 5.1
See Also:
MetadataDomain, MetadataDomainVisibility

deleteMetadataEntry

public Task deleteMetadataEntry(String key)
                         throws VCloudException
Deletes a specific metadata entry.

Parameters:
key - String
Returns:
Task
Throws:
VCloudException

deleteTypedMetadataEntry

public Task deleteTypedMetadataEntry(String key)
                              throws VCloudException
Deletes a specific typed metadata entry.

Parameters:
key - String
Returns:
Task
Throws:
VCloudException
Since:
API 5.1, SDK 5.1

deleteTypedMetadataEntry

public Task deleteTypedMetadataEntry(String key,
                                     MetadataDomain domain)
                              throws VCloudException
Deletes a specific typed metadata entry.

Parameters:
key - String
domain - MetadataDomain
Returns:
Task
Throws:
VCloudException
Since:
API 5.1, SDK 5.1

getMetadataEntry

public static String getMetadataEntry(VcloudClient client,
                                      com.vmware.vcloud.api.rest.schema.ReferenceType entityRef,
                                      String key)
                               throws VCloudException
Returns a specific metadata entry.

Parameters:
client - VcloudClient
entityRef - - Organization, Catalog, Vapp ref etc ReferenceType
key - String
Returns:
String
Throws:
VCloudException

getMetadataEntries

public static HashMap<String,String> getMetadataEntries(VcloudClient client,
                                                        com.vmware.vcloud.api.rest.schema.ReferenceType entityRef)
                                                 throws VCloudException
Retrieves a map of metadata entries for this vcloud resource.

Parameters:
client - VcloudClient
entityRef - - Organization, Catalog, Vapp ref etc ReferenceType
Returns:
HashMap<String,String>
Throws:
VCloudException

updateMetadataEntry

public static Task updateMetadataEntry(VcloudClient client,
                                       com.vmware.vcloud.api.rest.schema.ReferenceType entityRef,
                                       String key,
                                       String value)
                                throws VCloudException
Updates a specific metadata entry.

Parameters:
client - VcloudClient
entityRef - - Organization, Catalog, Vapp ref etc ReferenceType
key - String
value - String
Returns:
Task
Throws:
VCloudException

deleteMetadataEntry

public static Task deleteMetadataEntry(VcloudClient client,
                                       com.vmware.vcloud.api.rest.schema.ReferenceType entityRef,
                                       String key)
                                throws VCloudException
Deletes a specific metadata entry.

Parameters:
client - VcloudClient
entityRef - - Organization, Catalog, Vapp ref etc ReferenceType
key - String
Returns:
Task
Throws:
VCloudException


Copyright © 2016. All Rights Reserved.