Package io.fathom.cloud.protobuf.CloudModel

Examples of io.fathom.cloud.protobuf.CloudModel.KeyPairData


    }

    @GET
    @Path("{id}")
    public WrappedKeypair getKeypair(@PathParam("id") String id) throws CloudException {
        KeyPairData keypair = keypairs.findKeyPair(getProject(), id);
        notFoundIfNull(keypair);

        WrappedKeypair response = new WrappedKeypair();
        response.keypair = toModel(keypair);
        return response;
View Full Code Here


    }

    @DELETE
    @Path("{id}")
    public Response deleteKeypair(@PathParam("id") String id) throws CloudException {
        KeyPairData keypair = keypairs.findKeyPair(getProject(), id);
        notFoundIfNull(keypair);

        keypairs.delete(getProject(), id);
        return Response.accepted().build();
    }
View Full Code Here

            // publicKey = sshKey.getPublicKey();
            // privateKey = sshKey.getPrivateKey();
            // OpenSshUtils.serialize(sshPublicKey);
        }

        KeyPairData created = keypairs.create(getProject(), request.keypair.name, sshPublicKey);

        WrappedKeypair response = new WrappedKeypair();
        response.keypair = toModel(created);

        if (privateKey != null) {
View Full Code Here

        return getKeyPairsStore(project).create(keyPairData);
    }

    public boolean delete(Project project, String id) throws CloudException {
        NamedItemCollection<KeyPairData> store = getKeyPairsStore(project);
        KeyPairData keypair = store.find(id);
        if (keypair == null) {
            return false;
        }
        store.delete(id);
        return true;
View Full Code Here

            }
            keyPairData.setPublicKeyFingerprint(sb.toString());
        }

        try {
            KeyPairData created = create(project, keyPairData);
            return created;
        } catch (DuplicateValueException e) {
            throw new WebApplicationException(Status.CONFLICT);
        }
    }
View Full Code Here

        {
            InstanceData.Builder instance = InstanceData.newBuilder();
            instance.setName(request.server.name);

            if (request.server.keyName != null) {
                KeyPairData keypair = keypairs.findKeyPair(getProject(), request.server.keyName);
                if (keypair == null) {
                    throw new IllegalArgumentException();
                }
                instance.setKeyPair(keypair);
            }
View Full Code Here

    public String getEc2MetadataValue(@PathParam("key") String key) throws CloudException {
        InstanceData instance = getInstance();

        if (key.equals("public-keys")) {
            if (instance.hasKeyPair()) {
                KeyPairData keyPair = instance.getKeyPair();

                String name = keyPair.getKey();

                String s = "0=" + name;
                return s;
            }
        }
View Full Code Here

        InstanceData instance = getInstance();

        if (key.equals("public-keys")) {
            if (subkey.equals("openssh-key")) {
                if (index == 0 && instance.hasKeyPair()) {
                    KeyPairData keyPair = instance.getKeyPair();

                    String s = keyPair.getPublicKey();
                    return s;
                }
            }
        }
View Full Code Here

    @Override
    protected InstanceData run0() throws Exception {
        authenticate();

        KeyPairData keyPair = buildKeypair();

        List<Long> securityGroupIds = buildSecurityGroups();

        Image image = buildImage();
View Full Code Here

    private KeyPairData buildKeypair() throws CloudException, IOException {
        PublicKey sshPublicKey = sshContext.getPublicKey();

        String keypairName = "__system__";
        KeyPairData keyPair = keypairs.findKeyPair(project, keypairName);
        if (keyPair == null) {
            log.info("Creating keypair: {}", keypairName);
            keypairs.create(project, keypairName, sshPublicKey);
        } else {
            log.info("Found keypair: {}", keypairName);
View Full Code Here

TOP

Related Classes of io.fathom.cloud.protobuf.CloudModel.KeyPairData

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.