Package org.platformlayer.ops

Examples of org.platformlayer.ops.Command


    // TODO: Set content type?

    FileUpload.upload(request.target, excludeFile, Joiner.on("\n").join(request.exclude));

    Command tarCommand = Command.build("tar zcf - -X {0} {1}", excludeFile, request.rootDirectory);

    log.info("Backing up " + request.rootDirectory);

    uploadStream(request, tarCommand);
View Full Code Here


        .objects().buildPutRequest(openstackProperties);

    CurlRequest curlRequest = ((RemoteCurlOpenstackRequest) requestBuilder).toCurlRequest();
    curlRequest.bodyFromStdin = true;

    Command curlCommand = curlRequest.toCommand();
    Command pipedCommand = dataSourceCommand.pipeTo(curlCommand);

    ProcessExecution execution = request.target.executeCommand(pipedCommand);

    CurlResult curlResult = curlRequest.parseResponse(execution);
View Full Code Here

  }

  public void upgrade(OpsTarget target) throws OpsException {
    CommandEnvironment commandEnvironment = buildEnvironmentWithProxy(target);

    Command command = Command.build("apt-get --yes upgrade");
    target.executeCommand(command.setEnvironment(commandEnvironment).setTimeout(TimeSpan.TEN_MINUTES));

    flushCache(target);
  }
View Full Code Here

  }

  public void clean(OpsTarget target) throws OpsException {
    CommandEnvironment commandEnvironment = buildEnvironmentWithProxy(target);

    Command command = Command.build("apt-get clean");
    target.executeCommand(command.setEnvironment(commandEnvironment).setTimeout(TimeSpan.TEN_MINUTES));
  }
View Full Code Here

  private boolean haveCurl(OpsTarget target) throws OpsException {
    return target.getFilesystemInfoFile(new File("/usr/bin/curl")) != null;
  }

  public void addRepositoryKeyUrl(OpsTarget target, String url) throws OpsException {
    Command command = Command.build("wget -q -O - {0} | apt-key add -", url);
    target.executeCommand(command);

    flushCache(target);
  }
View Full Code Here

  public List<String> getInstalledPackageInfo(OpsTarget target) throws OpsException {
    AptInfoCache cached = getCache(target);

    if (cached.installedPackages == null) {
      Command command = Command.build("/usr/bin/dpkg --get-selections");
      ProcessExecution execution = target.executeCommand(command);

      final List<String> packages = Lists.newArrayList();
      for (String line : Splitter.on("\n").split(execution.getStdOut())) {
        line = line.trim();
View Full Code Here

  //
  // server.simpleRun(command, new TimeSpan("15m"));
  // }

  public List<String> findOutOfDatePackages(OpsTarget target) throws OpsException {
    Command command = Command.build("apt-get -q -q --simulate dist-upgrade");
    ProcessExecution execution = target.executeCommand(command);

    final List<String> packages = Lists.newArrayList();
    for (String line : Splitter.on("\n").split(execution.getStdOut())) {
      line = line.trim();
View Full Code Here

    CommandEnvironment commandEnvironment = buildEnvironmentWithProxy(target);
    commandEnvironment.put("DEBIAN_FRONTEND", "noninteractive");

    log.info("Installing APT packages: " + Joiner.on(",").join(packageNames));

    Command command = Command.build("apt-get install --yes");
    for (String packageName : packageNames) {
      command.addQuoted(packageName);
    }
    target.executeCommand(command.setEnvironment(commandEnvironment).setTimeout(TimeSpan.TEN_MINUTES));

    flushCache(target);
  }
View Full Code Here

    log.info("Updating apt repositories");

    CommandEnvironment commandEnvironment = buildEnvironmentWithProxy(target);

    Command command = Command.build("apt-get --yes update");
    command = command.setEnvironment(commandEnvironment).setTimeout(TimeSpan.TEN_MINUTES);
    executeAptCommand(target, command);

    flushCache(target);
  }
View Full Code Here

    }
  }

  private void doDpkgConfigure(OpsTarget target) throws OpsException {
    CommandEnvironment commandEnvironment = buildEnvironmentWithProxy(target);
    Command command = Command.build("dpkg --configure -a");
    command = command.setEnvironment(commandEnvironment).setTimeout(TimeSpan.TEN_MINUTES);
    target.executeCommand(command);
  }
View Full Code Here

TOP

Related Classes of org.platformlayer.ops.Command

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.