Package io.fathom.cloud.openstack.client.dns.model

Examples of io.fathom.cloud.openstack.client.dns.model.Zone


    @POST
    public WrappedZone createZone(WrappedZone request) throws CloudException {
        Project project = getProject();

        Zone zone = request.zone;

        DnsService.DnsZoneSpec zoneSpec = new DnsService.DnsZoneSpec();
        zoneSpec.name = zone.name;

        DnsService.Zone domain;
View Full Code Here


        response.zone = toModel((DnsZone) domain);
        return response;
    }

    private Zone toModel(DnsZone zone) {
        Zone model = new Zone();
        // zone.id = domain.getData().getDomain();
        model.name = zone.getName();
        model.project_id = "" + zone.getProjectId();
        model.id = "" + zone.getId();
        return model;
View Full Code Here

            throws CloudException {
        try {
            OpenstackClient openstackClient = getOpenstackClient();
            OpenstackDnsClient dns = openstackClient.getDns();

            Zone request = new Zone();
            request.name = zone;

            Zone response = dns.createZone(request);
            return response.id;
        } catch (RestClientException e) {
            if (e.is(409)) {
                throw new DuplicateValueException();
            }
View Full Code Here

            this.openstackClient = getOpenstackClient();
        }

        @Override
        public Void call() throws CloudException, IOException {
            Zone zone = getZone();

            List<Recordset> requested = readFromDatabase(true);
            List<Recordset> current;
            try {
                current = readFromOpenstack(zone);
View Full Code Here

        private Zone getZone() throws CloudException {
            String zoneName = this.zone.getName();
            try {
                OpenstackDnsClient client = openstackClient.getDns();
                List<Zone> zones = client.listZones();
                Zone zone = null;
                for (Zone z : zones) {
                    if (zoneName.equals(z.name)) {
                        zone = z;
                        break;
                    }
                }

                if (zone == null) {
                    zone = new Zone();
                    zone.name = zoneName;

                    zone = client.createZone(zone);
                }
View Full Code Here

TOP

Related Classes of io.fathom.cloud.openstack.client.dns.model.Zone

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.