本文整理了Java中io.cattle.platform.core.model.Volume.getImageId()
方法的一些代码示例,展示了Volume.getImageId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Volume.getImageId()
方法的具体详情如下:
包路径:io.cattle.platform.core.model.Volume
类名称:Volume
方法名:getImageId
[英]Getter for cattle.volume.image_id
.
[中][$0$]的Getter。
代码示例来源:origin: rancher/cattle
@Override
public HandlerResult handle(ProcessState state, ProcessInstance process) {
Volume volume = (Volume)state.getResource();
if (volume.getImageId() != null || StringUtils.isEmpty(volume.getName())) {
return null;
}
Map<Object, Object> data = new HashMap<>();
String externalId = volume.getExternalId();
if (StringUtils.isEmpty(externalId)) {
externalId = volume.getName();
}
data.put("externalId", VolumeUtils.externalId(externalId));
return new HandlerResult(data);
}
}
代码示例来源:origin: rancher/cattle
protected void activatePool(Volume volume, VolumeStoragePoolMap map, Map<String, Object> data) {
Image image = getObjectManager().loadResource(Image.class, volume.getImageId());
activateImageInPool(volume, image, map.getStoragePoolId(), data);
createThenActivate(map, data);
}
代码示例来源:origin: rancher/cattle
if (restrictToUnmanagedPool || volume.getImageId() != null) {
constraints.add(new UnmanagedStoragePoolKindConstraint(volume));
代码示例来源:origin: rancher/cattle
@Override
public HandlerResult handle(ProcessState state, ProcessInstance process) {
Volume volume = (Volume)state.getResource();
deallocate(volume, state.getData());
boolean maps = false;
boolean mounts = false;
for (VolumeStoragePoolMap map : mapDao.findToRemove(VolumeStoragePoolMap.class, Volume.class, volume.getId())) {
maps = true;
deactivateThenScheduleRemove(map, null);
}
for (Mount mount : mapDao.findToRemove(Mount.class, Volume.class, volume.getId())) {
mounts = true;
deactivateThenRemove(mount, null);
}
Image image = objectManager.loadResource(Image.class, volume.getImageId());
if (image != null) {
remove(image, null);
}
if (maps && !mounts && volume.getHostId() != null) {
/* HostId != null means this volume was created from a host, but no mounts also means it won't be deleted,
* so we delete.
*/
return super.handle(state, process);
}
return new HandlerResult();
}
代码示例来源:origin: rancher/cattle
setAttachedState(from.getAttachedState());
setInstanceId(from.getInstanceId());
setImageId(from.getImageId());
setZoneId(from.getZoneId());
setUri(from.getUri());
内容来源于网络,如有侵权,请联系作者删除!