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

Examples of org.jclouds.vcloud.director.v1_5.domain.Error$Builder


               .httpRequestBuilder().build(),
            new VcloudHttpResponsePrimer()
               .xmlFilePayload("/vdc/param/error400.xml", VCloudDirectorMediaType.ERROR)
               .httpResponseBuilder().statusCode(400).build());

      Error expected = Error.builder()
            .message("?")
            .majorErrorCode(400)
            .minorErrorCode("BAD_REQUEST")
            .build();
View Full Code Here


               HttpResponse.builder()
                           .statusCode(400)
                           .payload(payloadFromResourceWithContentType("/network/error400.xml", ERROR + ";version=1.5"))
                           .build());
     
      Error expected = Error.builder()
         .message("validation error : EntityRef has incorrect type, expected type is com.vmware.vcloud.entity.network.")
         .majorErrorCode(400)
         .minorErrorCode("BAD_REQUEST")
         .build();
View Full Code Here

      Exception exception = new HttpResponseException(command, response, message);
     
      // Try to create a VCloudDirectorException from XML payload, if it exists
      if (response.getPayload() != null && response.getPayload().getContentMetadata().getContentType().startsWith(VCloudDirectorMediaType.ERROR)) {
        try {
           Error error = JAXB.unmarshal(new ByteArrayInputStream(data), Error.class);
           exception = new VCloudDirectorException(error);
           message = error.getMessage();
        } catch (Exception e) {
           Throwables.propagate(e);
        }
      }
View Full Code Here

               .httpRequestBuilder().build(),
            new VcloudHttpResponsePrimer()
               .xmlFilePayload("/vdc/error400.xml", VCloudDirectorMediaType.ERROR)
               .httpResponseBuilder().statusCode(400).build());

      Error expected = Error.builder()
            .message("validation error : EntityRef has incorrect type, expected type is com.vmware.vcloud.entity.vdc.")
            .majorErrorCode(400)
            .minorErrorCode("BAD_REQUEST")
            .build();
View Full Code Here

               .httpRequestBuilder().build(),
            new VcloudHttpResponsePrimer()
               .xmlFilePayload("/vdc/param/error400.xml", VCloudDirectorMediaType.ERROR)
               .httpResponseBuilder().statusCode(400).build());

      Error expected = Error.builder()
            .message("?")
            .majorErrorCode(400)
            .minorErrorCode("BAD_REQUEST")
            .build();
View Full Code Here

               .httpRequestBuilder().build(),
            new VcloudHttpResponsePrimer()
               .xmlFilePayload("/media/error400.xml", VCloudDirectorMediaType.ERROR)
               .httpResponseBuilder().statusCode(400).build());
      Error expected = Error.builder()
            .message("validation error on field 'id': String value has invalid format or length")
            .majorErrorCode(400)
            .minorErrorCode("BAD_REQUEST")
            .build();
      
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

      // session api isn't typically exposed to the user, as it is implicit
      SessionApi sessionApi = context.utils().injector().getInstance(SessionApi.class);

      // Check the user can really login with the changed password
      // NOTE: the password is NOT returned in the User object returned from the server
      SessionWithToken sessionWithToken = sessionApi.loginUserInOrgWithPassword(URI.create(endpoint + "/sessions"), user.getName(), org.getName(), "newPassword");
      assertNotNull(sessionWithToken.getToken());
      sessionApi.logoutSessionWithToken(sessionWithToken.getSession().getHref(), sessionWithToken.getToken());
   }
View Full Code Here

      user = userApi.get(user.getHref());
      assertFalse(user.isLocked());

      // Double-check the user can now login again
      SessionWithToken sessionWithToken = sessionApi.loginUserInOrgWithPassword(URI.create(endpoint + "/sessions"), user.getName(), org.getName(), "newPassword");
      assertNotNull(sessionWithToken.getToken());
      sessionApi.logoutSessionWithToken(sessionWithToken.getSession().getHref(), sessionWithToken.getToken());
     
      // Return account settings to the previous values, if necessary
      if (settingsToRevertTo != null) {
         adminOrgApi.editPasswordPolicy(org.getId(), settingsToRevertTo);
      }
View Full Code Here

  }

   @Test(description = "GET /vms/query", dependsOnMethods = { "testQueryAllVApps" })
   public void testQueryAllVms() {
      // Wait for vApp to have been entirely instantiated
      Task instantiateTask = Iterables.getFirst(vApp.getTasks(), null);
      if (instantiateTask != null) {
         assertTaskSucceedsLong(instantiateTask);
      }

      // Start the vApp so that it has VMs
      Task task = vAppApi.powerOn(vApp.getId());
      assertTaskSucceedsLong(task);

      vApp = vAppApi.get(vApp.getId()); // reload, so it has the VMs
      List<Vm> vms = vApp.getChildren().getVms();
      Set<URI> vmHrefs = toHrefs(vms);
View Full Code Here

TOP

Related Classes of org.jclouds.vcloud.director.v1_5.domain.Error$Builder

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.