refresh zone after changes

master
adb 3 years ago
parent 24ff180ea6
commit 7b13d4ec73

@ -15,7 +15,7 @@ export class DynDnsBot{
Object.keys(this.config.records).forEach(domain => { Object.keys(this.config.records).forEach(domain => {
this.config.records[domain].forEach(record => { this.config.records[domain].forEach(record => {
record.target = newIp; record.target = newIp;
this.dns.updateRecord(record, domain); this.dns.updateRecord(record, domain).then(()=>this.dns.refreshZone(domain));
}) })
}); });
} }

@ -93,7 +93,7 @@ export class OvhApi{
return await this.sendSignedRequest({ return await this.sendSignedRequest({
path: `/domain/zone/${domain}/record/${id}`, path: `/domain/zone/${domain}/record/${id}`,
getMethod: rest=>rest.put, getMethod: rest=>rest.put,
body: {subDomain, target, ttl, fieldType} body: {subDomain, target, ttl}
}); });
} }
@ -118,4 +118,11 @@ export class OvhApi{
path: `/domain/zone/${domain}/record/${id}` path: `/domain/zone/${domain}/record/${id}`
}); });
} }
async refreshZone(zone){
return await this.sendSignedRequest({
path: `/domain/zone/${zone}/refresh`,
getMethod: rest=>rest.post
});
}
} }
Loading…
Cancel
Save