Overview

VMware logo

PowerCLI Views for vSphere Reference - Core Classes

This document provides a reference of the VMware vSphere PowerCLI views and provides a list of the core classes.

PowerCLI provides a client-side framework that simplifies the programming effort associated with the vSphere APIs and server-side object model. It is a part of the VMware vSphere PowerCLI, which provides easy-to-use C# and PowerShell interface to vSphere APIs. Using vSphere PowerCLI you can create, customize, or manage vSphere inventory objects using vSphere APIs calls.

Send feedback | Technical Support | Copyright © 1998 - 2013 VMware, Inc. All rights reserved. Protected by one or more U.S. patents listed at http://www.vmware.com/go/patents.


Class List

Here are the classes, structs, unions and interfaces with brief descriptions:
VMware::Vim::CertificateErrorEventArg | Provides data for the CertificateError event
VMware::Vim::DynamicPropertyFilterSpecGenerator | Provides functionality for automatic generating of PropertyFilterSpec objects. /summary>
VMware::Vim::EntityViewBase | Base view class for the managed entity objects
VMware::Vim::ViewBase | Base class for the client-side types called Views. A View is populated with the currents state of a managed object
VMware::Vim::VimClient | Manages VI Web Service requests and it's responsible for maintaining sessions, login/logout, retrieving and searching views
VMware::Vim::VimException | A geneneral exception that is thrown when a non-fatal error occurs in the Vim APIs
VMware::Vim::ViReflectionCache | Provides reflection caching for performance optimization. /summary>
Copyright © 1998 - 2013 VMware, Inc. All rights reserved.


VMware::Vim::CertificateErrorEventArg Class Reference

Provides data for the CertificateError event. More...

List of all members.

Public Member Functions

CertificateErrorEventArg (X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors, bool ignoreError)
Initializes a new instance of the CertificateErrorEventArg class.
CertificateErrorEventArg (X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors, bool ignoreError, object sender)
Initializes a new instance of the CertificateErrorEventArg class.

Properties

object | Sender [get]
The sender of the remote certificate validation event.
X509Certificate | Certificate [get]
Gets the certificate used to authenticate the remote party.
X509Chain | Chain [get]
Get the chain of certificate authorities associated with the remote certificate.
SslPolicyErrors | SslPolicyErrors [get]
Get the errors associated with the remote certificate.
bool | IgnoreError [get, set]
Get or set a value indicating if the errors should be ignored.

Detailed Description

Provides data for the CertificateError event.

Constructor & Destructor Documentation

VMware::Vim::CertificateErrorEventArg::CertificateErrorEventArg | ( | X509Certificate | certificate,
 |  | X509Chain | chain,
 |  | SslPolicyErrors | sslPolicyErrors,
 |  | bool | ignoreError
 | ) |  |

Initializes a new instance of the CertificateErrorEventArg class.

Parameters:
certificate | The certificate used to authenticate the remote party.
chain | The chain of certificate authorities associated with the remote certificate.
sslPolicyErrors | One or more errors associated with the remote certificate.
ignoreError | A flag indicating if this error should be ignored.

VMware::Vim::CertificateErrorEventArg::CertificateErrorEventArg | ( | X509Certificate | certificate,
 |  | X509Chain | chain,
 |  | SslPolicyErrors | sslPolicyErrors,
 |  | bool | ignoreError,
 |  | object | sender
 | ) |  |

Initializes a new instance of the CertificateErrorEventArg class.

Parameters:
certificate | The certificate used to authenticate the remote party.
chain | The chain of certificate authorities associated with the remote certificate.
sslPolicyErrors | One or more errors associated with the remote certificate.
ignoreError | A flag indicating if this error should be ignored.
sender | The sender of the remote certificate validation event.

Property Documentation

object VMware::Vim::CertificateErrorEventArg::Sender [get]

The sender of the remote certificate validation event.

X509Certificate VMware::Vim::CertificateErrorEventArg::Certificate [get]

Gets the certificate used to authenticate the remote party.

X509Chain VMware::Vim::CertificateErrorEventArg::Chain [get]

Get the chain of certificate authorities associated with the remote certificate.

SslPolicyErrors VMware::Vim::CertificateErrorEventArg::SslPolicyErrors [get]

Get the errors associated with the remote certificate.

bool VMware::Vim::CertificateErrorEventArg::IgnoreError [get, set]

Get or set a value indicating if the errors should be ignored.


Member List

VMware::Vim::CertificateErrorEventArg Member List

This is the complete list of members for VMware::Vim::CertificateErrorEventArg, including all inherited members.

Certificate | VMware::Vim::CertificateErrorEventArg
CertificateErrorEventArg(X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors, bool ignoreError) | VMware::Vim::CertificateErrorEventArg
CertificateErrorEventArg(X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors, bool ignoreError, object sender) | VMware::Vim::CertificateErrorEventArg
Chain | VMware::Vim::CertificateErrorEventArg
IgnoreError | VMware::Vim::CertificateErrorEventArg
Sender | VMware::Vim::CertificateErrorEventArg
SslPolicyErrors | VMware::Vim::CertificateErrorEventArg


VMware::Vim::DynamicPropertyFilterSpecGenerator Class Reference

Provides functionality for automatic generating of PropertyFilterSpec objects. /summary>. More...

List of all members.

Detailed Description

Provides functionality for automatic generating of PropertyFilterSpec objects. /summary>.


Member List

VMware::Vim::DynamicPropertyFilterSpecGenerator Member List

This is the complete list of members for VMware::Vim::DynamicPropertyFilterSpecGenerator, including all inherited members.


VMware::Vim::EntityViewBase Class Reference

Base view class for the managed entity objects. More...

