use of com.vmware.photon.controller.model.resources.DiskService.DiskState in project photon-model by vmware.
the class EndpointRemovalTaskServiceTest method createDiskState.
private static void createDiskState(BaseModelTest test, String endpointLink, List<String> tenantLinks) throws Throwable {
DiskState d = new DiskState();
d.id = UUID.randomUUID().toString();
d.type = DiskType.HDD;
d.name = "disk";
d.capacityMBytes = 100L;
d.tenantLinks = tenantLinks;
d.endpointLink = endpointLink;
d.endpointLinks = new HashSet<String>();
d.endpointLinks.add(endpointLink);
test.postServiceSynchronously(DiskService.FACTORY_LINK, d, DiskState.class);
}
use of com.vmware.photon.controller.model.resources.DiskService.DiskState in project photon-model by vmware.
the class TagGroomerTaskServiceTest method createDisksWithTags.
/**
* Create n computes associated with specific tags
*/
private void createDisksWithTags(int count, List<String> tagLinks) {
DiskState diskState = new DiskState();
diskState.descriptionLink = "description-link";
diskState.id = UUID.randomUUID().toString();
diskState.name = diskState.id;
diskState.tagLinks = new HashSet<>();
for (int i = 0; i < count; i++) {
diskState.tagLinks.add(tagLinks.get(i));
Operation op = Operation.createPost(UriUtils.buildUri(this.host, DiskService.FACTORY_LINK)).setBody(diskState);
this.host.waitForResponse(op);
// clear tagLinks and assign new one on the next round
diskState.tagLinks.clear();
}
}
Aggregations