congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Snapshot.getId
Code IndexAdd Tabnine to your IDE (free)

How to use
getId
method
in
io.cattle.platform.core.model.Snapshot

Best Java code snippets using io.cattle.platform.core.model.Snapshot.getId (Showing top 4 results out of 315)

origin: rancher/cattle

  void validateSnapshotRemove(ApiRequest request) {
    Snapshot snapshot = objectManager.loadResource(Snapshot.class, request.getId());
    Map<Object, Object> criteria = new HashMap<Object, Object>();
    criteria.put(SNAPSHOT.VOLUME_ID, snapshot.getVolumeId());
    criteria.put(SNAPSHOT.REMOVED, null);
    criteria.put(SNAPSHOT.ID, new Condition(ConditionType.GT, snapshot.getId()));
    List<Snapshot> snapshots = objectManager.find(Snapshot.class, criteria);
    if (snapshots.size() == 0) {
      throw new ClientVisibleException(ResponseCodes.BAD_REQUEST, ValidationErrorCodes.INVALID_STATE,
          "This snapshot cannot be removed because it is the latest one for the volume.", null);
    }
  }
}
origin: rancher/cattle

@Override
public HandlerResult handle(ProcessState state, ProcessInstance process) {
  Volume volume = (Volume)state.getResource();
  List<Snapshot> snapshots = null;
  if (VolumeConstants.PROCESS_RESTORE_FROM_BACKUP.equalsIgnoreCase(process.getName())) {
    snapshots = objectManager.children(volume, Snapshot.class);
  } else if (VolumeConstants.PROCESS_REVERT.equalsIgnoreCase(process.getName())) {
    Snapshot snapshot = objectManager.loadResource(Snapshot.class, state.getData().get("snapshotId").toString());
    Map<Object, Object> criteria = new HashMap<Object, Object>();
    criteria.put(SNAPSHOT.VOLUME_ID, volume.getId());
    criteria.put(SNAPSHOT.REMOVED, null);
    criteria.put(SNAPSHOT.ID, new Condition(ConditionType.GT, snapshot.getId()));
    snapshots = objectManager.find(Snapshot.class, criteria);
  } else {
    throw new IllegalStateException("Unknown process: " + process.getName());
  }
  for (Snapshot s : snapshots) {
    if (s.getRemoved() == null) {
      objectProcessManager.scheduleStandardProcess(StandardProcess.REMOVE, s, null);
    }
  }
  return null;
}
origin: rancher/cattle

backup.setSnapshotId(snapshot.getId());
backup.setVolumeId(snapshot.getVolumeId());
backup.setBackupTargetId(targetId);
origin: rancher/cattle

/**
 * {@inheritDoc}
 */
@Override
public void from(io.cattle.platform.core.model.Snapshot from) {
  setId(from.getId());
  setName(from.getName());
  setAccountId(from.getAccountId());
  setKind(from.getKind());
  setUuid(from.getUuid());
  setDescription(from.getDescription());
  setState(from.getState());
  setCreated(from.getCreated());
  setRemoved(from.getRemoved());
  setRemoveTime(from.getRemoveTime());
  setData(from.getData());
  setVolumeId(from.getVolumeId());
}
io.cattle.platform.core.modelSnapshotgetId

Javadoc

Getter for cattle.snapshot.id.

Popular methods of Snapshot

  • getAccountId
    Getter for cattle.snapshot.account_id.
  • getRemoved
    Getter for cattle.snapshot.removed.
  • getState
    Getter for cattle.snapshot.state.
  • getVolumeId
    Getter for cattle.snapshot.volume_id.
  • from
    Load data from another generated Record/POJO implementing the common interface Snapshot
  • getCreated
    Getter for cattle.snapshot.created.
  • getData
    Getter for cattle.snapshot.data.
  • getDescription
    Getter for cattle.snapshot.description.
  • getKind
    Getter for cattle.snapshot.kind.
  • getName
    Getter for cattle.snapshot.name.
  • getRemoveTime
    Getter for cattle.snapshot.remove_time.
  • getUuid
    Getter for cattle.snapshot.uuid.
  • getRemoveTime,
  • getUuid,
  • setAccountId,
  • setKind,
  • setName,
  • setVolumeId

Popular in Java

  • Making http post requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • compareTo (BigDecimal)
  • putExtra (Intent)
  • Menu (java.awt)
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • JFileChooser (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now