pyvcloud.vcd.client module

class pyvcloud.vcd.client.BasicLoginCredentials(user, org, password)

Bases: object

class pyvcloud.vcd.client.Client(uri, api_version=None, verify_ssl_certs=True, log_file=None, log_requests=False, log_headers=False, log_bodies=False)

Bases: object

A low-level interface to the vCloud Director REST API.

Clients default to the production vCD API version as of the pyvcloud module release and will try to negotiate down to a lower API version that pyvcloud certifies if the vCD server is older. You can also set the version explicitly using the api_version parameter or by calling the set_highest_supported_version() method.

The log_file is set by the first client instantiated and will be ignored in later clients.

Parameters:
  • uri (str) – vCD server host name or connection URI.
  • api_version (str) – vCD API version to use.
  • verify_ssl_certs (boolean) – If True validate server certificate; False allows self-signed certificates.
  • log_file (str) – log file name or None, which suppresses logging.
  • log_request (boolean) – if True log HTTP requests.
  • log_headers (boolean) – if True log HTTP headers.
  • log_bodies (boolean) – if True log HTTP bodies.
delete_linked_resource(resource, rel, media_type)

Deletes the resource referenced by the link.

Deletes the resource referenced by the link with the specified rel and mediaType in the specified resource.

Raises:OperationNotSupportedException: if the operation fails due to the link being not visible to the logged in user of the client.
delete_resource(uri, force=False, recursive=False)
download_from_uri(uri, file_name, chunk_size=1048576, size=0, callback=None)
get_admin()

Returns the “admin” root resource type.

get_api_uri()
get_api_version()

Return vCD API version client is using.

Returns:api version of the client.
Return type:str
get_extensibility()

Returns the ‘extensibility’ resource type.

get_extension()

Returns the ‘extension’ resource type.

get_linked_resource(resource, rel, media_type)

Gets the content of the resource link.

Gets the contents of the resource referenced by the link with the specified rel and mediaType in the specified resource.

Returns:an object containing XML representation of the resource the link points to.
Return type:lxml.objectify.ObjectifiedElement
Raises:OperationNotSupportedException: if the operation fails due to the link being not visible to the logged in user of the client.
get_org()

Returns the logged in org.

Returns:a sparse representation of the logged in org. The returned object has an ‘Org’ XML element with ‘name’, ‘href’, and ‘type’ attribute.
Return type:lxml.objectify.ObjectifiedElement
get_org_by_name(org_name)

Retrieve an organization.

Parameters:org_name (str) – name of the organization to be retrieved.
Returns:object containing EntityType.ORG XML data representing the organization.
Return type:lxml.objectify.ObjectifiedElement
Raises:EntityNotFoundException: if organization with the provided name couldn’t be found.
get_org_list()

Returns the list of organizations visible to the user.

Returns:a list of objects, where each object contains EntityType.ORG XML data which represents a single organization.
Return type:list
get_query_list()

Returns the list of supported queries.

get_resource(uri, objectify_results=True)

Gets the specified contents to the specified resource.

This method does an HTTP GET.

get_supported_versions()

Return non-deprecated API versions on vCD server.

Returns:an object containing SupportedVersions XML element which represents versions supported by vCD.
Return type:lxml.objectify.ObjectifiedElement
get_supported_versions_list()

Return non-deprecated server API versions as iterable list.

Returns:versions (str) sorted in numerical order.
Return type:list
get_task_monitor()
get_typed_query(query_type_name, query_result_format=<EnumValue: QueryResultFormat.REFERENCES [value=('application/vnd.vmware.vcloud.query.references+xml', 'references')]>, page_size=None, include_links=False, qfilter=None, equality_filter=None, sort_asc=None, sort_desc=None, fields=None)

Issue a typed query using vCD query API.

Parameters:
  • query_type_name (str) – name of the entity, which should be a string listed in ResourceType enum values.
  • query_result_format (QueryResultFormat) – format of query result.
  • page_size (int) – number of entries per page.
  • include_links – (not used).
  • qfilter (str) – filter expression for the query. Is normally made up of sub expressions, where each sub-expression is of the form <filter name><operator><value>. Few of the allowed operators are == for equality, =lt= for less than, =gt= for greater than etc. Multiple sub expression can be joined using logical AND i.e. ; logical OR i.e. , etc. Each value in query string must be url-encoded. E.g. ‘numberOfCpus=gt=4’ , ‘name==abc%20def’.
  • equality_filter (tuple) – a special filter that will be logically AND-ed to qfilter, with the operator being ==. The first element in the tuple is treated as filter name, while the second element is treated as value. There is no need to url-encode the value in this case.
  • sort_asc (str) – if ‘name’ field is present in the result sort ascending by that field.
  • sort_desc (str) – if ‘name’ field is present in the result sort descending by that field.
  • fields (str) – comma separated list of fields to return.
