Package com.vmware.vim25.mo

Examples of com.vmware.vim25.mo.LicenseManager


     */
    protected ManagedEntity searchManagedEntity(String type, String name)
    {
        ManagedEntity ret = null;
        try {
            ret = new InventoryNavigator
                (rootFolder_).searchManagedEntity(type, name);
        } catch (Exception e) { /* InvalidProperty, RuntimeFault, RemoteException */
            logger_.warning(Utility.toString(e));
            return null;
        }
View Full Code Here


    {
        List<ManagedEntity> ret = new LinkedList<ManagedEntity>();
       
        ManagedEntity[] mes;
        try {
            mes = new InventoryNavigator(rootFolder_).searchManagedEntities(type);
        } catch (Exception e) { /* InvalidProperty, RuntimeFault, RemoteException */
            return ret;
        }
        assert(mes != null);

View Full Code Here

    {
        List<ManagedEntity> ret = new LinkedList<ManagedEntity>();
       
        ManagedEntity[] mes;
        try {
            mes = new InventoryNavigator(rootFolder_).searchManagedEntities
                (new String[][] { {type, name}, }, true);
           
        } catch (Exception e) { /* InvalidProperty, RuntimeFault, RemoteException */
            return ret;
        }
View Full Code Here

{
  public static void main(String[] args) throws Exception
  {
    ServiceInstance si = new ServiceInstance(new URL("https://8.8.8.8/sdk"),
        "administrator", "vmware", true);
    LicenseManager lm = si.getLicenseManager();
    LicenseAssignmentManager lam = lm.getLicenseAssignmentManager();
   
    LicenseAssignmentManagerLicenseAssignment[] las = lam.queryAssignedLicenses(null);

    String newLic = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX";
    String oldLic = "YYYYY-YYYYY-YYYYY-YYYYY-YYYYY";
   
    List<LicEntity> entities = new ArrayList<LicEntity>();
  
    for(LicenseAssignmentManagerLicenseAssignment la : las)
    {
      LicenseManagerLicenseInfo licInfo = la.getAssignedLicense();
      if(oldLic.equals(licInfo.getLicenseKey()))
      {
        entities.add(new LicEntity(la.getEntityId(), la.getEntityDisplayName()));
        System.out.println("entityId:" + la.getEntityId());
       
      }
    }
   
    lm.addLicense(newLic, null);
   
    for(LicEntity e : entities)
    {
      lam.updateAssignedLicense(e.entityId, newLic, e.displayName);
    }
    lm.removeLicense(oldLic);
  }
View Full Code Here

    }
   
    ServiceInstance si = new ServiceInstance(
        new URL(args[0]), args[1], args[2], true);
   
    LicenseManager lm = si.getLicenseManager();
   
    System.out.println("License edition:"
      + lm.getLicensedEdition());
   
    System.out.println("Licnese source available:"
      + lm.getSourceAvailable());
   
    printLicenseSource(lm.getSource());
   
    System.out.println("License Diagnostic Info:");
    printDiagnostics(lm.getDiagnostics());

    // The featureInfo property is deprecated as of 2.5.
    // Use the querySupportedFeatures as follows.
    System.out.println("\nLicense Features:");
    printLicenseFeatures(lm.querySupportedFeatures(null));
   
    System.out.println("\nLicense Usage:");
    printLicenseUsage(lm.queryLicenseUsage(null));
   
    System.out.println("\nLicense source availability:");
    printLicenseAvailable(
      lm.queryLicenseSourceAvailability(null));
   
    si.getServerConnection().logout();
  }
View Full Code Here

{
  public static void main(String[] args) throws Exception
  {
    ServiceInstance si = new ServiceInstance(new URL("https://8.8.8.8/sdk"),
        "administrator", "vmware", true);
    LicenseManager lm = si.getLicenseManager();
    LicenseManagerLicenseInfo[] lics = lm.getLicenses();

    DateFormat df = DateFormat.getInstance();
    for(LicenseManagerLicenseInfo lic : lics)
    {
      Date expDate = null;
     
      if("eval".equalsIgnoreCase(lic.getEditionKey()))
      {
        LicenseManagerEvaluationInfo evalInfo = lm.getEvaluation();
        expDate = getExpirationDate(evalInfo.getProperties());
      }
      else
      {
        expDate = getExpirationDate(lic.getProperties());
View Full Code Here

        + "<username> <password>");
      return;
    }
    ServiceInstance si = new ServiceInstance(
      new URL(args[0]), args[1], args[2], true);
    LicenseManager lm = si.getLicenseManager();
   
    LicenseServerSource lss = new LicenseServerSource();
    // please change it to a license server you can access
    lss.setLicenseServer("27000@lic-serv.acme.com");
   
    lm.configureLicenseSource(null, lss);
    lm.setLicenseEdition(null, "esxFull");

    boolean enabled = lm.checkLicenseFeature(null, "iscsi");
    System.out.println("ISCSI enabled:" + enabled);

    lm.disableFeature(null, "iscsi");
    enabled = lm.checkLicenseFeature(null, "iscsi");
    System.out.println("ISCSI enabled:" + enabled);

    lm.enableFeature(null, "iscsi");
    enabled = lm.checkLicenseFeature(null, "iscsi");
    System.out.println("ISCSI enabled:" + enabled);
   
    si.getServerConnection().logout();
  }
View Full Code Here

     * @param name Name of the entity.
     * @return Found managed entity in success or null in failure.
     */
    protected ManagedEntity searchManagedEntity(String type, String name)
    {
        ManagedEntity ret = null;
        try {
            ret = new InventoryNavigator
                (rootFolder_).searchManagedEntity(type, name);
        } catch (Exception e) { /* InvalidProperty, RuntimeFault, RemoteException */
            logger_.warning(Utility.toString(e));
View Full Code Here

        ManagedObjectReference mor =
            generateMoref("VirtualMachine", morefStr);
        if (mor == null) { return null; }

        ManagedEntity vm =
            MorUtil.createExactManagedEntity(si_.getServerConnection(), mor);

        if (vm instanceof VirtualMachine) {
            return (VirtualMachine) vm; /* may be null */
        } else {
View Full Code Here

     */
    public VirtualMachineManager searchVmWithName(String vmName)
        throws Exception
    {
        if (conn_.isConnected() == false) { conn_.connect(); }
        ManagedEntity vm = conn_.searchManagedEntity("VirtualMachine", vmName);
        if (vm == null) { throw new Exception(); }
        return new VirtualMachineManager(conn_, (VirtualMachine)vm);
    }
View Full Code Here

TOP

Related Classes of com.vmware.vim25.mo.LicenseManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.