public void testList() { URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/os-hosts"); HostAdministrationApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, HttpRequest.builder().method("GET") .addHeader("Accept", "application/json") .addHeader("X-Auth-Token", authToken) .endpoint(endpoint).build(), HttpResponse.builder().statusCode(200).payload(payloadFromResource("/hosts_list.json")).build()).getHostAdministrationApi("az-1.region-a.geo-1").get(); Host expected = Host.builder().name("ubuntu").service("compute").zone("nova").build(); Set<? extends Host> result = api.list().toSet(); Host host = Iterables.getOnlyElement(result); assertEquals(host.getName(), "ubuntu"); assertEquals(host.getService(), "compute"); assertEquals(host.getZone(), "nova"); assertEquals(host, expected); }
public void testList() { URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/3456/os-hosts"); HostAdministrationApi api = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, HttpRequest.builder().method("GET") .addHeader("Accept", "application/json") .addHeader("X-Auth-Token", authToken) .endpoint(endpoint).build(), HttpResponse.builder().statusCode(200).payload(payloadFromResource("/hosts_list.json")).build()).getHostAdministrationExtensionForZone("az-1.region-a.geo-1").get(); Host expected = Host.builder().name("ubuntu").service("compute").build(); Set<? extends Host> result = api.list().toSet(); Host host = Iterables.getOnlyElement(result); assertEquals(host.getName(), "ubuntu"); assertEquals(host.getService(), "compute"); assertEquals(host, expected); }
/** * @see Host#getZone() */ public T zone(String zone) { this.zone = zone; return self(); }
/** * @see Host#getName() */ public T name(String name) { this.name = name; return self(); }
/** * @see Host#getService() */ public T service(String service) { this.service = service; return self(); }
/** * @see Host#getName() */ public T name(String name) { this.name = name; return self(); }
/** * @see Host#getName() */ public T name(String name) { this.name = name; return self(); }
/** * @see Host#getZone() */ public T zone(String zone) { this.zone = zone; return self(); }
/** * @see Host#getService() */ public T service(String service) { this.service = service; return self(); }
/** * @see Host#getName() */ public T name(String name) { this.name = name; return self(); }
/** * @see Host#getZone() */ public T zone(String zone) { this.zone = zone; return self(); }
/** * @see Host#getService() */ public T service(String service) { this.service = service; return self(); }
/** * @see Host#getName() */ public T name(String name) { this.name = name; return self(); }
/** * @see Host#getService() */ public T service(String service) { this.service = service; return self(); }
/** * @see Host#getName() */ public T name(String name) { this.name = name; return self(); }
/** * @see Host#getService() */ public T service(String service) { this.service = service; return self(); }