Package org.platformlayer.service.cloud.google.model

Examples of org.platformlayer.service.cloud.google.model.GoogleCloudInstance


    // return config;
  }

  @Override
  public InstanceBase buildInstanceTemplate(MachineCreationRequest request) {
    GoogleCloudInstance rawMachine = new GoogleCloudInstance();

    rawMachine.minimumMemoryMb = request.minimumMemoryMB;
    rawMachine.hostname = request.hostname;

    return rawMachine;
View Full Code Here


  @Override
  protected void addChildren() throws OpsException {
    final GoogleCloudPublicEndpoint model = OpsContext.get().getInstance(GoogleCloudPublicEndpoint.class);

    GoogleCloudInstance instance = client.getItem(model.instance, GoogleCloudInstance.class);

    CloudInstanceMapper instanceMapper;
    {
      instanceMapper = injected(CloudInstanceMapper.class);
      instanceMapper.instance = instance;
View Full Code Here

  @Inject
  ImageFactory imageFactory;

  @Override
  protected void addChildren() throws OpsException {
    final GoogleCloudInstance model = OpsContext.get().getInstance(GoogleCloudInstance.class);

    PublicKey rootPublicKey;

    try {
      rootPublicKey = OpenSshUtils.readSshPublicKey(model.sshPublicKey);
    } catch (IOException e) {
      throw new OpsException("Cannot read SSH key");
    }

    CloudInstanceMapper instance;
    {
      instance = injected(CloudInstanceMapper.class);
      instance.instance = model;
      addChild(instance);
    }

    {
      SshAuthorizedKey authorizeRoot = instance.addChild(SshAuthorizedKey.class);
      authorizeRoot.user = "root";
      authorizeRoot.publicKey = rootPublicKey;
    }

    {
      instance.addChild(ConfigureSshd.class);
    }

    {
      OpsProvider<TagChanges> tagChanges = new OpsProvider<TagChanges>() {
        @Override
        public TagChanges get() {
          GoogleComputeMachine machine = OpsContext.get().getInstance(GoogleComputeMachine.class);

          TagChanges tagChanges = new TagChanges();
          tagChanges.addTags.add(Tag.INSTANCE_KEY.build(model.getKey()));
          tagChanges.addTags.addAll(machine.buildAddressTags());

          return tagChanges;
        }
      };
View Full Code Here

TOP

Related Classes of org.platformlayer.service.cloud.google.model.GoogleCloudInstance

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.