Inherited by VMware::Vim::ManagedEntity.

List of all members.

Public Member Functions

EntityViewBase (VimClient client, ManagedObjectReference moRef)
Creates an instance of an managed entity object's view.
TaskHistoryCollector | GetTaskCollectorView (TaskFilterSpecRecursionOption recursionOption, TaskFilterSpec taskFilterSpec)
Returns a task history collector, as a specialized history collector that provides TaskInfo objects.
TaskHistoryCollector | GetEntityOnlyTasksCollectorView (TaskFilterSpec taskFilterSpec)
Returns a task history collector, as a specialized history collector that provides TaskInfo objects.
TaskHistoryCollector | GetAllTasksView (TaskFilterSpec taskFilterSpec)
Returns a task history collector, as a specialized history collector that provides TaskInfo objects.
EventHistoryCollector | GetEventCollectorView (EventFilterSpecRecursionOption recursionOption, EventFilterSpec eventFilterSpec)
Returns an event history collector, which is a specialized history collector that provides Event objects.
EventHistoryCollector | GetEntityOnlyEventsCollectorView (EventFilterSpec eventFilterSpec)
Returns an event history collector, which is a specialized history collector that provides Event objects.
EventHistoryCollector | GetAllEventsView (EventFilterSpec eventFilterSpec)
Returns an event history collector, which is a specialized history collector that provides Event objects.

Static Public Member Functions

static PropertyFilterSpec | GetSearchFilterSpec (ManagedObjectReference beginEntity, PropertySpec propSpec)
Returns PropertyFilterSpec used for getting view's properties.
static PropertyFilterSpec | GetSearchFilterSpec (VimClient client, ManagedObjectReference beginEntity, PropertySpec propSpec)
Returns PropertyFilterSpec used for getting view's properties.

Detailed Description

Base view class for the managed entity objects.

Constructor & Destructor Documentation

VMware::Vim::EntityViewBase::EntityViewBase | ( | VimClient | client,
 |  | ManagedObjectReference | moRef
 | ) |  |

Creates an instance of an managed entity object's view.

Parameters:
client | VimClient object that manages connection to the Vim service
moRef | ManagedObjectReference of the entity object

Member Function Documentation

static PropertyFilterSpec VMware::Vim::EntityViewBase::GetSearchFilterSpec | ( | ManagedObjectReference | beginEntity,
 |  | PropertySpec | propSpec |
 | ) |  |  | [static]

Returns PropertyFilterSpec used for getting view's properties.

Parameters:
beginEntity | Managed object reference that specifies starting point for search (in context of inventory).
propSpec | PropertySpec that identifies properties to be returned from the managed objects

static PropertyFilterSpec VMware::Vim::EntityViewBase::GetSearchFilterSpec | ( | VimClient | client,
 |  | ManagedObjectReference | beginEntity,
 |  | PropertySpec | propSpec |
 | ) |  |  | [static]

Returns PropertyFilterSpec used for getting view's properties.

Parameters:
beginEntity | Managed object reference that specifies starting point for search (in context of inventory).
propSpec | PropertySpec that identifies properties to be returned from the managed objects

TaskHistoryCollector VMware::Vim::EntityViewBase::GetTaskCollectorView | ( | TaskFilterSpecRecursionOption | recursionOption,
 |  | TaskFilterSpec | taskFilterSpec
 | ) |  |

Returns a task history collector, as a specialized history collector that provides TaskInfo objects.

Parameters:
recursionOption | Specification of related managed entities in the inventory hierarchy
taskFilterSpec | The specification for the task query filter
Returns:
Task history collector with populated TaskInfo objects

TaskHistoryCollector VMware::Vim::EntityViewBase::GetEntityOnlyTasksCollectorView ( TaskFilterSpec taskFilterSpec )

Returns a task history collector, as a specialized history collector that provides TaskInfo objects.

Returns tasks that pertain only to the specified managed entity, and not its children.

Parameters:
taskFilterSpec The specification for the task query filter
Returns:
Task history collector with populated TaskInfo objects

TaskHistoryCollector VMware::Vim::EntityViewBase::GetAllTasksView ( TaskFilterSpec taskFilterSpec )

Returns a task history collector, as a specialized history collector that provides TaskInfo objects.

Parameters:
taskFilterSpec The specification for the task query filter
Returns tasks pertaining either to the specified managed entity or to its child entities.
Returns:
Task history collector with populated TaskInfo objects

EventHistoryCollector VMware::Vim::EntityViewBase::GetEventCollectorView | ( | EventFilterSpecRecursionOption | recursionOption,
 |  | EventFilterSpec | eventFilterSpec
 | ) |  |

Returns an event history collector, which is a specialized history collector that provides Event objects.

Parameters:
recursionOption | This option specifies how to select events based on child relationships in the inventory hierarchy. If a managed entity has children, their events can be retrieved with this filter option.
eventFilterSpec | The event query filter
Returns:
Event history collector with populated Event objects

EventHistoryCollector VMware::Vim::EntityViewBase::GetEntityOnlyEventsCollectorView ( EventFilterSpec eventFilterSpec )

Returns an event history collector, which is a specialized history collector that provides Event objects.

Returns events that pertain only to the specified managed entity, and not its children.

Parameters:
eventFilterSpec The event query filter
Returns:
Event history collector with populated Event objects

EventHistoryCollector VMware::Vim::EntityViewBase::GetAllEventsView ( EventFilterSpec eventFilterSpec )

Returns an event history collector, which is a specialized history collector that provides Event objects.

Returns events pertaining either to the specified managed entity or to its child entities.

Parameters:
eventFilterSpec The event query filter
Returns:
Event history collector with populated Event objects


Member List

