Package io.fathom.cloud

Examples of io.fathom.cloud.CloudException


        try (Sftp sftp = buildSftp()) {
            File processFile = getProcessFile(containerId);
            sftp.delete(processFile);
            return true;
        } catch (IOException e) {
            throw new CloudException("Error stopping container", e);
        }
    }
View Full Code Here


        for (String instanceEc2Id : instanceEc2Ids) {
            long instanceId = decodeEc2Id("i-", instanceEc2Id);
            InstanceData instance = instanceStateStore.getInstances(getProject().getId()).find(instanceId);
            if (instance == null) {
                throw new CloudException("The instance ID '" + instanceEc2Id + "' does not exist");
            }
            stopInstances.add(instance);
        }

        asyncTasks.stopInstances(stopInstances);
View Full Code Here

        byte[] secretData;
        try {
            secretData = host.getSecret(containerId, key);
        } catch (IOException e) {
            throw new CloudException("Error reading secret", e);
        }
        return secretData;
    }
View Full Code Here

    // }

    public Csr buildCsr(KeyPair keyPair, String subject) throws CloudException {
        String domainName = subject;
        if (domainName == null) {
            throw new CloudException("Subject must be specified");
        }

        X500Principal principal = buildPrincipal(subject);

        Csr csr = Csr.buildCsr(keyPair, principal);
View Full Code Here

        ByteString data;
        try {
            data = codec.serialize(msg);
        } catch (IOException e) {
            throw new CloudException("Error serializing data", e);
        }

        node.update(data);
        return msg;
    }
View Full Code Here

            ByteString data;
            try {
                data = codec.serialize(built);
            } catch (IOException e) {
                throw new CloudException("Error serializing data", e);
            }
            StateNode node = parentNode.child(Long.toHexString(id));

            if (!node.create(data)) {
                continue;
View Full Code Here

            return response.id;
        } catch (RestClientException e) {
            if (e.is(409)) {
                throw new DuplicateValueException();
            }
            throw new CloudException("Error creating zone", e);
        }
    }
View Full Code Here

            List<Recordset> requested = readFromDatabase(true);
            List<Recordset> current;
            try {
                current = readFromOpenstack(zone);
            } catch (RestClientException e) {
                throw new CloudException("Error reading zone", e);
            }

            Changes changes = computeChanges(current, requested);

            try {
                OpenstackDnsClient client = openstackClient.getDns();
                for (Recordset r : changes.remove) {
                    client.deleteRecordset(zone.id, r.id);
                }
                for (Recordset r : changes.create) {
                    client.createRecordset(zone.id, r);
                }
            } catch (RestClientException e) {
                throw new CloudException("Error applying zone changes", e);
            }

            return null;
        }
View Full Code Here

                    zone = client.createZone(zone);
                }

                return zone;
            } catch (RestClientException e) {
                throw new CloudException("Error mapping zone: " + zoneName, e);
            }
        }
View Full Code Here

            if (!pb.hasSecretData()) {
                try {
                    pb.setSecretData(Secrets.buildProjectRolesSecret(granteeData, authenticatedProject));
                } catch (KeyczarException e) {
                    throw new CloudException("Crypto error granting project role", e);
                }
            }

            if (!pb.getRoleList().contains(role.getId())) {
                pb.addRole(role.getId());
View Full Code Here

TOP

Related Classes of io.fathom.cloud.CloudException

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.