denominator.dynect.DynECT Maven / Gradle / Ivy
package denominator.dynect;
import com.google.gson.JsonElement;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import denominator.model.ResourceRecordSet;
import denominator.model.Zone;
import feign.Body;
import feign.Param;
import feign.RequestLine;
public interface DynECT {
@RequestLine("GET /Zone")
Data> zones();
@RequestLine("PUT /Zone/{zone}")
@Body("{\"publish\":true}")
void publish(@Param("zone") String zone);
@RequestLine("GET /AllRecord/{zone}?detail=Y")
Data>> rrsets(@Param("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(@Param("zone") String zone,
@Param("fqdn") String fqdn);
@RequestLine("GET /{type}Record/{zone}/{fqdn}?detail=Y")
Data>> rrsetsInZoneByNameAndType(@Param("zone") String zone,
@Param("fqdn") String fqdn,
@Param("type") String type);
@RequestLine("GET /{type}Record/{zone}/{fqdn}")
Data> recordIdsInZoneByNameAndType(@Param("zone") String zone,
@Param("fqdn") String fqdn,
@Param("type") String type);
@RequestLine("GET /{type}Record/{zone}/{fqdn}?detail=Y")
Data> recordsInZoneByNameAndType(@Param("zone") String zone,
@Param("fqdn") String fqdn,
@Param("type") String type);
@RequestLine("POST /{type}Record/{zone}/{fqdn}")
void scheduleCreateRecord(@Param("zone") String zone, @Param("fqdn") String fqdn,
@Param("type") String type,
@Param("ttl") int ttl, @Param("rdata") Map rdata);
@RequestLine("DELETE /{recordId}")
void scheduleDeleteRecord(@Param("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();
}
}
}