VMware::Vim::EntityViewBase Member List

This is the complete list of members for VMware::Vim::EntityViewBase, including all inherited members.

EntityViewBase(VimClient client, ManagedObjectReference moRef) | VMware::Vim::EntityViewBase |
GetAllEventsView(EventFilterSpec eventFilterSpec) | VMware::Vim::EntityViewBase |
GetAllTasksView(TaskFilterSpec taskFilterSpec) | VMware::Vim::EntityViewBase |
GetEntityOnlyEventsCollectorView(EventFilterSpec eventFilterSpec) | VMware::Vim::EntityViewBase |
GetEntityOnlyTasksCollectorView(TaskFilterSpec taskFilterSpec) | VMware::Vim::EntityViewBase |
GetEventCollectorView(EventFilterSpecRecursionOption recursionOption, EventFilterSpec eventFilterSpec) | VMware::Vim::EntityViewBase |
GetSearchFilterSpec(ManagedObjectReference beginEntity, PropertySpec propSpec) | VMware::Vim::EntityViewBase | [static]
GetSearchFilterSpec(VimClient client, ManagedObjectReference beginEntity, PropertySpec propSpec) | VMware::Vim::EntityViewBase | [static]
GetTaskCollectorView(TaskFilterSpecRecursionOption recursionOption, TaskFilterSpec taskFilterSpec) | VMware::Vim::EntityViewBase |


VMware::Vim::ViReflectionCache Class Reference

Provides reflection caching for performance optimization. /summary>. More...

List of all members.

Static Public Member Functions

static PropertyInfo GetTypePropertyByName (Type type, string propName)

Detailed Description

Provides reflection caching for performance optimization. /summary>.

Member Function Documentation

static PropertyInfo VMware::Vim::ViReflectionCache::GetTypePropertyByName | ( | Type | type,
 |  | string | propName |
 | ) |  |  | [static]

Avoid using this in loops because it calls GetTypeProperties every time. Better call GetTypeProperties and then retrieve the desired value from the dictionary.


Member List

VMware::Vim::ViReflectionCache Member List

This is the complete list of members for VMware::Vim::ViReflectionCache, including all inherited members.

GetTypePropertyByName(Type type, string propName) VMware::Vim::ViReflectionCache [static]


VMware::Vim::ViewBase Class Reference

Base class for the client-side types called Views. A View is populated with the currents state of a managed object. More...

Inherited by VMware::Vim::AlarmManager, VMware::Vim::AuthorizationManager, VMware::Vim::CustomFieldsManager, VMware::Vim::CustomizationSpecManager, VMware::Vim::DatastoreNamespaceManager, VMware::Vim::DiagnosticManager, VMware::Vim::DistributedVirtualSwitchManager, VMware::Vim::EnvironmentBrowser, VMware::Vim::EventManager, VMware::Vim::ExtensibleManagedObject, VMware::Vim::ExtensionManager, VMware::Vim::FileManager, VMware::Vim::GuestAuthManager, VMware::Vim::GuestFileManager, VMware::Vim::GuestOperationsManager, VMware::Vim::GuestProcessManager, VMware::Vim::HistoryCollector, VMware::Vim::HostAuthenticationManager, VMware::Vim::HostAuthenticationStore, VMware::Vim::HostAutoStartManager, VMware::Vim::HostBootDeviceSystem, VMware::Vim::HostCacheConfigurationManager, VMware::Vim::HostDatastoreBrowser, VMware::Vim::HostDatastoreSystem, VMware::Vim::HostDateTimeSystem, VMware::Vim::HostDiagnosticSystem, VMware::Vim::HostEsxAgentHostManager, VMware::Vim::HostFirmwareSystem, VMware::Vim::HostHealthStatusSystem, VMware::Vim::HostImageConfigManager, VMware::Vim::HostKernelModuleSystem, VMware::Vim::HostLocalAccountManager, VMware::Vim::HostPatchManager, VMware::Vim::HostPowerSystem, VMware::Vim::HostSnmpSystem, VMware::Vim::HostVFlashManager, VMware::Vim::HostVsanInternalSystem, VMware::Vim::HostVsanSystem, VMware::Vim::HttpNfcLease, VMware::Vim::IpPoolManager, VMware::Vim::IscsiManager, VMware::Vim::LicenseAssignmentManager, VMware::Vim::LicenseManager, VMware::Vim::LocalizationManager, VMware::Vim::OptionManager, VMware::Vim::OvfManager, VMware::Vim::PerformanceManager, VMware::Vim::Profile, VMware::Vim::ProfileComplianceManager, VMware::Vim::ProfileManager, VMware::Vim::PropertyCollector, VMware::Vim::PropertyFilter, VMware::Vim::ResourcePlanningManager, VMware::Vim::ScheduledTaskManager, VMware::Vim::SearchIndex, VMware::Vim::ServiceInstance, VMware::Vim::ServiceManager, VMware::Vim::SessionManager, VMware::Vim::SimpleCommand, VMware::Vim::StorageResourceManager, VMware::Vim::TaskManager, VMware::Vim::UserDirectory, VMware::Vim::View, VMware::Vim::ViewManager, VMware::Vim::VirtualDiskManager, VMware::Vim::VirtualizationManager, VMware::Vim::VirtualMachineCompatibilityChecker, and VMware::Vim::VirtualMachineProvisioningChecker.

List of all members.

Public Member Functions

ViewBase (VimClient client, ManagedObjectReference moRef)
Constructs a new view object representing the current state of a managed object.
void | UpdateViewData (params string[] properties)
Refreshes the property values of a view object. Populates it with the current state of the managed object it represents.
void | UpdateViewData ()
Refreshes all property values of a view object.
void | SetViewData (ObjectContent objectContent, string[] properties)
Populates the properties of the view object with the specified values in objectContent.
object | WaitForTask (ManagedObjectReference taskReference)
Waits until a server-side task is completed. Deprecated. As of vSphere SDK for .Net 4.1.1 use VimClient.WaitForTask.

