Package com.vmware.vim25

Examples of com.vmware.vim25.PropertySpec


      }
    }
  }
 
  private Object[] getProperties(ManagedObjectReference moRef, String[] properties) throws RuntimeFault, RemoteException {
    PropertySpec pSpec = new PropertySpec();
    pSpec.setType(moRef.getType());
    pSpec.setPathSet(properties);

    ObjectSpec oSpec = new ObjectSpec();
    // Set the starting object
    oSpec.setObj(moRef);
   
View Full Code Here


  private void getHostVMs() throws Exception {
    ManagedObjectReference morHost = new ManagedObjectReference();
    morHost.setType("HostSystem");
    morHost.set_value("host-48");
   
    PropertySpec pSpec = new PropertySpec();
    pSpec.setType("VirtualMachine");
    pSpec.setPathSet(new String[] { "name", "runtime.powerState", "config.template" });
   
      TraversalSpec host2VmTraversal = new TraversalSpec();
      host2VmTraversal.setType("HostSystem");
      host2VmTraversal.setPath("vm");
      host2VmTraversal.setName("host2VmTraversal");
View Full Code Here

        assert (hostNetMo != null);
        hostNetMo.removePortGroup(portGroupName);
    }

    public ManagedObjectReference getNetworkMor(String portGroupName) throws Exception {
        PropertySpec pSpec = new PropertySpec();
        pSpec.setType("Network");
        pSpec.getPathSet().add("summary.name");

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

    public ObjectContent[] getVmPropertiesOnHyperHost(String[] propertyPaths) throws Exception {
        if (s_logger.isTraceEnabled())
            s_logger.trace("vCenter API trace - retrieveProperties() for VM properties. target MOR: " + _mor.getValue() + ", properties: " +
                    new Gson().toJson(propertyPaths));

        PropertySpec pSpec = new PropertySpec();
        pSpec.setType("VirtualMachine");
        pSpec.getPathSet().addAll(Arrays.asList(propertyPaths));

        TraversalSpec host2VmTraversal = new TraversalSpec();
        host2VmTraversal.setType("HostSystem");
        host2VmTraversal.setPath("vm");
        host2VmTraversal.setName("host2VmTraversal");
View Full Code Here

    public ObjectContent[] getDatastorePropertiesOnHyperHost(String[] propertyPaths) throws Exception {
        if (s_logger.isTraceEnabled())
            s_logger.trace("vCenter API trace - retrieveProperties() on Datastore properties. target MOR: " + _mor.getValue() + ", properties: " +
                    new Gson().toJson(propertyPaths));

        PropertySpec pSpec = new PropertySpec();
        pSpec.setType("Datastore");
        pSpec.getPathSet().addAll(Arrays.asList(propertyPaths));

        TraversalSpec host2DatastoreTraversal = new TraversalSpec();
        host2DatastoreTraversal.setType("HostSystem");
        host2DatastoreTraversal.setPath("datastore");
        host2DatastoreTraversal.setName("host2DatastoreTraversal");
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

    assert(hostNetMo != null);
    hostNetMo.removePortGroup(portGroupName);
  }

  public ManagedObjectReference getNetworkMor(String portGroupName) throws Exception {
    PropertySpec pSpec = new PropertySpec();
    pSpec.setType("Network");
    pSpec.getPathSet().add("summary.name");

      TraversalSpec host2NetworkTraversal = new TraversalSpec();
      host2NetworkTraversal.setType("HostSystem");
      host2NetworkTraversal.setPath("network");
      host2NetworkTraversal.setName("host2NetworkTraversal");
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.