-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdns-zones_module.js
85 lines (80 loc) · 2.18 KB
/
dns-zones_module.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
remoteStorage.defineModule("dns", function(privateClient, publicClient){
privateClient.declareType("zonefile", {
"type" : "object",
"properties" : {
"name" : {
"type" : "string"
},
"soa" : {
"type" : "object",
"properties" : {
"mname" : {
"type" : "string",
"description" : "The <domain-name> of the name server that was the original or primary source of data for this zone."
},
"rname" : {
"type" : "string",
"description" : "A <domain-name> which specifies the mailbox of the person responsible for this zone."
},
"serial" : {
"type" : "integer",
"description" : "The unsigned 32 bit version number of the original copy of the zone. Zone transfers preserve this value. This value wraps and should be compared using sequence space arithmetic."
},
"refresh" : {
"type" : "integer",
"description" : "A 32 bit time interval before the zone should be refreshed."
},
"retry" : {
"type" : "integer",
"description" : "A 32 bit time interval that should elapse before a failed refresh should be retried."
},
"expire" : {
"type" : "integer",
"description" : "A 32 bit time value that specifies the upper limit on the time interval that can elapse before the zone is no longer authoritative."
}
}
},
"records" : {
"type" : "array",
"items" : {
"type" : "object",
"properties" : {
"name" : {
"type" : "string"
},
"type" : {
"type" : "string",
"enum" : ["A","NS","CNAME","PTR"] //get complete list https://en.wikipedia.org/wiki/List_of_DNS_record_types
},
"value" : {
"type" : "string",
},
"ttl" : {
"type" : "integer"
}
}
}
}
}
});
var path = "zonefiles/"
return {
"exports" : {
"store_zone" : function(data) {
return privateClient
.storeObject("zonefile"
,path+data["name"]
, data )
} ,
"zone" : function(name) {
return privateClient.getObject(path+name);
},
"ls_zones" : function() {
return privateClient.getListing(path);
},
"delete_zone": function(name) {
return privateClient.remove(path+name);
}
}
}
});