Returns:

A query object that runs the query when execute() method is called.

Return type:

pyvcloud.vcd.client._TypedQuery

get_user_in_org(user_name, org_href)

Retrieve user from a particular organization.

Parameters:
  • user_name (str) – name of the user to be retrieved.
  • org_href (str) – href of the organization to which the user belongs.
Returns:

an object containing EntityType.USER XML data which respresnts an user in vCD.

Return type:

lxml.objectify.ObjectifiedElement

is_sysadmin()
logout()

Destroy the server session and deallocate local resources.

Logout is idempotent. Reusing a client after logout will result in undefined behavior.

post_linked_resource(resource, rel, media_type, contents)

Posts to a resource link.

Posts the contents of the resource referenced by the link with the specified rel and mediaType in the specified resource.

Returns:the result of the POST operation.
Raises:OperationNotSupportedException: if the operation fails due to the link being not visible to the logged in user of the client.
post_resource(uri, contents, media_type, objectify_results=True)

Posts to a resource link.

Posts the specified contents to the specified resource. (Does an HTTP POST.)

put_linked_resource(resource, rel, media_type, contents)

Puts to a resource link.

Puts the contents of the resource referenced by the link with the specified rel and mediaType in the specified resource.

Returns:the result of the PUT operation.
Raises:OperationNotSupportedException: if the operation fails due to the link being not visible to the logged in user of the client.
put_resource(uri, contents, media_type, objectify_results=True)

Puts the specified contents to the specified resource.

This method does an HTTP PUT.

rehydrate(state)
rehydrate_from_token(token)
set_credentials(creds)

Set credentials and authenticate to create a new session.

This call will automatically negotiate the server API version if it was not set previously. Note that the method may generate exceptions from the underlying socket connection, which we pass up unchanged to the client.

Parameters:creds (BasicLoginCredentials) – Credentials containing org, user, and password.
Raises:VcdException: if automatic API negotiation fails to arrive at a supported client version
set_highest_supported_version()

Set the client API version to the highest server API version.

This call is intended to make it easy to work with new vCD features before they are officially supported in pyvcloud. Production applications should either use the default pyvcloud API version or set the API version explicitly to freeze compatibility.

Returns:selected api version.
Return type:str
upload_fragment(uri, contents, range_str)
class pyvcloud.vcd.client.EntityType

Bases: flufl.enum._enum.Enum

