Source: dns.js

  1. /**
  2. * Methods for interacting with the DNS endpoints<br>
  3. * {@link https://www.vultr.com/api/#tag/dns}
  4. * @namespace dns
  5. */
  6. /**
  7. * List all DNS domains on the account.<br>
  8. * {@link https://www.vultr.com/api/#operation/list-dns-domains}
  9. * @function listDomains
  10. * @memberof dns
  11. * @instance
  12. */
  13. exports.listDomains = {
  14. url: '/domains',
  15. requestType: 'GET',
  16. apiKeyRequired: true,
  17. parameters: {
  18. per_page: { type: 'number' },
  19. cursor: { type: 'string' }
  20. }
  21. }
  22. /**
  23. * Create a DNS domain for the specified domain. If no IP address is
  24. * specified, a domain with no records will be created.<br>
  25. * {@link https://www.vultr.com/api/#operation/create-dns-domain}
  26. * @function createDomain
  27. * @memberof dns
  28. * @instance
  29. */
  30. exports.createDomain = {
  31. url: '/domains',
  32. requestType: 'POST',
  33. apiKeyRequired: true,
  34. parameters: {
  35. domain: {
  36. type: 'string',
  37. required: true
  38. },
  39. ip: { type: 'string' },
  40. dns_sec: { type: 'string' }
  41. }
  42. }
  43. /**
  44. * Get information for the specified DNS domain.<br>
  45. * {@link https://www.vultr.com/api/#operation/get-dns-domain}
  46. * @function getDomain
  47. * @memberof dns
  48. * @instance
  49. */
  50. exports.getDomain = {
  51. url: '/domains/{dns-domain}',
  52. requestType: 'GET',
  53. parameters: {
  54. 'dns-domain': {
  55. type: 'string',
  56. path: true,
  57. required: true
  58. }
  59. }
  60. }
  61. /**
  62. * Delete the specified DNS domain.<br>
  63. * {@link https://www.vultr.com/api/#operation/delete-dns-domain}
  64. * @function deleteDomain
  65. * @memberof dns
  66. * @instance
  67. */
  68. exports.deleteDomain = {
  69. url: '/domains/{dns-domain}',
  70. requestType: 'DELETE',
  71. apiKeyRequired: true,
  72. parameters: {
  73. 'dns-domain': {
  74. type: 'string',
  75. path: true,
  76. required: true
  77. }
  78. }
  79. }
  80. /**
  81. * Update the specified DNS domain to enable or disable DNS security.<br>
  82. * {@link https://www.vultr.com/api/#operation/update-dns-domain}
  83. * @function updateDomain
  84. * @memberof dns
  85. * @instance
  86. */
  87. exports.updateDomain = {
  88. url: '/domains/{dns-domain}',
  89. requestType: 'PUT',
  90. parameters: {
  91. 'dns-domain': {
  92. type: 'string',
  93. path: true,
  94. required: true
  95. },
  96. dns_sec: {
  97. type: 'string',
  98. required: true
  99. }
  100. }
  101. }
  102. /**
  103. * Get SOA information for the specified DNS domain.<br>
  104. * {@link https://www.vultr.com/api/#operation/get-dns-domain-soa}
  105. * @function getSoaInfo
  106. * @memberof dns
  107. * @instance
  108. */
  109. exports.getSoaInfo = {
  110. url: '/domains/{dns-domain}/soa',
  111. requestType: 'GET',
  112. apiKeyRequired: true,
  113. parameters: {
  114. 'dns-domain': {
  115. type: 'string',
  116. path: true,
  117. required: true
  118. }
  119. }
  120. }
  121. /**
  122. * Update SOA information for the specified DNS domain.<br>
  123. * {@link https://www.vultr.com/api/#operation/update-dns-domain-soa}
  124. * @function updateSoaInfo
  125. * @memberof dns
  126. * @instance
  127. */
  128. exports.updateSoaInfo = {
  129. url: '/domains/{dns-domain}/soa',
  130. requestType: 'PATCH',
  131. apiKeyRequired: true,
  132. parameters: {
  133. 'dns-domain': {
  134. type: 'string',
  135. path: true,
  136. required: true
  137. },
  138. nsprimary: { type: 'string' },
  139. email: { type: 'string' }
  140. }
  141. }
  142. /**
  143. * Get the DNSSEC information for the specified DNS domain.<br>
  144. * {@link https://www.vultr.com/api/#operation/get-dns-domain-dnssec}
  145. * @function getDnsSecInfo
  146. * @memberof dns
  147. * @instance
  148. */
  149. exports.getDnsSecInfo = {
  150. url: '/domains/{dns-domain}/dnssec',
  151. requestType: 'GET',
  152. apiKeyRequired: true,
  153. parameters: {
  154. 'dns-domain': {
  155. type: 'string',
  156. path: true,
  157. required: true
  158. }
  159. }
  160. }
  161. /**
  162. * Create a new DNS record.<br>
  163. * {@link https://www.vultr.com/api/#operation/create-dns-domain-record}
  164. * @function createRecord
  165. * @memberof dns
  166. * @instance
  167. */
  168. exports.createRecord = {
  169. url: '/domains/{dns-domain}/records',
  170. requestType: 'POST',
  171. apiKeyRequired: true,
  172. parameters: {
  173. 'dns-domain': {
  174. type: 'string',
  175. path: true,
  176. required: true
  177. },
  178. name: {
  179. type: 'string',
  180. required: true
  181. },
  182. type: {
  183. type: 'string',
  184. required: true
  185. },
  186. data: {
  187. type: 'string',
  188. required: true
  189. },
  190. ttl: { type: 'number' },
  191. priority: { type: 'number' }
  192. }
  193. }
  194. /**
  195. * List all DNS records.<br>
  196. * {@link https://www.vultr.com/api/#operation/list-dns-domain-records}
  197. * @function listRecords
  198. * @memberof dns
  199. * @instance
  200. */
  201. exports.listRecords = {
  202. url: '/domains/{dns-domain}/records',
  203. requestType: 'GET',
  204. apiKeyRequired: true,
  205. parameters: {
  206. 'dns-domain': {
  207. type: 'string',
  208. path: true,
  209. required: true
  210. },
  211. per_page: { type: 'number' },
  212. cursor: { type: 'string' }
  213. }
  214. }
  215. /**
  216. * Get the specified DNS record for the specified DNS domain.<br>
  217. * {@link https://www.vultr.com/api/#operation/get-dns-domain-record}
  218. * @function getRecord
  219. * @memberof dns
  220. * @instance
  221. */
  222. exports.getRecord = {
  223. url: '/domains/{dns-domain}/records/{record-id}',
  224. requestType: 'GET',
  225. apiKeyRequired: true,
  226. parameters: {
  227. 'dns-domain': {
  228. type: 'string',
  229. path: true,
  230. required: true
  231. },
  232. 'record-id': {
  233. type: 'string',
  234. path: true,
  235. required: true
  236. }
  237. }
  238. }
  239. /**
  240. * Update information for the specified DNS record.<br>
  241. * {@link https://www.vultr.com/api/#operation/update-dns-domain-record}
  242. * @function updateRecord
  243. * @memberof dns
  244. * @instance
  245. */
  246. exports.updateRecord = {
  247. url: '/domains/{dns-domain}/records/{record-id}',
  248. requestType: 'PATCH',
  249. apiKeyRequired: true,
  250. parameters: {
  251. 'dns-domain': {
  252. type: 'string',
  253. path: true,
  254. required: true
  255. },
  256. 'record-id': {
  257. type: 'string',
  258. path: true,
  259. required: true
  260. },
  261. name: { type: 'string' },
  262. data: { type: 'string' },
  263. ttl: { type: 'string' },
  264. priority: { type: 'string' }
  265. }
  266. }
  267. /**
  268. * Delete a specified DNS record.<br>
  269. * {@link https://www.vultr.com/api/#operation/delete-dns-domain-record}
  270. * @function deleteRecord
  271. * @memberof dns
  272. * @instance
  273. */
  274. exports.deleteRecord = {
  275. url: '/domains/{dns-domain}/records/{record-id}',
  276. requestType: 'DELETE',
  277. apiKeyRequired: true,
  278. parameters: {
  279. 'dns-domain': {
  280. type: 'string',
  281. path: true,
  282. required: true
  283. },
  284. 'record-id': {
  285. type: 'string',
  286. path: true,
  287. required: true
  288. }
  289. }
  290. }