All Downloads are FREE. Search and download functionalities are using the official Maven repository.

denominator.dynect.DynECT Maven / Gradle / Ivy

There is a newer version: 4.7.1
Show newest version
package denominator.dynect;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import javax.inject.Named;

import com.google.gson.JsonElement;

import denominator.model.ResourceRecordSet;
import denominator.model.Zone;
import feign.Body;
import feign.RequestLine;

public interface DynECT {
    @RequestLine("GET /Zone")
    Data> zones();

    @RequestLine("PUT /Zone/{zone}")
    @Body("{\"publish\":true}")
    void publish(@Named("zone") String zone);

    @RequestLine("GET /AllRecord/{zone}?detail=Y")
    Data>> rrsets(@Named("zone") String zone);

    @RequestLine("POST /CheckPermissionReport")
    @Body("{\"permission\":[\"GeoUpdate\",\"GeoDelete\",\"GeoGet\",\"GeoActivate\",\"GeoDeactivate\"]}")
    Data hasAllGeoPermissions();

    @RequestLine("GET /Geo?detail=Y")
    Data> geoServices();

    @RequestLine("GET /AllRecord/{zone}/{fqdn}?detail=Y")
    Data>> rrsetsInZoneByName(@Named("zone") String zone, @Named("fqdn") String fqdn);

    @RequestLine("GET /{type}Record/{zone}/{fqdn}?detail=Y")
    Data>> rrsetsInZoneByNameAndType(@Named("zone") String zone, @Named("fqdn") String fqdn,
            @Named("type") String type);

    @RequestLine("GET /{type}Record/{zone}/{fqdn}")
    Data> recordIdsInZoneByNameAndType(@Named("zone") String zone, @Named("fqdn") String fqdn,
            @Named("type") String type);

    @RequestLine("GET /{type}Record/{zone}/{fqdn}?detail=Y")
    Data> recordsInZoneByNameAndType(@Named("zone") String zone, @Named("fqdn") String fqdn,
            @Named("type") String type);

    @RequestLine("POST /{type}Record/{zone}/{fqdn}")
    void scheduleCreateRecord(@Named("zone") String zone, @Named("fqdn") String fqdn, @Named("type") String type,
            @Named("ttl") int ttl, @Named("rdata") Map rdata);

    @RequestLine("DELETE /{recordId}")
    void scheduleDeleteRecord(@Named("recordId") String recordId);

    /**
     * DynECT json includes an envelope called "data", which makes it difficult.
     */
    static class Data {
        T data;
    }

    static class Record {
        long id;
        String name;
        String type;
        int ttl;
        Map rdata = new LinkedHashMap();
    }

    static class GeoService {
        List nodes = new ArrayList();
        List groups = new ArrayList();

        static class Node {
            String zone;
            String fqdn;
        }

        static class GeoRegionGroup {
            String service_name;
            String name;
            // aaaa_weight
            Map> weight = new LinkedHashMap>();
            List countries = new ArrayList();
            // spf_rdata
            Map> rdata = new LinkedHashMap>();
            // dhcid_ttl
            Map ttl = new LinkedHashMap();
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy