Tabnine Logo
SnapshotInfo.getTO
Code IndexAdd Tabnine to your IDE (free)

How to use
getTO
method
in
org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo

Best Java code snippets using org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo.getTO (Showing top 6 results out of 315)

origin: apache/cloudstack

@Override
public void takeSnapshot(SnapshotInfo snapshot, AsyncCompletionCallback<CreateCmdResult> callback) {
  CreateCmdResult result = null;
  try {
    s_logger.info("taking elastistor volume snapshot");
    SnapshotObjectTO snapshotTO = (SnapshotObjectTO)snapshot.getTO();
    String volumeid = snapshotTO.getVolume().getUuid();
    String snapshotname = snapshotTO.getName();
    Answer answer = ElastistorUtil.createElastistorVolumeSnapshot(volumeid, snapshotname);
    if(answer.getResult() == false){
      s_logger.info("elastistor volume snapshot failed");
      throw new CloudRuntimeException("elastistor volume snapshot failed");
    }else{
      s_logger.info("elastistor volume snapshot succesfull");
      snapshotTO.setPath(answer.getDetails());
      CreateObjectAnswer createObjectAnswer = new CreateObjectAnswer(snapshotTO);
      result = new CreateCmdResult(null, createObjectAnswer);
      result.setResult(null);
    }
  }
   catch (Throwable e) {
    s_logger.debug("Failed to take snapshot: " + e.getMessage());
    result = new CreateCmdResult(null, null);
    result.setResult(e.toString());
  }
  callback.complete(result);
}
origin: apache/cloudstack

@Override
public void revertSnapshot(SnapshotInfo snapshot, SnapshotInfo snapshotOnPrimaryStore, AsyncCompletionCallback<CommandResult> callback) {
  SnapshotObjectTO snapshotTO = (SnapshotObjectTO)snapshot.getTO();
  RevertSnapshotCommand cmd = new RevertSnapshotCommand(snapshotTO);
  CommandResult result = new CommandResult();
  try {
    EndPoint ep = epSelector.select(snapshotOnPrimaryStore);
    if ( ep == null ){
      String errMsg = "No remote endpoint to send RevertSnapshotCommand, check if host or ssvm is down?";
      s_logger.error(errMsg);
      result.setResult(errMsg);
    } else {
      Answer answer = ep.sendMessage(cmd);
      if (answer != null && !answer.getResult()) {
        result.setResult(answer.getDetails());
      }
    }
  } catch (Exception ex) {
    s_logger.debug("Unable to revert snapshot " + snapshot.getId(), ex);
    result.setResult(ex.toString());
  }
  callback.complete(result);
}
origin: apache/cloudstack

CreateCmdResult result = null;
try {
  SnapshotObjectTO snapshotTO = (SnapshotObjectTO) snapshot.getTO();
  Object payload = snapshot.getPayload();
  if (payload != null && payload instanceof CreateSnapshotPayload) {
origin: apache/cloudstack

CopyCommand copyCommand = new CopyCommand(snapshotInfo.getTO(), destOnStore.getTO(), primaryStorageDownloadWait,
    VirtualMachineManager.ExecuteInSequence.value());
origin: apache/cloudstack

int primaryStorageDownloadWait = NumbersUtil.parseInt(value, Integer.parseInt(Config.PrimaryStorageDownloadWait.getDefaultValue()));
CopyCommand copyCommand = new CopyCommand(snapshotInfo.getTO(), volumeInfo.getTO(), primaryStorageDownloadWait,
    VirtualMachineManager.ExecuteInSequence.value());
origin: apache/cloudstack

SnapshotObjectTO snapshotObjectTo = (SnapshotObjectTO)snapshotInfo.getTO();
org.apache.cloudstack.engine.subsystem.api.storageSnapshotInfogetTO

Popular methods of SnapshotInfo

  • getId
  • getBaseVolume
  • getDataStore
  • getHypervisorType
  • getName
  • getVolumeId
  • getAccountId
  • getDataCenterId
  • getParent
  • getSize
  • getUuid
  • addPayload
  • getUuid,
  • addPayload,
  • getChild,
  • getFullBackup,
  • getLocationType,
  • getPath,
  • getPayload,
  • processEvent,
  • delete

Popular in Java

  • Creating JSON documents from java classes using gson
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (Timer)
  • getSharedPreferences (Context)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • CodeWhisperer alternatives
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