com.vmware package¶
Subpackages¶
- com.vmware.appliance package
- Subpackages
- Submodules
- com.vmware.appliance.access_client module
- com.vmware.appliance.health_client module
- com.vmware.appliance.local_accounts_client module
- com.vmware.appliance.localaccounts_client module
- com.vmware.appliance.logging_client module
- com.vmware.appliance.monitoring_client module
- com.vmware.appliance.networking_client module
- com.vmware.appliance.ntp_client module
- com.vmware.appliance.recovery_client module
- com.vmware.appliance.shutdown_client module
- com.vmware.appliance.system_client module
- com.vmware.appliance.tymesync_client module
- com.vmware.appliance.update_client module
- com.vmware.appliance.vmon_client module
- com.vmware.cis package
- com.vmware.content package
- com.vmware.vapi package
- Subpackages
- com.vmware.vapi.metadata package
- Subpackages
- Submodules
- com.vmware.vapi.metadata.authentication_client module
- com.vmware.vapi.metadata.cli_client module
- com.vmware.vapi.metadata.metamodel_client module
- com.vmware.vapi.metadata.privilege_client module
- com.vmware.vapi.std package
- com.vmware.vapi.metadata package
- Submodules
- com.vmware.vapi.std_client module
- Subpackages
- com.vmware.vcenter package
- Subpackages
- com.vmware.vcenter.compute package
- com.vmware.vcenter.deployment package
- com.vmware.vcenter.hvc package
- com.vmware.vcenter.storage package
- com.vmware.vcenter.vcha package
- com.vmware.vcenter.vm package
- Submodules
- com.vmware.vcenter.compute_client module
- com.vmware.vcenter.datastore_client module
- com.vmware.vcenter.deployment_client module
- com.vmware.vcenter.guest_client module
- com.vmware.vcenter.hvc_client module
- com.vmware.vcenter.inventory_client module
- com.vmware.vcenter.iso_client module
- com.vmware.vcenter.ovf_client module
- com.vmware.vcenter.services_client module
- com.vmware.vcenter.storage_client module
- com.vmware.vcenter.system_config_client module
- com.vmware.vcenter.vcha_client module
- com.vmware.vcenter.vm_client module
- com.vmware.vcenter.vm_template_client module
- Subpackages
Submodules¶
com.vmware.appliance_client module¶
The com.vmware.appliance_client
module provides classes for managing
vCenter Appliance configuration. The module is available starting in vSphere
6.7.
-
class
com.vmware.appliance_client.
Health
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
The
Health
class provides methods to retrieve the appliance health information. This class was added in vSphere API 6.7.Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
messages
(item)¶ Get health messages. This method was added in vSphere API 6.7.
Parameters: item ( str
) – ID of the data item The parameter must be an identifier for the resource type:com.vmware.appliance.health
.Return type: list
ofNotification
Returns: List of the health messages Raise: com.vmware.vapi.std.errors_client.NotFound
Unknown health itemRaise: com.vmware.vapi.std.errors_client.Error
Generic error
-
-
class
com.vmware.appliance_client.
LocalAccounts
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
The
LocalAccounts
class provides methods to manage local user account. This class was added in vSphere API 6.7.Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
class
Config
(password=None, old_password=None, full_name=None, email=None, roles=None, enabled=None, password_expires=None, password_expires_at=None, inactive_after_password_expiration=None, days_after_password_expiration=None, min_days_between_password_change=None, max_days_between_password_change=None, warn_days_before_password_expiration=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
LocalAccounts.Config
class defines the information required for the account. This class was added in vSphere API 6.7.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - password (
str
) – Password. This attribute was added in vSphere API 6.7. - old_password (
str
orNone
) – Old password of the user (required in case of the password change, not required if superAdmin user changes the password of the other user). This attribute was added in vSphere API 6.7. If None, user may not have password set. - full_name (
str
orNone
) – Full name of the user. This attribute was added in vSphere API 6.7. If None, user will have no fullname. - email (
str
orNone
) – Email address of the local account. This attribute was added in vSphere API 6.7. If None, user will have no email. - roles (
list
ofstr
) – User roles. This attribute was added in vSphere API 6.7. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:com.vmware.appliance.roles
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:com.vmware.appliance.roles
. - enabled (
bool
orNone
) – Flag indicating if the account is enabled. This attribute was added in vSphere API 6.7. If None, defaults to True - password_expires (
bool
orNone
) – Flag indicating if the account password expires. This attribute was added in vSphere API 6.7. If None, defaults to True. - password_expires_at (
datetime.datetime
orNone
) – Date when the account’s password will expire. This attribute was added in vSphere API 6.7. If None, will be taken from system defaults (see local-accounts/policy). - inactive_after_password_expiration (
bool
orNone
) – Flag indicating if the account will be locked after password expiration. This attribute was added in vSphere API 6.7. If None, defaults to True. - days_after_password_expiration (
long
orNone
) – Number of days after password expiration before the account will be locked. This attribute was added in vSphere API 6.7. If None, will be taken from system defaults (see local-accounts/policy). - min_days_between_password_change (
long
orNone
) – Minimum number of days between password change. This attribute was added in vSphere API 6.7. If None, will be taken from system defaults (see local-accounts/policy). - max_days_between_password_change (
long
orNone
) – Maximum number of days between password change. This attribute was added in vSphere API 6.7. If None, will be taken from system defaults (see local-accounts/policy). - warn_days_before_password_expiration (
long
orNone
) – Number of days of warning before password expires. This attribute was added in vSphere API 6.7. If None, will be taken from system defaults (see local-accounts/policy).
- password (
-
class
Info
(fullname=None, email=None, roles=None, enabled=None, has_password=None, last_password_change=None, password_expires_at=None, inactive_at=None, min_days_between_password_change=None, max_days_between_password_change=None, warn_days_before_password_expiration=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
LocalAccounts.Info
class defines the local account properties. This class was added in vSphere API 6.7.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - fullname (
str
orNone
) – Full name of the user. This attribute was added in vSphere API 6.7. If None, the value was never set. - email (
str
orNone
) – Email address of the local account. This attribute was added in vSphere API 6.7. If None, the value was never set. - roles (
list
ofstr
) – User roles. This attribute was added in vSphere API 6.7. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:com.vmware.appliance.roles
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:com.vmware.appliance.roles
. - enabled (
bool
) – Flag indicating if the account is enabled. This attribute was added in vSphere API 6.7. - has_password (
bool
) – Is the user password set. This attribute was added in vSphere API 6.7. - last_password_change (
datetime.datetime
orNone
) – Date and time password was changed. This attribute was added in vSphere API 6.7. If None, the password was never set. - password_expires_at (
datetime.datetime
orNone
) – Date when the account’s password will expire. This attribute was added in vSphere API 6.7. If None, the password never expires. - inactive_at (
datetime.datetime
orNone
) – Date and time account will be locked after password expiration. This attribute was added in vSphere API 6.7. If None, account will not be locked. - min_days_between_password_change (
long
orNone
) – Minimum number of days between password change. This attribute was added in vSphere API 6.7. If None, pasword can be changed any time. - max_days_between_password_change (
long
orNone
) – Maximum number of days between password change. This attribute was added in vSphere API 6.7. If None, password never expires. - warn_days_before_password_expiration (
long
orNone
) – Number of days of warning before password expires. This attribute was added in vSphere API 6.7. If None, a user is never warned.
- fullname (
-
class
UpdateConfig
(password=None, old_password=None, full_name=None, email=None, roles=None, enabled=None, password_expires=None, password_expires_at=None, inactive_after_password_expiration=None, days_after_password_expiration=None, min_days_between_password_change=None, max_days_between_password_change=None, warn_days_before_password_expiration=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
LocalAccounts.UpdateConfig
class defines the fields that might be updated. This class was added in vSphere API 6.7.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - password (
str
orNone
) – Password. This attribute was added in vSphere API 6.7. If None, value will not be changed - old_password (
str
orNone
) – Old password of the user (required in case of the password change, not required if superAdmin user changes the password of the other user). This attribute was added in vSphere API 6.7. If None, user may not have password set. - full_name (
str
orNone
) – Full name of the user. This attribute was added in vSphere API 6.7. If None, value will not be changed - email (
str
orNone
) – Email address of the local account. This attribute was added in vSphere API 6.7. If None, value will not be changed - roles (
list
ofstr
orNone
) – User roles. This attribute was added in vSphere API 6.7. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:com.vmware.appliance.roles
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:com.vmware.appliance.roles
. If None, value will not be changed - enabled (
bool
orNone
) – Flag indicating if the account is enabled. This attribute was added in vSphere API 6.7. If None, value will not be changed - password_expires (
bool
orNone
) – Flag indicating if the account password expires. This attribute was added in vSphere API 6.7. If None, value will not be changed - password_expires_at (
datetime.datetime
orNone
) – Date when the account’s password will expire. This attribute was added in vSphere API 6.7. If None, value will not be changed - inactive_after_password_expiration (
bool
orNone
) – Flag indicating if the account will be locked after password expiration. This attribute was added in vSphere API 6.7. If None, value will not be changed - days_after_password_expiration (
long
orNone
) – Number of days after password expiration before the account will be locked. This attribute was added in vSphere API 6.7. If None, value will not be changed - min_days_between_password_change (
long
orNone
) – Minimum number of days between password change. This attribute was added in vSphere API 6.7. If None, value will not be changed - max_days_between_password_change (
long
orNone
) – Maximum number of days between password change. This attribute was added in vSphere API 6.7. If None, value will not be changed - warn_days_before_password_expiration (
long
orNone
) – Number of days of warning before password expires. This attribute was added in vSphere API 6.7. If None, value will not be changed
- password (
-
create
(username, config)¶ Create a new local user account. This method was added in vSphere API 6.7.
Parameters: - username (
str
) – User login name The parameter must be an identifier for the resource type:com.vmware.appliance.local_accounts
. - config (
LocalAccounts.Config
) – User configuration
Raise: com.vmware.vapi.std.errors_client.AlreadyExists
If an account already existsRaise: com.vmware.vapi.std.errors_client.InvalidArgument
If a username is invalid (username is validated against [a-zA-Z0-9][a-zA-Z0-9-.\@]*[a-zA-Z0-9] pattern)Raise: com.vmware.vapi.std.errors_client.Error
Generic error- username (
-
delete
(username)¶ Delete a local user account. This method was added in vSphere API 6.7.
Parameters: username ( str
) – User login name The parameter must be an identifier for the resource type:com.vmware.appliance.local_accounts
.Raise: com.vmware.vapi.std.errors_client.NotFound
If the account is not foundRaise: com.vmware.vapi.std.errors_client.Error
Generic error
-
get
(username)¶ Get the local user account information. This method was added in vSphere API 6.7.
Parameters: username ( str
) – User login nameReturn type: LocalAccounts.Info
Returns: Local user account information Raise: com.vmware.vapi.std.errors_client.NotFound
If the account is not foundRaise: com.vmware.vapi.std.errors_client.Error
Generic error
-
list
()¶ Get a list of the local user accounts. This method was added in vSphere API 6.7.
Return type: list
ofstr
Returns: List of identifiers The return value will contain identifiers for the resource type: com.vmware.appliance.local_accounts
.Raise: com.vmware.vapi.std.errors_client.Error
Generic error
-
set
(username, config)¶ Set local user account properties. This method was added in vSphere API 6.7.
Parameters: - username (
str
) – User login name The parameter must be an identifier for the resource type:com.vmware.appliance.local_accounts
. - config (
LocalAccounts.Config
) – User configuration
Raise: com.vmware.vapi.std.errors_client.NotFound
If the account is not foundRaise: com.vmware.vapi.std.errors_client.Error
Generic error- username (
-
update
(username, config)¶ Update selected fields in local user account properties. This method was added in vSphere API 6.7.
Parameters: - username (
str
) – User login name The parameter must be an identifier for the resource type:com.vmware.appliance.local_accounts
. - config (
LocalAccounts.UpdateConfig
) – User configuration
Raise: com.vmware.vapi.std.errors_client.NotFound
If the account is not foundRaise: com.vmware.vapi.std.errors_client.Error
Generic error- username (
-
class
-
class
com.vmware.appliance_client.
Monitoring
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
Monitoring
class provides methods Get and list monitoring data for requested item.Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
class
FunctionType
(string)¶ Bases:
vmware.vapi.bindings.enum.Enum
Monitoring.FunctionType
class Defines aggregation functionNote
This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page.
Parameters: string ( str
) – String value for theFunctionType
instance.-
AVG
= FunctionType(string='AVG')¶ Aggregation takes average per period
-
COUNT
= FunctionType(string='COUNT')¶ Aggregation takes count per period (sum)
-
MAX
= FunctionType(string='MAX')¶ Aggregation takes maximums per period
-
MIN
= FunctionType(string='MIN')¶ Aggregation takes minimums per period
-
-
class
IntervalType
(string)¶ Bases:
vmware.vapi.bindings.enum.Enum
Monitoring.IntervalType
class Defines interval between the values in hours and mins, for which aggregation will applyNote
This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page.
Parameters: string ( str
) – String value for theIntervalType
instance.-
DAY1
= IntervalType(string='DAY1')¶ 24 hours interval between values. One year has 365 values.
-
HOURS2
= IntervalType(string='HOURS2')¶ Two hours interval between values. One month has 360 values.
-
HOURS6
= IntervalType(string='HOURS6')¶ Six hour interval between values. One quarter is 360 values.
-
MINUTES30
= IntervalType(string='MINUTES30')¶ Thirty minutes interval between values. One week is 336 values.
-
MINUTES5
= IntervalType(string='MINUTES5')¶ Five minutes interval between values (finest). One day would have 288 values, one week is 2016.
-
-
class
MonitoredItem
(id=None, name=None, units=None, category=None, instance=None, description=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
Monitoring.MonitoredItem
class Structure representing requested monitored item data.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - id (
str
) – monitored item ID Ex: CPU, MEMORY When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.appliance.monitoring
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.appliance.monitoring
. - name (
str
) – monitored item name Ex: “Network write speed” - units (
str
) – Y-axis label EX: “Mbps”, “%” - category (
str
) – category Ex: network, storage etc - instance (
str
) – instance name Ex: eth0 - description (
str
) – monitored item description Ex: com.vmware.applmgmt.mon.descr.net.rx.packetRate.eth0
- id (
-
class
MonitoredItemData
(name=None, interval=None, function=None, start_time=None, end_time=None, data=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
Monitoring.MonitoredItemData
class Structure representing monitored item data.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - name (
str
) – Monitored item IDs Ex: CPU, MEMORY, STORAGE_TOTAL When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.appliance.monitoring
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.appliance.monitoring
. - interval (
Monitoring.IntervalType
) – interval between values in hours, minutes - function (
Monitoring.FunctionType
) – aggregation function - start_time (
datetime.datetime
) – Start time in UTC - end_time (
datetime.datetime
) – End time in UTC - data (
list
ofstr
) – list of values
- name (
-
class
MonitoredItemDataRequest
(names=None, interval=None, function=None, start_time=None, end_time=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
Monitoring.MonitoredItemDataRequest
class Structure representing requested monitored item data.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - names (
list
ofstr
) – monitored item IDs Ex: CPU, MEMORY When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:com.vmware.appliance.monitoring
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:com.vmware.appliance.monitoring
. - interval (
Monitoring.IntervalType
) – interval between values in hours, minutes - function (
Monitoring.FunctionType
) – aggregation function - start_time (
datetime.datetime
) – Start time in UTC - end_time (
datetime.datetime
) – End time in UTC
- names (
-
get
(stat_id)¶ Get monitored item info
Parameters: stat_id ( str
) – statistic item id The parameter must be an identifier for the resource type:com.vmware.appliance.monitoring
.Return type: Monitoring.MonitoredItem
Returns: MonitoredItem structure Raise: com.vmware.vapi.std.errors_client.Error
Generic error
-
list
()¶ Get monitored items list
Return type: list
ofMonitoring.MonitoredItem
Returns: list of names Raise: com.vmware.vapi.std.errors_client.Error
Generic error
-
query
(item)¶ Get monitoring data.
Parameters: item ( Monitoring.MonitoredItemDataRequest
) – MonitoredItemDataRequest StructureReturn type: list
ofMonitoring.MonitoredItemData
Returns: list of MonitoredItemData structure Raise: com.vmware.vapi.std.errors_client.Error
Generic error
-
class
-
class
com.vmware.appliance_client.
Networking
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
The
Networking
class provides methods Get Network configurations. This class was added in vSphere API 6.7.Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
class
DNSInfo
(mode=None, hostname=None, servers=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Networking.DNSInfo
class contains information about the DNS configuration of a virtual appliance. This class was added in vSphere API 6.7.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - mode (
Networking.DNSInfo.DNSMode
) – DNS mode. This attribute was added in vSphere API 6.7. - hostname (
str
) – Hostname. This attribute was added in vSphere API 6.7. - servers (
list
ofstr
) – Servers. This attribute was added in vSphere API 6.7.
-
class
DNSMode
(string)¶ Bases:
vmware.vapi.bindings.enum.Enum
The
Networking.DNSInfo.DNSMode
class describes the source of DNS servers. This enumeration was added in vSphere API 6.7.Note
This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page.
Parameters: string ( str
) – String value for theDNSMode
instance.-
DHCP
= DNSMode(string='DHCP')¶ The DNS servers addresses are obtained from a DHCP server. This class attribute was added in vSphere API 6.7.
-
STATIC
= DNSMode(string='STATIC')¶ The DNS servers addresses are specified explicitly. This class attribute was added in vSphere API 6.7.
-
- mode (
-
class
Info
(dns=None, interfaces=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Networking.Info
class contains information about the network configuration of a virtual appliance. This class was added in vSphere API 6.7.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - dns (
Networking.DNSInfo
) – DNS configuration. This attribute was added in vSphere API 6.7. - interfaces (
dict
ofstr
andcom.vmware.appliance.networking_client.Interfaces.InterfaceInfo
) – Interface configuration as a key-value map where key is a network interface name, for example, “nic0”. This attribute was added in vSphere API 6.7. When clients pass a value of this class as a parameter, the key in the attributedict
must be an identifier for the resource type:com.vmware.appliance.networking.interfaces
. When methods return a value of this class as a return value, the key in the attributedict
will be an identifier for the resource type:com.vmware.appliance.networking.interfaces
.
- dns (
-
class
UpdateSpec
(ipv6_enabled=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Networking.UpdateSpec
class describes whether to enable or disable ipv6 on interfaces. This class was added in vSphere API 6.7.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: ipv6_enabled ( bool
orNone
) – IPv6 Enabled or not. This attribute was added in vSphere API 6.7. If unspecified, leaves the current state of Ipv6.
-
get
()¶ Get Networking information for all configured interfaces. This method was added in vSphere API 6.7.
Return type: Networking.Info
Returns: The Map of network configuration info for all interfaces. Raise: com.vmware.vapi.std.errors_client.Error
Generic error.
-
reset
()¶ Reset and restarts network configuration on all interfaces, also this will renew the DHCP lease for DHCP IP address. This method was added in vSphere API 6.7.
Raise: com.vmware.vapi.std.errors_client.Error
Generic error.
-
update
(spec)¶ Enable or Disable ipv6 on all interfaces. This method was added in vSphere API 6.7.
Parameters: spec ( Networking.UpdateSpec
) – update spec with optional boolean valueRaise: com.vmware.vapi.std.errors_client.Error
Generic error.
-
class
-
class
com.vmware.appliance_client.
Notification
(id=None, time=None, message=None, resolution=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Notification
class describes a notification that can be reported by the appliance task. This class was added in vSphere API 6.7.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - id (
str
) – The notification id. This attribute was added in vSphere API 6.7. - time (
datetime.datetime
orNone
) – The time the notification was raised/found. This attribute was added in vSphere API 6.7. Only if the time information is available. - message (
com.vmware.vapi.std_client.LocalizableMessage
) – The notification message. This attribute was added in vSphere API 6.7. - resolution (
com.vmware.vapi.std_client.LocalizableMessage
orNone
) – The resolution message, if any. This attribute was added in vSphere API 6.7. Onlyset
for warnings and errors.
- id (
-
class
com.vmware.appliance_client.
Notifications
(info=None, warnings=None, errors=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Notifications
class contains info/warning/error messages that can be reported be the appliance task. This class was added in vSphere API 6.7.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - info (
list
ofNotification
orNone
) – Info notification messages reported. This attribute was added in vSphere API 6.7. Onlyset
if an info was reported by the appliance task. - warnings (
list
ofNotification
orNone
) – Warning notification messages reported. This attribute was added in vSphere API 6.7. Onlyset
if an warning was reported by the appliance task. - errors (
list
ofNotification
orNone
) – Error notification messages reported. This attribute was added in vSphere API 6.7. Onlyset
if an error was reported by the appliance task.
- info (
-
class
com.vmware.appliance_client.
Ntp
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
Ntp
class provides methods Gets NTP configuration status and tests connection to ntp servers. This class was added in vSphere API 6.7.Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
class
LocalizableMessage
(id=None, default_message=None, args=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
Ntp.LocalizableMessage
class Structure representing message. This class was added in vSphere API 6.7.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - id (
str
) – id in message bundle. This attribute was added in vSphere API 6.7. - default_message (
str
) – text in english. This attribute was added in vSphere API 6.7. - args (
list
ofstr
) – nested data. This attribute was added in vSphere API 6.7.
- id (
-
class
ServerStatus
(string)¶ Bases:
vmware.vapi.bindings.enum.Enum
Ntp.ServerStatus
class Status of server during test. This enumeration was added in vSphere API 6.7.Note
This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page.
Parameters: string ( str
) – String value for theServerStatus
instance.-
SERVER_REACHABLE
= ServerStatus(string='SERVER_REACHABLE')¶ Server is reachable. This class attribute was added in vSphere API 6.7.
-
SERVER_UNREACHABLE
= ServerStatus(string='SERVER_UNREACHABLE')¶ Server is unreachable. This class attribute was added in vSphere API 6.7.
-
-
class
TestRunStatus
(server=None, status=None, message=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
Ntp.TestRunStatus
class Status of the test. This class was added in vSphere API 6.7.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - server (
str
) – Server name associated with the test run. This attribute was added in vSphere API 6.7. - status (
Ntp.ServerStatus
) – Server status. This attribute was added in vSphere API 6.7. - message (
Ntp.LocalizableMessage
) – Message associated with status. This attribute was added in vSphere API 6.7.
- server (
-
get
()¶ Get the NTP configuration status. If you run the ‘timesync.get’ command, you can retrieve the current time synchronization method (NTP- or VMware Tools-based). The ‘ntp’ command always returns the NTP server information, even when the time synchronization mode is not set to NTP. If the time synchronization mode is not NTP-based, the NTP server status is displayed as down. This method was added in vSphere API 6.7.
Return type: list
ofstr
Returns: List of NTP servers. Raise: com.vmware.vapi.std.errors_client.Error
Generic error
-
set
(servers)¶ Set NTP servers. This method updates old NTP servers from configuration and sets the input NTP servers in the configuration. If NTP based time synchronization is used internally, the NTP daemon will be restarted to reload given NTP configuration. In case NTP based time synchronization is not used, this method only replaces servers in the NTP configuration. This method was added in vSphere API 6.7.
Parameters: servers ( list
ofstr
) – List of host names or ip addresses of ntp servers.Raise: com.vmware.vapi.std.errors_client.Error
Generic error
-
test
(servers)¶ Test the connection to a list of ntp servers. This method was added in vSphere API 6.7.
Parameters: servers ( list
ofstr
) – List of host names or IP addresses of NTP servers.Return type: list
ofNtp.TestRunStatus
Returns: List of test run statuses. Raise: com.vmware.vapi.std.errors_client.Error
Generic error
-
class
-
class
com.vmware.appliance_client.
Recovery
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
The
Recovery
class provides methods to invoke an appliance recovery (backup and restore). This class was added in vSphere API 6.7.Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
class
Info
(supported=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Recovery.Info
class contains the information about the appliance recovery environment. This class was added in vSphere API 6.7.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: supported ( bool
) – Is recovery supported in this appliance. This attribute was added in vSphere API 6.7.
-
get
()¶ Gets the properties of the appliance Recovery subsystem. This method was added in vSphere API 6.7.
Return type: Recovery.Info
Returns: Structure containing the properties of the Recovery subsystem. Raise: com.vmware.vapi.std.errors_client.Error
if any error occurs during the execution of the operation.
-
class
-
class
com.vmware.appliance_client.
Services
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
The
Service
class provides methods to manage a single/set of appliance services. This class was added in vSphere API 6.7.Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
class
Info
(description=None, state=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Services.Info
class contains information about a service. This class was added in vSphere API 6.7.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - description (
str
) – Service description. This attribute was added in vSphere API 6.7. - state (
Services.State
) – Running State. This attribute was added in vSphere API 6.7.
- description (
-
class
State
(string)¶ Bases:
vmware.vapi.bindings.enum.Enum
The
Services.State
class defines valid Run State for services. This enumeration was added in vSphere API 6.7.Note
This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page.
Parameters: string ( str
) – String value for theState
instance.-
STARTED
= State(string='STARTED')¶ Service Run State is Started, it is fully functional. This class attribute was added in vSphere API 6.7.
-
STARTING
= State(string='STARTING')¶ Service Run State is Starting, it is still not functional. This class attribute was added in vSphere API 6.7.
-
STOPPED
= State(string='STOPPED')¶ Service Run State is Stopped. This class attribute was added in vSphere API 6.7.
-
STOPPING
= State(string='STOPPING')¶ Service Run State is Stopping, it is not functional. This class attribute was added in vSphere API 6.7.
-
-
get
(service)¶ Returns the state of a service. This method was added in vSphere API 6.7.
Parameters: service ( str
) – identifier of the service whose state is being queried. The parameter must be an identifier for the resource type:com.vmware.appliance.services
.Return type: Services.Info
Returns: Service Info structure. Raise: com.vmware.vapi.std.errors_client.NotFound
if the service associated withservice
does not exist.Raise: com.vmware.vapi.std.errors_client.Error
if any other error occurs during the execution of the operation.
-
list
()¶ Lists details of vCenter services. This method was added in vSphere API 6.7.
Return type: dict
ofstr
andServices.Info
Returns: Map of service identifiers to service Info structures. The key in the return value dict
will be an identifier for the resource type:com.vmware.appliance.services
.Raise: com.vmware.vapi.std.errors_client.Error
if any error occurs during the execution of the operation.
-
restart
(service)¶ Restarts a service. This method was added in vSphere API 6.7.
Parameters: service ( str
) – identifier of the service to restart The parameter must be an identifier for the resource type:com.vmware.appliance.services
.Raise: com.vmware.vapi.std.errors_client.NotFound
if the service associated withservice
does not exist.Raise: com.vmware.vapi.std.errors_client.TimedOut
if any timeout occurs during the execution of the restart operation.Raise: com.vmware.vapi.std.errors_client.NotAllowedInCurrentState
if the operation is denied in the current state of the service. If a stop or start operation is in progress, issuing a restart operation will lead to this error.Raise: com.vmware.vapi.std.errors_client.NotAllowedInCurrentState
if a restart operation is issued on a service which has startup type nullRaise: com.vmware.vapi.std.errors_client.Error
if any other error occurs during the execution of the operation.
-
start
(service)¶ Starts a service. This method was added in vSphere API 6.7.
Parameters: service ( str
) – identifier of the service to start The parameter must be an identifier for the resource type:com.vmware.appliance.services
.Raise: com.vmware.vapi.std.errors_client.NotFound
if the service associated withservice
does not exist.Raise: com.vmware.vapi.std.errors_client.NotAllowedInCurrentState
if the operation is denied in the current state of the service. If a stop or restart operation is in progress, the start operation will not be allowed.Raise: com.vmware.vapi.std.errors_client.NotAllowedInCurrentState
if start operation is issued on a service which has startup type null.Raise: com.vmware.vapi.std.errors_client.TimedOut
if any timeout occurs during the execution of the start operation. Timeout occurs when the service takes longer than StartTimeout to start.Raise: com.vmware.vapi.std.errors_client.Error
if any other error occurs during the execution of the operation.
-
stop
(service)¶ Stops a service. This method was added in vSphere API 6.7.
Parameters: service ( str
) – identifier of the service to stop The parameter must be an identifier for the resource type:com.vmware.appliance.services
.Raise: com.vmware.vapi.std.errors_client.NotFound
if the service associated withservice
does not exist.Raise: com.vmware.vapi.std.errors_client.Error
if any other error occurs during the execution of the operation.Raise: com.vmware.vapi.std.errors_client.NotAllowedInCurrentState
if the operation is denied in the current state of the service. If a stop operation is in progress, issuing another stop operation will lead to this error.
-
class
-
class
com.vmware.appliance_client.
Shutdown
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
Shutdown
class provides methods Performs reboot/shutdown operations on appliance. This class was added in vSphere API 6.7.Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
class
ShutdownConfig
(shutdown_time=None, action=None, reason=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
Shutdown.ShutdownConfig
class Structure that defines shutdown configuration returned by the Shutdown.get operation. This class was added in vSphere API 6.7.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - shutdown_time (
datetime.datetime
orNone
) – Shutdown time. This attribute was added in vSphere API 6.7. shutdownTime Optional value of pending shutdown time - action (
str
) – The pending shutdown operation. The string values for pending operations can be ‘poweroff’, ‘reboot’ or ‘’. This attribute was added in vSphere API 6.7. - reason (
str
) – The reason behind the shutdown action. This attribute was added in vSphere API 6.7.
- shutdown_time (
-
cancel
()¶ Cancel pending shutdown action. This method was added in vSphere API 6.7.
Raise: com.vmware.vapi.std.errors_client.Error
Generic error
-
get
()¶ Get details about the pending shutdown action. This method was added in vSphere API 6.7.
Return type: Shutdown.ShutdownConfig
Returns: Configuration of pending shutdown action. Raise: com.vmware.vapi.std.errors_client.Error
Generic error
-
poweroff
(delay, reason)¶ Power off the appliance. This method was added in vSphere API 6.7.
Parameters: - delay (
long
) – Minutes after which poweroff should start. If 0 is specified, poweroff will start immediately. - reason (
str
) – Reason for peforming poweroff.
Raise: com.vmware.vapi.std.errors_client.Error
Generic error- delay (
-
reboot
(delay, reason)¶ Reboot the appliance. This method was added in vSphere API 6.7.
Parameters: - delay (
long
) – Minutes after which reboot should start. If 0 is specified, reboot will start immediately. - reason (
str
) – Reason for peforming reboot.
Raise: com.vmware.vapi.std.errors_client.Error
Generic error- delay (
-
class
-
class
com.vmware.appliance_client.
StubFactory
(stub_config)¶ Bases:
vmware.vapi.bindings.stub.StubFactoryBase
Initialize StubFactoryBase
Parameters: stub_config ( vmware.vapi.bindings.stub.StubConfiguration
) – Stub config instance
-
class
com.vmware.appliance_client.
SubtaskInfo
(progress=None, result=None, description=None, service=None, operation=None, parent=None, target=None, status=None, cancelable=None, error=None, start_time=None, end_time=None, user=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
SubtaskInfo
class contains information about one of the subtasks that makes up an appliance task. This class was added in vSphere API 6.7.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - progress (
com.vmware.cis.task_client.Progress
) – Progress of the operation. This attribute was added in vSphere API 6.7. This attribute is optional and it is only relevant when the value of#status
is one ofcom.vmware.cis.task_client.Status.RUNNING
,com.vmware.cis.task_client.Status.BLOCKED
,com.vmware.cis.task_client.Status.SUCCEEDED
, orcom.vmware.cis.task_client.Status.FAILED
. - result (
Notifications
orNone
) – Result of the operation. If an operation reports partial results before it completes, this attribute could beset
before the null has the valuecom.vmware.cis.task_client.Status.SUCCEEDED
. The value could change as the operation progresses. This attribute was added in vSphere API 6.7. This attribute will be None if result is not available at the current step of the operation. - description (
com.vmware.vapi.std_client.LocalizableMessage
) – Description of the operation associated with the task. - service (
str
) – Identifier of the service containing the operation. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.vapi.service
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.vapi.service
. - operation (
str
) – Identifier of the operation associated with the task. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.vapi.operation
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.vapi.operation
. - parent (
str
orNone
) – Parent of the current task. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.cis.task
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.cis.task
. This attribute will be None if the task has no parent. - target (
com.vmware.vapi.std_client.DynamicID
orNone
) – Identifier of the target created by the operation or an existing one the operation performed on. This attribute will be None if the operation has no target or multiple targets. - status (
com.vmware.cis.task_client.Status
) – Status of the operation associated with the task. - cancelable (
bool
) – Flag to indicate whether or not the operation can be cancelled. The value may change as the operation progresses. - error (
Exception
orNone
) – Description of the error if the operation status is “FAILED”. If None the description of why the operation failed will be included in the result of the operation (seecom.vmware.cis.task_client.Info.result
). - start_time (
datetime.datetime
) – Time when the operation is started. This attribute is optional and it is only relevant when the value ofstatus
is one ofcom.vmware.cis.task_client.Status.RUNNING
,com.vmware.cis.task_client.Status.BLOCKED
,com.vmware.cis.task_client.Status.SUCCEEDED
, orcom.vmware.cis.task_client.Status.FAILED
. - end_time (
datetime.datetime
) – Time when the operation is completed. This attribute is optional and it is only relevant when the value ofstatus
is one ofcom.vmware.cis.task_client.Status.SUCCEEDED
orcom.vmware.cis.task_client.Status.FAILED
. - user (
str
orNone
) – Name of the user who performed the operation. This attribute will be None if the operation is performed by the system.
- progress (
-
class
com.vmware.appliance_client.
TaskInfo
(progress=None, subtask_order=None, subtasks=None, description=None, service=None, operation=None, parent=None, target=None, status=None, cancelable=None, error=None, start_time=None, end_time=None, user=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
TaskInfo
class contains information about an appliance task and the subtasks of which it consists. This class was added in vSphere API 6.7.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - progress (
com.vmware.cis.task_client.Progress
) – Progress of the task. This attribute was added in vSphere API 6.7. This attribute is optional and it is only relevant when the value of#status
is one ofcom.vmware.cis.task_client.Status.RUNNING
,com.vmware.cis.task_client.Status.BLOCKED
,com.vmware.cis.task_client.Status.SUCCEEDED
, orcom.vmware.cis.task_client.Status.FAILED
. - subtask_order (
list
ofstr
) – List of tasks that make up this appliance task in the order they are being run. This attribute was added in vSphere API 6.7. - subtasks (
dict
ofstr
andSubtaskInfo
) – Information about the subtasks that this appliance task consists of. This attribute was added in vSphere API 6.7. - description (
com.vmware.vapi.std_client.LocalizableMessage
) – Description of the operation associated with the task. - service (
str
) – Identifier of the service containing the operation. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.vapi.service
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.vapi.service
. - operation (
str
) – Identifier of the operation associated with the task. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.vapi.operation
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.vapi.operation
. - parent (
str
orNone
) – Parent of the current task. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.cis.task
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.cis.task
. This attribute will be None if the task has no parent. - target (
com.vmware.vapi.std_client.DynamicID
orNone
) – Identifier of the target created by the operation or an existing one the operation performed on. This attribute will be None if the operation has no target or multiple targets. - status (
com.vmware.cis.task_client.Status
) – Status of the operation associated with the task. - cancelable (
bool
) – Flag to indicate whether or not the operation can be cancelled. The value may change as the operation progresses. - error (
Exception
orNone
) – Description of the error if the operation status is “FAILED”. If None the description of why the operation failed will be included in the result of the operation (seecom.vmware.cis.task_client.Info.result
). - start_time (
datetime.datetime
) – Time when the operation is started. This attribute is optional and it is only relevant when the value ofstatus
is one ofcom.vmware.cis.task_client.Status.RUNNING
,com.vmware.cis.task_client.Status.BLOCKED
,com.vmware.cis.task_client.Status.SUCCEEDED
, orcom.vmware.cis.task_client.Status.FAILED
. - end_time (
datetime.datetime
) – Time when the operation is completed. This attribute is optional and it is only relevant when the value ofstatus
is one ofcom.vmware.cis.task_client.Status.SUCCEEDED
orcom.vmware.cis.task_client.Status.FAILED
. - user (
str
orNone
) – Name of the user who performed the operation. This attribute will be None if the operation is performed by the system.
- progress (
-
class
com.vmware.appliance_client.
Timesync
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
Timesync
class provides methods Performs time synchronization configuration. This class was added in vSphere API 6.7.Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
class
TimeSyncMode
(string)¶ Bases:
vmware.vapi.bindings.enum.Enum
The
Timesync.TimeSyncMode
class defines time synchronization modes. This enumeration was added in vSphere API 6.7.Note
This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page.
Parameters: string ( str
) – String value for theTimeSyncMode
instance.-
DISABLED
= TimeSyncMode(string='DISABLED')¶ Time synchronization is disabled. This class attribute was added in vSphere API 6.7.
-
HOST
= TimeSyncMode(string='HOST')¶ VMware Tool-based time synchronization. This class attribute was added in vSphere API 6.7.
-
NTP
= TimeSyncMode(string='NTP')¶ NTP-based time synchronization. This class attribute was added in vSphere API 6.7.
-
-
get
()¶ Get time synchronization mode. This method was added in vSphere API 6.7.
Return type: Timesync.TimeSyncMode
Returns: Time synchronization mode. Raise: com.vmware.vapi.std.errors_client.Error
Generic error
-
set
(mode)¶ Set time synchronization mode. This method was added in vSphere API 6.7.
Parameters: mode ( Timesync.TimeSyncMode
) – Time synchronization mode.Raise: com.vmware.vapi.std.errors_client.Error
Generic error
-
class
-
class
com.vmware.appliance_client.
Update
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
The
Update
class provides methods to get the status of the appliance update. This class was added in vSphere API 6.7.Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
class
Info
(state=None, task=None, version=None, latest_query_time=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Update.Info
class describes the state of the appliance update. This class was added in vSphere API 6.7.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - state (
Update.State
) – State of the appliance update. This attribute was added in vSphere API 6.7. - task (
TaskInfo
orNone
) – The running or completed update task. This attribute was added in vSphere API 6.7. - version (
str
) – Version of base appliance if state is UP_TO_DATE Version of update being staged or installed if state is INSTALL_IN_PROGRESS or STAGE_IN_PROGRESS Version of update staged if state is UPDATES_PENDING Version of update failed if state is INSTALL_FAILED or ROLLBACK_IN_PROGRESS. This attribute was added in vSphere API 6.7. - latest_query_time (
datetime.datetime
orNone
) – Timestamp of latest query to update repository. This attribute was added in vSphere API 6.7. If None the update was never queried
- state (
-
class
State
(string)¶ Bases:
vmware.vapi.bindings.enum.Enum
The
Update.State
class defines the various states the appliance update can be in. This enumeration was added in vSphere API 6.7.Note
This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page.
Parameters: string ( str
) – String value for theState
instance.-
INSTALL_FAILED
= State(string='INSTALL_FAILED')¶ The appliance update failed and cannot recover. This class attribute was added in vSphere API 6.7.
-
INSTALL_IN_PROGRESS
= State(string='INSTALL_IN_PROGRESS')¶ The appliance update is in progress of installing an update. This class attribute was added in vSphere API 6.7.
-
ROLLBACK_IN_PROGRESS
= State(string='ROLLBACK_IN_PROGRESS')¶ The appliance update failed and recovery is in progress. This class attribute was added in vSphere API 6.7.
-
STAGE_IN_PROGRESS
= State(string='STAGE_IN_PROGRESS')¶ The appliance update is in progress of downloading an update. This class attribute was added in vSphere API 6.7.
-
UPDATES_PENDING
= State(string='UPDATES_PENDING')¶ A new update is available. This class attribute was added in vSphere API 6.7.
-
UP_TO_DATE
= State(string='UP_TO_DATE')¶ The appliance is up to date. This class attribute was added in vSphere API 6.7.
-
-
cancel
()¶ Request the cancellation the update operation that is currently in progress. This method was added in vSphere API 6.7.
Raise: com.vmware.vapi.std.errors_client.Error
Generic errorRaise: com.vmware.vapi.std.errors_client.NotAllowedInCurrentState
Current task is not cancellableRaise: com.vmware.vapi.std.errors_client.Unauthenticated
session is not authenticatedRaise: com.vmware.vapi.std.errors_client.Unauthorized
session is not authorized to perform this operation
-
get
()¶ Gets the current status of the appliance update. This method was added in vSphere API 6.7.
Return type: Update.Info
Returns: Info structure containing the status information about the appliance. Raise: com.vmware.vapi.std.errors_client.Error
Generic errorRaise: com.vmware.vapi.std.errors_client.Unauthenticated
session is not authenticatedRaise: com.vmware.vapi.std.errors_client.Unauthorized
session is not authorized to perform this operation
-
class
com.vmware.cis_client module¶
The com.vmware.cis_client
module provides VMware common infrastructure
classes.
-
class
com.vmware.cis_client.
Session
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
The
Session
class allows API clients to manage session tokens including creating, deleting and obtaining information about sessions.- The
Session.create()
method creates session token in exchange for another authentication token. - The
Session.delete()
method invalidates a session token. - The
Session.get()
retrieves information about a session token.
The call to the
Session.create()
method is part of the overall authentication process for API clients. For example, the sequence of steps for establishing a session with SAML token is:- Connect to lookup service.
- Discover the secure token service (STS) endpoint URL.
- Connect to the secure token service to obtain a SAML token.
- Authenticate to the lookup service using the obtained SAML token.
- Discover the API endpoint URL from lookup service.
- Call the
Session.create()
method. TheSession.create()
call must include the SAML token.
See the programming guide and samples for additional information about establishing API sessions.
Execution Context and Security ContextTo use session based authentication a client should supply the session token obtained through the
Session.create()
method. The client should add the session token in the security context when using SDK classes. Clients using the REST API should supply the session token as a HTTP header.Session LifetimeA session begins with call to the
Session.create()
method to exchange a SAML token for a API session token. A session ends under the following circumstances:- Call to the
Session.delete()
method. - The session expires. Session expiration may be caused by one of the following situations:
- Client inactivity - For a particular session identified by client requests that specify the associated session ID, the lapsed time since the last request exceeds the maximum interval between requests.
- Unconditional or absolute session expiration time: At the beginning of the session, the session logic uses the SAML token and the system configuration to calculate absolute expiration time.
When a session ends, the authentication logic will reject any subsequent client requests that specify that session. Any operations in progress will continue to completion.
Error Handling
The
Session
returns the following exceptions:com.vmware.vapi.std.errors_client.Unauthenticated
exception for any exceptions related to the request.com.vmware.vapi.std.errors_client.ServiceUnavailable
exception for all exceptions caused by internal service failure.
Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
class
Info
(user=None, created_time=None, last_accessed_time=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
Represents data associated with an API session.
Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - user (
str
) – Fully qualified name of the end user that created the session, for example Administrator\@vsphere.local. A typical use case for this information is in Graphical User Interfaces (GUI) or logging systems to visualize the identity of the current user. - created_time (
datetime.datetime
) – Time when the session was created. - last_accessed_time (
datetime.datetime
) – Last time this session was used by passing the session key for invoking an API.
- user (
-
create
()¶ Creates a session with the API. This is the equivalent of login. This method exchanges user credentials supplied in the security context for a session identifier that is to be used for authenticating subsequent calls. To authenticate subsequent calls clients are expected to include the session key.
Return type: str
Returns: Newly created session identifier to be used for authenticating further requests.
Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the session creation fails due to request specific issues. Due to the security nature of the API the details of the error are not disclosed.Please check the following preconditions if using a SAML token to authenticate:
- the supplied token is delegate-able.
- the time of client and server system are synchronized.
- the token supplied is valid.
- if bearer tokens are used check that system configuration allows the API endpoint to accept such tokens.
Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if session creation fails due to server specific issues, for example connection to a back end component is failing. Due to the security nature of this API further details will not be disclosed in the exception. Please refer to component health information, administrative logs and product specific documentation for possible causes.
-
delete
()¶ Terminates the validity of a session token. This is the equivalent of log out.
A session identifier is expected as part of the request.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the session id is missing from the request or the corresponding session object cannot be found.Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if session deletion fails due to server specific issues, for example connection to a back end component is failing. Due to the security nature of this API further details will not be disclosed in the exception. Please refer to component health information, administrative logs and product specific documentation for possible causes.
-
get
()¶ Returns information about the current session. This method expects a valid session identifier to be supplied.
A side effect of invoking this method may be a change to the session’s last accessed time to the current time if this is supported by the session implementation. Invoking any other method in the API will also update the session’s last accessed time.
This API is meant to serve the needs of various front end projects that may want to display the name of the user. Examples of this include various web based user interfaces and logging facilities.
Return type: Session.Info
Returns: Information about the session. Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the session id is missing from the request or the corresponding session object cannot be found.Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if session retrieval fails due to server specific issues e.g. connection to back end component is failing. Due to the security nature of this API further details will not be disclosed in the error. Please refer to component health information, administrative logs and product specific documentation for possible causes.
- The
-
class
com.vmware.cis_client.
StubFactory
(stub_config)¶ Bases:
vmware.vapi.bindings.stub.StubFactoryBase
Initialize StubFactoryBase
Parameters: stub_config ( vmware.vapi.bindings.stub.StubConfiguration
) – Stub config instance
-
class
com.vmware.cis_client.
Tasks
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
The
Tasks
class provides methods for managing the task related to a long running operation. This class was added in vSphere API 6.7 U1.Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
class
FilterSpec
(tasks=None, services=None, status=None, targets=None, users=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Tasks.FilterSpec
class contains attributes used to filter the results when listing tasks (seeTasks.list()
). If multiple attributes are specified, only tasks matching all of the attributes match the filter. This class was added in vSphere API 6.7 U1.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - tasks (
set
ofstr
orNone
) – Identifiers of tasks that can match the filter. This attribute was added in vSphere API 6.7 U1. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:com.vmware.cis.task
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:com.vmware.cis.task
. This attribute may be None ifservices
is specified. Currently all tasks must be from the same provider. If None or empty, tasks with any identifier will match the filter. - services (
set
ofstr
orNone
) – Identifiers of services. Tasks created by operations in these services match the filter (seecom.vmware.cis.task_client.CommonInfo.service
). This attribute was added in vSphere API 6.7 U1. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:com.vmware.vapi.service
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:com.vmware.vapi.service
. This attribute may be None iftasks
is specified. Currently all services must be from the same provider. If this attribute is None or empty, tasks for all services will match the filter. - status (
set
ofcom.vmware.cis.task_client.Status
orNone
) – Status that a task must have to match the filter (seecom.vmware.cis.task_client.CommonInfo.status
). This attribute was added in vSphere API 6.7 U1. If None or empty, tasks with any status match the filter. - targets (
list
ofcom.vmware.vapi.std_client.DynamicID
orNone
) – Identifiers of the targets the operation for the associated task created or was performed on (seecom.vmware.cis.task_client.CommonInfo.target
). This attribute was added in vSphere API 6.7 U1. If None or empty, tasks associated with operations on any target match the filter. - users (
set
ofstr
orNone
) – Users who must have initiated the operation for the associated task to match the filter (seecom.vmware.cis.task_client.CommonInfo.user
). This attribute was added in vSphere API 6.7 U1. If None or empty, tasks associated with operations initiated by any user match the filter.
- tasks (
-
class
GetSpec
(return_all=None, exclude_result=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Tasks.GetSpec
class describes what data should be included when retrieving information about a task. This class was added in vSphere API 6.7 U1.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - return_all (
bool
orNone
) – If true, all data, including operation-specific data, will be returned, otherwise only the data described incom.vmware.cis.task_client.Info
will be returned. This attribute was added in vSphere API 6.7 U1. If None, only the data described incom.vmware.cis.task_client.Info
will be returned. - exclude_result (
bool
orNone
) – If true, the result will not be included in the task information, otherwise it will be included. This attribute was added in vSphere API 6.7 U1. If None, the result of the operation will be included in the task information.
- return_all (
-
RESOURCE_TYPE
= 'com.vmware.cis.task'¶ Resource type for task. This class attribute was added in vSphere API 6.7 U1.
-
cancel
(task)¶ Cancel a running operation associated with the task. This is the best effort attempt. Operation may not be cancelled anymore once it reaches certain stage. This method was added in vSphere API 6.7 U1.
Parameters: task ( str
) – Task identifier. The parameter must be an identifier for the resource type:com.vmware.cis.task
.Raise: com.vmware.vapi.std.errors_client.Error
if the system reports an error while responding to the request.Raise: com.vmware.vapi.std.errors_client.NotAllowedInCurrentState
if the task is already canceled or completed.Raise: com.vmware.vapi.std.errors_client.NotFound
if the task is not found.Raise: com.vmware.vapi.std.errors_client.ResourceInaccessible
if the task’s state cannot be accessed.Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if the system is unable to communicate with a service to complete the request.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have the required privileges.Raise: com.vmware.vapi.std.errors_client.Unsupported
if the task is not cancelable.
-
get
(task, spec=None)¶ Returns information about a task. This method was added in vSphere API 6.7 U1.
Parameters: - task (
str
) – Task identifier. The parameter must be an identifier for the resource type:com.vmware.cis.task
. - spec (
Tasks.GetSpec
orNone
) – Specification on what to get for a task. If None, the behavior is equivalent to aTasks.GetSpec
with all attributes None which means only the data described incom.vmware.cis.task_client.Info
will be returned and the result of the operation will be return.
Return type: Returns: Information about the specified task.
Raise: com.vmware.vapi.std.errors_client.Error
if the system reports an error while responding to the request.Raise: com.vmware.vapi.std.errors_client.NotFound
if the task is not found.Raise: com.vmware.vapi.std.errors_client.ResourceInaccessible
if the task’s state cannot be accessed.Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if the system is unable to communicate with a service to complete the request.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have the required privileges.- task (
-
list
(filter_spec=None, result_spec=None)¶ Returns information about at most 1000 visible (subject to permission checks) tasks matching the
Tasks.FilterSpec
. All tasks must be in the same provider. This method was added in vSphere API 6.7 U1.Parameters: - filter_spec (
Tasks.FilterSpec
orNone
) – Specification of matching tasks. This is currently required. In the future, if it is None, the behavior is equivalent to aTasks.FilterSpec
with all attributes None which means all tasks match the filter. - result_spec (
Tasks.GetSpec
orNone
) – Specification of what to return for a task. If None, the behavior is equivalent to aTasks.GetSpec
with all attributes None which means only the data describe incom.vmware.cis.task_client.Info
will be returned and the result of the operation will be return.
Return type: dict
ofstr
andcom.vmware.cis.task_client.Info
Returns: Map of task identifier to information about the task. The key in the return value
dict
will be an identifier for the resource type:com.vmware.cis.task
.Raise: com.vmware.vapi.std.errors_client.InvalidArgument
if any of the specified parameters are invalid.Raise: com.vmware.vapi.std.errors_client.ResourceInaccessible
if a task’s state cannot be accessed or over 1000 tasks matching theTasks.FilterSpec
.Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if the system is unable to communicate with a service to complete the request.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have the required privileges.- filter_spec (
-
class
com.vmware.content_client module¶
The Content module provides classes and classes for configuring global settings and permissions, and for managing libraries in the Content Library Service.
-
class
com.vmware.content_client.
Configuration
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
The
Configuration
class provides methods to configure the global settings of the Content Library Service.The configuration settings are used by the Content Library Service to control the behavior of various operations.
Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
get
()¶ Retrieves the current configuration values.
Return type: Returns: The
ConfigurationModel
instance representing the configuration of the Content Library Service.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if you do not have all of the privileges described as follows:- Method execution requires
ContentLibrary.GetConfiguration
.
- Method execution requires
-
update
(model)¶ Updates the configuration. The update is incremental. Any attribute in the
ConfigurationModel
class that is None will not be modified. Note that this update method doesn’t guarantee an atomic change of all the properties. In the case of a system crash or failure, some of the properties could be left unchanged while others may be updated.Parameters: model (
ConfigurationModel
) – TheConfigurationModel
specifying the settings to update.Raise: com.vmware.vapi.std.errors_client.InvalidArgument
if one of the configuration properties is not within the proper range.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if you do not have all of the privileges described as follows:- Method execution requires
ContentLibrary.UpdateConfiguration
.
- Method execution requires
-
-
class
com.vmware.content_client.
ConfigurationModel
(automatic_sync_enabled=None, automatic_sync_start_hour=None, automatic_sync_stop_hour=None, maximum_concurrent_item_syncs=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
ConfigurationModel
class defines the global settings of the Content Library Service.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - automatic_sync_enabled (
bool
) –Whether automatic synchronization is enabled.
When automatic synchronization is enabled, the Content Library Service will automatically synchronize all subscribed libraries on a daily basis. Subscribed libraries with the
com.vmware.content.library_client.SubscriptionInfo.automatic_sync_enabled
flag turned on will be synchronized every hour betweenConfigurationModel.automatic_sync_start_hour
andConfigurationModel.automatic_sync_stop_hour
. This attribute is not used for thecreate
method. It will always be present in the return value of theget
orlist
methods. It is optional for theupdate
method. - automatic_sync_start_hour (
long
) – The hour at which the automatic synchronization will start. This value is between 0 (midnight) and 23 inclusive. This attribute is not used for thecreate
method. It will always be present in the return value of theget
orlist
methods. It is optional for theupdate
method. - automatic_sync_stop_hour (
long
) – The hour at which the automatic synchronization will stop. Any active synchronization operation will continue to run, however no new synchronization operations will be triggered after the stop hour. This value is between 0 (midnight) and 23 inclusive. This attribute is not used for thecreate
method. It will always be present in the return value of theget
orlist
methods. It is optional for theupdate
method. - maximum_concurrent_item_syncs (
long
) –The maximum allowed number of library items to synchronize concurrently from remote libraries. This must be a positive number. The service may not be able to guarantee the requested concurrency if there is no available capacity.
This setting is global across all subscribed libraries.This attribute is not used for the
create
method. It will always be present in the return value of theget
orlist
methods. It is optional for theupdate
method.
- automatic_sync_enabled (
-
class
com.vmware.content_client.
Library
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
The
Library
class provides methods to manage and findLibraryModel
entities.The
Library
class provides support for generic functionality which can be applied equally to all types of libraries. The functionality provided by this class will not affect the properties specific to the type of library. See alsoLocalLibrary
andSubscribedLibrary
.Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
class
FindSpec
(name=None, type=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
Specifies the properties that can be used as a filter to find libraries. When multiple attributes are specified, all properties of the library must match the specification.
Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - name (
str
orNone
) – Name of the library to search. The name is case-insensitive. SeeLibraryModel.name
. If not specified any name will be searched. - type (
LibraryModel.LibraryType
orNone
) – Library type to search. SeeLibraryModel.type
. If not specified any library type will be searched.
- name (
-
RESOURCE_TYPE
= 'com.vmware.content.Library'¶ Resource type for library.
-
find
(spec)¶ Returns a list of all the visible (as determined by authorization policy) libraries matching the requested
Library.FindSpec
.Parameters: spec (
Library.FindSpec
) – Specification describing what properties to filter on.Return type: list
ofstr
Returns: The
list
of identifiers of all the visible libraries matching the givenspec
. The return value will contain identifiers for the resource type:com.vmware.content.Library
.Raise: com.vmware.vapi.std.errors_client.InvalidArgument
if no properties are specified in thespec
.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if you do not have all of the privileges described as follows:- Method execution requires
System.Read
.
- Method execution requires
-
get
(library_id)¶ Returns a given
LibraryModel
.Parameters: library_id (
str
) – Identifier of the library to return. The parameter must be an identifier for the resource type:com.vmware.content.Library
.Return type: Returns: The
LibraryModel
instance with the specifiedlibrary_id
.Raise: com.vmware.vapi.std.errors_client.NotFound
if the specified library does not exist.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if you do not have all of the privileges described as follows:- The resource
com.vmware.content.Library
referenced by the parameterlibrary_id
requiresSystem.Read
.
- The resource
-
list
()¶ Returns the identifiers of all libraries of any type in the Content Library.
Return type: list
ofstr
Returns: The
list
of all identifiers of all libraries in the Content Library. The return value will contain identifiers for the resource type:com.vmware.content.Library
.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if you do not have all of the privileges described as follows:- Method execution requires
System.Read
.
- Method execution requires
-
update
(library_id, update_spec)¶ Updates the properties of a library.
This is an incremental update to the library. Any attribute in the
LibraryModel
class that is None will not be modified.This method will only update the common properties for all library types. This will not, for example, update the
LibraryModel.publish_info
of a local library, nor theLibraryModel.subscription_info
of a subscribed library. Specific properties are updated inLocalLibrary.update()
andSubscribedLibrary.update()
.Parameters: - library_id (
str
) – Identifier of the library to update. The parameter must be an identifier for the resource type:com.vmware.content.Library
. - update_spec (
LibraryModel
) – Specification of the new property values to set on the library.
Raise: com.vmware.vapi.std.errors_client.NotFound
if the library associated withlibrary_id
does not exist.Raise: com.vmware.vapi.std.errors_client.InvalidArgument
if theupdate_spec
is not valid.Raise: com.vmware.vapi.std.errors_client.InvalidArgument
if theLibraryModel.version
ofupdate_spec
is not equal to the current version of the library.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if you do not have all of the privileges described as follows:- The resource
com.vmware.content.Library
referenced by the parameterlibrary_id
requiresContentLibrary.UpdateLibrary
.
- library_id (
-
class
-
class
com.vmware.content_client.
LibraryModel
(id=None, creation_time=None, description=None, last_modified_time=None, last_sync_time=None, name=None, storage_backings=None, type=None, optimization_info=None, version=None, publish_info=None, subscription_info=None, server_guid=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
LibraryModel
class represents a Content Library resource model.A
LibraryModel
is a container for a set of items which represent a usable set of files. The Content Library Service allows for multiple libraries to be created with separate authorization and sharing policies.Each
LibraryModel
is a container for a set ofcom.vmware.content.library_client.ItemModel
instances. Each item is a logical object in a library, which may have multiple files.A
LibraryModel
may be local or subscribed. A local library has its source of truth about items within this Content Library Service. Items may be added to or removed from the library. A local library may also be private or published. When published, the library is exposed by a network endpoint and can be used by another Content Library Service for synchronization. A private local library cannot be used for synchronization.A subscribed library is a library which gets its source of truth from another library that may be across a network in another Content Library Service. A subscribed library may have a different name and metadata from the library to which it subscribes, but the set of library items is always the same as those in the source library. Library items cannot be manually added to a subscribed library – they can only be added by adding new items to the source library.
Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - id (
str
) – An identifier which uniquely identifies thisLibraryModel
. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.content.Library
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.content.Library
. This attribute is not used for thecreate
method. It will not be present in the return value of theget
orlist
methods. It is not used for theupdate
method. - creation_time (
datetime.datetime
) – The date and time when this library was created. This attribute is not used for thecreate
method. It will always be present in the return value of theget
orlist
methods. It is not used for theupdate
method. - description (
str
) – A human-readable description for this library. This attribute is optional for thecreate
method. Leaving it None during creation will result in an empty string value. It will always be present in the result of aget
orlist
method. It is optional for theupdate
method. Leaving it None during update indicates that the description should be left unchanged. - last_modified_time (
datetime.datetime
) –The date and time when this library was last updated.
This attribute is updated automatically when the library properties are changed. This attribute is not affected by adding, removing, or modifying a library item or its content within the library. Tagging the library or syncing the subscribed library does not alter this attribute. This attribute is not used for the
create
method. It will always be present in the return value of theget
orlist
methods. It is not used for theupdate
method. - last_sync_time (
datetime.datetime
) –The date and time when this library was last synchronized.
This attribute applies only to subscribed libraries. It is updated every time a synchronization is triggered on the library. The value is None for a local library. This attribute is not used for the
create
method. It is optional in the return value of theget
orlist
methods. It is not used for theupdate
method. - name (
str
) –The name of the library.
A Library is identified by a human-readable name. Library names cannot be undefined or an empty string. Names do not have to be unique. This attribute must be provided for the
create
method. It will always be present in the return value of theget
orlist
methods. It is optional for theupdate
method. - storage_backings (
list
ofcom.vmware.content.library_client.StorageBacking
) –The list of default storage backings which are available for this library.
A
com.vmware.content.library_client.StorageBacking
defines a default storage location which can be used to store files for library items in this library. Some library items, for instance, virtual machine template items, support files that may be distributed across various storage backings. One or more item files may or may not be located on the default storage backing.Multiple default storage locations are not currently supported but may become supported in future releases. This attribute must be provided for the
create
method. It will always be present in the return value of theget
orlist
methods. It is not used for theupdate
method. - type (
LibraryModel.LibraryType
) –The type (LOCAL, SUBSCRIBED) of this library.
This value can be used to determine what additional services and information can be available for this library. This attribute is not used for the
create
andupdate
methods. It will always be present in the result of aget
method. This attribute is not used for thecreate
method. It will always be present in the return value of theget
orlist
methods. It is not used for theupdate
method. - optimization_info (
com.vmware.content.library_client.OptimizationInfo
) – Defines various optimizations and optimization parameters applied to this library. This attribute is optional for thecreate
method. It is optional in the return value of theget
orlist
methods. It is optional for theupdate
method. - version (
str
) –A version number which is updated on metadata changes. This value allows clients to detect concurrent updates and prevent accidental clobbering of data.
This value represents a number which is incremented every time library properties, such as name or description, are changed. It is not incremented by changes to a library item within the library, including adding or removing items. It is also not affected by tagging the library. This attribute is not used for the
create
method. It will always be present in the result of aget
orlist
method. It is optional for theupdate
method. Leaving it None during update indicates that you do not need to detect concurrent updates. - publish_info (
com.vmware.content.library_client.PublishInfo
) –Defines how this library is published so that it can be subscribed to by a remote subscribed library.
The
com.vmware.content.library_client.PublishInfo
defines where and how the metadata for this local library is accessible. A local library is only published publically ifcom.vmware.content.library_client.PublishInfo.published
istrue
. This attribute is optional for thecreate
andupdate
methods. If not specified during creation, the default is for the library to not be published. If not specified during update, the attribute is left unchanged. - subscription_info (
com.vmware.content.library_client.SubscriptionInfo
) –Defines the subscription behavior for this Library.
The
com.vmware.content.library_client.SubscriptionInfo
defines how this subscribed library synchronizes to a remote source. Setting the value will determine the remote source to which the library synchronizes, and how. Changing the subscription will result in synchronizing to a new source. If the new source differs from the old one, the old library items and data will be lost. Settingcom.vmware.content.library_client.SubscriptionInfo.automatic_sync_enabled
to false will halt subscription but will not remove existing cached data. This attribute is optional for thecreate
andupdate
methods. If not specified during creation, a default will be created without an active subscription. If not specified during update, the attribute is left unchanged. - server_guid (
str
) – The unique identifier of the vCenter server where the library exists. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.vcenter.VCenter
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.vcenter.VCenter
. This attribute is optional for thecreate
method. It will always be present in the return value of theget
orlist
methods. It is not used for theupdate
method.
-
class
LibraryType
(string)¶ Bases:
vmware.vapi.bindings.enum.Enum
The
LibraryModel.LibraryType
class defines the type of aLibraryModel
.The type of a library can be used to determine which additional services can be performed with a library.
Note
This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page.
Parameters: string ( str
) – String value for theLibraryType
instance.-
LOCAL
= LibraryType(string='LOCAL')¶ The library contents are defined and stored by the local Content Library Service installation.
A local library can be retrieved and managed via the
LocalLibrary
.
-
SUBSCRIBED
= LibraryType(string='SUBSCRIBED')¶ The library synchronizes its items and content from another published library.
A subscribed library can be retrieved and managed via the
SubscribedLibrary
.
-
- id (
-
class
com.vmware.content_client.
LocalLibrary
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
The
LocalLibrary
class manages local libraries.The
LocalLibrary
class provides support for creating and maintaining local library instances. A local library may also use theLibrary
class to manage general library functionality.Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
create
(create_spec, client_token=None)¶ Creates a new local library.
Parameters: - client_token (
str
orNone
) – A unique token generated on the client for each creation request. The token should be a universally unique identifier (UUID), for example:b8a2a2e3-2314-43cd-a871-6ede0f429751
. This token can be used to guarantee idempotent creation. If not specified creation is not idempotent. - create_spec (
LibraryModel
) – Specification for the new local library.
Return type: str
Returns: Identifier of the newly created
LibraryModel
. The return value will be an identifier for the resource type:com.vmware.content.Library
.Raise: com.vmware.vapi.std.errors_client.InvalidArgument
if thecreate_spec
is not valid.Raise: com.vmware.vapi.std.errors_client.InvalidArgument
if theclient_token
does not conform to the UUID format.Raise: com.vmware.vapi.std.errors_client.Unsupported
if using multiple storage backings.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if you do not have all of the privileges described as follows:- Method execution requires
ContentLibrary.CreateLocalLibrary
.
- client_token (
-
delete
(library_id)¶ Deletes the specified local library.
Deleting a local library will remove the entry immediately and begin an asynchronous task to remove all cached content for the library. If the asynchronous task fails, file content may remain on the storage backing. This content will require manual removal.
Parameters: library_id (
str
) – Identifier of the local library to delete. The parameter must be an identifier for the resource type:com.vmware.content.Library
.Raise: com.vmware.vapi.std.errors_client.InvalidElementType
if the library specified bylibrary_id
is not a local library.Raise: com.vmware.vapi.std.errors_client.NotFound
if the library specified bylibrary_id
does not exist.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if you do not have all of the privileges described as follows:- The resource
com.vmware.content.Library
referenced by the parameterlibrary_id
requiresContentLibrary.DeleteLocalLibrary
.
- The resource
-
get
(library_id)¶ Returns a given local library.
Parameters: library_id (
str
) – Identifier of the local library to return. The parameter must be an identifier for the resource type:com.vmware.content.Library
.Return type: Returns: The
LibraryModel
instance associated withlibrary_id
.Raise: com.vmware.vapi.std.errors_client.NotFound
if the library specified bylibrary_id
does not exist.Raise: com.vmware.vapi.std.errors_client.InvalidElementType
if the library specified bylibrary_id
is not a local library.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if you do not have all of the privileges described as follows:- The resource
com.vmware.content.Library
referenced by the parameterlibrary_id
requiresSystem.Read
.
- The resource
-
list
()¶ Returns the identifiers of all local libraries in the Content Library.
Return type: list
ofstr
Returns: The
list
of identifiers of all local libraries in the Content Library. The return value will contain identifiers for the resource type:com.vmware.content.Library
.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if you do not have all of the privileges described as follows:- Method execution requires
System.Read
.
- Method execution requires
-
update
(library_id, update_spec)¶ Updates the properties of a local library.
This is an incremental update to the local library. Attributes that are None in the update specification will be left unchanged.
Parameters: - library_id (
str
) – Identifier of the local library to update. The parameter must be an identifier for the resource type:com.vmware.content.Library
. - update_spec (
LibraryModel
) – Specification of the new property values to set on the local library.
Raise: com.vmware.vapi.std.errors_client.NotFound
if the library specified bylibrary_id
does not exist.Raise: com.vmware.vapi.std.errors_client.NotAllowedInCurrentState
if the library specified bylibrary_id
is a published library with JSON persistence enabled (seecom.vmware.content.library_client.PublishInfo.persist_json_enabled
) and the content of the library has been deleted from the storage backings (seeLibraryModel.storage_backings
) associated with it.Raise: com.vmware.vapi.std.errors_client.InvalidElementType
if the library specified bylibrary_id
is not a local library.Raise: com.vmware.vapi.std.errors_client.InvalidArgument
if theupdate_spec
is not valid.Raise: com.vmware.vapi.std.errors_client.InvalidArgument
if thecom.vmware.content.library_client.PublishInfo.current_password
in theupdate_spec
does not match the existing password of the published library.Raise: com.vmware.vapi.std.errors_client.ResourceBusy
if theLibraryModel.version
ofupdate_spec
is None and the library is being concurrently updated by another user.Raise: com.vmware.vapi.std.errors_client.ConcurrentChange
if theLibraryModel.version
ofupdate_spec
is not equal to the current version of the library.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if you do not have all of the privileges described as follows:- The resource
com.vmware.content.Library
referenced by the parameterlibrary_id
requiresContentLibrary.UpdateLocalLibrary
.
- library_id (
-
-
class
com.vmware.content_client.
StubFactory
(stub_config)¶ Bases:
vmware.vapi.bindings.stub.StubFactoryBase
Initialize StubFactoryBase
Parameters: stub_config ( vmware.vapi.bindings.stub.StubConfiguration
) – Stub config instance
-
class
com.vmware.content_client.
SubscribedLibrary
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
class
ProbeResult
(status=None, ssl_thumbprint=None, error_messages=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
SubscribedLibrary.ProbeResult
class defines the subscription information probe result. This describes whether using a given subscription URL is successful or if there are access problems, such as SSL errors.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - status (
SubscribedLibrary.ProbeResult.Status
) – The status of probe result. This will be one of SUCCESS, INVALID_URL, TIMED_OUT, HOST_NOT_FOUND, RESOURCE_NOT_FOUND, INVALID_CREDENTIALS, CERTIFICATE_ERROR, UNKNOWN_ERROR. - ssl_thumbprint (
str
orNone
) – The SSL thumbprint for the remote endpoint. An SSL thumbprint is only returned if the host is secured with SSL/TLS. - error_messages (
list
ofcom.vmware.vapi.std_client.LocalizableMessage
) – If the probe result is in an error status, this attribute will contain the detailed error messages.
-
class
Status
(string)¶ Bases:
vmware.vapi.bindings.enum.Enum
The
SubscribedLibrary.ProbeResult.Status
class defines the error status constants for the probe result.Note
This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page.
Parameters: string ( str
) – String value for theStatus
instance.-
CERTIFICATE_ERROR
= Status(string='CERTIFICATE_ERROR')¶ Indicates that the provided server certificate thumbprint in
com.vmware.content.library_client.SubscriptionInfo.ssl_thumbprint
is invalid. In this case, the returned null should be set incom.vmware.content.library_client.SubscriptionInfo.ssl_thumbprint
.
-
HOST_NOT_FOUND
= Status(string='HOST_NOT_FOUND')¶ Indicates that the host in the URL could not be found.
-
INVALID_CREDENTIALS
= Status(string='INVALID_CREDENTIALS')¶ Indicates that the connection was rejected due to invalid credentials.
-
INVALID_URL
= Status(string='INVALID_URL')¶ Indicates that the supplied URL was not valid.
-
RESOURCE_NOT_FOUND
= Status(string='RESOURCE_NOT_FOUND')¶ Indicates that the given resource at the URL was not found.
-
SUCCESS
= Status(string='SUCCESS')¶ Indicates that the probe was successful.
-
TIMED_OUT
= Status(string='TIMED_OUT')¶ Indicates that the probe timed out while attempting to connect to the URL.
-
UNKNOWN_ERROR
= Status(string='UNKNOWN_ERROR')¶ Indicates an unspecified error different from the other error cases defined in
SubscribedLibrary.ProbeResult.Status
.
-
- status (
-
create
(create_spec, client_token=None)¶ Creates a new subscribed library.
Once created, the subscribed library will be empty. If the
LibraryModel.subscription_info
property is set, the Content Library Service will attempt to synchronize to the remote source. This is an asynchronous operation so the content of the published library may not immediately appear.Parameters: - client_token (
str
orNone
) – Unique token generated on the client for each creation request. The token should be a universally unique identifier (UUID), for example:b8a2a2e3-2314-43cd-a871-6ede0f429751
. This token can be used to guarantee idempotent creation. If not specified creation is not idempotent. - create_spec (
LibraryModel
) – Specification for the new subscribed library.
Return type: str
Returns: Identifier of the newly created subscribed library. The return value will be an identifier for the resource type:
com.vmware.content.Library
.Raise: com.vmware.vapi.std.errors_client.InvalidArgument
if thecreate_spec
is not valid.Raise: com.vmware.vapi.std.errors_client.InvalidArgument
if theclient_token
does not conform to the UUID format.Raise: com.vmware.vapi.std.errors_client.Unsupported
if using multiple storage backings.Raise: com.vmware.vapi.std.errors_client.ResourceInaccessible
if subscribing to a published library which cannot be accessed.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if you do not have all of the privileges described as follows:- Method execution requires
ContentLibrary.CreateSubscribedLibrary
.
- client_token (
-
delete
(library_id)¶ Deletes the specified subscribed library.
Deleting a subscribed library will remove the entry immediately and begin an asynchronous task to remove all cached content for the library. If the asynchronous task fails, file content may remain on the storage backing. This content will require manual removal.
Parameters: library_id (
str
) – Identifier of the subscribed library to delete. The parameter must be an identifier for the resource type:com.vmware.content.Library
.Raise: com.vmware.vapi.std.errors_client.InvalidElementType
if the library referenced bylibrary_id
is not a subscribed library.Raise: com.vmware.vapi.std.errors_client.NotFound
if the library referenced bylibrary_id
does not exist.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if you do not have all of the privileges described as follows:- The resource
com.vmware.content.Library
referenced by the parameterlibrary_id
requiresContentLibrary.DeleteSubscribedLibrary
.
- The resource
-
evict
(library_id)¶ Evicts the cached content of an on-demand subscribed library.
This method allows the cached content of a subscribed library to be removed to free up storage capacity. This method will only work when a subscribed library is synchronized on-demand.
Parameters: library_id (
str
) – Identifier of the subscribed library whose content should be evicted. The parameter must be an identifier for the resource type:com.vmware.content.Library
.Raise: com.vmware.vapi.std.errors_client.NotFound
if the library specified bylibrary_id
does not exist.Raise: com.vmware.vapi.std.errors_client.InvalidElementType
if the library specified bylibrary_id
is not a subscribed library.Raise: com.vmware.vapi.std.errors_client.NotAllowedInCurrentState
if the library specified bylibrary_id
does not synchronize on-demand, or if the content of the library specified bylibrary_id
has been deleted from the storage backings (seeLibraryModel.storage_backings
) associated with it.For instance, this {\@term error) is reported on evicting an on-demand subscribed library that was restored from backup, and the library was deleted after the backup was taken, thus resulting in its content being deleted from the associated storage backings. In this scenario, the metadata of the library is present on a restore, while its content has been deleted.
Raise: com.vmware.vapi.std.errors_client.Unauthorized
if you do not have all of the privileges described as follows:- The resource
com.vmware.content.Library
referenced by the parameterlibrary_id
requiresContentLibrary.EvictSubscribedLibrary
.
- The resource
-
get
(library_id)¶ Returns a given subscribed library.
Parameters: library_id (
str
) – Identifier of the subscribed library to return. The parameter must be an identifier for the resource type:com.vmware.content.Library
.Return type: Returns: The
LibraryModel
instance that corresponds tolibrary_id
.Raise: com.vmware.vapi.std.errors_client.NotFound
if the library associated withlibrary_id
does not exist.Raise: com.vmware.vapi.std.errors_client.InvalidElementType
if the library associated withlibrary_id
is not a subscribed library.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if you do not have all of the privileges described as follows:- The resource
com.vmware.content.Library
referenced by the parameterlibrary_id
requiresSystem.Read
.
- The resource
-
list
()¶ Returns the identifiers of all subscribed libraries in the Content Library.
Return type: list
ofstr
Returns: The
list
of identifiers of all subscribed libraries in the Content Library. The return value will contain identifiers for the resource type:com.vmware.content.Library
.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if you do not have all of the privileges described as follows:- Method execution requires
System.Read
.
- Method execution requires
-
probe
(subscription_info)¶ Probes remote library subscription information, including URL, SSL certificate and password. The resulting
SubscribedLibrary.ProbeResult
class describes whether or not the subscription configuration is successful.Parameters: subscription_info (
com.vmware.content.library_client.SubscriptionInfo
) – The subscription info to be probed.Return type: Returns: The subscription info probe result.
Raise: com.vmware.vapi.std.errors_client.Unauthorized
if you do not have all of the privileges described as follows:- Method execution requires
ContentLibrary.ProbeSubscription
.
- Method execution requires
-
sync
(library_id)¶ Forces the synchronization of the subscribed library.
Synchronizing a subscribed library forcefully with this method will perform the same synchronization behavior as would run periodically for the library. The
com.vmware.content.library_client.SubscriptionInfo.on_demand
setting is respected. Calling this method on a library that is already in the process of synchronizing will have no effect.Parameters: library_id (
str
) – Identifier of the subscribed library to synchronize. The parameter must be an identifier for the resource type:com.vmware.content.Library
.Raise: com.vmware.vapi.std.errors_client.NotFound
if the library specified bylibrary_id
does not exist.Raise: com.vmware.vapi.std.errors_client.InvalidElementType
if the library specified bylibrary_id
is not a subscribed library.Raise: com.vmware.vapi.std.errors_client.NotAllowedInCurrentState
if the content of the library specified bylibrary_id
has been deleted from the storage backings (seeLibraryModel.storage_backings
) associated with it.For instance, this {\@term error) is reported on synchronizing a subscribed library that was restored from backup, and the library was deleted after the backup was taken, thus resulting in its content being deleted from the associated storage backings. In this scenario, the metadata of the library is present on a restore, while its content has been deleted.
Raise: com.vmware.vapi.std.errors_client.InvalidArgument
if some parameter in the subscribed library subscription info is invalid.Raise: com.vmware.vapi.std.errors_client.ResourceInaccessible
if the published library cannot be contacted or found.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if you do not have all of the privileges described as follows:- The resource
com.vmware.content.Library
referenced by the parameterlibrary_id
requiresContentLibrary.SyncLibrary
.
- The resource
-
update
(library_id, update_spec)¶ Updates the properties of a subscribed library.
This is an incremental update to the subscribed library. Attributes that are None in the update specification will be left unchanged.
Parameters: - library_id (
str
) – Identifier of the subscribed library to update. The parameter must be an identifier for the resource type:com.vmware.content.Library
. - update_spec (
LibraryModel
) – Specification of the new property values to set on the subscribed library.
Raise: com.vmware.vapi.std.errors_client.NotFound
if the library specified bylibrary_id
does not exist.Raise: com.vmware.vapi.std.errors_client.NotAllowedInCurrentState
if theupdate_spec
updates the subscription URL (seecom.vmware.content.library_client.SubscriptionInfo.subscription_url
) and the content of the library specified bylibrary_id
has been deleted from the storage backings (seeLibraryModel.storage_backings
) associated with it.Raise: com.vmware.vapi.std.errors_client.InvalidElementType
if the library specified bylibrary_id
is not a subscribed library.Raise: com.vmware.vapi.std.errors_client.InvalidArgument
if theupdate_spec
is not valid.Raise: com.vmware.vapi.std.errors_client.ResourceInaccessible
if the subscription info is being updated but the published library cannot be contacted or found.Raise: com.vmware.vapi.std.errors_client.ResourceBusy
if theLibraryModel.version
ofupdate_spec
is None and the library is being concurrently updated by another user.Raise: com.vmware.vapi.std.errors_client.ConcurrentChange
if theLibraryModel.version
ofupdate_spec
is not equal to the current version of the library.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if you do not have all of the privileges described as follows:- The resource
com.vmware.content.Library
referenced by the parameterlibrary_id
requiresContentLibrary.UpdateSubscribedLibrary
.
- library_id (
-
class
-
class
com.vmware.content_client.
Type
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
The
Type
class exposes thecom.vmware.content.library_client.ItemModel
types that this Content Library Service supports.A library item has an optional type which can be specified with the
com.vmware.content.library_client.ItemModel.type
attribute. For items with a type that is supported by a plugin, the Content Library Service may understand the files which are part of the library item and can produce metadata for the item.In other cases, uploads may require a process in which one upload implies subsequent uploads. For example, an Open Virtualization Format (OVF) package is composed of an OVF descriptor file and the associated virtual disk files. Uploading an OVF descriptor can enable the Content Library Service to understand that the complete OVF package requires additional disk files, and it can set up the transfers for the disks automatically by adding the file entries for the disks when the OVF descriptor is uploaded.
When a type is not supported by a plugin, or the type is not specified, the Content Library Service can handle a library item in a default way, without adding metadata to the item or guiding the upload process.
Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
class
Info
(description=None, name=None, type=None, vendor=None, version=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Type.Info
class describes support for a specific type of data in ancom.vmware.content.library_client.ItemModel
. TheType.Info
can be queried through theType
class. Type support describes plugins in the Content Library which can provide metadata on library items and help manage the transfer process by adding dependent files when a current file is added.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - description (
str
) – A description of the type support offered by the plugin. - name (
str
) – The name of the plugin which provides the type support. - type (
str
) –The type which the plugin supports.
To upload a library item of the type supported by the plugin, the
com.vmware.content.library_client.ItemModel.type
attribute of the item should be set to this value. - vendor (
str
) – The name of the vendor who created the type support plugin. - version (
str
) – The version number of the type support plugin.
- description (
-
list
()¶ Returns a
list
ofType.Info
instances which describe the type support plugins in this Content Library.Return type: Returns: The
list
ofType.Info
instances which describe the type support plugins in this Content Library.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if you do not have all of the privileges described as follows:- Method execution requires
ContentLibrary.TypeIntrospection
.
- Method execution requires
-
class
com.vmware.vcenter_client module¶
The com.vmware.vcenter_client
module provides classes for managing VMware
vSphere environments. The module is available starting in vSphere 6.5.
-
class
com.vmware.vcenter_client.
Cluster
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
The
Cluster
class provides methods to manage clusters in the vCenter Server.Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
class
FilterSpec
(clusters=None, names=None, folders=None, datacenters=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Cluster.FilterSpec
class contains attributes used to filter the results when listing clusters (seeCluster.list()
). If multiple attributes are specified, only clusters matching all of the attributes match the filter.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - clusters (
set
ofstr
orNone
) – Identifiers of clusters that can match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:ClusterComputeResource
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:ClusterComputeResource
. If None or empty, clusters with any identifier match the filter. - names (
set
ofstr
orNone
) – Names that clusters must have to match the filter (seeCluster.Info.name
). If None or empty, clusters with any name match the filter. - folders (
set
ofstr
orNone
) – Folders that must contain the cluster for the cluster to match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:Folder
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:Folder
. If None or empty, clusters in any folder match the filter. - datacenters (
set
ofstr
orNone
) – Datacenters that must contain the cluster for the cluster to match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:Datacenter
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:Datacenter
. If None or empty, clusters in any datacenter match the filter.
- clusters (
-
class
Info
(name=None, resource_pool=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Cluster.Info
class contains information about a cluster in vCenter Server.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - name (
str
) – The name of the cluster - resource_pool (
str
) – Identifier of the root resource pool of the cluster When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:ResourcePool
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:ResourcePool
.
- name (
-
RESOURCE_TYPE
= 'ClusterComputeResource'¶ The resource type for the vCenter Cluster
-
class
Summary
(cluster=None, name=None, ha_enabled=None, drs_enabled=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Cluster.Summary
class contains commonly used information about a cluster in vCenter Server.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - cluster (
str
) – Identifier of the cluster. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:ClusterComputeResource
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:ClusterComputeResource
. - name (
str
) – Name of the cluster. - ha_enabled (
bool
) – Flag indicating whether the vSphere HA feature is enabled for the cluster. - drs_enabled (
bool
) – Flag indicating whether the vSphere DRS service is enabled for the cluster.
- cluster (
-
get
(cluster)¶ Retrieves information about the cluster corresponding to
cluster
.Parameters: cluster ( str
) – Identifier of the cluster. The parameter must be an identifier for the resource type:ClusterComputeResource
.Return type: Cluster.Info
Returns: The Cluster.Info
instances that corresponds to thecluster
.Raise: com.vmware.vapi.std.errors_client.NotFound
if there is no cluster associated withcluster
in the system.Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if the system is unable to communicate with a service to complete the request.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the session id is missing from the request or the corresponding session object cannot be found.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t not have the required privileges.
-
list
(filter=None)¶ Returns information about at most 1000 visible (subject to permission checks) clusters in vCenter matching the
Cluster.FilterSpec
.Parameters: filter ( Cluster.FilterSpec
orNone
) – Specification of matching clusters for which information should be returned. If None, the behavior is equivalent to aCluster.FilterSpec
with all attributes None which means all clusters match the filter.Return type: list
ofCluster.Summary
Returns: Commonly used information about the clusters matching the Cluster.FilterSpec
.Raise: com.vmware.vapi.std.errors_client.UnableToAllocateResource
if more than 1000 clusters match theCluster.FilterSpec
.Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if the system is unable to communicate with a service to complete the request.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have the required privileges.
-
class
-
class
com.vmware.vcenter_client.
Datacenter
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
The
Datacenter
class provides methods to manage datacenters in the vCenter Server.Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
class
CreateSpec
(name=None, folder=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Datacenter.CreateSpec
class defines the information used to create a datacenter.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - name (
str
) – The name of the datacenter to be created. - folder (
str
orNone
) – Datacenter folder in which the new datacenter should be created. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:Folder
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:Folder
. This attribute is currently required. In the future, if this attribute is None, the system will attempt to choose a suitable folder for the datacenter; if a folder cannot be chosen, the datacenter creation operation will fail.
- name (
-
class
FilterSpec
(datacenters=None, names=None, folders=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Datacenter.FilterSpec
class contains attributes used to filter the results when listing datacenters (seeDatacenter.list()
). If multiple attributes are specified, only datacenters matching all of the attributes match the filter.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - datacenters (
set
ofstr
orNone
) – Identifiers of datacenters that can match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:Datacenter
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:Datacenter
. If None or empty, datacenters with any identifier match the filter. - names (
set
ofstr
orNone
) – Names that datacenters must have to match the filter (seeDatacenter.Info.name
). If None or empty, datacenters with any name match the filter. - folders (
set
ofstr
orNone
) – Folders that must contain the datacenters for the datacenter to match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:Folder
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:Folder
. If None or empty, datacenters in any folder match the filter.
- datacenters (
-
class
Info
(name=None, datastore_folder=None, host_folder=None, network_folder=None, vm_folder=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Datacenter.Info
class contains information about a datacenter in vCenter Server.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - name (
str
) – The name of the datacenter. - datastore_folder (
str
) – The root datastore folder associated with the datacenter. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:Folder
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:Folder
. - host_folder (
str
) – The root host and cluster folder associated with the datacenter. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:Folder
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:Folder
. - network_folder (
str
) – The root network folder associated with the datacenter. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:Folder
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:Folder
. - vm_folder (
str
) – The root virtual machine folder associated with the datacenter. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:Folder
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:Folder
.
- name (
-
RESOURCE_TYPE
= 'Datacenter'¶ The resource type for the vCenter Datacenter
-
class
Summary
(datacenter=None, name=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Datacenter.Summary
class contains commonly used information about a datacenter in vCenter Server.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - datacenter (
str
) – Identifier of the datacenter. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:Datacenter
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:Datacenter
. - name (
str
) – Name of the datacenter.
- datacenter (
-
create
(spec)¶ Create a new datacenter in the vCenter inventory
Parameters: spec ( Datacenter.CreateSpec
) – Specification for the new datacenter to be created.Return type: str
Returns: The identifier of the newly created datacenter The return value will be an identifier for the resource type: Datacenter
.Raise: com.vmware.vapi.std.errors_client.Error
if the system reports an error while responding to the request.Raise: com.vmware.vapi.std.errors_client.AlreadyExists
if the datacenter with the same name is already present.Raise: com.vmware.vapi.std.errors_client.InvalidArgument
if the datacenter name is empty or invalid as per the underlying implementation.Raise: com.vmware.vapi.std.errors_client.InvalidArgument
if the folder is not specified and the system cannot choose a suitable one.Raise: com.vmware.vapi.std.errors_client.NotFound
if the datacenter folder cannot be found.Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if the system is unable to communicate with a service to complete the request.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have the required privileges.
-
delete
(datacenter, force=None)¶ Delete an empty datacenter from the vCenter Server
Parameters: - datacenter (
str
) – Identifier of the datacenter to be deleted. The parameter must be an identifier for the resource type:Datacenter
. - force (
bool
orNone
) – If true, delete the datacenter even if it is not empty. If None acom.vmware.vapi.std.errors_client.ResourceInUse
exception will be reported if the datacenter is not empty. This is the equivalent of passing the value false.
Raise: com.vmware.vapi.std.errors_client.Error
if the system reports an error while responding to the request.Raise: com.vmware.vapi.std.errors_client.NotFound
if there is no datacenter associated withdatacenter
in the system.Raise: com.vmware.vapi.std.errors_client.ResourceInUse
if the datacenter associated withdatacenter
is not empty.Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if the system is unable to communicate with a service to complete the request.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have the required privileges.- datacenter (
-
get
(datacenter)¶ Retrieves information about the datacenter corresponding to
datacenter
.Parameters: datacenter ( str
) – Identifier of the datacenter. The parameter must be an identifier for the resource type:Datacenter
.Return type: Datacenter.Info
Returns: The Datacenter.Info
instances that corresponds to thedatacenter
.Raise: com.vmware.vapi.std.errors_client.Error
if the system reports an error while responding to the request.Raise: com.vmware.vapi.std.errors_client.NotFound
if there is no datacenter associated withdatacenter
in the system.Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if the system is unable to communicate with a service to complete the request.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have the required privileges.
-
list
(filter=None)¶ Returns information about at most 1000 visible (subject to permission checks) datacenters in vCenter matching the
Datacenter.FilterSpec
.Parameters: filter ( Datacenter.FilterSpec
orNone
) – Specification of matching datacenters for which information should be returned. If None, the behavior is equivalent to aDatacenter.FilterSpec
with all attributes None which means all datacenters match the filter.Return type: list
ofDatacenter.Summary
Returns: Commonly used information about the datacenters matching the Datacenter.FilterSpec
.Raise: com.vmware.vapi.std.errors_client.UnableToAllocateResource
if more than 1000 datacenters match theDatacenter.FilterSpec
.Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if the system is unable to communicate with a service to complete the request.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have the required privileges.
-
class
-
class
com.vmware.vcenter_client.
Datastore
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
The Datastore class provides methods for manipulating a datastore.
Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
class
FilterSpec
(datastores=None, names=None, types=None, folders=None, datacenters=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Datastore.FilterSpec
class contains attributes used to filter the results when listing datastores (seeDatastore.list()
). If multiple attributes are specified, only datastores matching all of the attributes match the filter.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - datastores (
set
ofstr
orNone
) – Identifiers of datastores that can match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:Datastore
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:Datastore
. If None or empty, datastores with any identifier match the filter. - names (
set
ofstr
orNone
) – Names that datastores must have to match the filter (seeDatastore.Info.name
). If None or empty, datastores with any name match the filter. - types (
set
ofDatastore.Type
orNone
) – Types that datastores must have to match the filter (seeDatastore.Summary.type
). If None or empty, datastores with any type match the filter. - folders (
set
ofstr
orNone
) – Folders that must contain the datastore for the datastore to match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:Folder
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:Folder
. If None or empty, datastores in any folder match the filter. - datacenters (
set
ofstr
orNone
) – Datacenters that must contain the datastore for the datastore to match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:Datacenter
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:Datacenter
. If None or empty, datastores in any datacenter match the filter.
- datastores (
-
class
Info
(name=None, type=None, accessible=None, free_space=None, multiple_host_access=None, thin_provisioning_supported=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Datastore.Info
class contains information about a datastore.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - name (
str
) – Name of the datastore. - type (
Datastore.Type
) – Type (VMFS, NFS, NFS41, CIFS, VSAN, VFFS, VVOL) of the datastore. - accessible (
bool
) – Whether or not this datastore is accessible. - free_space (
long
orNone
) –Available space of this datastore, in bytes.
The server periodically updates this value.This attribute will be None if the available space of this datastore is not known.
- multiple_host_access (
bool
) – Whether or not ore than one host in the datacenter has been configured with access to the datastore. - thin_provisioning_supported (
bool
) – Whether or not the datastore supports thin provisioning on a per file basis. When thin provisioning is used, backing storage is lazily allocated.
- name (
-
RESOURCE_TYPE
= 'Datastore'¶ The resource type for the vCenter datastore
-
class
Summary
(datastore=None, name=None, type=None, free_space=None, capacity=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Datastore.Summary
class contains commonly used information about a datastore.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - datastore (
str
) – Identifier of the datastore. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:Datastore
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:Datastore
. - name (
str
) – Name of the datastore. - type (
Datastore.Type
) – Type (VMFS, NFS, NFS41, CIFS, VSAN, VFFS, VVOL) of the datatore. - free_space (
long
orNone
) –Available space of this datastore, in bytes.
The server periodically updates this value.This attribute will be None if the available space of this datastore is not known.
- capacity (
long
orNone
) –Capacity of this datastore, in bytes.
The server periodically updates this value.This attribute will be None if the capacity of this datastore is not known.
- datastore (
-
class
Type
(string)¶ Bases:
vmware.vapi.bindings.enum.Enum
The
Datastore.Type
class defines the supported types of vCenter datastores.Note
This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page.
Parameters: string ( str
) – String value for theType
instance.-
CIFS
= Type(string='CIFS')¶ Common Internet File System.
-
NFS
= Type(string='NFS')¶ Network file system v3 (linux & esx servers only).
-
NFS41
= Type(string='NFS41')¶ Network file system v4.1 (linux & esx servers only).
-
VFFS
= Type(string='VFFS')¶ Flash Read Cache (ESX Server only).
-
VMFS
= Type(string='VMFS')¶ VMware File System (ESX Server only).
-
VSAN
= Type(string='VSAN')¶ Virtual SAN (ESX Server only).
-
VVOL
= Type(string='VVOL')¶ vSphere Virtual Volume (ESX Server only).
-
-
get
(datastore)¶ Retrieves information about the datastore indicated by
datastore
.Parameters: datastore ( str
) – Identifier of the datastore for which information should be retrieved. The parameter must be an identifier for the resource type:Datastore
.Return type: Datastore.Info
Returns: information about the datastore. Raise: com.vmware.vapi.std.errors_client.NotFound
if the datastore indicated bydatastore
does not exist.Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if the system is unable to communicate with a service to complete the request.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have the required privileges.
-
list
(filter=None)¶ Returns information about at most 1000 visible (subject to permission checks) datastores in vCenter matching the
Datastore.FilterSpec
.Parameters: filter ( Datastore.FilterSpec
orNone
) – Specification of matching datastores for which information should be returned. If None, the behavior is equivalent to aDatastore.FilterSpec
with all attributes None which means all datastores match the filter.Return type: list
ofDatastore.Summary
Returns: Commonly used information about the datastores matching the Datastore.FilterSpec
.Raise: com.vmware.vapi.std.errors_client.InvalidArgument
if theDatastore.FilterSpec.types
attribute contains a value that is not supported by the server.Raise: com.vmware.vapi.std.errors_client.InvalidArgument
if theDatastore.FilterSpec.types
attribute contains a value that is not supported by the server.Raise: com.vmware.vapi.std.errors_client.UnableToAllocateResource
if more than 1000 datastores match theDatastore.FilterSpec
.Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if the system is unable to communicate with a service to complete the request.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have the required privileges.
-
class
-
class
com.vmware.vcenter_client.
Deployment
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
The
Deployment
class provides methods to get the status of the vCenter appliance deployment. This class was added in vSphere API 6.7.Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
class
Info
(state=None, progress=None, subtask_order=None, subtasks=None, description=None, service=None, operation=None, parent=None, target=None, status=None, cancelable=None, error=None, start_time=None, end_time=None, user=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Deployment.Info
class contains attributes to describe the state of the appliance. This class was added in vSphere API 6.7.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - state (
com.vmware.vcenter.deployment_client.ApplianceState
) – State of the vCenter Server Appliance. This attribute was added in vSphere API 6.7. - progress (
com.vmware.cis.task_client.Progress
) – The progress info of the current appliance status. This attribute was added in vSphere API 6.7. This attribute is optional and it is only relevant when the value of#status
is one ofcom.vmware.cis.task_client.Status.RUNNING
,com.vmware.cis.task_client.Status.BLOCKED
,com.vmware.cis.task_client.Status.SUCCEEDED
, orcom.vmware.cis.task_client.Status.FAILED
. - subtask_order (
list
ofstr
orNone
) – The ordered list of subtasks for this deployment operation. This attribute was added in vSphere API 6.7. Onlyset
when the appliance state is RUNNING_IN_PROGRESS, FAILED, CANCELLED and SUCCEEDED. - subtasks ((
dict
ofstr
andDeployment.Task
) orNone
) – The map of the deployment subtasks and their status infomation. This attribute was added in vSphere API 6.7. Onlyset
when the appliance state is RUNNING_IN_PROGRESS, FAILED, CANCELLED and SUCCEEDED. - description (
com.vmware.vapi.std_client.LocalizableMessage
) – Description of the operation associated with the task. - service (
str
) – Identifier of the service containing the operation. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.vapi.service
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.vapi.service
. - operation (
str
) – Identifier of the operation associated with the task. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.vapi.operation
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.vapi.operation
. - parent (
str
orNone
) – Parent of the current task. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.cis.task
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.cis.task
. This attribute will be None if the task has no parent. - target (
com.vmware.vapi.std_client.DynamicID
orNone
) – Identifier of the target created by the operation or an existing one the operation performed on. This attribute will be None if the operation has no target or multiple targets. - status (
com.vmware.cis.task_client.Status
) – Status of the operation associated with the task. - cancelable (
bool
) – Flag to indicate whether or not the operation can be cancelled. The value may change as the operation progresses. - error (
Exception
orNone
) – Description of the error if the operation status is “FAILED”. If None the description of why the operation failed will be included in the result of the operation (seecom.vmware.cis.task_client.Info.result
). - start_time (
datetime.datetime
) – Time when the operation is started. This attribute is optional and it is only relevant when the value ofstatus
is one ofcom.vmware.cis.task_client.Status.RUNNING
,com.vmware.cis.task_client.Status.BLOCKED
,com.vmware.cis.task_client.Status.SUCCEEDED
, orcom.vmware.cis.task_client.Status.FAILED
. - end_time (
datetime.datetime
) – Time when the operation is completed. This attribute is optional and it is only relevant when the value ofstatus
is one ofcom.vmware.cis.task_client.Status.SUCCEEDED
orcom.vmware.cis.task_client.Status.FAILED
. - user (
str
orNone
) – Name of the user who performed the operation. This attribute will be None if the operation is performed by the system.
- state (
-
class
Task
(progress=None, result=None, description=None, service=None, operation=None, parent=None, target=None, status=None, cancelable=None, error=None, start_time=None, end_time=None, user=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Deployment.Task
class contains attributes to describe a particular deployment task. This class was added in vSphere API 6.7.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - progress (
com.vmware.cis.task_client.Progress
) – The progress info of this deployment task. This attribute was added in vSphere API 6.7. This attribute is optional and it is only relevant when the value of#status
is one ofcom.vmware.cis.task_client.Status.RUNNING
,com.vmware.cis.task_client.Status.BLOCKED
,com.vmware.cis.task_client.Status.SUCCEEDED
, orcom.vmware.cis.task_client.Status.FAILED
. - result (
com.vmware.vcenter.deployment_client.Notifications
orNone
) – Result of the task. This attribute was added in vSphere API 6.7. This attribute will be None if result is not available at the current step of the task. - description (
com.vmware.vapi.std_client.LocalizableMessage
) – Description of the operation associated with the task. - service (
str
) – Identifier of the service containing the operation. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.vapi.service
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.vapi.service
. - operation (
str
) – Identifier of the operation associated with the task. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.vapi.operation
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.vapi.operation
. - parent (
str
orNone
) – Parent of the current task. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.cis.task
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.cis.task
. This attribute will be None if the task has no parent. - target (
com.vmware.vapi.std_client.DynamicID
orNone
) – Identifier of the target created by the operation or an existing one the operation performed on. This attribute will be None if the operation has no target or multiple targets. - status (
com.vmware.cis.task_client.Status
) – Status of the operation associated with the task. - cancelable (
bool
) – Flag to indicate whether or not the operation can be cancelled. The value may change as the operation progresses. - error (
Exception
orNone
) – Description of the error if the operation status is “FAILED”. If None the description of why the operation failed will be included in the result of the operation (seecom.vmware.cis.task_client.Info.result
). - start_time (
datetime.datetime
) – Time when the operation is started. This attribute is optional and it is only relevant when the value ofstatus
is one ofcom.vmware.cis.task_client.Status.RUNNING
,com.vmware.cis.task_client.Status.BLOCKED
,com.vmware.cis.task_client.Status.SUCCEEDED
, orcom.vmware.cis.task_client.Status.FAILED
. - end_time (
datetime.datetime
) – Time when the operation is completed. This attribute is optional and it is only relevant when the value ofstatus
is one ofcom.vmware.cis.task_client.Status.SUCCEEDED
orcom.vmware.cis.task_client.Status.FAILED
. - user (
str
orNone
) – Name of the user who performed the operation. This attribute will be None if the operation is performed by the system.
- progress (
-
get
()¶ Get the current status of the appliance deployment. This method was added in vSphere API 6.7.
Return type: Deployment.Info
Returns: Info structure containing the status information about the appliance. Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the caller is not authenticated.Raise: com.vmware.vapi.std.errors_client.NotFound
if appliance state cannot be determined.
-
rollback
()¶ Rollback a failed appliance so it can be configured once again. This method was added in vSphere API 6.7.
Raise: com.vmware.vapi.std.errors_client.Unsupported
if the appliance is not in FAILED state.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the caller is not authenticated.
-
class
-
class
com.vmware.vcenter_client.
Folder
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
The Folder class provides methods for manipulating a vCenter Server folder.
Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
class
FilterSpec
(folders=None, names=None, type=None, parent_folders=None, datacenters=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Folder.FilterSpec
class contains attributes used to filter the results when listing folders (seeFolder.list()
). If multiple attributes are specified, only folders matching all of the attributes match the filter.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - folders (
set
ofstr
orNone
) – Identifiers of folders that can match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:Folder
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:Folder
. If None or empty, folders with any identifier match the filter. - names (
set
ofstr
orNone
) – Names that folders must have to match the filter (seeFolder.Summary.name
). If None or empty, folders with any name match the filter. - type (
Folder.Type
orNone
) – Type that folders must have to match the filter (seeFolder.Summary.type
). If None, folders with any type match the filter. - parent_folders (
set
ofstr
orNone
) – Folders that must contain the folder for the folder to match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:Folder
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:Folder
. If None or empty, folder in any folder match the filter. - datacenters (
set
ofstr
orNone
) – Datacenters that must contain the folder for the folder to match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:Datacenter
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:Datacenter
. If None or empty, folder in any datacenter match the filter.
- folders (
-
RESOURCE_TYPE
= 'Folder'¶ The resource type for the vCenter folder
-
class
Summary
(folder=None, name=None, type=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Folder.Summary
class contains commonly used information about a folder.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - folder (
str
) – Identifier of the folder. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:Folder
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:Folder
. - name (
str
) – Name of the vCenter Server folder. - type (
Folder.Type
) – Type (DATACENTER, DATASTORE, HOST, NETWORK, VIRTUAL_MACHINE) of the vCenter Server folder.
- folder (
-
class
Type
(string)¶ Bases:
vmware.vapi.bindings.enum.Enum
The
Folder.Type
class defines the type of a vCenter Server folder. The type of a folder determines what what kinds of children can be contained in the folder.Note
This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page.
Parameters: string ( str
) – String value for theType
instance.-
DATACENTER
= Type(string='DATACENTER')¶ A folder that can contain datacenters.
-
DATASTORE
= Type(string='DATASTORE')¶ A folder that can contain datastores.
-
HOST
= Type(string='HOST')¶ A folder that can contain compute resources (hosts and clusters).
-
NETWORK
= Type(string='NETWORK')¶ A folder that can contain networkds.
-
VIRTUAL_MACHINE
= Type(string='VIRTUAL_MACHINE')¶ A folder that can contain virtual machines.
-
-
list
(filter=None)¶ Returns information about at most 1000 visible (subject to permission checks) folders in vCenter matching the
Folder.FilterSpec
.Parameters: filter ( Folder.FilterSpec
orNone
) – Specification of matching folders for which information should be returned. If None, the behavior is equivalent to aFolder.FilterSpec
with all attributes None which means all folders match the filter.Return type: list
ofFolder.Summary
Returns: Commonly used information about the folders matching the Folder.FilterSpec
.Raise: com.vmware.vapi.std.errors_client.InvalidArgument
if theFolder.FilterSpec.type
attribute contains a value that is not supported by the server.Raise: com.vmware.vapi.std.errors_client.UnableToAllocateResource
if more than 1000 folders match theFolder.FilterSpec
.Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if the system is unable to communicate with a service to complete the request.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have the required privileges.
-
class
-
class
com.vmware.vcenter_client.
Host
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
The
Host
class provides methods to manage hosts in the vCenter Server.Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
class
ConnectionState
(string)¶ Bases:
vmware.vapi.bindings.enum.Enum
The
Host.ConnectionState
class defines the connection status of a host.Note
This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page.
Parameters: string ( str
) – String value for theConnectionState
instance.-
CONNECTED
= ConnectionState(string='CONNECTED')¶ Host is connected to the vCenter Server
-
DISCONNECTED
= ConnectionState(string='DISCONNECTED')¶ Host is disconnected from the vCenter Server
-
NOT_RESPONDING
= ConnectionState(string='NOT_RESPONDING')¶ VirtualCenter is not receiving heartbeats from the server. The state automatically changes to connected once heartbeats are received again.
-
-
class
CreateSpec
(hostname=None, port=None, user_name=None, password=None, folder=None, thumbprint_verification=None, thumbprint=None, force_add=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Host.CreateSpec
class defines the information used to create a host.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - hostname (
str
) – The IP address or DNS resolvable name of the host. - port (
long
orNone
) – The port of the host. If None, port 443 will be used. - user_name (
str
) – The administrator account on the host. - password (
str
) – The password for the administrator account on the host. - folder (
str
orNone
) – Host and cluster folder in which the new standalone host should be created. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:Folder
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:Folder
. This attribute is currently required. In the future, if this attribute is None, the system will attempt to choose a suitable folder for the host; if a folder cannot be chosen, the host creation operation will fail. - thumbprint_verification (
Host.CreateSpec.ThumbprintVerification
) – Type of host’s SSL certificate verification to be done. - thumbprint (
str
) – The thumbprint of the SSL certificate, which the host is expected to have. The thumbprint is always computed using the SHA1 hash and is the string representation of that hash in the format: xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx where, ‘x’ represents a hexadecimal digit. This attribute is optional and it is only relevant when the value ofthumbprintVerification
isHost.CreateSpec.ThumbprintVerification.THUMBPRINT
. - force_add (
bool
orNone
) – Whether host should be added to the vCenter Server even if it is being managed by another vCenter Server. The original vCenterServer loses connection to the host. If None, forceAdd is default to false.
-
class
ThumbprintVerification
(string)¶ Bases:
vmware.vapi.bindings.enum.Enum
The
Host.CreateSpec.ThumbprintVerification
class defines the thumbprint verification schemes for a host’s SSL certificate.Note
This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page.
Parameters: string ( str
) – String value for theThumbprintVerification
instance.-
NONE
= ThumbprintVerification(string='NONE')¶ Accept the host’s thumbprint without verifying it.
-
THUMBPRINT
= ThumbprintVerification(string='THUMBPRINT')¶ Host’s SSL certificate verified by checking its thumbprint against the specified thumbprint.
-
- hostname (
-
class
FilterSpec
(hosts=None, names=None, folders=None, datacenters=None, standalone=None, clusters=None, connection_states=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Host.FilterSpec
class contains attributes used to filter the results when listing hosts (seeHost.list()
). If multiple attributes are specified, only hosts matching all of the attributes match the filter.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - hosts (
set
ofstr
orNone
) – Identifiers of hosts that can match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:HostSystem
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:HostSystem
. If None or empty, hosts with any identifier match the filter. - names (
set
ofstr
orNone
) – Names that hosts must have to match the filter (seeHost.Summary.name
). If None or empty, hosts with any name match the filter. - folders (
set
ofstr
orNone
) – Folders that must contain the hosts for the hosts to match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:Folder
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:Folder
. If None or empty, hosts in any folder match the filter. - datacenters (
set
ofstr
orNone
) – Datacenters that must contain the hosts for the hosts to match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:Datacenter
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:Datacenter
. If None or empty, hosts in any datacenter match the filter. - standalone (
bool
orNone
) – If true, only hosts that are not part of a cluster can match the filter, and if false, only hosts that are are part of a cluster can match the filter. If None Hosts can match filter independent of whether they are part of a cluster or not. If this field is true andHost.FilterSpec.clusters
os not empty, no hosts will match the filter. - clusters (
set
ofstr
orNone
) – Clusters that must contain the hosts for the hosts to match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:ClusterComputeResource
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:ClusterComputeResource
. If None or empty, hosts in any cluster and hosts that are not in a cluster match the filter. If this attribute is not empty andHost.FilterSpec.standalone
is true, no hosts will match the filter. - connection_states (
set
ofHost.ConnectionState
orNone
) – Connection states that a host must be in to match the filter (seeHost.Summary.connection_state
. If None or empty, hosts in any connection state match the filter.
- hosts (
-
class
PowerState
(string)¶ Bases:
vmware.vapi.bindings.enum.Enum
The
Host.PowerState
class defines the power states of a host.Note
This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page.
Parameters: string ( str
) – String value for thePowerState
instance.-
POWERED_OFF
= PowerState(string='POWERED_OFF')¶ The host was specifically powered off by the user through vCenter server. This state is not a cetain state, because after vCenter server issues the command to power off the host, the host might crash, or kill all the processes but fail to power off.
-
POWERED_ON
= PowerState(string='POWERED_ON')¶ The host is powered on. A host that is entering standby mode is also in this state.
-
STANDBY
= PowerState(string='STANDBY')¶ The host was specifically put in standby mode, either explicitly by the user, or automatically by DPM. This state is not a cetain state, because after VirtualCenter issues the command to put the host in standby state, the host might crash, or kill all the processes but fail to enter standby mode. A host that is exiting standby mode is also in this state.
-
-
RESOURCE_TYPE
= 'HostSystem'¶ The resource type for the vCenter Host.
-
class
Summary
(host=None, name=None, connection_state=None, power_state=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Host.Summary
class contains commonly used information about a host in vCenter Server.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - host (
str
) – Identifier of the host. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:HostSystem
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:HostSystem
. - name (
str
) – Name of the host. - connection_state (
Host.ConnectionState
) – Connection status of the host - power_state (
Host.PowerState
) – Power state of the host This attribute is optional and it is only relevant when the value ofconnectionState
isHost.ConnectionState.CONNECTED
.
- host (
-
connect
(host)¶ Connect to the host corresponding to
host
previously added to the vCenter server.Parameters: host ( str
) – Identifier of the host to be reconnected. The parameter must be an identifier for the resource type:HostSystem
.Raise: com.vmware.vapi.std.errors_client.AlreadyInDesiredState
if the host associated withhost
is already connected.Raise: com.vmware.vapi.std.errors_client.Error
if the system reports an error while responding to the request.Raise: com.vmware.vapi.std.errors_client.NotFound
if there is no host associated withhost
in the system.Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if the system is unable to communicate with a service to complete the request.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have the required privileges.
-
create
(spec)¶ Add a new standalone host in the vCenter inventory. The newly connected host will be in connected state. The vCenter Server will verify the SSL certificate before adding the host to its inventory. In the case where the SSL certificate cannot be verified because the Certificate Authority is not recognized or the certificate is self signed, the vCenter Server will fall back to thumbprint verification mode as defined by
Host.CreateSpec.ThumbprintVerification
.Parameters: spec ( Host.CreateSpec
) – Specification for the new host to be created.Return type: str
Returns: The newly created identifier of the host in vCenter. The return value will be an identifier for the resource type: HostSystem
.Raise: com.vmware.vapi.std.errors_client.AlreadyExists
if the host with the same name is already present.Raise: com.vmware.vapi.std.errors_client.Error
if installation of VirtualCenter agent on a host fails.Raise: com.vmware.vapi.std.errors_client.Error
if the system reports an error while responding to the request.Raise: com.vmware.vapi.std.errors_client.InvalidArgument
if the host name is invalid.Raise: com.vmware.vapi.std.errors_client.InvalidArgument
if the host folder is invalid.Raise: com.vmware.vapi.std.errors_client.InvalidArgument
if the SSL thumbprint specified is invalid.Raise: com.vmware.vapi.std.errors_client.InvalidElementType
if the host folder id does not support vSphere compute resource as its children type.Raise: com.vmware.vapi.std.errors_client.NotFound
if there is no folder associated with thefolder
attribute in the system.Raise: com.vmware.vapi.std.errors_client.ResourceInUse
if the host is already being managed by another vCenter ServerRaise: com.vmware.vapi.std.errors_client.UnableToAllocateResource
if there are not enough licenses to add the host.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the user name or password for the administration account on the host are invalid.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.Raise: com.vmware.vapi.std.errors_client.Unsupported
if the software version on the host is not supported.Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if the system is unable to communicate with a service to complete the request.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have the required privileges.
-
delete
(host)¶ Remove a standalone host from the vCenter Server.
Parameters: host ( str
) – Identifier of the host to be deleted. The parameter must be an identifier for the resource type:HostSystem
.Raise: com.vmware.vapi.std.errors_client.Error
if the system reports an error while responding to the request.Raise: com.vmware.vapi.std.errors_client.NotFound
if there is no host associated withhost
in the system.Raise: com.vmware.vapi.std.errors_client.ResourceInUse
if the host associated withhost
is in a vCenter clusterRaise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if the system is unable to communicate with a service to complete the request.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have the required privileges.
-
disconnect
(host)¶ Disconnect the host corresponding to
host
from the vCenter serverParameters: host ( str
) – Identifier of the host to be disconnected. The parameter must be an identifier for the resource type:HostSystem
.Raise: com.vmware.vapi.std.errors_client.AlreadyInDesiredState
if the host associated withhost
is already disconnected.Raise: com.vmware.vapi.std.errors_client.Error
if the system reports an error while responding to the request.Raise: com.vmware.vapi.std.errors_client.NotFound
if there is no host associated withhost
in the system.Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if the system is unable to communicate with a service to complete the request.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have the required privileges.
-
list
(filter=None)¶ Returns information about at most 1000 visible (subject to permission checks) hosts in vCenter matching the
Host.FilterSpec
.Parameters: filter ( Host.FilterSpec
orNone
) – Specification of matching hosts for which information should be returned. If None, the behavior is equivalent to aHost.FilterSpec
with all attributes None which means all hosts match the filter.Return type: list
ofHost.Summary
Returns: Commonly used information about the hosts matching the Host.FilterSpec
.Raise: com.vmware.vapi.std.errors_client.InvalidArgument
if theHost.FilterSpec.connection_states
attribute contains a value that is not supported by the server.Raise: com.vmware.vapi.std.errors_client.UnableToAllocateResource
if more than 1000 hosts match theHost.FilterSpec
.Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if the system is unable to communicate with a service to complete the request.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have the required privileges.
-
class
-
class
com.vmware.vcenter_client.
Network
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
The Network class provides methods for manipulating a vCenter Server network.
Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
class
FilterSpec
(networks=None, names=None, types=None, folders=None, datacenters=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Network.FilterSpec
class contains attributes used to filter the results when listing networks (seeNetwork.list()
). If multiple attributes are specified, only networks matching all of the attributes match the filter.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - networks (
set
ofstr
orNone
) – Identifiers of networks that can match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:Network
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:Network
. If None or empty, networks with any identifier match the filter. - names (
set
ofstr
orNone
) – Names that networks must have to match the filter (seeNetwork.Summary.name
). If None or empty, networks with any name match the filter. - types (
set
ofNetwork.Type
orNone
) – Types that networks must have to match the filter (seeNetwork.Summary.type
). If None, networks with any type match the filter. - folders (
set
ofstr
orNone
) – Folders that must contain the network for the network to match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:Folder
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:Folder
. If None or empty, networks in any folder match the filter. - datacenters (
set
ofstr
orNone
) – Datacenters that must contain the network for the network to match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:Datacenter
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:Datacenter
. If None or empty, networks in any datacenter match the filter.
- networks (
-
RESOURCE_TYPE
= 'Network'¶ The resource type for the vCenter network
-
class
Summary
(network=None, name=None, type=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
Network.Summary
class contains commonly used information about a network.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - network (
str
) – Identifier of the network. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:Network
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:Network
. - name (
str
) – Name of the network. - type (
Network.Type
) – Type (STANDARD_PORTGROUP, DISTRIBUTED_PORTGROUP, OPAQUE_NETWORK) of the vCenter Server network.
- network (
-
class
Type
(string)¶ Bases:
vmware.vapi.bindings.enum.Enum
The
Network.Type
class defines the type of a vCenter Server network. The type of a network can be used to determine what features it supports and which APIs can be used to find more information about the network or change its configuration.Note
This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new values. To use new values of the enumerated type in communication with a server that supports the newer version of the API, you instantiate this class. See enumerated type description page.
Parameters: string ( str
) – String value for theType
instance.-
DISTRIBUTED_PORTGROUP
= Type(string='DISTRIBUTED_PORTGROUP')¶ XXX: vCenter based (create and managed through vCenter)
-
OPAQUE_NETWORK
= Type(string='OPAQUE_NETWORK')¶ A network for whose configuration is managed outside of vSphere. The identifer and name of the network is made available through vSphere so that host and virtual machine virtual ethernet devices can connect to them.
-
STANDARD_PORTGROUP
= Type(string='STANDARD_PORTGROUP')¶ XXX: ESX based (created and managed on ESX)
-
-
list
(filter=None)¶ Returns information about at most 1000 visible (subject to permission checks) networks in vCenter matching the
Network.FilterSpec
.Parameters: filter ( Network.FilterSpec
orNone
) – Specification of matching networks for which information should be returned. If None, the behavior is equivalent to aNetwork.FilterSpec
with all attributes None which means all networks match the filter.Return type: list
ofNetwork.Summary
Returns: Commonly used information about the networks matching the Network.FilterSpec
.Raise: com.vmware.vapi.std.errors_client.InvalidArgument
if theNetwork.FilterSpec.types
attribute contains a value that is not supported by the server.Raise: com.vmware.vapi.std.errors_client.UnableToAllocateResource
if more than 1000 networks match theNetwork.FilterSpec
.Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if the system is unable to communicate with a service to complete the request.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have the required privileges.
-
class
-
class
com.vmware.vcenter_client.
ResourcePool
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
The ResourcePool class provides methods for manipulating a vCenter Server resource pool.
This class does not include virtual appliances in the inventory of resource pools even though part of the behavior of a virtual appliance is to act like a resource pool.
Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
class
FilterSpec
(resource_pools=None, names=None, parent_resource_pools=None, datacenters=None, hosts=None, clusters=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
ResourcePool.FilterSpec
class contains attributes used to filter the results when listing resource pools (seeResourcePool.list()
). If multiple attributes are specified, only resource pools matching all of the attributes match the filter.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - resource_pools (
set
ofstr
orNone
) – Identifiers of resource pools that can match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:ResourcePool
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:ResourcePool
. If None or empty, resource pools with any identifier match the filter. - names (
set
ofstr
orNone
) – Names that resource pools must have to match the filter (seeResourcePool.Info.name
). If None or empty, resource pools with any name match the filter. - parent_resource_pools (
set
ofstr
orNone
) – Resource pools that must contain the resource pool for the resource pool to match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:ResourcePool
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:ResourcePool
. If None or empty, resource pools in any resource pool match the filter. - datacenters (
set
ofstr
orNone
) – Datacenters that must contain the resource pool for the resource pool to match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:Datacenter
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:Datacenter
. If None or empty, resource pools in any datacenter match the filter. - hosts (
set
ofstr
orNone
) – Hosts that must contain the resource pool for the resource pool to match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:HostSystem
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:HostSystem
. If None or empty, resource pools in any host match the filter. - clusters (
set
ofstr
orNone
) – Clusters that must contain the resource pool for the resource pool to match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:ClusterComputeResource
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:ClusterComputeResource
. If None or empty, resource pools in any cluster match the filter.
- resource_pools (
-
class
Info
(name=None, resource_pools=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
ResourcePool.Info
class contains information about a resource pool.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - name (
str
) – Name of the vCenter Server resource pool. - resource_pools (
set
ofstr
) – Identifiers of the child resource pools contained in this resource pool. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:ResourcePool
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:ResourcePool
.
- name (
-
RESOURCE_TYPE
= 'ResourcePool'¶ The resource type for the vCenter resource pool
-
class
Summary
(resource_pool=None, name=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
ResourcePool.Summary
class contains commonly used information about a resource pool in vCenter Server.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - resource_pool (
str
) – Identifier of the resource pool. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:ResourcePool
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:ResourcePool
. - name (
str
) – Name of the resource pool.
- resource_pool (
-
get
(resource_pool)¶ Retrieves information about the resource pool indicated by
resource_pool
.Parameters: resource_pool ( str
) – Identifier of the resource pool for which information should be retrieved. The parameter must be an identifier for the resource type:ResourcePool
.Return type: ResourcePool.Info
Returns: information about the resource pool. Raise: com.vmware.vapi.std.errors_client.NotFound
if the resource pool indicated byresource_pool
does not exist.Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if the system is unable to communicate with a service to complete the request.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have the required privileges.
-
list
(filter=None)¶ Returns information about at most 1000 visible (subject to permission checks) resource pools in vCenter matching the
ResourcePool.FilterSpec
.Parameters: filter ( ResourcePool.FilterSpec
orNone
) – Specification of matching resource pools for which information should be returned. If None, the behavior is equivalent to aResourcePool.FilterSpec
with all attributes None which means all resource pools match the filter.Return type: list
ofResourcePool.Summary
Returns: Commonly used information about the resource pools matching the ResourcePool.FilterSpec
.Raise: com.vmware.vapi.std.errors_client.UnableToAllocateResource
if more than 1000 resource pools match theResourcePool.FilterSpec
.Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if the system is unable to communicate with a service to complete the request.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have the required privileges.
-
class
-
class
com.vmware.vcenter_client.
StubFactory
(stub_config)¶ Bases:
vmware.vapi.bindings.stub.StubFactoryBase
Initialize StubFactoryBase
Parameters: stub_config ( vmware.vapi.bindings.stub.StubConfiguration
) – Stub config instance
-
class
com.vmware.vcenter_client.
VM
(config)¶ Bases:
vmware.vapi.bindings.stub.VapiInterface
The
VM
class provides methods for managing the lifecycle of a virtual machine.Parameters: config ( vmware.vapi.bindings.stub.StubConfiguration
) – Configuration to be used for creating the stub.-
class
CreateSpec
(guest_os=None, name=None, placement=None, hardware_version=None, boot=None, boot_devices=None, cpu=None, memory=None, disks=None, nics=None, cdroms=None, floppies=None, parallel_ports=None, serial_ports=None, sata_adapters=None, scsi_adapters=None, storage_policy=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
Document-based creation spec.
Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - guest_os (
com.vmware.vcenter.vm_client.GuestOS
) – Guest OS. - name (
str
orNone
) – Virtual machine name. If None, a default name will be generated by the server. - placement (
VM.PlacementSpec
orNone
) – Virtual machine placement information. This attribute is currently required. In the future, if this attribute is None, the system will attempt to choose suitable resources on which to place the virtual machine. - hardware_version (
com.vmware.vcenter.vm_client.Hardware.Version
orNone
) – Virtual hardware version. If None, defaults to the most recent version supported by the server. - boot (
com.vmware.vcenter.vm.hardware_client.Boot.CreateSpec
orNone
) – Boot configuration. If None, guest-specific default values will be used. - boot_devices (
list
ofcom.vmware.vcenter.vm.hardware.boot_client.Device.EntryCreateSpec
orNone
) – Boot device configuration. If None, a server-specific boot sequence will be used. - cpu (
com.vmware.vcenter.vm.hardware_client.Cpu.UpdateSpec
orNone
) – CPU configuration. If None, guest-specific default values will be used. - memory (
com.vmware.vcenter.vm.hardware_client.Memory.UpdateSpec
orNone
) – Memory configuration. If None, guest-specific default values will be used. - disks (
list
ofcom.vmware.vcenter.vm.hardware_client.Disk.CreateSpec
orNone
) – List of disks. If None, a single blank virtual disk of a guest-specific size will be created on the same storage as the virtual machine configuration, and will use a guest-specific host bus adapter type. If the guest-specific size is 0, no virtual disk will be created. - nics (
list
ofcom.vmware.vcenter.vm.hardware_client.Ethernet.CreateSpec
orNone
) – List of Ethernet adapters. If None, no Ethernet adapters will be created. - cdroms (
list
ofcom.vmware.vcenter.vm.hardware_client.Cdrom.CreateSpec
orNone
) – List of CD-ROMs. If None, no CD-ROM devices will be created. - floppies (
list
ofcom.vmware.vcenter.vm.hardware_client.Floppy.CreateSpec
orNone
) – List of floppy drives. If None, no floppy drives will be created. - parallel_ports (
list
ofcom.vmware.vcenter.vm.hardware_client.Parallel.CreateSpec
orNone
) – List of parallel ports. If None, no parallel ports will be created. - serial_ports (
list
ofcom.vmware.vcenter.vm.hardware_client.Serial.CreateSpec
orNone
) – List of serial ports. If None, no serial ports will be created. - sata_adapters (
list
ofcom.vmware.vcenter.vm.hardware.adapter_client.Sata.CreateSpec
orNone
) – List of SATA adapters. If None, any adapters necessary to connect the virtual machine’s storage devices will be created; this includes any devices that explicitly specify a SATA host bus adapter, as well as any devices that do not specify a host bus adapter if the guest’s preferred adapter type is SATA. - scsi_adapters (
list
ofcom.vmware.vcenter.vm.hardware.adapter_client.Scsi.CreateSpec
orNone
) – List of SCSI adapters. If None, any adapters necessary to connect the virtual machine’s storage devices will be created; this includes any devices that explicitly specify a SCSI host bus adapter, as well as any devices that do not specify a host bus adapter if the guest’s preferred adapter type is SCSI. The type of the SCSI adapter will be a guest-specific default type. - storage_policy (
VM.StoragePolicySpec
orNone
) – TheVM.StoragePolicySpec
class contains information about the storage policy that is to be associated with the virtual machine home (which contains the configuration and log files). This attribute was added in vSphere API 6.7. If None the datastore default storage policy (if applicable) is applied. Currently a default storage policy is only supported by object datastores : VVol and vSAN. For non-object datastores, if None then no storage policy would be associated with the virtual machine home.
- guest_os (
-
class
FilterSpec
(vms=None, names=None, folders=None, datacenters=None, hosts=None, clusters=None, resource_pools=None, power_states=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
VM.FilterSpec
class contains attributes used to filter the results when listing virtual machines (seeVM.list()
). If multiple attributes are specified, only virtual machines matching all of the attributes match the filter.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - vms (
set
ofstr
orNone
) – Identifiers of virtual machines that can match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:VirtualMachine
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:VirtualMachine
. If None or empty, virtual machines with any identifier match the filter. - names (
set
ofstr
orNone
) – Names that virtual machines must have to match the filter (seeVM.Info.name
). If None or empty, virtual machines with any name match the filter. - folders (
set
ofstr
orNone
) – Folders that must contain the virtual machine for the virtual machine to match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:Folder
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:Folder
. If None or empty, virtual machines in any folder match the filter. - datacenters (
set
ofstr
orNone
) – Datacenters that must contain the virtual machine for the virtual machine to match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:Datacenter
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:Datacenter
. If None or empty, virtual machines in any datacenter match the filter. - hosts (
set
ofstr
orNone
) – Hosts that must contain the virtual machine for the virtual machine to match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:HostSystem
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:HostSystem
. If None or empty, virtual machines on any host match the filter. - clusters (
set
ofstr
orNone
) – Clusters that must contain the virtual machine for the virtual machine to match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:ClusterComputeResource
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:ClusterComputeResource
. If None or empty, virtual machines in any cluster match the filter. - resource_pools (
set
ofstr
orNone
) – Resource pools that must contain the virtual machine for the virtual machine to match the filter. When clients pass a value of this class as a parameter, the attribute must contain identifiers for the resource type:ResourcePool
. When methods return a value of this class as a return value, the attribute will contain identifiers for the resource type:ResourcePool
. If None or empty, virtual machines in any resource pool match the filter. - power_states (
set
ofcom.vmware.vcenter.vm_client.Power.State
orNone
) – Power states that a virtual machine must be in to match the filter (seecom.vmware.vcenter.vm_client.Power.Info.state
. If None or empty, virtual machines in any power state match the filter.
- vms (
-
class
Info
(guest_os=None, name=None, power_state=None, hardware=None, boot=None, boot_devices=None, cpu=None, memory=None, disks=None, nics=None, cdroms=None, floppies=None, parallel_ports=None, serial_ports=None, sata_adapters=None, scsi_adapters=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
Document-based info.
Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - guest_os (
com.vmware.vcenter.vm_client.GuestOS
) – Guest OS. - name (
str
) – Virtual machine name. - power_state (
com.vmware.vcenter.vm_client.Power.State
) – Power state of the virtual machine. - hardware (
com.vmware.vcenter.vm_client.Hardware.Info
) – Virtual hardware version information. - boot (
com.vmware.vcenter.vm.hardware_client.Boot.Info
) – Boot configuration. - boot_devices (
list
ofcom.vmware.vcenter.vm.hardware.boot_client.Device.Entry
) – Boot device configuration. If thelist
has no entries, a server-specific default boot sequence is used. - cpu (
com.vmware.vcenter.vm.hardware_client.Cpu.Info
) – CPU configuration. - memory (
com.vmware.vcenter.vm.hardware_client.Memory.Info
) – Memory configuration. - disks (
dict
ofstr
andcom.vmware.vcenter.vm.hardware_client.Disk.Info
) – List of disks. When clients pass a value of this class as a parameter, the key in the attributedict
must be an identifier for the resource type:com.vmware.vcenter.vm.hardware.Disk
. When methods return a value of this class as a return value, the key in the attributedict
will be an identifier for the resource type:com.vmware.vcenter.vm.hardware.Disk
. - nics (
dict
ofstr
andcom.vmware.vcenter.vm.hardware_client.Ethernet.Info
) – List of Ethernet adapters. When clients pass a value of this class as a parameter, the key in the attributedict
must be an identifier for the resource type:com.vmware.vcenter.vm.hardware.Ethernet
. When methods return a value of this class as a return value, the key in the attributedict
will be an identifier for the resource type:com.vmware.vcenter.vm.hardware.Ethernet
. - cdroms (
dict
ofstr
andcom.vmware.vcenter.vm.hardware_client.Cdrom.Info
) – List of CD-ROMs. When clients pass a value of this class as a parameter, the key in the attributedict
must be an identifier for the resource type:com.vmware.vcenter.vm.hardware.Cdrom
. When methods return a value of this class as a return value, the key in the attributedict
will be an identifier for the resource type:com.vmware.vcenter.vm.hardware.Cdrom
. - floppies (
dict
ofstr
andcom.vmware.vcenter.vm.hardware_client.Floppy.Info
) – List of floppy drives. When clients pass a value of this class as a parameter, the key in the attributedict
must be an identifier for the resource type:com.vmware.vcenter.vm.hardware.Floppy
. When methods return a value of this class as a return value, the key in the attributedict
will be an identifier for the resource type:com.vmware.vcenter.vm.hardware.Floppy
. - parallel_ports (
dict
ofstr
andcom.vmware.vcenter.vm.hardware_client.Parallel.Info
) – List of parallel ports. When clients pass a value of this class as a parameter, the key in the attributedict
must be an identifier for the resource type:com.vmware.vcenter.vm.hardware.ParallelPort
. When methods return a value of this class as a return value, the key in the attributedict
will be an identifier for the resource type:com.vmware.vcenter.vm.hardware.ParallelPort
. - serial_ports (
dict
ofstr
andcom.vmware.vcenter.vm.hardware_client.Serial.Info
) – List of serial ports. When clients pass a value of this class as a parameter, the key in the attributedict
must be an identifier for the resource type:com.vmware.vcenter.vm.hardware.SerialPort
. When methods return a value of this class as a return value, the key in the attributedict
will be an identifier for the resource type:com.vmware.vcenter.vm.hardware.SerialPort
. - sata_adapters (
dict
ofstr
andcom.vmware.vcenter.vm.hardware.adapter_client.Sata.Info
) – List of SATA adapters. When clients pass a value of this class as a parameter, the key in the attributedict
must be an identifier for the resource type:com.vmware.vcenter.vm.hardware.SataAdapter
. When methods return a value of this class as a return value, the key in the attributedict
will be an identifier for the resource type:com.vmware.vcenter.vm.hardware.SataAdapter
. - scsi_adapters (
dict
ofstr
andcom.vmware.vcenter.vm.hardware.adapter_client.Scsi.Info
) – List of SCSI adapters. When clients pass a value of this class as a parameter, the key in the attributedict
must be an identifier for the resource type:com.vmware.vcenter.vm.hardware.ScsiAdapter
. When methods return a value of this class as a return value, the key in the attributedict
will be an identifier for the resource type:com.vmware.vcenter.vm.hardware.ScsiAdapter
.
- guest_os (
-
class
PlacementSpec
(folder=None, resource_pool=None, host=None, cluster=None, datastore=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
VM.PlacementSpec
class contains information used to place a virtual machine onto resources within the vCenter inventory.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - folder (
str
orNone
) – Virtual machine folder into which the virtual machine should be placed. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:Folder
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:Folder
. This attribute is currently required. In the future, if this attribute is None, the system will attempt to choose a suitable folder for the virtual machine; if a folder cannot be chosen, the virtual machine creation operation will fail. - resource_pool (
str
orNone
) – Resource pool into which the virtual machine should be placed. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:ResourcePool
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:ResourcePool
. This attribute is currently required if bothhost
andcluster
are None. In the future, if this attribute is None, the system will attempt to choose a suitable resource pool for the virtual machine; if a resource pool cannot be chosen, the virtual machine creation operation will fail. - host (
str
orNone
) –Host onto which the virtual machine should be placed.
If
host
andresourcePool
are both specified,resourcePool
must belong tohost
.If
host
andcluster
are both specified,host
must be a member ofcluster
. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:HostSystem
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:HostSystem
. This attribute may be None ifresourcePool
orcluster
is specified. If None, the system will attempt to choose a suitable host for the virtual machine; if a host cannot be chosen, the virtual machine creation operation will fail. - cluster (
str
orNone
) –Cluster into which the virtual machine should be placed.
If
cluster
andresourcePool
are both specified,resourcePool
must belong tocluster
.If
cluster
andhost
are both specified,host
must be a member ofcluster
. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:ClusterComputeResource
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:ClusterComputeResource
. IfresourcePool
orhost
is specified, it is recommended that this attribute be None. - datastore (
str
orNone
) – Datastore on which the virtual machine’s configuration state should be stored. This datastore will also be used for any virtual disks that are created as part of the virtual machine creation operation. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:Datastore
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:Datastore
. This attribute is currently required. In the future, if this attribute is None, the system will attempt to choose suitable storage for the virtual machine; if storage cannot be chosen, the virtual machine creation operation will fail.
- folder (
-
class
StoragePolicySpec
(policy=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
VM.StoragePolicySpec
class contains information about the storage policy to be associated with a virtual machine object. This class was added in vSphere API 6.7.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: policy ( str
) – Identifier of the storage policy which should be associated with the virtual machine. This attribute was added in vSphere API 6.7. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:com.vmware.vcenter.StoragePolicy
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:com.vmware.vcenter.StoragePolicy
.
-
class
Summary
(vm=None, name=None, power_state=None, cpu_count=None, memory_size_mib=None)¶ Bases:
vmware.vapi.bindings.struct.VapiStruct
The
VM.Summary
class contains commonly used information about a virtual machine.Tip
The arguments are used to initialize data attributes with the same names.
Parameters: - vm (
str
) – Identifier of the virtual machine. When clients pass a value of this class as a parameter, the attribute must be an identifier for the resource type:VirtualMachine
. When methods return a value of this class as a return value, the attribute will be an identifier for the resource type:VirtualMachine
. - name (
str
) – Name of the Virtual machine. - power_state (
com.vmware.vcenter.vm_client.Power.State
) – Power state of the virtual machine. - cpu_count (
long
orNone
) – Number of CPU cores. This attribute will be None if the virtual machine configuration is not available. For example, the configuration information would be unavailable if the server is unable to access the virtual machine files on disk, and is often also unavailable during the intial phases of virtual machine creation. - memory_size_mib (
long
orNone
) – Memory size in mebibytes. This attribute will be None if the virtual machine configuration is not available. For example, the configuration information would be unavailable if the server is unable to access the virtual machine files on disk, and is often also unavailable during the intial phases of virtual machine creation.
- vm (
-
create
(spec)¶ Creates a virtual machine.
Parameters: spec ( VM.CreateSpec
) – Virtual machine specification.Return type: str
Returns: ID of newly-created virtual machine. The return value will be an identifier for the resource type: VirtualMachine
.Raise: com.vmware.vapi.std.errors_client.AlreadyExists
if a virtual machine with the specified name already exists.Raise: com.vmware.vapi.std.errors_client.Error
if the system reports an error while responding to the request.Raise: com.vmware.vapi.std.errors_client.InvalidArgument
if any of the specified parameters are invalid.Raise: com.vmware.vapi.std.errors_client.NotFound
if any of the resources specified in spec could not be foundRaise: com.vmware.vapi.std.errors_client.ResourceInaccessible
if a specified resource (eg. host) is not accessible.Raise: com.vmware.vapi.std.errors_client.ResourceInUse
if any of the specified storage addresses (eg. IDE, SATA, SCSI) result in a storage address conflict.Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if the system is unable to communicate with a service to complete the request.Raise: com.vmware.vapi.std.errors_client.UnableToAllocateResource
if any of the resources needed to create the virtual machine could not be allocated.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have the required privileges.Raise: com.vmware.vapi.std.errors_client.Unsupported
ifguestOS
is not supported for the requested virtual hardware version and spec includes None attributes that default to guest-specific values.
-
delete
(vm)¶ Deletes a virtual machine.
Parameters: vm ( str
) – Virtual machine identifier. The parameter must be an identifier for the resource type:VirtualMachine
.Raise: com.vmware.vapi.std.errors_client.Error
if the system reports an error while responding to the request.Raise: com.vmware.vapi.std.errors_client.NotAllowedInCurrentState
if the virtual machine is running (powered on).Raise: com.vmware.vapi.std.errors_client.NotFound
if the virtual machine is not found.Raise: com.vmware.vapi.std.errors_client.ResourceBusy
if the virtual machine is busy performing another operation.Raise: com.vmware.vapi.std.errors_client.ResourceInaccessible
if the virtual machine’s configuration state cannot be accessed.Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if the system is unable to communicate with a service to complete the request.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have the required privileges.
-
get
(vm)¶ Returns information about a virtual machine.
Parameters: vm ( str
) – Virtual machine identifier. The parameter must be an identifier for the resource type:VirtualMachine
.Return type: VM.Info
Returns: Information about the specified virtual machine. Raise: com.vmware.vapi.std.errors_client.Error
if the system reports an error while responding to the request.Raise: com.vmware.vapi.std.errors_client.NotFound
if the virtual machine is not found.Raise: com.vmware.vapi.std.errors_client.ResourceInaccessible
if the virtual machine’s configuration state cannot be accessed.Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if the system is unable to communicate with a service to complete the request.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have the required privileges.
-
list
(filter=None)¶ Returns information about at most 1000 visible (subject to permission checks) virtual machines in vCenter matching the
VM.FilterSpec
.Parameters: filter ( VM.FilterSpec
orNone
) – Specification of matching virtual machines for which information should be returned. If None, the behavior is equivalent to aVM.FilterSpec
with all attributes None which means all virtual machines match the filter.Return type: list
ofVM.Summary
Returns: Commonly used information about the virtual machines matching the VM.FilterSpec
.Raise: com.vmware.vapi.std.errors_client.InvalidArgument
if theVM.FilterSpec.power_states
attribute contains a value that is not supported by the server.Raise: com.vmware.vapi.std.errors_client.UnableToAllocateResource
if more than 1000 virtual machines match theVM.FilterSpec
.Raise: com.vmware.vapi.std.errors_client.ServiceUnavailable
if the system is unable to communicate with a service to complete the request.Raise: com.vmware.vapi.std.errors_client.Unauthenticated
if the user can not be authenticated.Raise: com.vmware.vapi.std.errors_client.Unauthorized
if the user doesn’t have the required privileges.
-
class