Package org.jclouds.vcloud.director.v1_5.domain

Examples of org.jclouds.vcloud.director.v1_5.domain.Reference


   public void testEditVdc() throws Exception {
      String origName = lazyGetVdc().getName();
      String newName = name("a");
      Exception exception = null;

      AdminVdc vdc = AdminVdc.builder().name(newName).build();

      try {
         Task task = vdcApi.edit(vdcUrn, vdc);
         assertTaskSucceeds(task);

         AdminVdc modified = vdcApi.get(vdcUrn);
         assertEquals(modified.getName(), newName);

         // parent type
         Checks.checkAdminVdc(vdc);
      } catch (Exception e) {
         exception = e;
      } finally {
         try {
            AdminVdc restorableVdc = AdminVdc.builder().name(origName).build();
            Task task = vdcApi.edit(vdcUrn, restorableVdc);
            assertTaskSucceeds(task);
         } catch (Exception e) {
            if (exception != null) {
               logger.warn(e, "Error resetting adminVdc.name; rethrowing original test exception...");
View Full Code Here


      }
   }

   @Test(description = "GET /admin/vdc/{id}/metadata")
   public void testGetMetadata() throws Exception {
      Metadata metadata = metadataApi.get();

      Checks.checkMetadata(metadata);
   }
View Full Code Here

  
   @Override
   @BeforeClass(alwaysRun = true)
   public void setupRequiredApis() {
      groupApi = adminContext.getApi().getGroupApi();
      Reference orgRef = null;
     
      // TODO: requisite LDAP settings
//      oldLdapSettings = adminContext.getApi().getAdminOrgApi().getLdapSettings(orgRef.getId());
//      OrgLdapSettings newLdapSettings = oldLdapSettings.toBuilder()
//         .ldapMode(OrgLdapSettings.LdapMode.SYSTEM) 
View Full Code Here

    * @throws VCloudException
    */
   public RecomposeVAppParams addRecomposeParams(VApp vApp, Vm vm) {

      // creating an item element. this item will contain the vm which should be added to the vapp.
      Reference reference = Reference.builder().name(name("vm-")).href(vm.getHref()).type(vm.getType()).build();
      SourcedCompositionItemParam vmItem = SourcedCompositionItemParam.builder().source(reference).build();

      InstantiationParams vmInstantiationParams = null;

      Set<NetworkAssignment> networkAssignments = Sets.newLinkedHashSet();
View Full Code Here

   @Test(description = "PUT /vApp/{id}/networkConnectionSection", dependsOnMethods = { "testEditGuestCustomizationSection" })
  public void testEditNetworkConnectionSection() {

    // Look up a network in the Vdc
    Set<Reference> networks = vdc.getAvailableNetworks();
    Reference network = Iterables.getLast(networks);

    // Copy existing section and edit fields
    NetworkConnectionSection oldSection = vmApi
        .getNetworkConnectionSection(vmUrn);
    NetworkConnection newNetworkConnection = NetworkConnection.builder()
        .network(network.getName()).networkConnectionIndex(1)
        .ipAddressAllocationMode(IpAddressAllocationMode.DHCP).build();
    NetworkConnectionSection newSection = oldSection.toBuilder()
        .networkConnection(newNetworkConnection).build();

    // The method under test
View Full Code Here

      }
   }

   @Test(description = "GET /org/{id}", dependsOnMethods = { "testGetOrgList" })
   public void testGetOrg() {
      Reference orgRef = Iterables.getFirst(orgList, null);
      assertNotNull(orgRef);

      // Call the method being tested
      org = orgApi.get(orgUrn);
View Full Code Here

   }

   @Test(description = "GET /tasksList/{id}")
   public void testGetTaskList() {
      orgList = orgApi.list();
      Reference orgRef = Iterables.getFirst(orgList, null);
      assertNotNull(orgRef);
      orgURI = orgRef.getHref();
     
      Org org = orgApi.get(orgURI);
     
      URI taskListHref = Iterables.find(org.getLinks(), LinkPredicates.typeEquals(VCloudDirectorMediaType.TASKS_LIST)).getHref();
View Full Code Here

   @Test(description = "PUT /vApp/{id}/networkConnectionSection", dependsOnMethods = { "testEditGuestCustomizationSection" })
  public void testEditNetworkConnectionSection() {

    // Look up a network in the Vdc
    Set<Reference> networks = vdc.getAvailableNetworks();
    Reference network = Iterables.getLast(networks);

    // Copy existing section and edit fields
    NetworkConnectionSection oldSection = vmApi
        .getNetworkConnectionSection(vmUrn);
    NetworkConnection newNetworkConnection = NetworkConnection.builder()
        .network(network.getName()).networkConnectionIndex(1)
        .ipAddressAllocationMode(IpAddressAllocationMode.DHCP).build();
    NetworkConnectionSection newSection = oldSection.toBuilder()
        .networkConnection(newNetworkConnection).build();

    // The method under test
View Full Code Here

  
   @Override
   @BeforeClass(alwaysRun = true)
   public void setupRequiredApis() {
      groupApi = adminContext.getApi().getGroupApi();
      Reference orgRef = null;
     
      // TODO: requisite LDAP settings
//      oldLdapSettings = adminContext.getApi().getAdminOrgApi().getLdapSettings(orgRef.getId());
//      OrgLdapSettings newLdapSettings = oldLdapSettings.toBuilder()
//         .ldapMode(OrgLdapSettings.LdapMode.SYSTEM) 
View Full Code Here

      }
   }

   @Test(description = "GET /org/{id}", dependsOnMethods = { "testGetOrgList" })
   public void testGetOrg() {
      Reference orgRef = Iterables.getFirst(orgList, null);
      assertNotNull(orgRef);

      // Call the method being tested
      org = orgApi.get(orgUrn);
View Full Code Here

TOP

Related Classes of org.jclouds.vcloud.director.v1_5.domain.Reference

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.