ADMIN = <EnumValue: EntityType.ADMIN [value=application/vnd.vmware.admin.vcloud+xml]>
ADMIN_CATALOG = <EnumValue: EntityType.ADMIN_CATALOG [value=application/vnd.vmware.admin.catalog+xml]>
ADMIN_ORG = <EnumValue: EntityType.ADMIN_ORG [value=application/vnd.vmware.admin.organization+xml]>
ADMIN_SERVICE = <EnumValue: EntityType.ADMIN_SERVICE [value=application/vnd.vmware.admin.service+xml]>
AMQP_SETTINGS = <EnumValue: EntityType.AMQP_SETTINGS [value=application/vnd.vmware.admin.amqpSettings+xml]>
API_EXTENSIBILITY = <EnumValue: EntityType.API_EXTENSIBILITY [value=application/vnd.vmware.vcloud.apiextensibility+xml]>
CAPTURE_VAPP_PARAMS = <EnumValue: EntityType.CAPTURE_VAPP_PARAMS [value=application/vnd.vmware.vcloud.captureVAppParams+xml]>
CATALOG = <EnumValue: EntityType.CATALOG [value=application/vnd.vmware.vcloud.catalog+xml]>
COMPOSE_VAPP_PARAMS = <EnumValue: EntityType.COMPOSE_VAPP_PARAMS [value=application/vnd.vmware.vcloud.composeVAppParams+xml]>
CONTROL_ACCESS_PARAMS = <EnumValue: EntityType.CONTROL_ACCESS_PARAMS [value=application/vnd.vmware.vcloud.controlAccess+xml]>
DEPLOY = <EnumValue: EntityType.DEPLOY [value=application/vnd.vmware.vcloud.deployVAppParams+xml]>
DISK = <EnumValue: EntityType.DISK [value=application/vnd.vmware.vcloud.disk+xml]>
DISK_ATTACH_DETACH_PARAMS = <EnumValue: EntityType.DISK_ATTACH_DETACH_PARAMS [value=application/vnd.vmware.vcloud.diskAttachOrDetachParams+xml]>
DISK_CREATE_PARMS = <EnumValue: EntityType.DISK_CREATE_PARMS [value=application/vnd.vmware.vcloud.diskCreateParams+xml]>
EDGE_GATEWAY = <EnumValue: EntityType.EDGE_GATEWAY [value=application/vnd.vmware.admin.edgeGateway+xml]>
EDGE_GATEWAY_SERVICE_CONFIGURATION = <EnumValue: EntityType.EDGE_GATEWAY_SERVICE_CONFIGURATION [value=application/vnd.vmware.admin.edgeGatewayServiceConfiguration+xml]>
EXTENSION = <EnumValue: EntityType.EXTENSION [value=application/vnd.vmware.admin.vmwExtension+xml]>
EXTENSION_SERVICES = <EnumValue: EntityType.EXTENSION_SERVICES [value=application/vnd.vmware.admin.extensionServices+xml]>
EXTERNAL_NETWORK = <EnumValue: EntityType.EXTERNAL_NETWORK [value=application/vnd.vmware.admin.vmwexternalnet+xml]>
EXTERNAL_NETWORK_REFS = <EnumValue: EntityType.EXTERNAL_NETWORK_REFS [value=application/vnd.vmware.admin.vmwExternalNetworkReferences+xml]>
INSTANTIATE_VAPP_TEMPLATE_PARAMS = <EnumValue: EntityType.INSTANTIATE_VAPP_TEMPLATE_PARAMS [value=application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml]>
LEASE_SETTINGS = <EnumValue: EntityType.LEASE_SETTINGS [value=application/vnd.vmware.vcloud.leaseSettingsSection+xml]>
MEDIA = <EnumValue: EntityType.MEDIA [value=application/vnd.vmware.vcloud.media+xml]>
METADATA = <EnumValue: EntityType.METADATA [value=application/vnd.vmware.vcloud.metadata+xml]>
NETWORK_CONFIG_SECTION = <EnumValue: EntityType.NETWORK_CONFIG_SECTION [value=application/vnd.vmware.vcloud.networkConfigSection+xml]>
NETWORK_CONNECTION_SECTION = <EnumValue: EntityType.NETWORK_CONNECTION_SECTION [value=application/vnd.vmware.vcloud.networkConnectionSection+xml]>
NETWORK_MANAGERS = <EnumValue: EntityType.NETWORK_MANAGERS [value=application/vnd.vmware.admin.networkManagers+xml]>
NETWORK_POOL_REFERENCES = <EnumValue: EntityType.NETWORK_POOL_REFERENCES [value=application/vnd.vmware.admin.vmwNetworkPoolReferences+xml]>
NSXT_MANAGER = <EnumValue: EntityType.NSXT_MANAGER [value=application/vnd.vmware.admin.nsxTmanager+xml]>
ORG = <EnumValue: EntityType.ORG [value=application/vnd.vmware.vcloud.org+xml]>
ORG_LIST = <EnumValue: EntityType.ORG_LIST [value=application/vnd.vmware.vcloud.orgList+xml]>
ORG_NETWORK = <EnumValue: EntityType.ORG_NETWORK [value=application/vnd.vmware.vcloud.orgNetwork+xml]>
ORG_RIGHTS = <EnumValue: EntityType.ORG_RIGHTS [value=application/vnd.vmware.admin.org.rights+xml]>
ORG_VDC_NETWORK = <EnumValue: EntityType.ORG_VDC_NETWORK [value=application/vnd.vmware.vcloud.orgVdcNetwork+xml]>
OWNER = <EnumValue: EntityType.OWNER [value=application/vnd.vmware.vcloud.owner+xml]>
PROVIDER_VDC = <EnumValue: EntityType.PROVIDER_VDC [value=application/vnd.vmware.admin.providervdc+xml]>
PROVIDER_VDC_PARAMS = <EnumValue: EntityType.PROVIDER_VDC_PARAMS [value=application/vnd.vmware.admin.createProviderVdcParams+xml]>
PUBLISH_CATALOG_PARAMS = <EnumValue: EntityType.PUBLISH_CATALOG_PARAMS [value=application/vnd.vmware.admin.publishCatalogParams+xml]>
QUERY_LIST = <EnumValue: EntityType.QUERY_LIST [value=application/vnd.vmware.vcloud.query.queryList+xml]>
RASD_ITEM = <EnumValue: EntityType.RASD_ITEM [value=application/vnd.vmware.vcloud.rasdItem+xml]>
RASD_ITEMS_LIST = <EnumValue: EntityType.RASD_ITEMS_LIST [value=application/vnd.vmware.vcloud.rasdItemsList+xml]>
RECOMPOSE_VAPP_PARAMS = <EnumValue: EntityType.RECOMPOSE_VAPP_PARAMS [value=application/vnd.vmware.vcloud.recomposeVAppParams+xml]>
RECORDS = <EnumValue: EntityType.RECORDS [value=application/vnd.vmware.vcloud.query.records+xml]>
REGISTER_VC_SERVER_PARAMS = <EnumValue: EntityType.REGISTER_VC_SERVER_PARAMS [value=application/vnd.vmware.admin.registerVimServerParams+xml]>
RESOURCE_POOL_LIST = <EnumValue: EntityType.RESOURCE_POOL_LIST [value=application/vnd.vmware.admin.resourcePoolList+xml]>
RES_POOL_SET_UPDATE_PARAMS = <EnumValue: EntityType.RES_POOL_SET_UPDATE_PARAMS [value=application/vnd.vmware.admin.resourcePoolSetUpdateParams+xml]>
RIGHT = <EnumValue: EntityType.RIGHT [value=application/vnd.vmware.admin.right+xml]>
ROLE = <EnumValue: EntityType.ROLE [value=application/vnd.vmware.admin.role+xml]>
SNAPSHOT_CREATE = <EnumValue: EntityType.SNAPSHOT_CREATE [value=application/vnd.vmware.vcloud.createSnapshotParams+xml]>
SYSTEM_SETTINGS = <EnumValue: EntityType.SYSTEM_SETTINGS [value=application/vnd.vmware.admin.systemSettings+xml]>
TASK = <EnumValue: EntityType.TASK [value=application/vnd.vmware.vcloud.task+xml]>
TASKS_LIST = <EnumValue: EntityType.TASKS_LIST [value=application/vnd.vmware.vcloud.tasksList+xml]>
TEXT_XML = <EnumValue: EntityType.TEXT_XML [value=text/xml]>
UNDEPLOY = <EnumValue: EntityType.UNDEPLOY [value=application/vnd.vmware.vcloud.undeployVAppParams+xml]>
UPLOAD_VAPP_TEMPLATE_PARAMS = <EnumValue: EntityType.UPLOAD_VAPP_TEMPLATE_PARAMS [value=application/vnd.vmware.vcloud.uploadVAppTemplateParams+xml]>
USER = <EnumValue: EntityType.USER [value=application/vnd.vmware.admin.user+xml]>
VAPP = <EnumValue: EntityType.VAPP [value=application/vnd.vmware.vcloud.vApp+xml]>
VAPP_TEMPLATE = <EnumValue: EntityType.VAPP_TEMPLATE [value=application/vnd.vmware.vcloud.vAppTemplate+xml]>
VDC = <EnumValue: EntityType.VDC [value=application/vnd.vmware.vcloud.vdc+xml]>
VDCS_PARAMS = <EnumValue: EntityType.VDCS_PARAMS [value=application/vnd.vmware.admin.createVdcParams+xml]>
VDC_REFERENCES = <EnumValue: EntityType.VDC_REFERENCES [value=application/vnd.vmware.admin.vdcReferences+xml]>
VIM_SERVER_REFS = <EnumValue: EntityType.VIM_SERVER_REFS [value=application/vnd.vmware.admin.vmwVimServerReferences+xml]>
VIRTUAL_CENTER = <EnumValue: EntityType.VIRTUAL_CENTER [value=application/vnd.vmware.admin.vmwvirtualcenter+xml]>
VM = <EnumValue: EntityType.VM [value=application/vnd.vmware.vcloud.vm+xml]>
VMS = <EnumValue: EntityType.VMS [value=application/vnd.vmware.vcloud.vms+xml]>
VMW_PROVIDER_VDC_RESOURCE_POOL = <EnumValue: EntityType.VMW_PROVIDER_VDC_RESOURCE_POOL [value=application/vnd.vmware.admin.vmwProviderVdcResourcePool+xml]>
VMW_PROVIDER_VDC_RESOURCE_POOL_SET = <EnumValue: EntityType.VMW_PROVIDER_VDC_RESOURCE_POOL_SET [value=application/vnd.vmware.admin.vmwProviderVdcResourcePoolSet+xml]>
class pyvcloud.vcd.client.FenceMode

