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

  • Running tasks concurrently on multiple threads
  • getSupportFragmentManager (FragmentActivity)
  • getExternalFilesDir (Context)
  • addToBackStack (FragmentTransaction)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • 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