@Test public void testGetVLANInfo() throws Exception { for (VLANInfo vlanInfo : api.listVLANs().concat()) { assertNotNull(vlanInfo.getUuid()); } }
nicObject.addProperty("vlan", nic.getVlan().getUuid()); } else if (nic.getIpV4Configuration() != null) { nicObject.add("ip_v4_conf", ipConfigurationToJsonObject(nic.getIpV4Configuration()));
nicObject.addProperty("vlan", nic.getVlan().getUuid()); } else if (nic.getIpV4Configuration() != null) { nicObject.add("ip_v4_conf", ipConfigurationToJsonObject(nic.getIpV4Configuration()));
nicObject.addProperty("vlan", nic.getVlan().getUuid()); } else if (nic.getIpV4Configuration() != null) { nicObject.add("ip_v4_conf", ipConfigurationToJsonObject(nic.getIpV4Configuration()));
@Test public void testListVLANs() throws Exception { CloudSigma2Api api = requestsSendResponses( getBuilder() .endpoint(endpoint + "vlans/") .build(), responseBuilder() .payload(payloadFromResourceWithContentType("/vlans.json", MediaType.APPLICATION_JSON)) .build(), getBuilder() .endpoint(endpoint + "vlans/") .addQueryParam("limit", "1") .addQueryParam("offset", "1") .build(), responseBuilder() .payload(payloadFromResourceWithContentType("/vlans-last-page.json", MediaType.APPLICATION_JSON)) .build()); List<VLANInfo> vlans = api.listVLANs().concat().toList(); assertEquals(vlans.size(), 2); assertEquals(vlans.get(0).getUuid(), "96537817-f4b6-496b-a861-e74192d3ccb0"); assertEquals(vlans.get(1).getUuid(), "00b445a9-3936-47e5-ba8a-38adcf43db20"); }
@Test public void testListVLANInfo() throws Exception { CloudSigma2Api api = requestsSendResponses( getBuilder() .endpoint(endpoint + "vlans/detail/") .build(), responseBuilder() .payload(payloadFromResourceWithContentType("/vlans.json", MediaType.APPLICATION_JSON)) .build(), getBuilder() .endpoint(endpoint + "vlans/detail/") .addQueryParam("limit", "1") .addQueryParam("offset", "1") .build(), responseBuilder() .payload(payloadFromResourceWithContentType("/vlans-last-page.json", MediaType.APPLICATION_JSON)) .build()); List<VLANInfo> vlanInfos = api.listVLANInfo().concat().toList(); assertEquals(vlanInfos.size(), 2); assertEquals(vlanInfos.get(0).getUuid(), "96537817-f4b6-496b-a861-e74192d3ccb0"); assertEquals(vlanInfos.get(1).getUuid(), "00b445a9-3936-47e5-ba8a-38adcf43db20"); }
@Test public void testEditVLAN() throws Exception { Map<String, String> meta = Maps.newHashMap(); meta.put("test", "test data"); VLANInfo vlanInfo = new VLANInfo.Builder() .meta(meta) .build(); if (!api.listVLANs().concat().isEmpty()) { checkVlAN(vlanInfo, api.editVLAN(api.listVLANs().concat().get(0).getUuid(), vlanInfo)); } }