Static Public Member Functions

static PropertySpec[] | GetPropertySpec (String typeName)
Constructs a PropertySpec object used to retrieve all the properties of the managed object identified by the typeName parameter.
static PropertyFilterSpec | GetPropertyFilterSpec (ManagedObjectReference moRef)
Constructs a PropertyFilterSpec object used to retrieve all the properties of the managed object identified by the managedObjectReference parameter.
static Type | GetViewType (string typeName)
Gets the managed object type with the specified name, performing a case-insensitive search.

Properties

virtual ManagedObjectReference | MoRef [get]
The managed object reference that this type instance represents.
virtual VimClient | Client [get]
Instance of a VimClient object that manages connection to the VI server.

Detailed Description

Base class for the client-side types called Views. A View is populated with the currents state of a managed object.

Constructor & Destructor Documentation

VMware::Vim::ViewBase::ViewBase | ( | VimClient | client,
 |  | ManagedObjectReference | moRef
 | ) |  |

Constructs a new view object representing the current state of a managed object.

Parameters:
client | VimClient object that manages connection to the Vim service
moRef | The managed object that the view represents

Member Function Documentation

static PropertySpec [] VMware::Vim::ViewBase::GetPropertySpec ( String typeName ) [static]

Constructs a PropertySpec object used to retrieve all the properties of the managed object identified by the typeName parameter.

Parameters:
typeName The type of the managed object to construct PropertySpec for
Returns:
PropertySpec object for the specified managed object

static PropertyFilterSpec VMware::Vim::ViewBase::GetPropertyFilterSpec ( ManagedObjectReference moRef ) [static]

Constructs a PropertyFilterSpec object used to retrieve all the properties of the managed object identified by the managedObjectReference parameter.

Parameters:
moRef The type of the managed object to construct PropertyFilterSpec for
Returns:
A PropertyFilterSpec obejct for the specified managed object

static Type VMware::Vim::ViewBase::GetViewType ( string typeName ) [static]

Gets the managed object type with the specified name, performing a case-insensitive search.

Parameters:
typeName The name of the type to get
Returns:
The managed object type with the specified name, if found; otherwise returns null

void VMware::Vim::ViewBase::UpdateViewData ( params string[] properties )

Refreshes the property values of a view object. Populates it with the current state of the managed object it represents.

Parameters:
properties A list of property names identifiying specific properties of the managed object. Setting this property is optional.

void VMware::Vim::ViewBase::UpdateViewData ( )

Refreshes all property values of a view object.

void VMware::Vim::ViewBase::SetViewData | ( | ObjectContent | objectContent,
 |  | string[] | properties
 | ) |  |

Populates the properties of the view object with the specified values in objectContent.

Parameters:
objectContent | Contains the list of the managed object's property values
properties | A list of property names identifiying specific properties of the managed object. Setting this property is optional.

object VMware::Vim::ViewBase::WaitForTask ( ManagedObjectReference taskReference )

Waits until a server-side task is completed. Deprecated. As of vSphere SDK for .Net 4.1.1 use VimClient.WaitForTask.

Parameters:
taskReference Managed Object Reference representing the task object
Returns:
Task result information

Property Documentation

virtual ManagedObjectReference VMware::Vim::ViewBase::MoRef [get]

The managed object reference that this type instance represents.

virtual VimClient VMware::Vim::ViewBase::Client [get]

Instance of a VimClient object that manages connection to the VI server.


Member List

VMware::Vim::ViewBase Member List

This is the complete list of members for VMware::Vim::ViewBase, including all inherited members.

Client | VMware::Vim::ViewBase |
GetPropertyFilterSpec(ManagedObjectReference moRef) | VMware::Vim::ViewBase | [static]
GetPropertySpec(String typeName) | VMware::Vim::ViewBase | [static]
GetViewType(string typeName) | VMware::Vim::ViewBase | [static]
MoRef | VMware::Vim::ViewBase |
SetViewData(ObjectContent objectContent, string[] properties) | VMware::Vim::ViewBase |
UpdateViewData(params string[] properties) | VMware::Vim::ViewBase |
UpdateViewData() | VMware::Vim::ViewBase |
ViewBase(VimClient client, ManagedObjectReference moRef) | VMware::Vim::ViewBase |
WaitForTask(ManagedObjectReference taskReference) | VMware::Vim::ViewBase |


VMware::Vim::VimClient Class Reference

Manages VI Web Service requests and it's responsible for maintaining sessions, login/logout, retrieving and searching views. More...

List of all members.

Public Member Functions

