public void testCreateAggregate() { if (apiOption.isPresent()) { // TODO assuming "nova" availability zone is present testAggregate = apiOption.get().createInAvailabilityZone("jclouds-test-a", "nova"); } }
public void testCreateAggregate() { if (apiOption.isPresent()) { // TODO assuming "nova" availability zone is present testAggregate = apiOption.get().createInAvailabilityZone("jclouds-test-a", "nova"); } }
public void testCreateAggregate() { URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-aggregates"); HostAggregateApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, authenticatedGET().endpoint(endpoint).method("POST") .payload(payloadFromStringWithContentType("{\"aggregate\":{\"name\":\"ubuntu1\",\"availability_zone\":\"nova\"}}", MediaType.APPLICATION_JSON)) .endpoint(endpoint).build(), HttpResponse.builder().statusCode(200).payload(payloadFromResource("/host_aggregate_details.json")).build()) .getHostAggregateExtensionForZone("az-1.region-a.geo-1").get(); assertEquals(api.createInAvailabilityZone("ubuntu1", "nova"), exampleHostAggregate()); }
public void testCreateAggregate() { URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/os-aggregates"); HostAggregateApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, authenticatedGET().endpoint(endpoint).method("POST") .payload(payloadFromStringWithContentType("{\"aggregate\":{\"name\":\"ubuntu1\",\"availability_zone\":\"nova\"}}", MediaType.APPLICATION_JSON)) .endpoint(endpoint).build(), HttpResponse.builder().statusCode(200).payload(payloadFromResource("/host_aggregate_details.json")).build()) .getHostAggregateApi("az-1.region-a.geo-1").get(); assertEquals(api.createInAvailabilityZone("ubuntu1", "nova"), exampleHostAggregate()); }