Package org.platformlayer.ops.helpers

Examples of org.platformlayer.ops.helpers.SshKey


  ServiceContext service;

  @Handler
  public void handler(RawTarget rawTarget) throws OpsException, IOException {
    OpaqueMachine machine = new OpaqueMachine(NetworkPoint.forPublicHostname(rawTarget.host));
    SshKey serviceSshKey = service.getSshKey();
    OpsTarget target = machine.getTarget(serviceSshKey);

    // TODO: We have a bootstrapping problem here!!
    PublicKey sshPublicKey = service.getSshKey().getKeyPair().getPublic();
    SshAuthorizedKey.ensureSshAuthorization(target, "root", sshPublicKey);
View Full Code Here


      } else {
        server = computeClient.ensureHasPublicIp(server);

        machine = new GoogleComputeMachine(computeClient, cloud, server);

        SshKey sshKey = service.getSshKey();
        target = machine.getTarget(GoogleComputeClient.USER_NAME, sshKey.getKeyPair());

        // We need to use sudo while we set up root access
        ((SshOpsTarget) target).setEnsureRunningAsRoot(true);
      }
    }
View Full Code Here

      // DNS service!)
      PlatformLayerKey machineKey = machine.getKey();
      platformLayer.addTag(item.getKey(), Tag.INSTANCE_KEY.build(machineKey));
    }

    SshKey sshKey = service.getSshKey();
    if (machine != null) {
      if (OpsContext.isDelete()) {
        target = null;
        machine = null;
      } else {
View Full Code Here

    recursion.pushChildScope(InstanceBase.class, instance);
    recursion.pushChildScope(OpsTarget.class, target);
  }

  private PersistentInstance buildPersistentInstanceTemplate() throws OpsException {
    SshKey sshKey = service.getSshKey();
    String securityGroup = service.getSecurityGroupName();
    DiskImageRecipe recipeTemplate = diskImageRecipe.get();
    if (recipeTemplate.getKey() == null) {
      // TODO: Something nicer than a UUID
      String recipeId = UUID.randomUUID().toString();
      recipeTemplate.setKey(PlatformLayerKey.fromId(recipeId));
    }

    DiskImageRecipe recipe = imageFactory.getOrCreateRecipe(recipeTemplate);

    PersistentInstance persistentInstanceTemplate = new PersistentInstance();

    persistentInstanceTemplate.setDnsName(dnsName);
    persistentInstanceTemplate.setSshPublicKey(SshKeys.serialize(sshKey.getKeyPair().getPublic()));
    persistentInstanceTemplate.setSecurityGroup(securityGroup);
    persistentInstanceTemplate.setMinimumRam(minimumMemoryMb);
    persistentInstanceTemplate.setCloud(cloud);
    persistentInstanceTemplate.setHostPolicy(hostPolicy);
    persistentInstanceTemplate.setRecipe(recipe.getKey());
View Full Code Here

TOP

Related Classes of org.platformlayer.ops.helpers.SshKey

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.