io.cattle.platform.core.model.Volume.getImageId()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(119)

本文整理了Java中io.cattle.platform.core.model.Volume.getImageId()方法的一些代码示例,展示了Volume.getImageId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Volume.getImageId()方法的具体详情如下:
包路径:io.cattle.platform.core.model.Volume
类名称:Volume
方法名:getImageId

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());

相关文章