Bases: flufl.enum._enum.Enum

BRIDGED = <EnumValue: FenceMode.BRIDGED [value=bridged]>
DIRECT = <EnumValue: FenceMode.DIRECT [value=direct]>
ISOLATED = <EnumValue: FenceMode.ISOLATED [value=isolated]>
NAT_ROUTED = <EnumValue: FenceMode.NAT_ROUTED [value=natRouted]>

Bases: object

Abstraction over <Link> elements.

class pyvcloud.vcd.client.NetworkAdapterType

Bases: flufl.enum._enum.Enum

E1000 = <EnumValue: NetworkAdapterType.E1000 [value=E1000]>
E1000E = <EnumValue: NetworkAdapterType.E1000E [value=E1000E]>
VLANCE = <EnumValue: NetworkAdapterType.VLANCE [value=PCNet32]>
VMXNET = <EnumValue: NetworkAdapterType.VMXNET [value=VMXNET]>
VMXNET2 = <EnumValue: NetworkAdapterType.VMXNET2 [value=VMXNET2]>
VMXNET3 = <EnumValue: NetworkAdapterType.VMXNET3 [value=VMXNET3]>
class pyvcloud.vcd.client.QueryResultFormat

Bases: flufl.enum._enum.Enum

ID_RECORDS = <EnumValue: QueryResultFormat.ID_RECORDS [value=('application/vnd.vmware.vcloud.query.idrecords+xml', 'idrecords')]>
RECORDS = <EnumValue: QueryResultFormat.RECORDS [value=('application/vnd.vmware.vcloud.query.records+xml', 'records')]>
REFERENCES = <EnumValue: QueryResultFormat.REFERENCES [value=('application/vnd.vmware.vcloud.query.references+xml', 'references')]>
class pyvcloud.vcd.client.RelationType

