Package com.google.api.services.compute.model

Examples of com.google.api.services.compute.model.Metadata


          networkInterface.setAccessConfigs(Lists.newArrayList(networkAccessConfig));

          create.setNetworkInterfaces(Lists.newArrayList(networkInterface));
        }

        Metadata metadata = new Metadata();
        metadata.setItems(Lists.<Items> newArrayList());
        create.setMetadata(metadata);

        if (request.tags != null) {
          for (Tag tag : request.tags) {
            Metadata.Items meta = new Metadata.Items();
            meta.setKey(tag.getKey());
            meta.setValue(tag.getValue());
            metadata.getItems().add(meta);
          }
        }

        if (request.sshPublicKey != null) {
          Metadata.Items meta = new Metadata.Items();
          meta.setKey("sshKeys");
          meta.setValue(USER_NAME + ":" + OpenSshUtils.serialize(sshPublicKey));

          metadata.getItems().add(meta);
        }

        create.setImage(foundImage.getSelfLink());

        MachineType flavor = getClosestInstanceType(request);
View Full Code Here


                po.getProjectId(), gccTemplate.getGccZone().getValue(), gccTemplate.getGccInstanceType().getValue()));
        instance.setName(name);
        instance.setCanIpForward(Boolean.TRUE);
        instance.setNetworkInterfaces(getNetworkInterface(po.getProjectId(), stack.getName()));
        instance.setDisks(listOfDisks);
        Metadata metadata = new Metadata();
        metadata.setItems(Lists.<Metadata.Items>newArrayList());

        Metadata.Items sshMetaData = new Metadata.Items();
        sshMetaData.setKey("sshKeys");
        sshMetaData.setValue("ubuntu:" + gccCredential.getPublicKey());

        Metadata.Items startupScript = new Metadata.Items();
        startupScript.setKey("startup-script");
        startupScript.setValue(po.getUserData());

        metadata.getItems().add(sshMetaData);
        metadata.getItems().add(startupScript);
        instance.setMetadata(metadata);
        Compute.Instances.Insert ins =
                po.getCompute().instances().insert(gccCredential.getProjectId(), gccTemplate.getGccZone().getValue(), instance);

        ins.setPrettyPrint(Boolean.TRUE);
View Full Code Here

TOP

Related Classes of com.google.api.services.compute.model.Metadata

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.