Package io.fathom.cloud.dns.model

Examples of io.fathom.cloud.dns.model.DnsZone


    RecordsetList list(boolean details) throws CloudException {
        RecordsetList recordsets = new RecordsetList();
        recordsets.recordsets = Lists.newArrayList();

        DnsZone domain = getZone();
        for (DnsService.Recordset record : dnsService.listRecordsets(getProject(), domain)) {
            recordsets.recordsets.add(toModel(domain, (DnsRecordset) record, true));
        }

        return recordsets;
View Full Code Here


        return list(true);
    }

    @POST
    public WrappedRecordset createRecordset(WrappedRecordset request) throws CloudException {
        DnsZone zone = getZone();

        Recordset recordset = request.recordset;
        DnsRecordsetData.Builder b = DnsRecordsetData.newBuilder();
        b.setFqdn(recordset.name);
        b.setType(recordset.type);
View Full Code Here

    }

    @DELETE
    @Path("{id}")
    public void deleteRecordset(@PathParam("id") Long recordsetId) throws CloudException {
        DnsZone zone = getZone();

        dnsService.deleteRecordset(getProject(), zone, recordsetId);
    }
View Full Code Here

    }

    @GET
    @Path("{id}")
    public WrappedRecordset read(@PathParam("id") Long recordsetId) throws CloudException {
        DnsZone zone = getZone();

        DnsService.Recordset record = dnsService.findRecordset(getProject(), zone, recordsetId);
        notFoundIfNull(record);

        WrappedRecordset response = new WrappedRecordset();
View Full Code Here

        return response;
    }

    private DnsZone getZone() throws CloudException {
        DnsZone domain = dnsService.findDomain(getProject(), zoneId);
        notFoundIfNull(domain);
        return domain;
    }
View Full Code Here

    @Override
    protected DnsZoneData run0() throws Exception {
        Auth auth = getAuth();
        Project project = auth.getProject();

        DnsZone found = dns.findZoneByName(project, zone);
        if (found == null) {
            throw new IllegalArgumentException("Zone not found: " + zone);
        }
        dns.deleteZone(project, found);
        return found.getData();
    }
View Full Code Here

    @Override
    protected DnsRecordsetData run0() throws Exception {
        Auth auth = getAuth();
        Project project = auth.getProject();

        DnsZone zone = dns.findMaximalZone(project, fqdn);
        if (zone == null) {
            throw new IllegalArgumentException("Cannot find matching zone");
        }

        DnsRecordset created = dns.createRecordset(project, zone, fqdn, type, values);
View Full Code Here

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

        DnsZone created;

        try {
            created = dns.createZone(project, zoneSpec);
        } catch (DuplicateValueException e) {
            throw new CmdletException("Zone already exists (locally or in backend provider).");
        }

        if (shared) {
            dns.createShared(created);
        }
        return created.getData();
    }
View Full Code Here

    @Override
    protected List<DnsRecordsetData> run0() throws Exception {
        Auth auth = getAuth();
        Project project = auth.getProject();

        DnsZone zone = dns.findZoneByName(project, zoneName);
        if (zone == null) {
            throw new WebApplicationException(Status.NOT_FOUND);
        }

        List<DnsRecordset> records = dns.listRecordsets(project, zone);
View Full Code Here

    @Override
    protected DnsRecordsetData run0() throws Exception {
        Auth auth = getAuth();
        Project project = auth.getProject();

        DnsZone zone = dns.findMaximalZone(project, fqdn);
        if (zone == null) {
            throw new IllegalArgumentException("Cannot find matching zone");
        }

        List<DnsRecordsetData> matches = Lists.newArrayList();
View Full Code Here

TOP

Related Classes of io.fathom.cloud.dns.model.DnsZone

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.