Bases: flufl.enum._enum.Enum

ADD = <EnumValue: RelationType.ADD [value=add]>
ALTERNATE = <EnumValue: RelationType.ALTERNATE [value=alternate]>
CONTROL_ACCESS = <EnumValue: RelationType.CONTROL_ACCESS [value=controlAccess]>
DEPLOY = <EnumValue: RelationType.DEPLOY [value=deploy]>
DISABLE = <EnumValue: RelationType.DISABLE [value=disable]>
DISK_ATTACH = <EnumValue: RelationType.DISK_ATTACH [value=disk:attach]>
DISK_DETACH = <EnumValue: RelationType.DISK_DETACH [value=disk:detach]>
DOWN = <EnumValue: RelationType.DOWN [value=down]>
DOWNLOAD_DEFAULT = <EnumValue: RelationType.DOWNLOAD_DEFAULT [value=download:default]>
DOWN_EXTENSIBILITY = <EnumValue: RelationType.DOWN_EXTENSIBILITY [value=down:extensibility]>
EDGE_GATEWAYS = <EnumValue: RelationType.EDGE_GATEWAYS [value=edgeGateways]>
EDIT = <EnumValue: RelationType.EDIT [value=edit]>
ENABLE = <EnumValue: RelationType.ENABLE [value=enable]>
MIGRATE_VMS = <EnumValue: RelationType.MIGRATE_VMS [value=migrateVms]>
NEXT_PAGE = <EnumValue: RelationType.NEXT_PAGE [value=nextPage]>
ORG_VDC_NETWORKS = <EnumValue: RelationType.ORG_VDC_NETWORKS [value=orgVdcNetworks]>
POWER_OFF = <EnumValue: RelationType.POWER_OFF [value=power:powerOff]>
POWER_ON = <EnumValue: RelationType.POWER_ON [value=power:powerOn]>
POWER_REBOOT = <EnumValue: RelationType.POWER_REBOOT [value=power:reboot]>
POWER_RESET = <EnumValue: RelationType.POWER_RESET [value=power:reset]>
POWER_SHUTDOWN = <EnumValue: RelationType.POWER_SHUTDOWN [value=power:shutdown]>
POWER_SUSPEND = <EnumValue: RelationType.POWER_SUSPEND [value=power:suspend]>
PUBLISH = <EnumValue: RelationType.PUBLISH [value=publish]>
RECOMPOSE = <EnumValue: RelationType.RECOMPOSE [value=recompose]>
REMOVE = <EnumValue: RelationType.REMOVE [value=remove]>
RESOURCE_POOL_VM_LIST = <EnumValue: RelationType.RESOURCE_POOL_VM_LIST [value=resourcePoolVmList]>
SNAPSHOT_CREATE = <EnumValue: RelationType.SNAPSHOT_CREATE [value=snapshot:create]>
SNAPSHOT_REMOVE_ALL = <EnumValue: RelationType.SNAPSHOT_REMOVE_ALL [value=snapshot:removeAll]>
SNAPSHOT_REVERT_TO_CURRENT = <EnumValue: RelationType.SNAPSHOT_REVERT_TO_CURRENT [value=snapshot:revertToCurrent]>
TASK_CANCEL = <EnumValue: RelationType.TASK_CANCEL [value=task:cancel]>
UNDEPLOY = <EnumValue: RelationType.UNDEPLOY [value=undeploy]>
UNREGISTER = <EnumValue: RelationType.UNREGISTER [value=unregister]>
UP = <EnumValue: RelationType.UP [value=up]>
UPDATE_RESOURCE_POOLS = <EnumValue: RelationType.UPDATE_RESOURCE_POOLS [value=update:resourcePools]>
class pyvcloud.vcd.client.ResourceType

