Package com.vmware.vim25

Examples of com.vmware.vim25.PropertySpec


  }

  public static Pair<DatacenterMO, String> getOwnerDatacenter(VmwareContext context,
    ManagedObjectReference morEntity) throws Exception {

    PropertySpec pSpec = new PropertySpec();
    pSpec.setType("Datacenter");
    pSpec.getPathSet().add("name");

      TraversalSpec entityParentTraversal = new TraversalSpec();
      entityParentTraversal.setType("ManagedEntity");
      entityParentTraversal.setPath("parent");
      entityParentTraversal.setName("entityParentTraversal");
View Full Code Here


      return new Pair<DatacenterMO, String>(new DatacenterMO(context, ocs.get(0).getObj()), dcName);
  }


  public ManagedObjectReference getDvPortGroupMor(String dvPortGroupName) throws Exception {
        PropertySpec pSpec = new PropertySpec();
    pSpec.setType("DistributedVirtualPortgroup");
    pSpec.getPathSet().add("name");

    TraversalSpec datacenter2DvPortGroupTraversal = new TraversalSpec();
    datacenter2DvPortGroupTraversal.setType("Datacenter");
    datacenter2DvPortGroupTraversal.setPath("network");
    datacenter2DvPortGroupTraversal.setName("datacenter2DvPortgroupTraversal");
View Full Code Here

  }

  public DVPortgroupConfigInfo getDvPortGroupSpec(String dvPortGroupName) throws Exception {
    DVPortgroupConfigInfo configSpec = null;
    String nameProperty = null;
    PropertySpec pSpec = new PropertySpec();
    pSpec.setType("DistributedVirtualPortgroup");
    pSpec.getPathSet().add("name");
    pSpec.getPathSet().add("config");

      TraversalSpec datacenter2DvPortGroupTraversal = new TraversalSpec();
      datacenter2DvPortGroupTraversal.setType("Datacenter");
      datacenter2DvPortGroupTraversal.setPath("network");
      datacenter2DvPortGroupTraversal.setName("datacenter2DvPortgroupTraversal");
View Full Code Here

  }

    public ManagedObjectReference getDvSwitchMor(ManagedObjectReference dvPortGroupMor) throws Exception {
        String dvPortGroupKey = null;
        ManagedObjectReference dvSwitchMor = null;
        PropertySpec pSpec = new PropertySpec();
        pSpec.setType("DistributedVirtualPortgroup");
        pSpec.getPathSet().add("key");
        pSpec.getPathSet().add("config.distributedVirtualSwitch");

        TraversalSpec datacenter2DvPortGroupTraversal = new TraversalSpec();
        datacenter2DvPortGroupTraversal.setType("Datacenter");
        datacenter2DvPortGroupTraversal.setPath("network");
        datacenter2DvPortGroupTraversal.setName("datacenter2DvPortgroupTraversal");
View Full Code Here

  }

  public Pair<DatastoreMO, String> getOwnerDatastore(String dsFullPath) throws Exception {
    String dsName = DatastoreFile.getDatastoreNameFromPath(dsFullPath);

    PropertySpec pSpec = new PropertySpec();
    pSpec.setType("Datastore");
    pSpec.getPathSet().add("name");

      TraversalSpec vmDatastoreTraversal = new TraversalSpec();
      vmDatastoreTraversal.setType("VirtualMachine");
      vmDatastoreTraversal.setPath("datastore");
      vmDatastoreTraversal.setName("vmDatastoreTraversal");
View Full Code Here

    descriptor.parse(content);
    return descriptor;
  }

  public String getSnapshotDescriptorDatastorePath() throws Exception {
    PropertySpec pSpec = new PropertySpec();
    pSpec.setType("VirtualMachine");
    pSpec.getPathSet().add("name");
    pSpec.getPathSet().add("config.files");

      ObjectSpec oSpec = new ObjectSpec();
      oSpec.setObj(_mor);
      oSpec.setSkip(Boolean.FALSE);
View Full Code Here

    return (ManagedObjectReference)_context.getVimClient().getDynamicProperty(
      _mor, "parent");
  }

  public String[] getNetworks() throws Exception {
    PropertySpec pSpec = new PropertySpec();
    pSpec.setType("Network");
    pSpec.getPathSet().add("name");

      TraversalSpec vm2NetworkTraversal = new TraversalSpec();
      vm2NetworkTraversal.setType("VirtualMachine");
      vm2NetworkTraversal.setPath("network");
      vm2NetworkTraversal.setName("vm2NetworkTraversal");
View Full Code Here

    if(gcTagKey == 0) {
      gcTagKey = getCustomFieldKey("DistributedVirtualPortgroup", CustomFieldConstants.CLOUD_GC_DVP);
      s_logger.debug("The custom key for dvPortGroup is : " + gcTagKey);
    }

    PropertySpec pSpec = new PropertySpec();
    pSpec.setType("Network");
    pSpec.getPathSet().add("name");
    pSpec.getPathSet().add("vm");
    pSpec.getPathSet().add(String.format("value[%d]", gcTagKey));

      TraversalSpec vm2NetworkTraversal = new TraversalSpec();
      vm2NetworkTraversal.setType("VirtualMachine");
      vm2NetworkTraversal.setPath("network");
      vm2NetworkTraversal.setName("vm2NetworkTraversal");
View Full Code Here

    ManagedObjectReference mor = getRootFolder();
    for(int i=0; i < tokens.length;i++) {
      String token = tokens[i];
      List<ObjectContent> ocs;
      PropertySpec pSpec = null;
      ObjectSpec oSpec = null;
      if(mor.getType().equalsIgnoreCase("Datacenter")) {
        pSpec = new PropertySpec();
        pSpec.setAll(false);
        pSpec.setType("ManagedEntity");
        pSpec.getPathSet().add("name");

          TraversalSpec dcHostFolderTraversal = new TraversalSpec();
          dcHostFolderTraversal.setType("Datacenter");
          dcHostFolderTraversal.setPath("hostFolder");
          dcHostFolderTraversal.setName("dcHostFolderTraversal");

          oSpec = new ObjectSpec();
          oSpec.setObj(mor);
          oSpec.setSkip(Boolean.TRUE);
          oSpec.getSelectSet().add(dcHostFolderTraversal);

      } else if(mor.getType().equalsIgnoreCase("Folder")) {
        pSpec = new PropertySpec();
        pSpec.setAll(false);
        pSpec.setType("ManagedEntity");
        pSpec.getPathSet().add("name");

          TraversalSpec folderChildrenTraversal = new TraversalSpec();
          folderChildrenTraversal.setType("Folder");
          folderChildrenTraversal.setPath("childEntity");
          folderChildrenTraversal.setName("folderChildrenTraversal");

          oSpec = new ObjectSpec();
          oSpec.setObj(mor);
          oSpec.setSkip(Boolean.TRUE);
          oSpec.getSelectSet().add(folderChildrenTraversal);


      } else if(mor.getType().equalsIgnoreCase("ClusterComputeResource")) {
        pSpec = new PropertySpec();
        pSpec.setType("ManagedEntity");
        pSpec.getPathSet().add("name");

          TraversalSpec clusterHostTraversal = new TraversalSpec();
          clusterHostTraversal.setType("ClusterComputeResource");
          clusterHostTraversal.setPath("host");
          clusterHostTraversal.setName("folderChildrenTraversal");
View Full Code Here

    // It will give false result if there really does not exist data-center in the inventory, however, I consider
    // this really is not possible in production deployment
    //
   
        // Create PropertySpecs
        PropertySpec pSpec = new PropertySpec();
        pSpec.setType("Datacenter");
        pSpec.setAll(false);
        pSpec.getPathSet().add("name");

        ObjectSpec oSpec = new ObjectSpec();
        oSpec.setObj(getRootFolder());
        oSpec.setSkip(false);
        oSpec.getSelectSet().addAll(constructCompleteTraversalSpec());
View Full Code Here

TOP

Related Classes of com.vmware.vim25.PropertySpec

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.