VimClient ()
Initializes a new instance of the VimClient class.
VimClient (SoapHttpClientProtocol service, object serviceContent)
Initializes a new instance of the VimClient class using already created service connection. If VI server supports higher version than VimService supports a new VimService service for the version is created, otherwise proviced VimService instance is used.
ServiceContent | Connect ()
Initialize connection to the VI Web Server.
ServiceContent | Connect (string serviceUrl)
Initialize connection to the VI Web Server.
ServiceContent | Connect (string server, CommunicationProtocol?protocol, ushort?port)
Initialize connection to the VI Web Server.
UserSession | Login (string username, string password)
Establishes a session with the VirtualCenter Management Server or ESX Server Web service using the provided credentials (username and password).
UserSession | Login (string serviceUrl, string username, string password)
Establishes a session with the VirtualCenter Management Server or ESX Server Web service using the provided credentials (username and password).
void | Logout ()
Log out from the server and terminate the current session.
UserSession | ConnectToSession (string serviceUrl, string soapSessionId)
Reestablishes a session with the vCenter Server using the provided sessionId.
EntityViewBase | FindEntityView (Type viewType, ManagedObjectReference beginEntity, NameValueCollection filter, String[] properties)
Searches the inventory tree for a managed entity that matches a filter specification. Search begins with root folder unless the beginEntity parameter is specified.
List< EntityViewBase > | FindEntityViews (Type viewType, ManagedObjectReference beginEntity, NameValueCollection filter, String[] properties)
Searches the inventory tree for a managed entity that matches the specified entity Type. Search begins with root folder unless the beginEntity parameter is specified.
List< ViewBase > | GetViews (IEnumerable< ManagedObjectReference > moRefs, params string[] properties)
Retrieves the properties of a set of managed objects.
List< ViewBase > | GetViews (ObjectContent[] objectContent, string[] properties)
Populates the properties of a list of view objects with the values in objectContent.
List< ViewBase > | GetViewsByMorefs (IEnumerable< ManagedObjectReference > moRefs, params string[] properties)
Retrieves the properties of a set of managed objects.
ViewBase | GetView (ManagedObjectReference moRef, String[] properties)
Retrieves the properties of a single managed object.
void | Disconnect ()
Log out from the VI server and close the current connection.
void | SaveSession (string fileName)
Saves VI web service session to a file.
void | LoadSession (string fileName)
Loads VI web service session from a file.
bool | IsVimVersionOrHigher (VimVersion version)
Check if version of the connected vSphere Web service is same or higher than version specified in the version parameter.
object | WaitForTask (ManagedObjectReference taskReference)
Waits until a server-side task is completed.

Static Public Member Functions

static List< Type > | GetSupportedVimServiceTypes ()
Return list of all VimService proxy types used to communicate with vSphere web service.

Public Attributes

EventHandler
< CertificateErrorEventArg > 		CertificateError
Occurs when a SSL certificate error occures when communicating with VI Web Service.

Properties

VimVersion | Version [get]
Get current version the connected VI Web service.
SoapHttpClientProtocol | VimService [get]
Get instance of the VI Web service.
ServiceContent | ServiceContent [get]
Get retrieved properties of the ServiceInstance server object.
string | ServiceUrl [get, set]
Sets or gets the Url of the VI Web service to which the client connects.
int | ServiceTimeout [get, set]
Sets or gets the time vSphere Web service client waits for a request to complete (in milliseconds). The default is 100000 milliseconds.

Detailed Description

Manages VI Web Service requests and it's responsible for maintaining sessions, login/logout, retrieving and searching views.

Constructor & Destructor Documentation

VMware::Vim::VimClient::VimClient ( )

Initializes a new instance of the VimClient class.

VMware::Vim::VimClient::VimClient | ( | SoapHttpClientProtocol | service,
 |  | object | serviceContent
 | ) |  |

Initializes a new instance of the VimClient class using already created service connection. If VI server supports higher version than VimService supports a new VimService service for the version is created, otherwise proviced VimService instance is used.

Parameters:
service | Initlializated VimService object
serviceContent | ServiceContent already retrieved from the VI server

Member Function Documentation

ServiceContent VMware::Vim::VimClient::Connect ( )

Initialize connection to the VI Web Server.

Returns:
ServiceContent object retrived from the VI Server

ServiceContent VMware::Vim::VimClient::Connect ( string serviceUrl )

Initialize connection to the VI Web Server.

Parameters:
serviceUrl Url of the VI Web service which the client connects to.
Returns:
ServiceContent object retrived from the VI Server

ServiceContent VMware::Vim::VimClient::Connect | ( | string | server,
 |  | CommunicationProtocol? | protocol,
 |  | ushort? | port
 | ) |  |

Initialize connection to the VI Web Server.

Parameters:
server | The network name of the server to connect to. The name may be an IP address or a domain name.
protocol | The protocol (http or https) to use in communicating with the server
port | The port of the server to connect to. If not passed the default value for the supplied protocol is used
Returns:
ServiceContent object retrived from the VI Server

UserSession VMware::Vim::VimClient::Login | ( | string | username,
 |  | string | password
 | ) |  |

Establishes a session with the VirtualCenter Management Server or ESX Server Web service using the provided credentials (username and password).

Parameters:
username | User account on the ESX Server or VirtualCenter Server host system.
password | Password for the user account.
Returns:
Session object that can be saved to a file for future use. See SaveSession for details.

UserSession VMware::Vim::VimClient::Login | ( | string | serviceUrl,
 |  | string | username,
 |  | string | password
 | ) |  |

Establishes a session with the VirtualCenter Management Server or ESX Server Web service using the provided credentials (username and password).

Parameters:
serviceUrl | The URL of the server to which the client connects.
username | User account on the ESX Server or VirtualCenter Server host system.
password | Password for the user account.
Returns:
Session object that can be saved to a file for future use. See SaveSession for details.

void VMware::Vim::VimClient::Logout ( )

Log out from the server and terminate the current session.

UserSession VMware::Vim::VimClient::ConnectToSession | ( | string | serviceUrl,
 |  | string | soapSessionId
 | ) |  |

Reestablishes a session with the vCenter Server using the provided sessionId.

Parameters:
serviceUrl | The URL of the server to which the client connects.
soapSessionId | Specify the Id of an existing vSphere server session you want to reestablish.
Returns:
Session object that contains information about the client's current session.

EntityViewBase VMware::Vim::VimClient::FindEntityView | ( | Type | viewType,
 |  | ManagedObjectReference | beginEntity,
 |  | NameValueCollection | filter,
 |  | String[] | properties
 | ) |  |

