Edit C:\Program Files (x86)\VMware\VMware VIX\doc\lang\c\functions\VixHost_Connect.html
<html> <head> <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> <meta HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <link rel="stylesheet" href="../../../foundrydoc.css" type="text/css" charset="ISO-8859-1"> <link rel="stylesheet" href="foundrydoc.css" type="text/css" charset="ISO-8859-1"> </head> <body> <h1>Name</h1> <b>VixHost_Connect</b> <h1>Description</h1> <pre> VixHandle VixHost_Connect(int apiVersion, VixServiceProvider hostType, const char *hostName, int hostPort, const char *userName, const char *password, VixHostOptions options, VixHandle propertyListHandle, VixEventProc *callbackProc, void *clientData); </pre> <p> Creates a host handle. This handle cannot be shared or reused after disconnect. <h1>Parameters</h1> <dl> <dt><i>apiVersion</i></dt> <dd> Must be VIX_API_VERSION. </dd> <dt><i>hostType</i></dt> <dd> With vCenter Server, ESX/ESXi hosts, and VMware Server 2.0, use VIX_SERVICEPROVIDER_VMWARE_VI_SERVER. With VMware Workstation, use VIX_SERVICEPROVIDER_VMWARE_WORKSTATION. With VMware Workstation (shared mode), use VIX_SERVICEPROVIDER_VMWARE_WORKSTATION_SHARED. With VMware Player, use VIX_SERVICEPROVIDER_VMWARE_PLAYER. With VMware Server 1.0.x, use VIX_SERVICEPROVIDER_VMWARE_SERVER. </dd> <dt><i>hostName</i></dt> <dd> Varies by product platform. With vCenter Server, ESX/ESXi hosts, VMware Workstation (shared mode) and VMware Server 2.0, use a URL of the form "https://<hostName>:<port>/sdk" where <hostName> is either the DNS name or IP address. If missing, <port> may default to 443 (see Remarks below). In VIX API 1.10 and later, you can omit "https://" and "/sdk" specifying just the DNS name or IP address. Credentials are required even for connections made locally. With Workstation, use NULL to connect to the local host. With VMware Server 1.0.x, use the DNS name or IP address for remote connections, or the same as Workstation for local connections. </dd> <dt><i>hostPort</i></dt> <dd> TCP/IP port on the remote host. With VMware Workstation and VMware Player, use zero for the local host. With ESX/ESXi hosts, VMware Workstation (shared mode) and VMware Server 2.0 you specify port number within the hostName parameter, so this parameter is ignored (see Remarks below). </dd> <dt><i>login</i></dt> <dd> Username for authentication on the remote machine. With VMware Workstation, VMware Player, and VMware Server 1.0.x, use NULL to authenticate as the current user on local host. With vCenter Server, ESX/ESXi hosts, VMware Workstation (shared mode) and VMware Server 2.0, you must use a valid login. </dd> <dt><i>password</i></dt> <dd> Password for authentication on the remote machine. With VMware Workstation, VMware Player, and VMware Server 1.0.x, use NULL to authenticate as the current user on local host. With ESX/ESXi, VMware Workstation (shared mode) and VMware Server 2.0, you must use a valid login. </dd> <dt><i>options</i></dt> <dd> Should be zero. The option VIX_HOSTOPTION_USE_EVENT_PUMP has been deprecated and may be removed from future versions of the VIX API. </dd> <dt><i>propertyListHandle</i></dt> <dd> Must be VIX_INVALID_HANDLE. </dd> <dt><i>callbackProc</i></dt> <dd> Optional callback of type VixEventProc. </dd> <dt><i>clientData</i></dt> <dd> Optional user supplied opaque data to be passed to optional callback. </dd> </dl> <h1>Return Value</h1> A job handle. When the job completes, retrieve the Host handle from the job handle using the VIX_PROPERTY_JOB_RESULT_HANDLE property. <h1>Remarks</h1> <ul> <li> To specify the local host (where the API client runs) with VMware Workstation and VMware Player, pass null values for the hostName, hostPort, userName, and password parameters. <li> With vCenter Server, ESX/ESXi hosts, and VMware Server 2.0, the URL for the hostName argument may specify the port. Otherwise an HTTPS connection is attempted on port 443. HTTPS is strongly recommended. Port numbers are set during installation of Server 2.0. The installer's default HTTP and HTTPS values are 8222 and 8333 for Server on Windows, or (if not already in use) 80 and 443 for Server on Linux, and 902 for the automation socket, authd. If connecting to a virtual machine though a firewall, port 902 and the communicating port must be opened to allow guest operations. <li> If a VMware ESX host is being managed by a VMware VCenter Server, you should call VixHost_Connect with the hostname or IP address of the VCenter server, not the ESX host. Connecting directly to an ESX host while bypassing its VCenter Server can cause state inconsistency. <li> On Windows, this function should not be called multiple times with different service providers in the same process; doing so will result in a VIX_E_WRAPPER_MULTIPLE_SERVICEPROVIDERS error. A single client process can connect to multiple hosts as long as it connects using the same service provider type. <li> To enable SSL certificate verification, set the value of the options parameter to include the bit flag specified by VIX_HOSTOPTION_VERIFY_SSL_CERT. This option can also be set in the VMware config file by assigning vix.enableSslCertificateCheck as TRUE or FALSE. The vix.sslCertificateFile config option specifies the path to a file containing CA certificates in PEM format. The vix.sslCertificateDirectory config option can specify a directory containing files that each contain a CA certificate. Upon encountering a SSL validation error, the host handle is not created with a resulting error code of VIX_E_NET_HTTP_SSL_SECURITY. <li> The option VIX_HOSTOPTION_USE_EVENT_PUMP has been deprecated and may be removed from future versions of the VIX API. <li> With VMware vCenter Server and ESX/ESXi 4.0 hosts, an existing VI API session can be used instead of the username/password pair to authenticate when connecting. To use an existing VI API session, a VI "clone ticket" is required; call the VI API AcquireCloneTicket() method of the SessionManager object to get this ticket. Using the ticket string returned by this method, call VixHost_Connect() with NULL as the 'username' and the ticket as the 'password'. </ul> <h1>Side Effects</h1> None. <h1>Requirements</h1> vix.h, since VMware Server 1.0 <h1>Example</h1> <pre> #include "vix.h" int main(int argc, char * argv[]) { VixHandle hostHandle = VIX_INVALID_HANDLE; VixHandle jobHandle = VIX_INVALID_HANDLE; VixError err; // Connect as current user on local host. jobHandle = VixHost_Connect(VIX_API_VERSION, VIX_SERVICEPROVIDER_VMWARE_VI_SERVER, "https://viserver.example.com/sdk", // hostName 0, // hostPort "Administrator", // userName "adminpass", // password, 0, // options VIX_INVALID_HANDLE, // propertyListHandle NULL, // callbackProc NULL); // clientData err = VixJob_Wait(jobHandle, VIX_PROPERTY_JOB_RESULT_HANDLE, &hostHandle, VIX_PROPERTY_NONE); if (VIX_OK != err) { // Handle the error... goto abort; } Vix_ReleaseHandle(jobHandle); // Other code goes here... abort: Vix_ReleaseHandle(jobHandle); VixHost_Disconnect(hostHandle); } </pre> </body> </html> <hr>Copyright (C) 2007-2017 VMware, Inc. All rights reserved.
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de