dns_api.py 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. # !/usr/bin/env python
  2. # coding=UTF-8
  3. #
  4. # Copyright 2022 Baidu, Inc.
  5. #
  6. # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
  7. # the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
  12. # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
  13. # specific language governing permissions and limitations under the License.
  14. """
  15. This module provides a api config list for dns.
  16. """
  17. from baidubce.http import http_methods
  18. dns_apis = {
  19. "add_line_group": {
  20. "method": http_methods.POST,
  21. "path": "/v1/dns/customline",
  22. "queries": {
  23. "client_token": None
  24. },
  25. "headers": {
  26. }
  27. },
  28. "create_paid_zone": {
  29. "method": http_methods.POST,
  30. "path": "/v1/dns/zone/order",
  31. "queries": {
  32. "client_token": None
  33. },
  34. "headers": {
  35. }
  36. },
  37. "create_record": {
  38. "method": http_methods.POST,
  39. "path": "/v1/dns/zone/[zoneName]/record",
  40. "queries": {
  41. "client_token": None
  42. },
  43. "headers": {
  44. }
  45. },
  46. "create_zone": {
  47. "method": http_methods.POST,
  48. "path": "/v1/dns/zone",
  49. "queries": {
  50. "client_token": None
  51. },
  52. "headers": {
  53. }
  54. },
  55. "delete_line_group": {
  56. "method": http_methods.DELETE,
  57. "path": "/v1/dns/customline/[lineId]",
  58. "queries": {
  59. "client_token": None
  60. },
  61. "headers": {
  62. }
  63. },
  64. "delete_record": {
  65. "method": http_methods.DELETE,
  66. "path": "/v1/dns/zone/[zoneName]/record/[recordId]",
  67. "queries": {
  68. "client_token": None
  69. },
  70. "headers": {
  71. }
  72. },
  73. "delete_zone": {
  74. "method": http_methods.DELETE,
  75. "path": "/v1/dns/zone/[zoneName]",
  76. "queries": {
  77. "client_token": None
  78. },
  79. "headers": {
  80. }
  81. },
  82. "list_line_group": {
  83. "method": http_methods.GET,
  84. "path": "/v1/dns/customline",
  85. "queries": {
  86. "marker": None,
  87. "max_keys": None
  88. },
  89. "headers": {
  90. }
  91. },
  92. "list_record": {
  93. "method": http_methods.GET,
  94. "path": "/v1/dns/zone/[zoneName]/record",
  95. "queries": {
  96. "rr": None,
  97. "id": None,
  98. "marker": None,
  99. "max_keys": None
  100. },
  101. "headers": {
  102. }
  103. },
  104. "list_zone": {
  105. "method": http_methods.GET,
  106. "path": "/v1/dns/zone",
  107. "queries": {
  108. "name": None,
  109. "marker": None,
  110. "max_keys": None
  111. },
  112. "headers": {
  113. }
  114. },
  115. "renew_zone": {
  116. "method": http_methods.PUT,
  117. "path": "/v1/dns/zone/order/[name]",
  118. "queries": {
  119. "client_token": None,
  120. "purchaseReserved": ''
  121. },
  122. "headers": {
  123. }
  124. },
  125. "update_line_group": {
  126. "method": http_methods.PUT,
  127. "path": "/v1/dns/customline/[lineId]",
  128. "queries": {
  129. "client_token": None
  130. },
  131. "headers": {
  132. }
  133. },
  134. "update_record": {
  135. "method": http_methods.PUT,
  136. "path": "/v1/dns/zone/[zoneName]/record/[recordId]",
  137. "queries": {
  138. "client_token": None
  139. },
  140. "headers": {
  141. }
  142. },
  143. "update_record_disable": {
  144. "method": http_methods.PUT,
  145. "path": "/v1/dns/zone/[zoneName]/record/[recordId]",
  146. "queries": {
  147. "client_token": None,
  148. "disable": ''
  149. },
  150. "headers": {
  151. }
  152. },
  153. "update_record_enable": {
  154. "method": http_methods.PUT,
  155. "path": "/v1/dns/zone/[zoneName]/record/[recordId]",
  156. "queries": {
  157. "client_token": None,
  158. "enable": ''
  159. },
  160. "headers": {
  161. }
  162. },
  163. "upgrade_zone": {
  164. "method": http_methods.PUT,
  165. "path": "/v1/dns/zone/order",
  166. "queries": {
  167. "client_token": None,
  168. "upgradeToDiscount": ''
  169. },
  170. "headers": {
  171. }
  172. }
  173. }