Ascio DNS
NodeJS CreateRecord
Adds a record to a zone. Please provide at least an source and a target. If names are used, FQDNs (which includes the zone-name) are needed. The zone must exist, and the permissions must match. All records at ascio have the long zone-format. Like www.ascio.com instead of www
Possible record-type that can be created are: WebForward, SRV, CNAME, SOA, TXT, PTR, MX, A, AAAA, NS, MailForward. A record wit the type 'Record' are invalid.
Response CreateRecord(CreateRecord createRecord)
Response codes
ResultCode | Message | Value |
---|---|---|
200 | OK | |
400 | Parameter value error - Null or invalid value | |
401 | Authorization failed | |
404 | Zone not found | |
416 | Validation failed | |
202 | Record already exists |
CreateRecord Request
Property | Type | Description |
---|---|---|
zoneName | Example: "testing-ascio.com" | |
record |
CreateRecordResponse
Property | Description |
---|---|
CreateRecordResult | |
recordId | Example: 1 |
NodeJS example
var soap = require("soap");
var createRecordExample = function(callback) {
//WebForward
record = {};
record.Source="www.testing-ascio.com";
record.TTL=3600;
record.Target="5.6.7.8";
soap.createClient("https://dnsservice.demo.ascio.com/2010/10/30/DnsService.wsdl", function(err, client) {
if(err) {
callback(err);
}
else {
client.CreateRecord({zoneName: "zoneName", record: record}, function(err,result) {
if(err) {
callback({error: err, request : result.request.body});
} else {
if(result.CreateRecordResult.ResultCode < 400) {
callback(null,result);
} else {
callback({error: result.CreateRecordResult,request : request});
}
}
});
};
});
};
createRecordExample(function(err,result) {
if(err) {
console.log("\n\n Request \n\n",err.request, "\n\n Response \n\n" ,err.error,"\n");
}
else {
console.log(result);
}
});
WSDL AscioDns
https://dnsservice.demo.ascio.com/2010/10/30/DnsService.wsdl (OTE)
https://dnsservice.ascio.com/2010/10/30/DnsService.wsdl (Live)
Please configure the IP-Whitelisting in the portal/demo-portal.
https://dnsservice.demo.ascio.com/2010/10/30/DnsService.wsdl (OTE)
https://dnsservice.ascio.com/2010/10/30/DnsService.wsdl (Live)
Please configure the IP-Whitelisting in the portal/demo-portal.