use of com.vmware.photon.controller.model.resources.DiskService.DiskState.BootConfig in project photon-model by vmware.
the class TestVSphereProvisionWithCloudConfigTask method createBootDisk.
private DiskState createBootDisk(String cloudConfig) throws Throwable {
DiskState res = new DiskState();
res.bootOrder = 1;
res.type = DiskType.HDD;
res.id = res.name = "boot-disk";
res.sourceImageReference = URI.create("file:///dev/null");
res.bootConfig = new BootConfig();
res.bootConfig.files = new FileEntry[] { new FileEntry(), new FileEntry() };
res.bootConfig.files[0].path = "user-data";
res.bootConfig.files[0].contents = cloudConfig;
res.bootConfig.files[1].path = "public-keys";
res.bootConfig.files[1].contents = IOUtils.toString(new File("src/test/resources/testkey.pub").toURI());
return TestUtils.doPost(this.host, res, DiskState.class, UriUtils.buildUri(this.host, DiskService.FACTORY_LINK));
}
use of com.vmware.photon.controller.model.resources.DiskService.DiskState.BootConfig in project photon-model by vmware.
the class TestVSphereProvisionWithStaticIpTask method createBootDisk.
@SuppressWarnings("unused")
private DiskState createBootDisk(String cloudConfig) throws Throwable {
DiskState res = new DiskState();
res.bootOrder = 1;
res.type = DiskType.HDD;
res.id = res.name = "boot-disk";
res.sourceImageReference = URI.create("file:///dev/null");
res.bootConfig = new BootConfig();
res.bootConfig.files = new FileEntry[] { new FileEntry(), new FileEntry() };
res.bootConfig.files[0].path = "user-data";
res.bootConfig.files[0].contents = cloudConfig;
res.bootConfig.files[1].path = "public-keys";
res.bootConfig.files[1].contents = IOUtils.toString(new File("src/test/resources/testkey.pub").toURI());
return TestUtils.doPost(this.host, res, DiskState.class, UriUtils.buildUri(this.host, DiskService.FACTORY_LINK));
}
Aggregations