Searches the inventory tree for a managed entity that matches a filter specification. Search begins with root folder unless the beginEntity parameter is specified.

Parameters:
viewType | Managed entity type of the searched objects
beginEntity | Managed object reference that specifies starting point for search (in context of inventory).
filter | A hash of one or more name-value pairs, in which the name represents the property value to test and the value represents a pattern the property must match. If more than one pair is present, all the patterns must match.
properties | A list of property names identifiying specific properties of the managed object. Setting this property is optional.
Returns:
A reference to a view object containing the same properties as the managed entity. If there is more than one managed entity that matches your filter specifications, the subroutine returns the first managed entity found. If there are no matching managed entities, returns null.

List<EntityViewBase> VMware::Vim::VimClient::FindEntityViews | ( | Type | viewType,
 |  | ManagedObjectReference | beginEntity,
 |  | NameValueCollection | filter,
 |  | String[] | properties
 | ) |  |

Searches the inventory tree for a managed entity that matches the specified entity Type. Search begins with root folder unless the beginEntity parameter is specified.

Parameters:
viewType | Managed entity Type of the searched objects
beginEntity | Managed object reference that specifies starting point for search (in context of inventory)
filter | A hash of one or more name-value pairs, in which the name represents the property value to test and the value represents a pattern the property must match. If more than one pair is present, all the patterns must match.
properties | A list of single property names identifiying specific properties of the managed object. Setting this property is optional.
Returns:
An array of view objects containing static copies of property values for the matching inventory objects. If there are no matching entities, the array is empty.

List<ViewBase> VMware::Vim::VimClient::GetViews | ( | IEnumerable< ManagedObjectReference > | moRefs,
 |  | params string[] | properties
 | ) |  |

Retrieves the properties of a set of managed objects.

Parameters:
moRefs | List of managed object references.
properties | A list of single property names identifiying specific properties of the managed object. Setting this property is optional.
Returns:
An array of view objects containing copies of property values for multiple managed objects.

List<ViewBase> VMware::Vim::VimClient::GetViews | ( | ObjectContent[] | objectContent,
 |  | string[] | properties
 | ) |  |

Populates the properties of a list of view objects with the values in objectContent.

Parameters:
objectContent | Contains the list of the managed object's property values
properties | A list of property names identifiying specific properties of the managed object. Setting this property is optional.

List<ViewBase> VMware::Vim::VimClient::GetViewsByMorefs | ( | IEnumerable< ManagedObjectReference > | moRefs,
 |  | params string[] | properties
 | ) |  |

Retrieves the properties of a set of managed objects.

Parameters:
moRefs | List of managed object references.
properties | A list of single property names identifiying specific properties of the managed object. Setting this property is optional.
Returns:
An array of view objects containing copies of property values for multiple managed objects.

ViewBase VMware::Vim::VimClient::GetView | ( | ManagedObjectReference | moRef,
 |  | String[] | properties
 | ) |  |

Retrieves the properties of a single managed object.

Parameters:
moRef | A managed object reference, obtained from a property of another managed object or a view
properties | A list of property names identifiying specific properties of the managed object. Setting this property is optional.
Returns:
A view object containing static copies of the property values for a managed object.

void VMware::Vim::VimClient::Disconnect ( )

Log out from the VI server and close the current connection.

void VMware::Vim::VimClient::SaveSession ( string fileName )

Saves VI web service session to a file.

Parameters:
fileName The name of the file to store the session in

void VMware::Vim::VimClient::LoadSession ( string fileName )

Loads VI web service session from a file.

Parameters:
fileName The name of the file to load the session from

bool VMware::Vim::VimClient::IsVimVersionOrHigher ( VimVersion version )

Check if version of the connected vSphere Web service is same or higher than version specified in the version parameter.

Parameters:
version VimVersion that is required
Returns:
True if current version of the vSphere server is same or higher than version specified in version parameter

static List<Type> VMware::Vim::VimClient::GetSupportedVimServiceTypes ( ) [static]

Return list of all VimService proxy types used to communicate with vSphere web service.

object VMware::Vim::VimClient::WaitForTask ( ManagedObjectReference taskReference )

Waits until a server-side task is completed.

Parameters:
taskReference Managed Object Reference representing the task object
Returns:
Task result information

Member Data Documentation

EventHandler<CertificateErrorEventArg> VMware::Vim::VimClient::CertificateError

Occurs when a SSL certificate error occures when communicating with VI Web Service.

Property Documentation

VimVersion VMware::Vim::VimClient::Version [get]

Get current version the connected VI Web service.

SoapHttpClientProtocol VMware::Vim::VimClient::VimService [get]

Get instance of the VI Web service.

ServiceContent VMware::Vim::VimClient::ServiceContent [get]

Get retrieved properties of the ServiceInstance server object.

string VMware::Vim::VimClient::ServiceUrl [get, set]

Sets or gets the Url of the VI Web service to which the client connects.

int VMware::Vim::VimClient::ServiceTimeout [get, set]

Sets or gets the time vSphere Web service client waits for a request to complete (in milliseconds). The default is 100000 milliseconds.


Member List

VMware::Vim::VimClient Member List

This is the complete list of members for VMware::Vim::VimClient, including all inherited members.

