Пример #1
0
  /**
   * works only for vCenter, this grants us a ticket to access a ESX host controlled by our vCenter
   *
   * @return a valid ticket to use for login
   * @see com.vmware.vim25.HostServiceTicket
   */
  public HostServiceTicket ticket() {
    getHost.vCenterCheck(); // die if not connected to a vCenter server
    HostServiceTicket ticket = null;

    try {

      ticket =
          connection.connect().getVimPort().acquireCimServicesTicket(getHost.byName(cimHostname));

    } catch (Throwable t) {
      throw new GetCimRuntimeFault(t);
    }

    return ticket;
  }
Пример #2
0
 /**
  * Only appropriate for direct connections to ESX hosts
  *
  * @param connection
  */
 public GetCim(final Connection connection) {
   this(connection, connection.getHost(), new GetHost(connection));
 }