Bases: flufl.enum._enum.Enum

Contains resource type names.

ACL_RULE = <EnumValue: ResourceType.ACL_RULE [value=aclRule]>
ADMIN_ALLOCATED_EXTERNAL_ADDRESS = <EnumValue: ResourceType.ADMIN_ALLOCATED_EXTERNAL_ADDRESS [value=adminAllocatedExternalAddress]>
ADMIN_API_DEFINITION = <EnumValue: ResourceType.ADMIN_API_DEFINITION [value=adminApiDefinition]>
ADMIN_CATALOG = <EnumValue: ResourceType.ADMIN_CATALOG [value=adminCatalog]>
ADMIN_CATALOG_ITEM = <EnumValue: ResourceType.ADMIN_CATALOG_ITEM [value=adminCatalogItem]>
ADMIN_DISK = <EnumValue: ResourceType.ADMIN_DISK [value=adminDisk]>
ADMIN_EVENT = <EnumValue: ResourceType.ADMIN_EVENT [value=adminEvent]>
ADMIN_FILE_DESCRIPTOR = <EnumValue: ResourceType.ADMIN_FILE_DESCRIPTOR [value=adminFileDescriptor]>
ADMIN_GROUP = <EnumValue: ResourceType.ADMIN_GROUP [value=adminGroup]>
ADMIN_MEDIA = <EnumValue: ResourceType.ADMIN_MEDIA [value=adminMedia]>
ADMIN_ORG_NETWORK = <EnumValue: ResourceType.ADMIN_ORG_NETWORK [value=adminOrgNetwork]>
ADMIN_ORG_VDC = <EnumValue: ResourceType.ADMIN_ORG_VDC [value=adminOrgVdc]>
ADMIN_ORG_VDC_STORAGE_PROFILE = <EnumValue: ResourceType.ADMIN_ORG_VDC_STORAGE_PROFILE [value=adminOrgVdcStorageProfile]>
ADMIN_ROLE = <EnumValue: ResourceType.ADMIN_ROLE [value=adminRole]>
ADMIN_SERVICE = <EnumValue: ResourceType.ADMIN_SERVICE [value=adminService]>
ADMIN_SHADOW_VM = <EnumValue: ResourceType.ADMIN_SHADOW_VM [value=adminShadowVM]>
ADMIN_TASK = <EnumValue: ResourceType.ADMIN_TASK [value=adminTask]>
ADMIN_USER = <EnumValue: ResourceType.ADMIN_USER [value=adminUser]>
ADMIN_VAPP = <EnumValue: ResourceType.ADMIN_VAPP [value=adminVApp]>
ADMIN_VAPP_NETWORK = <EnumValue: ResourceType.ADMIN_VAPP_NETWORK [value=adminVAppNetwork]>
ADMIN_VAPP_TEMPLATE = <EnumValue: ResourceType.ADMIN_VAPP_TEMPLATE [value=adminVAppTemplate]>
ADMIN_VM = <EnumValue: ResourceType.ADMIN_VM [value=adminVM]>
ADMIN_VM_DISK_RELATION = <EnumValue: ResourceType.ADMIN_VM_DISK_RELATION [value=adminVMDiskRelation]>
ALLOCATED_EXTERNAL_ADDRESS = <EnumValue: ResourceType.ALLOCATED_EXTERNAL_ADDRESS [value=allocatedExternalAddress]>
API_DEFINITION = <EnumValue: ResourceType.API_DEFINITION [value=apiDefinition]>
API_FILTER = <EnumValue: ResourceType.API_FILTER [value=apiFilter]>
BLOCKING_TASK = <EnumValue: ResourceType.BLOCKING_TASK [value=blockingTask]>
CATALOG = <EnumValue: ResourceType.CATALOG [value=catalog]>
CATALOG_ITEM = <EnumValue: ResourceType.CATALOG_ITEM [value=catalogItem]>
CELL = <EnumValue: ResourceType.CELL [value=cell]>
CONDITION = <EnumValue: ResourceType.CONDITION [value=condition]>
DATASTORE = <EnumValue: ResourceType.DATASTORE [value=datastore]>
DATASTORE_PROVIDER_VDC_RELATION = <EnumValue: ResourceType.DATASTORE_PROVIDER_VDC_RELATION [value=datastoreProviderVdcRelation]>
DISK = <EnumValue: ResourceType.DISK [value=disk]>
DV_SWITCH = <EnumValue: ResourceType.DV_SWITCH [value=dvSwitch]>
EDGE_GATEWAY = <EnumValue: ResourceType.EDGE_GATEWAY [value=edgeGateway]>
EVENT = <EnumValue: ResourceType.EVENT [value=event]>
EXTERNAL_LOCALIZATION = <EnumValue: ResourceType.EXTERNAL_LOCALIZATION [value=externalLocalization]>
EXTERNAL_NETWORK = <EnumValue: ResourceType.EXTERNAL_NETWORK [value=externalNetwork]>
FILE_DESCRIPTOR = <EnumValue: ResourceType.FILE_DESCRIPTOR [value=fileDescriptor]>
FROM_CLOUD_TUNNEL = <EnumValue: ResourceType.FROM_CLOUD_TUNNEL [value=fromCloudTunnel]>
GROUP = <EnumValue: ResourceType.GROUP [value=group]>
HOST = <EnumValue: ResourceType.HOST [value=host]>
MEDIA = <EnumValue: ResourceType.MEDIA [value=media]>
NETWORK_POOL = <EnumValue: ResourceType.NETWORK_POOL [value=networkPool]>
NSXT_MANAGER = <EnumValue: ResourceType.NSXT_MANAGER [value=nsxTManager]>
ORGANIZATION = <EnumValue: ResourceType.ORGANIZATION [value=organization]>
ORG_NETWORK = <EnumValue: ResourceType.ORG_NETWORK [value=orgNetwork]>
ORG_VDC = <EnumValue: ResourceType.ORG_VDC [value=orgVdc]>
ORG_VDC_NETWORK = <EnumValue: ResourceType.ORG_VDC_NETWORK [value=orgVdcNetwork]>
ORG_VDC_RESOURCE_POOL_RELATION = <EnumValue: ResourceType.ORG_VDC_RESOURCE_POOL_RELATION [value=orgVdcResourcePoolRelation]>
ORG_VDC_STORAGE_PROFILE = <EnumValue: ResourceType.ORG_VDC_STORAGE_PROFILE [value=orgVdcStorageProfile]>
PORT_GROUP = <EnumValue: ResourceType.PORT_GROUP [value=portgroup]>
PROVIDER_VDC = <EnumValue: ResourceType.PROVIDER_VDC [value=providerVdc]>
PROVIDER_VDC_RESOURCE_POOL_RELATION = <EnumValue: ResourceType.PROVIDER_VDC_RESOURCE_POOL_RELATION [value=providerVdcResourcePoolRelation]>
PROVIDER_VDC_STORAGE_PROFILE = <EnumValue: ResourceType.PROVIDER_VDC_STORAGE_PROFILE [value=providerVdcStorageProfile]>
RESOURCE_CLASS = <EnumValue: ResourceType.RESOURCE_CLASS [value=resourceClass]>
RESOURCE_CLASS_ACTION = <EnumValue: ResourceType.RESOURCE_CLASS_ACTION [value=resourceClassAction]>
RESOURCE_POOL = <EnumValue: ResourceType.RESOURCE_POOL [value=resourcePool]>
RESOURCE_POOL_VM_LIST = <EnumValue: ResourceType.RESOURCE_POOL_VM_LIST [value=resourcePoolVmList]>
RIGHT = <EnumValue: ResourceType.RIGHT [value=right]>
ROLE = <EnumValue: ResourceType.ROLE [value=role]>
SERVICE = <EnumValue: ResourceType.SERVICE [value=service]>
SERVICE_RESOURCE = <EnumValue: ResourceType.SERVICE_RESOURCE [value=serviceResource]>
STRANDED_ITEM = <EnumValue: ResourceType.STRANDED_ITEM [value=strandedItem]>
STRANDED_USER = <EnumValue: ResourceType.STRANDED_USER [value=strandedUser]>
TASK = <EnumValue: ResourceType.TASK [value=task]>
TO_CLOUD_TUNNEL = <EnumValue: ResourceType.TO_CLOUD_TUNNEL [value=toCloudTunnel]>
USER = <EnumValue: ResourceType.USER [value=user]>
VAPP = <EnumValue: ResourceType.VAPP [value=vApp]>
VAPP_NETWORK = <EnumValue: ResourceType.VAPP_NETWORK [value=vAppNetwork]>
VAPP_ORG_VDC_NETWORK_RELATION = <EnumValue: ResourceType.VAPP_ORG_VDC_NETWORK_RELATION [value=vAppOrgVdcNetworkRelation]>
VAPP_TEMPLATE = <EnumValue: ResourceType.VAPP_TEMPLATE [value=vAppTemplate]>
VIRTUAL_CENTER = <EnumValue: ResourceType.VIRTUAL_CENTER [value=virtualCenter]>
VM = <EnumValue: ResourceType.VM [value=vm]>
VM_DISK_RELATION = <EnumValue: ResourceType.VM_DISK_RELATION [value=vmDiskRelation]>
VM_GROUPS = <EnumValue: ResourceType.VM_GROUPS [value=vmGroups]>
VM_GROUP_VMS = <EnumValue: ResourceType.VM_GROUP_VMS [value=vmGroupVms]>
class pyvcloud.vcd.client.TaskStatus

