aboutsummaryrefslogtreecommitdiff
path: root/src/provider/gandi.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/provider/gandi.rs')
-rw-r--r--src/provider/gandi.rs30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/provider/gandi.rs b/src/provider/gandi.rs
index eeff641..0658db2 100644
--- a/src/provider/gandi.rs
+++ b/src/provider/gandi.rs
@@ -56,10 +56,16 @@ impl DnsProvider for GandiProvider {
"gandi"
}
- async fn update_a(&self, domain: &str, subdomain: &str, targets: &[Ipv4Addr]) -> Result<()> {
+ async fn update_a(
+ &self,
+ domain: &str,
+ subdomain: Option<&str>,
+ targets: &[Ipv4Addr],
+ ) -> Result<()> {
let url = format!(
"https://api.gandi.net/v5/livedns/domains/{}/records/{}/A",
- domain, subdomain
+ domain,
+ subdomain.unwrap_or("@")
);
let rrset = GandiRrset {
@@ -70,10 +76,16 @@ impl DnsProvider for GandiProvider {
self.put_rrset(&url, &rrset).await
}
- async fn update_aaaa(&self, domain: &str, subdomain: &str, targets: &[Ipv6Addr]) -> Result<()> {
+ async fn update_aaaa(
+ &self,
+ domain: &str,
+ subdomain: Option<&str>,
+ targets: &[Ipv6Addr],
+ ) -> Result<()> {
let url = format!(
"https://api.gandi.net/v5/livedns/domains/{}/records/{}/AAAA",
- domain, subdomain
+ domain,
+ subdomain.unwrap_or("@")
);
let rrset = GandiRrset {
@@ -84,10 +96,16 @@ impl DnsProvider for GandiProvider {
self.put_rrset(&url, &rrset).await
}
- async fn update_cname(&self, domain: &str, subdomain: &str, target: &str) -> Result<()> {
+ async fn update_cname(
+ &self,
+ domain: &str,
+ subdomain: Option<&str>,
+ target: &str,
+ ) -> Result<()> {
let url = format!(
"https://api.gandi.net/v5/livedns/domains/{}/records/{}/CNAME",
- domain, subdomain
+ domain,
+ subdomain.unwrap_or("@")
);
let rrset = GandiRrset {