Package io.fathom.cloud.protobuf.CloudModel

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


        IpRange range = IpRange.parse(cidr);
        if (!range.isIpv6()) {
            throw new IllegalArgumentException("Only IPV6 is supported");
        }

        HostData host = networkMap.findHost(cidr);
        if (host == null) {
            throw new IllegalArgumentException("Host with specified CIDR not found");
        }

        HostData.Builder b = HostData.newBuilder(host);
        if (label != null) {
            b.setLabel(label);
        }
        if (networkDevice != null) {
            b.setNetworkDevice(networkDevice);
        }

        HostData created = networkMap.updateHost(host.getId(), b);
        return created;
    }
View Full Code Here


        }
        b.setHostGroup(parent.getId());
        b.setCidr(cidr);
        b.setNetworkDevice(networkDevice);

        HostData created = networkMap.createHost(b);

        return created;
    }
View Full Code Here

    private Host toModel(SchedulerHost host) {
        Host model = new Host();
        model.name = Long.toString(host.getId());

        HostData hostData = host.getHostData();

        model.service = "compute";
        model.zone = OpenstackDefaults.DEFAULT_ZONE;

        /*
 
View Full Code Here

    }

    @Override
    public HostData updateHost(long hostId, io.fathom.cloud.protobuf.CloudModel.HostData.Builder b)
            throws CloudException {
        HostData host = hostStore.getHosts().find(hostId);
        if (host == null) {
            throw new IllegalArgumentException();
        }

        HostData.Builder hb = HostData.newBuilder(host);
        hb.mergeFrom(b.buildPartial());
        hb.setId(host.getId());

        return hostStore.getHosts().update(hb);
    }
View Full Code Here

            return host.fetchUrl(uri);
        }
    }

    public String findHost(SchedulerHost host) {
        HostData hostData = host.getHostData();
        if (hostData.getHostGroup() != hostGroupData.getId()) {
            throw new IllegalStateException();
        }

        String providerId = hostData.getProviderId();
        if (Strings.isNullOrEmpty(providerId)) {
            throw new IllegalStateException();
        }

        return providerId;
View Full Code Here

TOP

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

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.