use of com.emc.storageos.model.NamedRelatedResourceRep in project coprhd-controller by CoprHD.
the class InternalVdcApiTest method testSetInUse.
@Test
public void testSetInUse() throws Exception {
VirtualDataCenterList vdcResp = rSys.path("/vdc").get(VirtualDataCenterList.class);
List<NamedRelatedResourceRep> vdcList = vdcResp.getVirtualDataCenters();
Assert.assertTrue(!vdcList.isEmpty());
URI vdcId = vdcList.get(0).getId();
ClientResponse resp = internalVdcClient.setVdcInUse(vdcId, true);
Assert.assertEquals(resp.getClientResponseStatus(), ClientResponse.Status.OK);
resp = internalVdcClient.setVdcInUse(vdcId, false);
Assert.assertEquals(resp.getClientResponseStatus(), ClientResponse.Status.OK);
}
use of com.emc.storageos.model.NamedRelatedResourceRep in project coprhd-controller by CoprHD.
the class InternalVdcApiTest method testListVdc.
@Test
public void testListVdc() throws Exception {
VirtualDataCenterList vdcResp = rSys.path("/vdc").get(VirtualDataCenterList.class);
List<NamedRelatedResourceRep> vdcList = vdcResp.getVirtualDataCenters();
VirtualDataCenterList vdcListFromInternalApi = internalVdcClient.listVdc();
Assert.assertTrue(vdcListFromInternalApi != null);
Assert.assertEquals(vdcList.size(), vdcListFromInternalApi.getVirtualDataCenters().size());
Assert.assertTrue(!vdcList.isEmpty());
URI vdcId = vdcList.get(0).getId();
URI vdcIdFromInternalApi = vdcListFromInternalApi.getVirtualDataCenters().get(0).getId();
Assert.assertEquals(vdcId, vdcIdFromInternalApi);
}
use of com.emc.storageos.model.NamedRelatedResourceRep in project coprhd-controller by CoprHD.
the class InternalVdcApiTest method testGetVdc.
@Test
public void testGetVdc() throws Exception {
VirtualDataCenterList vdcResp = rSys.path("/vdc").get(VirtualDataCenterList.class);
List<NamedRelatedResourceRep> vdcList = vdcResp.getVirtualDataCenters();
Assert.assertTrue(!vdcList.isEmpty());
URI vdcId = vdcList.get(0).getId();
VirtualDataCenterRestRep vdcFromInternalApi = internalVdcClient.getVdc(vdcId);
Assert.assertTrue(vdcFromInternalApi != null);
Assert.assertEquals(vdcId, vdcFromInternalApi.getId());
Assert.assertEquals("vdc1", vdcFromInternalApi.getShortId());
}
use of com.emc.storageos.model.NamedRelatedResourceRep in project coprhd-controller by CoprHD.
the class ApiTestVcenter method getVcenterIdsFromVcenterList.
private List<URI> getVcenterIdsFromVcenterList(VcenterList vcenterList) {
List<URI> vcenterUris = new ArrayList<URI>();
if (vcenterList == null || CollectionUtils.isEmpty(vcenterList.getVcenters())) {
return vcenterUris;
}
Iterator<NamedRelatedResourceRep> vcentersIterator = vcenterList.getVcenters().iterator();
while (vcentersIterator.hasNext()) {
NamedRelatedResourceRep vCenter = vcentersIterator.next();
vcenterUris.add(vCenter.getId());
}
return vcenterUris;
}
use of com.emc.storageos.model.NamedRelatedResourceRep in project coprhd-controller by CoprHD.
the class ApiTestVcenter method getClusterIdsFromClusterList.
private List<URI> getClusterIdsFromClusterList(ClusterList clusterList) {
List<URI> clusterUris = new ArrayList<URI>();
if (clusterList == null || CollectionUtils.isEmpty(clusterList.getClusters())) {
return clusterUris;
}
Iterator<NamedRelatedResourceRep> vcentersIterator = clusterList.getClusters().iterator();
while (vcentersIterator.hasNext()) {
NamedRelatedResourceRep cluster = vcentersIterator.next();
clusterUris.add(cluster.getId());
}
return clusterUris;
}
Aggregations