Bases: flufl.enum._enum.Enum

ABORTED = <EnumValue: TaskStatus.ABORTED [value=aborted]>
CANCELED = <EnumValue: TaskStatus.CANCELED [value=canceled]>
ERROR = <EnumValue: TaskStatus.ERROR [value=error]>
PRE_RUNNING = <EnumValue: TaskStatus.PRE_RUNNING [value=preRunning]>
QUEUED = <EnumValue: TaskStatus.QUEUED [value=queued]>
RUNNING = <EnumValue: TaskStatus.RUNNING [value=running]>
SUCCESS = <EnumValue: TaskStatus.SUCCESS [value=success]>

Returns the link of the specified rel and type in the resource.

Parameters:
  • resource (lxml.objectify.ObjectifiedElement) – the resource with the link.
  • rel (ResourceType) – the rel of the desired link.
  • media_type (str) – media type of content.
  • fail_if_absent (bool) – if True raise an exception if there’s not exactly one link of the specified rel and media type.
Returns:

an object containing Link XML element representing the desired link or None if no such link is present and fail_if_absent is False.

Return type:

lxml.objectify.ObjectifiedElement

Raises:

Returns all the links of the specified rel and type in the resource.

Parameters:
  • resource (lxml.objectify.ObjectifiedElement) – the resource with the links.
  • rel (RelationType) – the rel of the desired link.
  • media_type (str) – media type of content.
Returns:

list of lxml.objectify.ObjectifiedElement objects, where each object contains a Link XML element. Result could include an empty list.

Return type:

list