CertificateError | VMware::Vim::VimClient |
Connect() | VMware::Vim::VimClient |
Connect(string serviceUrl) | VMware::Vim::VimClient |
Connect(string server, CommunicationProtocol?protocol, ushort?port) | VMware::Vim::VimClient |
ConnectToSession(string serviceUrl, string soapSessionId) | VMware::Vim::VimClient |
Disconnect() | VMware::Vim::VimClient |
FindEntityView(Type viewType, ManagedObjectReference beginEntity, NameValueCollection filter, String[] properties) | VMware::Vim::VimClient |
FindEntityViews(Type viewType, ManagedObjectReference beginEntity, NameValueCollection filter, String[] properties) | VMware::Vim::VimClient |
GetSupportedVimServiceTypes() | VMware::Vim::VimClient | [static]
GetView(ManagedObjectReference moRef, String[] properties) | VMware::Vim::VimClient |
GetViews(IEnumerable< ManagedObjectReference > moRefs, params string[] properties) | VMware::Vim::VimClient |
GetViews(ObjectContent[] objectContent, string[] properties) | VMware::Vim::VimClient |
GetViewsByMorefs(IEnumerable< ManagedObjectReference > moRefs, params string[] properties) | VMware::Vim::VimClient |
IsVimVersionOrHigher(VimVersion version) | VMware::Vim::VimClient |
LoadSession(string fileName) | VMware::Vim::VimClient |
Login(string username, string password) | VMware::Vim::VimClient |
Login(string serviceUrl, string username, string password) | VMware::Vim::VimClient |
Logout() | VMware::Vim::VimClient |
SaveSession(string fileName) | VMware::Vim::VimClient |
ServiceContent | VMware::Vim::VimClient |
ServiceTimeout | VMware::Vim::VimClient |
ServiceUrl | VMware::Vim::VimClient |
Version | VMware::Vim::VimClient |
VimClient() | VMware::Vim::VimClient |
VimClient(SoapHttpClientProtocol service, object serviceContent) | VMware::Vim::VimClient |
VimService | VMware::Vim::VimClient |
WaitForTask(ManagedObjectReference taskReference) | VMware::Vim::VimClient |


VMware::Vim::VimException Class Reference

A geneneral exception that is thrown when a non-fatal error occurs in the Vim APIs. More...

List of all members.

Public Member Functions

VimException ()
Initializes a new instance of the VimException class.
VimException (string message)
Initializes a new instance of the VimException class with a specified error message.
VimException (string message, MethodFault methodFault)
Initializes a new instance of the VimException class with a specified error message and a reference to the methodFault fault object that is the cause of this exception.
VimException (string message, MethodFault methodFault, Exception inner)
Initializes a new instance of the VimException class with a specified error message, a reference to the methodFault fault object and a reference to the inner exception.

Properties

MethodFault MethodFault [get, set]
Gets the MethodFault instance that contains information about error returned from the server-side.

Detailed Description

A geneneral exception that is thrown when a non-fatal error occurs in the Vim APIs.

Constructor & Destructor Documentation

VMware::Vim::VimException::VimException ( )

Initializes a new instance of the VimException class.

VMware::Vim::VimException::VimException ( string message )

Initializes a new instance of the VimException class with a specified error message.

Parameters:
message The message that describes the error.

VMware::Vim::VimException::VimException | ( | string | message,
 |  | MethodFault | methodFault
 | ) |  |

Initializes a new instance of the VimException class with a specified error message and a reference to the methodFault fault object that is the cause of this exception.

Parameters:
message | The message that describes the error.
methodFault | The methodFault that is the cause of the current exception, or a null reference if no methodFault exception is specified.

VMware::Vim::VimException::VimException | ( | string | message,
 |  | MethodFault | methodFault,
 |  | Exception | inner
 | ) |  |

Initializes a new instance of the VimException class with a specified error message, a reference to the methodFault fault object and a reference to the inner exception.

Parameters:
message | The message that describes the error.
methodFault | The methodFault that is the cause of the current exception, or a null reference if no methodFault exception is specified.
inner | The exception that is the cause of the current exception, or a null reference if no inner exception is specified.

Property Documentation

MethodFault VMware::Vim::VimException::MethodFault [get, set]

Gets the MethodFault instance that contains information about error returned from the server-side.


Member List

VMware::Vim::VimException Member List

This is the complete list of members for VMware::Vim::VimException, including all inherited members.

MethodFault | VMware::Vim::VimException
VimException() | VMware::Vim::VimException
VimException(string message) | VMware::Vim::VimException
VimException(string message, MethodFault methodFault) | VMware::Vim::VimException
VimException(string message, MethodFault methodFault, Exception inner) | VMware::Vim::VimException


Class Members

  • All
  • Functions
  • Variables
  • Properties
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • s
  • u
  • v
  • w

Here is a list of all documented class members with links to the class documentation for each member:

- c -

  • Certificate : VMware::Vim::CertificateErrorEventArg
  • CertificateError : VMware::Vim::VimClient
  • CertificateErrorEventArg() : VMware::Vim::CertificateErrorEventArg
  • Chain : VMware::Vim::CertificateErrorEventArg
  • Client : VMware::Vim::ViewBase
  • Connect() : VMware::Vim::VimClient
  • ConnectToSession() : VMware::Vim::VimClient

- d -

  • Disconnect() : VMware::Vim::VimClient

- e -

  • EntityViewBase() : VMware::Vim::EntityViewBase

- f -

  • FindEntityView() : VMware::Vim::VimClient
  • FindEntityViews() : VMware::Vim::VimClient

- g -

  • GetAllEventsView() : VMware::Vim::EntityViewBase
  • GetAllTasksView() : VMware::Vim::EntityViewBase
  • GetEntityOnlyEventsCollectorView() : VMware::Vim::EntityViewBase
  • GetEntityOnlyTasksCollectorView() : VMware::Vim::EntityViewBase
  • GetEventCollectorView() : VMware::Vim::EntityViewBase
  • GetPropertyFilterSpec() : VMware::Vim::ViewBase
  • GetPropertySpec() : VMware::Vim::ViewBase
  • GetSearchFilterSpec() : VMware::Vim::EntityViewBase
  • GetSupportedVimServiceTypes() : VMware::Vim::VimClient
  • GetTaskCollectorView() : VMware::Vim::EntityViewBase
  • GetTypePropertyByName() : VMware::Vim::ViReflectionCache
  • GetView() : VMware::Vim::VimClient
  • GetViews() : VMware::Vim::VimClient
  • GetViewsByMorefs() : VMware::Vim::VimClient
  • GetViewType() : VMware::Vim::ViewBase

