Package org.jclouds.compute.callables

Examples of org.jclouds.compute.callables.RunScriptOnNode


            .apply(hostSupplier.get());
      BridgedIf activeBridgedIf = checkNotNull(Iterables.get(activeBridgedInterfaces, 0), "activeBridgedInterfaces");
      String network = activeBridgedIf.getIpAddress();

      // scan ip
      RunScriptOnNode ipScanRunScript = scriptRunnerFactory.create(hostSupplier.get(),
            new ScanNetworkWithPing(network), RunScriptOptions.NONE);
      ExecResponse execResponse = ipScanRunScript.init().call();
      checkState(execResponse.getExitStatus() == 0);

      // retrieve ip from mac
      RunScriptOnNode getIpFromMACAddressRunScript = scriptRunnerFactory.create(hostSupplier.get(),
            new GetIPAddressFromMAC(networkAdapter.getMACAddress()), RunScriptOptions.NONE);
      ExecResponse ipExecResponse = getIpFromMACAddressRunScript.init().call();
      checkState(ipExecResponse.getExitStatus() == 0);
      return checkNotNull(ipExecResponse.getOutput(), "ipAddress");
   }
View Full Code Here


      String originalId = node.get().getId();
      try {
         if (options.shouldBlockUntilRunning()) {
            pollNodeRunning.apply(node);
            if (statement != null) {
               RunScriptOnNode runner = initScriptRunnerFactory.create(node.get(), statement, options, badNodes).call();
               if (runner != null) {
                  ExecResponse exec = runner.call();
                  customizationResponses.put(node.get(), exec);
               }
            }
            if (options.getPort() > 0) {
               openSocketFinder.findOpenSocketOnNode(node.get(), options.getPort(), options.getSeconds(),
View Full Code Here

   @SuppressWarnings({ "unchecked", "rawtypes" })
   @Test
   public void testStartVboxConnectsToManagerWhenPortAlreadyListening() throws Exception {
      VirtualBoxManager manager = createMock(VirtualBoxManager.class);
      Factory runScriptOnNodeFactory = createMock(Factory.class);
      RunScriptOnNode runScriptOnNode = createMock(RunScriptOnNode.class);
      RetryIfSocketNotYetOpen client = createMock(RetryIfSocketNotYetOpen.class);
      HardcodedHostToHostNodeMetadata hardcodedHostToHostNodeMetadata = createMock(HardcodedHostToHostNodeMetadata.class);
      NodeMetadata host = new NodeMetadataBuilder().id("host").status(Status.RUNNING).build();
      URI provider = URI.create("http://localhost:18083/");
      expect(client.seconds(3)).andReturn(client);
View Full Code Here

            .apply(hostSupplier.get());
      BridgedIf activeBridgedIf = checkNotNull(Iterables.get(activeBridgedInterfaces, 0), "activeBridgedInterfaces");
      String network = activeBridgedIf.getIpAddress();

      // scan ip
      RunScriptOnNode ipScanRunScript = scriptRunnerFactory.create(hostSupplier.get(),
            new ScanNetworkWithPing(network), RunScriptOptions.NONE);
      ExecResponse execResponse = ipScanRunScript.init().call();
      checkState(execResponse.getExitStatus() == 0);

      // retrieve ip from mac
      RunScriptOnNode getIpFromMACAddressRunScript = scriptRunnerFactory.create(hostSupplier.get(),
            new GetIPAddressFromMAC(networkAdapter.getMACAddress()), RunScriptOptions.NONE);
      ExecResponse ipExecResponse = getIpFromMACAddressRunScript.init().call();
      checkState(ipExecResponse.getExitStatus() == 0);
      return checkNotNull(ipExecResponse.getOutput(), "ipAddress");
   }
View Full Code Here

  // purposes
  public class LogCallToRunScriptOnNode implements MethodInterceptor {

    public Object invoke(MethodInvocation i) throws Throwable {
      if (i.getMethod().getName().equals("call")) {
        RunScriptOnNode runScriptOnNode = RunScriptOnNode.class.cast(i
            .getThis());
        String nodeName = runScriptOnNode.getNode().getName();
        LOG.info(nodeName + " >> running script");
        Object returnVal = i.proceed();
        LOG.info(nodeName + " << " + returnVal);
        return returnVal;
      } else {
View Full Code Here

      String originalId = node.get().getId();
      try {
         if (options.shouldBlockUntilRunning()) {
            pollNodeRunning.apply(node);
            if (statement != null) {
               RunScriptOnNode runner = initScriptRunnerFactory.create(node.get(), statement, options, badNodes).call();
               if (runner != null) {
                  ExecResponse exec = runner.call();
                  customizationResponses.put(node.get(), exec);
               }
            }
            if (options.getPort() > 0) {
               openSocketFinder.findOpenSocketOnNode(node.get(), options.getPort(), options.getSeconds(),
View Full Code Here

      String originalId = node.get().getId();
      try {
         if (options.shouldBlockUntilRunning()) {
            pollNodeRunning.apply(node);
            if (statement != null) {
               RunScriptOnNode runner = initScriptRunnerFactory.create(node.get(), statement, options, badNodes).call();
               if (runner != null) {
                  ExecResponse exec = runner.call();
                  customizationResponses.put(node.get(), exec);
               }
            }
            if (options.getPort() > 0) {
               openSocketFinder.findOpenSocketOnNode(node.get(), options.getPort(), options.getSeconds(),
View Full Code Here

      String originalId = node.get().getId();
      try {
         if (options.shouldBlockUntilRunning()) {
            pollNodeRunning.apply(node);
            if (statement != null) {
               RunScriptOnNode runner = initScriptRunnerFactory.create(node.get(), statement, options, badNodes).call();
               if (runner != null) {
                  ExecResponse exec = runner.call();
                  customizationResponses.put(node.get(), exec);
               }
            }
            if (options.getPort() > 0) {
               openSocketFinder.findOpenSocketOnNode(node.get(), options.getPort(), options.getSeconds(),
View Full Code Here

TOP

Related Classes of org.jclouds.compute.callables.RunScriptOnNode

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.