- i -

  • IgnoreError : VMware::Vim::CertificateErrorEventArg
  • IsVimVersionOrHigher() : VMware::Vim::VimClient

- l -

  • LoadSession() : VMware::Vim::VimClient
  • Login() : VMware::Vim::VimClient
  • Logout() : VMware::Vim::VimClient

- m -

  • MethodFault : VMware::Vim::VimException
  • MoRef : VMware::Vim::ViewBase

- s -

  • SaveSession() : VMware::Vim::VimClient
  • Sender : VMware::Vim::CertificateErrorEventArg
  • ServiceContent : VMware::Vim::VimClient
  • ServiceTimeout : VMware::Vim::VimClient
  • ServiceUrl : VMware::Vim::VimClient
  • SetViewData() : VMware::Vim::ViewBase
  • SslPolicyErrors : VMware::Vim::CertificateErrorEventArg

- u -

  • UpdateViewData() : VMware::Vim::ViewBase

- v -

  • Version : VMware::Vim::VimClient
  • ViewBase() : VMware::Vim::ViewBase
  • VimClient() : VMware::Vim::VimClient
  • VimException() : VMware::Vim::VimException
  • VimService : VMware::Vim::VimClient

- w -

  • WaitForTask()
: VMware::Vim::ViewBase
, VMware::Vim::VimClient


Class Members - Functions

  • All
  • Functions
  • Variables
  • Properties
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • s
  • u
  • v
  • w

- c -

  • CertificateErrorEventArg() : VMware::Vim::CertificateErrorEventArg
  • Connect() : VMware::Vim::VimClient
  • ConnectToSession() : VMware::Vim::VimClient

- d -

  • Disconnect() : VMware::Vim::VimClient

- e -

  • EntityViewBase() : VMware::Vim::EntityViewBase

- f -

  • FindEntityView() : VMware::Vim::VimClient
  • FindEntityViews() : VMware::Vim::VimClient

- g -

  • GetAllEventsView() : VMware::Vim::EntityViewBase
  • GetAllTasksView() : VMware::Vim::EntityViewBase
  • GetEntityOnlyEventsCollectorView() : VMware::Vim::EntityViewBase
  • GetEntityOnlyTasksCollectorView() : VMware::Vim::EntityViewBase
  • GetEventCollectorView() : VMware::Vim::EntityViewBase
  • GetPropertyFilterSpec() : VMware::Vim::ViewBase
  • GetPropertySpec() : VMware::Vim::ViewBase
  • GetSearchFilterSpec() : VMware::Vim::EntityViewBase
  • GetSupportedVimServiceTypes() : VMware::Vim::VimClient
  • GetTaskCollectorView() : VMware::Vim::EntityViewBase
  • GetTypePropertyByName() : VMware::Vim::ViReflectionCache
  • GetView() : VMware::Vim::VimClient
  • GetViews() : VMware::Vim::VimClient
  • GetViewsByMorefs() : VMware::Vim::VimClient
  • GetViewType() : VMware::Vim::ViewBase

- i -

  • IsVimVersionOrHigher() : VMware::Vim::VimClient

- l -

  • LoadSession() : VMware::Vim::VimClient
  • Login() : VMware::Vim::VimClient
  • Logout() : VMware::Vim::VimClient

- s -

  • SaveSession() : VMware::Vim::VimClient
  • SetViewData() : VMware::Vim::ViewBase

- u -

  • UpdateViewData() : VMware::Vim::ViewBase

- v -

  • ViewBase() : VMware::Vim::ViewBase
  • VimClient() : VMware::Vim::VimClient
  • VimException() : VMware::Vim::VimException

- w -

  • WaitForTask()
: VMware::Vim::ViewBase
, VMware::Vim::VimClient


Class Members - Properties

  • All
  • Functions
  • Variables
  • Properties

  • Certificate : VMware::Vim::CertificateErrorEventArg
  • Chain : VMware::Vim::CertificateErrorEventArg
  • Client : VMware::Vim::ViewBase
  • IgnoreError : VMware::Vim::CertificateErrorEventArg
  • MethodFault : VMware::Vim::VimException
  • MoRef : VMware::Vim::ViewBase
  • Sender : VMware::Vim::CertificateErrorEventArg
  • ServiceContent : VMware::Vim::VimClient
  • ServiceTimeout : VMware::Vim::VimClient
  • ServiceUrl : VMware::Vim::VimClient
  • SslPolicyErrors : VMware::Vim::CertificateErrorEventArg
  • Version : VMware::Vim::VimClient
  • VimService : VMware::Vim::VimClient


Class Members - Variables

  • All
  • Functions
  • Variables
  • Properties

  • CertificateError : VMware::Vim::VimClient


Hierarchical Index

Class Hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically:
  • VMware::Vim::CertificateErrorEventArg
  • VMware::Vim::DynamicPropertyFilterSpecGenerator
  • VMware::Vim::EntityViewBase
  • VMware::Vim::ViewBase
  • VMware::Vim::VimClient
  • VMware::Vim::VimException
  • VMware::Vim::ViReflectionCache


Main Page

  • Main Page
  • Classes
    • Class List
    • Class Hierarchy
  • Class List
  • Class Hierarchy