1and1 1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (290) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +2 -0
  3. data/1and1-1.0.gem +0 -0
  4. data/1and1.gemspec +20 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE +201 -0
  7. data/README.md +499 -0
  8. data/docs/reference.md +2447 -0
  9. data/examples/dvd_examples.rb +15 -0
  10. data/examples/example_app.rb +100 -0
  11. data/examples/firewall_examples.rb +137 -0
  12. data/examples/image_examples.rb +48 -0
  13. data/examples/load_balancer_examples.rb +145 -0
  14. data/examples/log_examples.rb +15 -0
  15. data/examples/monitoring_center_examples.rb +15 -0
  16. data/examples/monitoring_policy_examples.rb +343 -0
  17. data/examples/private_network_examples.rb +86 -0
  18. data/examples/public_ip_examples.rb +42 -0
  19. data/examples/role_examples.rb +113 -0
  20. data/examples/server_appliance_examples.rb +15 -0
  21. data/examples/server_examples.rb +438 -0
  22. data/examples/shared_storage_examples.rb +108 -0
  23. data/examples/usage_examples.rb +6 -0
  24. data/examples/user_examples.rb +113 -0
  25. data/examples/vpn_examples.rb +56 -0
  26. data/lib/1and1/datacenter.rb +73 -0
  27. data/lib/1and1/dvd.rb +73 -0
  28. data/lib/1and1/firewall.rb +427 -0
  29. data/lib/1and1/image.rb +231 -0
  30. data/lib/1and1/load_balancer.rb +448 -0
  31. data/lib/1and1/log.rb +77 -0
  32. data/lib/1and1/monitoring_center.rb +84 -0
  33. data/lib/1and1/monitoring_policy.rb +598 -0
  34. data/lib/1and1/oneandone.rb +57 -0
  35. data/lib/1and1/ping.rb +41 -0
  36. data/lib/1and1/ping_auth.rb +41 -0
  37. data/lib/1and1/pricing.rb +41 -0
  38. data/lib/1and1/private_network.rb +333 -0
  39. data/lib/1and1/public_ip.rb +192 -0
  40. data/lib/1and1/role.rb +381 -0
  41. data/lib/1and1/server.rb +1208 -0
  42. data/lib/1and1/server_appliance.rb +73 -0
  43. data/lib/1and1/shared_storage.rb +379 -0
  44. data/lib/1and1/usage.rb +58 -0
  45. data/lib/1and1/user.rb +374 -0
  46. data/lib/1and1/vpn.rb +249 -0
  47. data/lib/oneandone.rb +27 -0
  48. data/sphinx/Makefile +192 -0
  49. data/sphinx/_build/doctrees/dvds.doctree +0 -0
  50. data/sphinx/_build/doctrees/environment.pickle +0 -0
  51. data/sphinx/_build/doctrees/firewalls.doctree +0 -0
  52. data/sphinx/_build/doctrees/images.doctree +0 -0
  53. data/sphinx/_build/doctrees/index.doctree +0 -0
  54. data/sphinx/_build/doctrees/load_balancers.doctree +0 -0
  55. data/sphinx/_build/doctrees/logs.doctree +0 -0
  56. data/sphinx/_build/doctrees/monitoring_center.doctree +0 -0
  57. data/sphinx/_build/doctrees/monitoring_policies.doctree +0 -0
  58. data/sphinx/_build/doctrees/private_networks.doctree +0 -0
  59. data/sphinx/_build/doctrees/public_ips.doctree +0 -0
  60. data/sphinx/_build/doctrees/server_appliances.doctree +0 -0
  61. data/sphinx/_build/doctrees/servers.doctree +0 -0
  62. data/sphinx/_build/doctrees/shared_storages.doctree +0 -0
  63. data/sphinx/_build/doctrees/usages.doctree +0 -0
  64. data/sphinx/_build/doctrees/users.doctree +0 -0
  65. data/sphinx/_build/html/.buildinfo +4 -0
  66. data/sphinx/_build/html/_sources/dvds.txt +42 -0
  67. data/sphinx/_build/html/_sources/firewalls.txt +189 -0
  68. data/sphinx/_build/html/_sources/images.txt +101 -0
  69. data/sphinx/_build/html/_sources/index.txt +499 -0
  70. data/sphinx/_build/html/_sources/load_balancers.txt +231 -0
  71. data/sphinx/_build/html/_sources/logs.txt +55 -0
  72. data/sphinx/_build/html/_sources/monitoring_center.txt +55 -0
  73. data/sphinx/_build/html/_sources/monitoring_policies.txt +288 -0
  74. data/sphinx/_build/html/_sources/private_networks.txt +146 -0
  75. data/sphinx/_build/html/_sources/public_ips.txt +78 -0
  76. data/sphinx/_build/html/_sources/server_appliances.txt +42 -0
  77. data/sphinx/_build/html/_sources/servers.txt +630 -0
  78. data/sphinx/_build/html/_sources/shared_storages.txt +160 -0
  79. data/sphinx/_build/html/_sources/usages.txt +45 -0
  80. data/sphinx/_build/html/_sources/users.txt +172 -0
  81. data/sphinx/_build/html/_static/ajax-loader.gif +0 -0
  82. data/sphinx/_build/html/_static/alabaster.css +585 -0
  83. data/sphinx/_build/html/_static/basic.css +599 -0
  84. data/sphinx/_build/html/_static/comment-bright.png +0 -0
  85. data/sphinx/_build/html/_static/comment-close.png +0 -0
  86. data/sphinx/_build/html/_static/comment.png +0 -0
  87. data/sphinx/_build/html/_static/doctools.js +263 -0
  88. data/sphinx/_build/html/_static/down-pressed.png +0 -0
  89. data/sphinx/_build/html/_static/down.png +0 -0
  90. data/sphinx/_build/html/_static/file.png +0 -0
  91. data/sphinx/_build/html/_static/jquery-1.11.1.js +10308 -0
  92. data/sphinx/_build/html/_static/jquery.js +4 -0
  93. data/sphinx/_build/html/_static/minus.png +0 -0
  94. data/sphinx/_build/html/_static/plus.png +0 -0
  95. data/sphinx/_build/html/_static/pygments.css +63 -0
  96. data/sphinx/_build/html/_static/searchtools.js +651 -0
  97. data/sphinx/_build/html/_static/underscore-1.3.1.js +999 -0
  98. data/sphinx/_build/html/_static/underscore.js +31 -0
  99. data/sphinx/_build/html/_static/up-pressed.png +0 -0
  100. data/sphinx/_build/html/_static/up.png +0 -0
  101. data/sphinx/_build/html/_static/websupport.js +808 -0
  102. data/sphinx/_build/html/dvds.html +151 -0
  103. data/sphinx/_build/html/firewalls.html +397 -0
  104. data/sphinx/_build/html/genindex.html +114 -0
  105. data/sphinx/_build/html/images.html +236 -0
  106. data/sphinx/_build/html/index.html +571 -0
  107. data/sphinx/_build/html/load_balancers.html +409 -0
  108. data/sphinx/_build/html/logs.html +160 -0
  109. data/sphinx/_build/html/monitoring_center.html +160 -0
  110. data/sphinx/_build/html/monitoring_policies.html +530 -0
  111. data/sphinx/_build/html/objects.inv +0 -0
  112. data/sphinx/_build/html/private_networks.html +316 -0
  113. data/sphinx/_build/html/public_ips.html +215 -0
  114. data/sphinx/_build/html/rb-modindex.html +106 -0
  115. data/sphinx/_build/html/search.html +99 -0
  116. data/sphinx/_build/html/searchindex.js +1 -0
  117. data/sphinx/_build/html/server_appliances.html +153 -0
  118. data/sphinx/_build/html/servers.html +994 -0
  119. data/sphinx/_build/html/shared_storages.html +349 -0
  120. data/sphinx/_build/html/usages.html +140 -0
  121. data/sphinx/_build/html/users.html +363 -0
  122. data/sphinx/conf.py +287 -0
  123. data/sphinx/dvds.rst +42 -0
  124. data/sphinx/firewalls.rst +189 -0
  125. data/sphinx/images.rst +101 -0
  126. data/sphinx/index.rst +499 -0
  127. data/sphinx/load_balancers.rst +231 -0
  128. data/sphinx/logs.rst +55 -0
  129. data/sphinx/make.bat +263 -0
  130. data/sphinx/monitoring_center.rst +55 -0
  131. data/sphinx/monitoring_policies.rst +288 -0
  132. data/sphinx/private_networks.rst +146 -0
  133. data/sphinx/public_ips.rst +78 -0
  134. data/sphinx/server_appliances.rst +42 -0
  135. data/sphinx/servers.rst +630 -0
  136. data/sphinx/shared_storages.rst +160 -0
  137. data/sphinx/usages.rst +45 -0
  138. data/sphinx/users.rst +172 -0
  139. data/test/mock-api/add-firewall.json +66 -0
  140. data/test/mock-api/add-hdd.json +49 -0
  141. data/test/mock-api/add-lb.json +71 -0
  142. data/test/mock-api/add-new-ip.json +18 -0
  143. data/test/mock-api/add-pn.json +66 -0
  144. data/test/mock-api/add-port-mp.json +81 -0
  145. data/test/mock-api/add-process-mp.json +20 -0
  146. data/test/mock-api/add-rule-fp.json +33 -0
  147. data/test/mock-api/add-rule-lb.json +40 -0
  148. data/test/mock-api/add-server-ip.json +66 -0
  149. data/test/mock-api/add-server-mp.json +66 -0
  150. data/test/mock-api/assign-ip-fp.json +32 -0
  151. data/test/mock-api/assign-server-lb.json +39 -0
  152. data/test/mock-api/attach-server-pn.json +14 -0
  153. data/test/mock-api/attach-server-storage.json +24 -0
  154. data/test/mock-api/change-api-key.json +15 -0
  155. data/test/mock-api/change-password.json +5 -0
  156. data/test/mock-api/change-server-status.json +70 -0
  157. data/test/mock-api/clone-server.json +29 -0
  158. data/test/mock-api/create-fp.json +26 -0
  159. data/test/mock-api/create-image.json +30 -0
  160. data/test/mock-api/create-lb.json +33 -0
  161. data/test/mock-api/create-mp.json +81 -0
  162. data/test/mock-api/create-pn.json +11 -0
  163. data/test/mock-api/create-public-ip.json +10 -0
  164. data/test/mock-api/create-server.json +34 -0
  165. data/test/mock-api/create-snapshot.json +74 -0
  166. data/test/mock-api/create-storage.json +13 -0
  167. data/test/mock-api/create-user.json +14 -0
  168. data/test/mock-api/delete-fp.json +26 -0
  169. data/test/mock-api/delete-image.json +26 -0
  170. data/test/mock-api/delete-ip.json +15 -0
  171. data/test/mock-api/delete-lb.json +33 -0
  172. data/test/mock-api/delete-mp.json +71 -0
  173. data/test/mock-api/delete-pn.json +11 -0
  174. data/test/mock-api/delete-public-ip.json +10 -0
  175. data/test/mock-api/delete-rule-fp.json +26 -0
  176. data/test/mock-api/delete-server.json +50 -0
  177. data/test/mock-api/delete-snapshot.json +74 -0
  178. data/test/mock-api/delete-storage.json +24 -0
  179. data/test/mock-api/delete-user.json +15 -0
  180. data/test/mock-api/detach-server-lb.json +33 -0
  181. data/test/mock-api/detach-server-mp.json +65 -0
  182. data/test/mock-api/detach-server-storage.json +19 -0
  183. data/test/mock-api/edit-image.json +26 -0
  184. data/test/mock-api/eject-dvd.json +66 -0
  185. data/test/mock-api/fixed-server-flavors.json +70 -0
  186. data/test/mock-api/get-appliance.json +16 -0
  187. data/test/mock-api/get-dvd.json +9 -0
  188. data/test/mock-api/get-firewall.json +26 -0
  189. data/test/mock-api/get-fixed-server.json +17 -0
  190. data/test/mock-api/get-fp-rule.json +7 -0
  191. data/test/mock-api/get-hardware.json +13 -0
  192. data/test/mock-api/get-hdd.json +5 -0
  193. data/test/mock-api/get-image.json +26 -0
  194. data/test/mock-api/get-lb-rule.json +7 -0
  195. data/test/mock-api/get-lb-server.json +5 -0
  196. data/test/mock-api/get-load-balancer.json +33 -0
  197. data/test/mock-api/get-log.json +23 -0
  198. data/test/mock-api/get-monitoring-center.json +161 -0
  199. data/test/mock-api/get-mp-port.json +7 -0
  200. data/test/mock-api/get-mp-process.json +6 -0
  201. data/test/mock-api/get-mp-server.json +4 -0
  202. data/test/mock-api/get-mp.json +65 -0
  203. data/test/mock-api/get-pn-server.json +4 -0
  204. data/test/mock-api/get-private-network.json +20 -0
  205. data/test/mock-api/get-public-ip.json +10 -0
  206. data/test/mock-api/get-server-dvd.json +4 -0
  207. data/test/mock-api/get-server-image.json +4 -0
  208. data/test/mock-api/get-server-ip-fp.json +4 -0
  209. data/test/mock-api/get-server-ip.json +8 -0
  210. data/test/mock-api/get-server-pn.json +16 -0
  211. data/test/mock-api/get-server-status.json +4 -0
  212. data/test/mock-api/get-server-storage.json +5 -0
  213. data/test/mock-api/get-server.json +44 -0
  214. data/test/mock-api/get-storage.json +19 -0
  215. data/test/mock-api/get-usage.json +161 -0
  216. data/test/mock-api/get-user-api-key.json +3 -0
  217. data/test/mock-api/get-user-api.json +7 -0
  218. data/test/mock-api/get-user.json +15 -0
  219. data/test/mock-api/list-appliances.json +66 -0
  220. data/test/mock-api/list-credentials.json +5 -0
  221. data/test/mock-api/list-dvds.json +128 -0
  222. data/test/mock-api/list-firewalls.json +54 -0
  223. data/test/mock-api/list-fp-rules.json +16 -0
  224. data/test/mock-api/list-hdds.json +7 -0
  225. data/test/mock-api/list-images.json +54 -0
  226. data/test/mock-api/list-lb-rules.json +16 -0
  227. data/test/mock-api/list-lb-servers.json +12 -0
  228. data/test/mock-api/list-load-balancers.json +68 -0
  229. data/test/mock-api/list-logs.json +49 -0
  230. data/test/mock-api/list-monitoring-center-usages.json +90 -0
  231. data/test/mock-api/list-mp-ports.json +16 -0
  232. data/test/mock-api/list-mp-processes.json +14 -0
  233. data/test/mock-api/list-mp-servers.json +10 -0
  234. data/test/mock-api/list-mps.json +152 -0
  235. data/test/mock-api/list-pn-servers.json +10 -0
  236. data/test/mock-api/list-private-networks.json +24 -0
  237. data/test/mock-api/list-public-ips.json +44 -0
  238. data/test/mock-api/list-server-fps.json +4 -0
  239. data/test/mock-api/list-server-ips-fp.json +7 -0
  240. data/test/mock-api/list-server-ips.json +10 -0
  241. data/test/mock-api/list-server-lbs.json +6 -0
  242. data/test/mock-api/list-server-pns.json +6 -0
  243. data/test/mock-api/list-servers.json +66 -0
  244. data/test/mock-api/list-snapshots.json +7 -0
  245. data/test/mock-api/list-storages.json +47 -0
  246. data/test/mock-api/list-usages.json +144 -0
  247. data/test/mock-api/list-user-ips.json +5 -0
  248. data/test/mock-api/list-users.json +31 -0
  249. data/test/mock-api/load-dvd.json +63 -0
  250. data/test/mock-api/modify-fp.json +26 -0
  251. data/test/mock-api/modify-lb.json +33 -0
  252. data/test/mock-api/modify-mp.json +81 -0
  253. data/test/mock-api/modify-pn.json +20 -0
  254. data/test/mock-api/modify-port-mp.json +81 -0
  255. data/test/mock-api/modify-process-mp.json +73 -0
  256. data/test/mock-api/modify-public-ip.json +10 -0
  257. data/test/mock-api/modify-server-hardware.json +44 -0
  258. data/test/mock-api/modify-server-hdd.json +54 -0
  259. data/test/mock-api/modify-server.json +44 -0
  260. data/test/mock-api/modify-storage.json +19 -0
  261. data/test/mock-api/modify-user-api.json +15 -0
  262. data/test/mock-api/modify-user.json +15 -0
  263. data/test/mock-api/reinstall-image.json +52 -0
  264. data/test/mock-api/remove-firewall-policy.json +26 -0
  265. data/test/mock-api/remove-hdd.json +54 -0
  266. data/test/mock-api/remove-ip-fp.json +26 -0
  267. data/test/mock-api/remove-lb.json +66 -0
  268. data/test/mock-api/remove-pn.json +71 -0
  269. data/test/mock-api/remove-port-mp.json +73 -0
  270. data/test/mock-api/remove-process-mp.json +66 -0
  271. data/test/mock-api/remove-rule-lb.json +33 -0
  272. data/test/mock-api/remove-server-ip.json +58 -0
  273. data/test/mock-api/remove-server-pn.json +16 -0
  274. data/test/mock-api/restore-snapshot.json +55 -0
  275. data/test/mock-api/storage-servers.json +12 -0
  276. data/test/test_mock_dvd.rb +55 -0
  277. data/test/test_mock_firewall.rb +309 -0
  278. data/test/test_mock_image.rb +123 -0
  279. data/test/test_mock_load_balancer.rb +312 -0
  280. data/test/test_mock_log.rb +55 -0
  281. data/test/test_mock_monitoring_center.rb +55 -0
  282. data/test/test_mock_monitoring_policy.rb +587 -0
  283. data/test/test_mock_private_network.rb +206 -0
  284. data/test/test_mock_public_ip.rb +118 -0
  285. data/test/test_mock_server.rb +929 -0
  286. data/test/test_mock_server_appliance.rb +55 -0
  287. data/test/test_mock_shared_storage.rb +256 -0
  288. data/test/test_mock_usage.rb +34 -0
  289. data/test/test_mock_user.rb +270 -0
  290. metadata +360 -0
@@ -0,0 +1,146 @@
1
+ Private Networks
2
+ *****************
3
+
4
+ .. rb:class:: OneAndOne::PrivateNetwork()
5
+
6
+ The :rb:class:`PrivateNetwork` class allows a user to perform actions against the 1and1 API.
7
+
8
+
9
+ .. rb:method:: list(page: nil, per_page: nil, sort: nil, q: nil, fields: nil)
10
+
11
+ Return a list of all private networks.
12
+
13
+ :param page: Allows the use of pagination. Indicate which page to start on.
14
+ :type page: ``int``
15
+
16
+ :param per_page: Number of items per page.
17
+ :type per_page: ``int``
18
+
19
+ :param sort: ``sort: 'name'`` retrieves a list of elements sorted
20
+ alphabetically. ``sort: 'creation_date'`` retrieves a list of elements
21
+ sorted by their creation date in descending order.
22
+ :type sort: ``str``
23
+
24
+ :param q: ``q`` is for query. Use this parameter to return only the items
25
+ that match your search query.
26
+ :type q: ``str``
27
+
28
+ :param fields: Returns only the parameters requested.
29
+ (i.e. fields: 'id, name, description, hardware.ram')
30
+ :type fields: ``str``
31
+
32
+ :rtype: JSON
33
+
34
+
35
+ .. rb:method:: create(name: nil, description: nil, network_address: nil, subnet_mask: nil)
36
+
37
+ Create a private network.
38
+
39
+ :param name: private network name.
40
+ :type name: ``str``
41
+
42
+ :param description: private network description.
43
+ :type description: ``str``
44
+
45
+ :param network_address: Private network address. (valid IP)
46
+ :type network_address: ``str``
47
+
48
+ :param subnet_mask: Subnet mask (valid subnet for the given IP).
49
+ :type subnet_mask: ``str``
50
+
51
+ :rtype: JSON
52
+
53
+
54
+ .. rb:method:: get(private_network_id: @id)
55
+
56
+ Returns a private network's current specs.
57
+
58
+ :param private_network_id: the unique identifier for the private network.
59
+ :type private_network_id: ``str``
60
+
61
+ :rtype: JSON
62
+
63
+
64
+ .. rb:method:: modify(private_network_id: @id, name: nil, description: nil, network_address: nil, subnet_mask: nil)
65
+
66
+ Modify a private network.
67
+
68
+ :param name: private network name.
69
+ :type name: ``str``
70
+
71
+ :param description: private network description.
72
+ :type description: ``str``
73
+
74
+ :param network_address: Private network address. (valid IP)
75
+ :type network_address: ``str``
76
+
77
+ :param subnet_mask: Subnet mask (valid subnet for the given IP).
78
+ :type subnet_mask: ``str``
79
+
80
+ :rtype: JSON
81
+
82
+
83
+ .. rb:method:: delete(private_network_id: @id)
84
+
85
+ Delete a private network.
86
+
87
+ :param private_network_id: the unique identifier for the private network.
88
+ :type private_network_id: ``str``
89
+
90
+ :rtype: JSON
91
+
92
+
93
+ .. rb:method:: servers(private_network_id: @id)
94
+
95
+ Lists a private network's servers.
96
+
97
+ :param private_network_id: the unique identifier for the private network.
98
+ :type private_network_id: ``str``
99
+
100
+ :rtype: JSON
101
+
102
+
103
+ .. rb:method:: server(private_network_id: @id, server_id: nil)
104
+
105
+ Returns information about a private network's server.
106
+
107
+ :param private_network_id: the unique identifier for the private network.
108
+ :type private_network_id: ``str``
109
+
110
+ :param server_id: the unique identifier for the server.
111
+ :type server_id: ``str``
112
+
113
+ :rtype: JSON
114
+
115
+
116
+ .. rb:method:: remove_server(private_network_id: @id, server_id: nil)
117
+
118
+ Remove a server from a private network.
119
+
120
+ :param private_network_id: the unique identifier for the private network.
121
+ :type private_network_id: ``str``
122
+
123
+ :param server_id: the unique identifier for the server.
124
+ :type server_id: ``str``
125
+
126
+ :rtype: JSON
127
+
128
+
129
+ .. rb:method:: add_servers(private_network_id: @id, servers: nil)
130
+
131
+ Add servers to a private network.
132
+
133
+ :param private_network_id: the unique identifier for the private network.
134
+ :type private_network_id: ``str``
135
+
136
+ :param servers: an array of server ID strings.
137
+ :type servers: ``array``
138
+
139
+ :rtype: JSON
140
+
141
+
142
+ .. rb:method:: wait_for()
143
+
144
+ Polls the private network until an "ACTIVE" state is returned. Use this when chaining actions.
145
+
146
+ :rtype: ``nil``
@@ -0,0 +1,78 @@
1
+ Public IPs
2
+ *****************
3
+
4
+ .. rb:class:: OneAndOne::PublicIP()
5
+
6
+ The :rb:class:`PublicIP` class allows a user to perform actions against the 1and1 API.
7
+
8
+
9
+ .. rb:method:: list(page: nil, per_page: nil, sort: nil, q: nil, fields: nil)
10
+
11
+ Return a list of all public IPs.
12
+
13
+ :param page: Allows the use of pagination. Indicate which page to start on.
14
+ :type page: ``int``
15
+
16
+ :param per_page: Number of items per page.
17
+ :type per_page: ``int``
18
+
19
+ :param sort: ``sort: 'name'`` retrieves a list of elements sorted
20
+ alphabetically. ``sort: 'creation_date'`` retrieves a list of elements
21
+ sorted by their creation date in descending order.
22
+ :type sort: ``str``
23
+
24
+ :param q: ``q`` is for query. Use this parameter to return only the items
25
+ that match your search query.
26
+ :type q: ``str``
27
+
28
+ :param fields: Returns only the parameters requested.
29
+ (i.e. fields: 'id, name, description, hardware.ram')
30
+ :type fields: ``str``
31
+
32
+ :rtype: JSON
33
+
34
+
35
+ .. rb:method:: create(reverse_dns: nil, type: nil)
36
+
37
+ Create a public IP.
38
+
39
+ :param reverse_dns: reverse dns name.
40
+ :type reverse_dns: ``str``
41
+
42
+ :param type: can only be set to ``'IPV4'`` at this time.
43
+ :type type: ``str``
44
+
45
+ :rtype: JSON
46
+
47
+
48
+ .. rb:method:: get(ip_id: @id)
49
+
50
+ Returns a public IP's current specs.
51
+
52
+ :param ip_id: the unique identifier for the IP.
53
+ :type ip_id: ``str``
54
+
55
+ :rtype: JSON
56
+
57
+
58
+ .. rb:method:: modify(ip_id: @id, reverse_dns: nil)
59
+
60
+ Modify a public IP.
61
+
62
+ :param ip_id: the unique identifier for the IP.
63
+ :type ip_id: ``str``
64
+
65
+ :param reverse_dns: reverse dns name.
66
+ :type reverse_dns: ``str``
67
+
68
+ :rtype: JSON
69
+
70
+
71
+ .. rb:method:: delete(ip_id: @id)
72
+
73
+ Delete a public IP.
74
+
75
+ :param ip_id: the unique identifier for the IP.
76
+ :type ip_id: ``str``
77
+
78
+ :rtype: JSON
@@ -0,0 +1,42 @@
1
+ Server Appliances
2
+ *****************
3
+
4
+ .. rb:class:: OneAndOne::ServerAppliance()
5
+
6
+ The :rb:class:`ServerAppliance` class allows a user to perform actions against the 1and1 API.
7
+
8
+
9
+ .. rb:method:: list(page: nil, per_page: nil, sort: nil, q: nil, fields: nil)
10
+
11
+ List all server appliances.
12
+
13
+ :param page: Allows the use of pagination. Indicate which page to start on.
14
+ :type page: ``int``
15
+
16
+ :param per_page: Number of items per page.
17
+ :type per_page: ``int``
18
+
19
+ :param sort: ``sort: 'name'`` retrieves a list of elements sorted
20
+ alphabetically. ``sort: 'creation_date'`` retrieves a list of elements
21
+ sorted by their creation date in descending order.
22
+ :type sort: ``str``
23
+
24
+ :param q: ``q`` is for query. Use this parameter to return only the items
25
+ that match your search query.
26
+ :type q: ``str``
27
+
28
+ :param fields: Returns only the parameters requested.
29
+ (i.e. fields: 'id, name, description, hardware.ram')
30
+ :type fields: ``str``
31
+
32
+ :rtype: JSON
33
+
34
+
35
+ .. rb:method:: get(appliance_id: nil)
36
+
37
+ Returns information about an appliance.
38
+
39
+ :param appliance_id: the unique identifier for the appliance.
40
+ :type appliance_id: ``str``
41
+
42
+ :rtype: JSON
@@ -0,0 +1,630 @@
1
+ Servers
2
+ ********
3
+
4
+ .. rb:class:: OneAndOne::Server()
5
+
6
+ The :rb:class:`Server` class allows a user to perform actions against the 1and1 API.
7
+
8
+
9
+ .. rb:method:: list(page: nil, per_page: nil, sort: nil, q: nil, fields: nil)
10
+
11
+ Return a list of all images.
12
+
13
+ :param page: Allows the use of pagination. Indicate which page to start on.
14
+ :type page: ``int``
15
+
16
+ :param per_page: Number of items per page.
17
+ :type per_page: ``int``
18
+
19
+ :param sort: ``sort: 'name'`` retrieves a list of elements sorted
20
+ alphabetically. ``sort: 'creation_date'`` retrieves a list of elements
21
+ sorted by their creation date in descending order.
22
+ :type sort: ``str``
23
+
24
+ :param q: ``q`` is for query. Use this parameter to return only the items
25
+ that match your search query.
26
+ :type q: ``str``
27
+
28
+ :param fields: Returns only the parameters requested.
29
+ (i.e. fields: 'id, name, description, hardware.ram')
30
+ :type fields: ``str``
31
+
32
+ :rtype: JSON
33
+
34
+
35
+
36
+ .. rb:method:: create(name: nil, description: nil, fixed_instance_id: nil, vcore: nil, cores_per_processor: nil, ram: nil, appliance_id: nil, hdds: nil, password: nil, power_on: nil, firewall_id: nil, ip_id: nil, load_balancer_id: nil, monitoring_policy_id: nil)
37
+
38
+ Create a server.
39
+
40
+ .. note:: Only the following parameters are **required** to create a server:
41
+
42
+ * ``name``
43
+ * ``description``
44
+ * ``vcore``
45
+ * ``cores_per_processor``
46
+ * ``ram``
47
+ * ``appliance_id``
48
+
49
+ .. note:: Your HDD's size must be a multiple of ``20``.
50
+
51
+ :param name: server name.
52
+ :type name: ``str``
53
+
54
+ :param description: server description.
55
+ :type description: ``str``
56
+
57
+ :param fixed_instance_id: the unique identifier for your desired fixed server flavor.
58
+ :type fixed_instance_id: ``str``
59
+
60
+ :param vcore: Total amount of virtual cores.
61
+ :type vcore: ``int``
62
+
63
+ :param cores_per_processor: Number of cores per processor.
64
+ :type cores_per_processor: ``int``
65
+
66
+ :param ram: Memory size.
67
+ :type ram: ``int``
68
+
69
+ :param appliance_id: image to be installed on the server.
70
+ :type appliance_id: ``str``
71
+
72
+ :param hdds: takes an array of HDD's.
73
+ :type hdds: ``array``
74
+
75
+ :param password: server password.
76
+ :type password: ``str``
77
+
78
+ :param power_on: choose whether or not you want the server to 'POWER_ON' after creation. (True by default)
79
+ :type power_on: ``bool``
80
+
81
+ :param firewall_id: the unique identifier for the firewall policy to be assigned.
82
+ :type firewall_id: ``str``
83
+
84
+ :param ip_id: the unique identifier for the IP to be assigned.
85
+ :type ip_id: ``str``
86
+
87
+ :param load_balancer_id: the unique identifier for the load balancer to be assigned.
88
+ :type load_balancer_id: ``str``
89
+
90
+ :param monitoring_policy_id: the unique identifier for the monitoring policy to be assigned.
91
+ :type monitoring_policy_id: ``str``
92
+
93
+ :rtype: JSON
94
+
95
+
96
+
97
+ .. rb:method:: list_fixed()
98
+
99
+ Returns a list of available fixed server options.
100
+
101
+ :rtype: JSON
102
+
103
+
104
+
105
+ .. rb:method:: get_fixed(fixed_instance_id: nil)
106
+
107
+ Retrieve information about a fixed server option.
108
+
109
+ :param fixed_instance_id: the unique identifier for the fixed server option.
110
+ :type fixed_instance_id: ``str``
111
+
112
+ :rtype: JSON
113
+
114
+
115
+
116
+ .. rb:method:: get(server_id: @id)
117
+
118
+ Retrieve the current specs of a server.
119
+
120
+ :param server_id: the unique identifier for the server.
121
+ :type server_id: ``str``
122
+
123
+ :rtype: JSON
124
+
125
+
126
+
127
+ .. rb:method:: modify(server_id: @id, name: nil, description: nil)
128
+
129
+ Modify a server.
130
+
131
+ :param server_id: the unique identifier for the server.
132
+ :type server_id: ``str``
133
+
134
+ :param name: server name.
135
+ :type name: ``str``
136
+
137
+ :param description: server description.
138
+ :type description: ``str``
139
+
140
+ :rtype: JSON
141
+
142
+
143
+
144
+ .. rb:method:: delete(server_id: @id, keep_ips: nil)
145
+
146
+ Delete a server.
147
+
148
+ :param server_id: the unique identifier for the server.
149
+ :type server_id: ``str``
150
+
151
+ :param keep_ips: Set ``keep_ips`` to ``True`` to keep server IPs after deleting a server. (``False`` by default).
152
+ :type keep_ips: ``bool``
153
+
154
+ :rtype: JSON
155
+
156
+
157
+
158
+ .. rb:method:: hardware(server_id: @id)
159
+
160
+ Retrieve a server's hardware configurations.
161
+
162
+ :param server_id: the unique identifier for the server.
163
+ :type server_id: ``str``
164
+
165
+ :rtype: JSON
166
+
167
+
168
+
169
+ .. rb:method:: modify_hardware(server_id: @id, fixed_instance_id: nil, vcore: nil, cores_per_processor: nil, ram: nil)
170
+
171
+ Modify a server's hardware.
172
+
173
+ .. note:: Cannot perform "hot" decreasing of server hardware values. "Cold" decreasing is allowed.
174
+
175
+ :param server_id: the unique identifier for the server.
176
+ :type server_id: ``str``
177
+
178
+ :param fixed_instance_id: ID of the instance size for the server. It
179
+ is not possible to resize to a fixed instance with a HDD smaller than the current one.
180
+ :type fixed_instance_size_id: ``str``
181
+
182
+ :param vcore: Total amount of virtual cores.
183
+ :type vcore: ``int``
184
+
185
+ :param cores_per_processor: Number of cores per processor.
186
+ :type cores_per_processor: ``int``
187
+
188
+ :param ram: Memory size.
189
+ :type ram: ``int``
190
+
191
+ :rtype: JSON
192
+
193
+
194
+
195
+ .. rb:method:: hdds(server_id: @id)
196
+
197
+ Returns a list of the server's HDD's.
198
+
199
+ :param server_id: the unique identifier for the server.
200
+ :type server_id: ``str``
201
+
202
+ :rtype: JSON
203
+
204
+
205
+
206
+ .. rb:method:: add_hdds(server_id: @id, hdds: nil)
207
+
208
+ Add additional HDD's to a server.
209
+
210
+ :param server_id: the unique identifier for the server.
211
+ :type server_id: ``str``
212
+
213
+ :param hdds: takes an array of HDD's.
214
+ :type hdds: ``array``
215
+
216
+ :rtype: JSON
217
+
218
+
219
+
220
+ .. rb:method:: get_hdd(server_id: @id, hdd_id: nil)
221
+
222
+ Retrieve information about a server's HDD.
223
+
224
+ :param server_id: the unique identifier for the server.
225
+ :type server_id: ``str``
226
+
227
+ :param hdd_id: the unique identifier for the HDD.
228
+ :type hdd_id: ``str``
229
+
230
+ :rtype: JSON
231
+
232
+
233
+
234
+ .. rb:method:: modify_hdd(server_id: @id, hdd_id: nil, size: nil)
235
+
236
+ Modify a server's HDD.
237
+
238
+ :param server_id: the unique identifier for the server.
239
+ :type server_id: ``str``
240
+
241
+ :param hdd_id: the unique identifier for the server's HDD.
242
+ :type hdd_id: ``str``
243
+
244
+ :param size: the new size of the HDD. Must be a multiple of ``20``.
245
+ :type size: ``int``
246
+
247
+ :rtype: JSON
248
+
249
+
250
+
251
+ .. rb:method:: delete_hdd(server_id: @id, hdd_id: nil)
252
+
253
+ Delete a server's HDD.
254
+
255
+ :param server_id: the unique identifier for the server.
256
+ :type server_id: ``str``
257
+
258
+ :param hdd_id: the unique identifier for the server's HDD.
259
+ :type hdd_id: ``str``
260
+
261
+ :rtype: JSON
262
+
263
+
264
+
265
+ .. rb:method:: image(server_id: @id)
266
+
267
+ Returns information about a server's image.
268
+
269
+ :param server_id: the unique identifier for the server.
270
+ :type server_id: ``str``
271
+
272
+ :rtype: JSON
273
+
274
+
275
+
276
+ .. rb:method:: install_image(server_id: @id, image_id: nil, password: nil, firewall_id: nil)
277
+
278
+ Installs an image onto the server.
279
+
280
+ :param server_id: the unique identifier for the server.
281
+ :type server_id: ``str``
282
+
283
+ :param image_id: the unique identifier for the server image.
284
+ :type image_id: ``str``
285
+
286
+ :param password: server password.
287
+ :type password: ``str``
288
+
289
+ :param firewall_id: the unique identifier for the firewall policy to be assigned.
290
+ :type firewall_id: ``str``
291
+
292
+ :rtype: JSON
293
+
294
+
295
+
296
+ .. rb:method:: ips(server_id: @id)
297
+
298
+ Returns a list of the server's IP's.
299
+
300
+ :param server_id: the unique identifier for the server.
301
+ :type server_id: ``str``
302
+
303
+ :rtype: JSON
304
+
305
+
306
+
307
+ .. rb:method:: add_ip(server_id: @id, ip_type: nil)
308
+
309
+ Add an IP to the server.
310
+
311
+ :param server_id: the unique identifier for the server.
312
+ :type server_id: ``str``
313
+
314
+ :param ip_type: at the moment, only ```IPV4``` is currently supported.
315
+ :type ip_type: ``str``
316
+
317
+ :rtype: JSON
318
+
319
+
320
+
321
+ .. rb:method:: ip(server_id: @id, ip_id: nil)
322
+
323
+ Returns information about a server's IP.
324
+
325
+ :param server_id: the unique identifier for the server.
326
+ :type server_id: ``str``
327
+
328
+ :param ip_id: the unique identifier for the IP.
329
+ :type ip_id: ``str``
330
+
331
+ :rtype: JSON
332
+
333
+
334
+
335
+ .. rb:method:: release_ip(server_id: @id, ip_id: nil, keep_ip: nil)
336
+
337
+ Release an IP from the server.
338
+
339
+ :param server_id: the unique identifier for the server.
340
+ :type server_id: ``str``
341
+
342
+ :param ip_id: the unique identifier for the server's IP.
343
+ :type ip_id: ``str``
344
+
345
+ :param keep_ip: Set ``keep_ip`` to ``True`` for releasing the IP without deleting it permanently. (``False`` by default)
346
+ :type keep_ip: ``bool``
347
+
348
+ :rtype: JSON
349
+
350
+
351
+
352
+ .. rb:method:: add_firewall(server_id: @id, ip_id: nil, firewall_id: nil)
353
+
354
+ Add a firewall policy to a server's IP.
355
+
356
+ :param server_id: the unique identifier for the server.
357
+ :type server_id: ``str``
358
+
359
+ :param ip_id: the unique identifier for the server's IP.
360
+ :type ip_id: ``str``
361
+
362
+ :param firewall_id: the unique identifier for the firewall policy.
363
+ :type firewall_id: ``str``
364
+
365
+ :rtype: JSON
366
+
367
+
368
+
369
+ .. rb:method:: firewall(server_id: @id, ip_id: nil)
370
+
371
+ Returns information about a server IP's firewall policy.
372
+
373
+ :param server_id: the unique identifier for the server.
374
+ :type server_id: ``str``
375
+
376
+ :param ip_id: the unique identifier for the server's IP.
377
+ :type ip_id: ``str``
378
+
379
+ :rtype: JSON
380
+
381
+
382
+
383
+ .. rb:method:: remove_firewall(server_id: @id, ip_id: nil)
384
+
385
+ Remove a firewall policy from a server's IP.
386
+
387
+ :param server_id: the unique identifier for the server.
388
+ :type server_id: ``str``
389
+
390
+ :param ip_id: the unique identifier for the server's IP.
391
+ :type ip_id: ``str``
392
+
393
+ :rtype: JSON
394
+
395
+
396
+
397
+ .. rb:method:: load_balancers(server_id: @id, ip_id: nil)
398
+
399
+ Returns a list of the load balancers assigned to a server IP.
400
+
401
+ :param server_id: the unique identifier for the server.
402
+ :type server_id: ``str``
403
+
404
+ :param ip_id: the unique identifier for the server's IP.
405
+ :type ip_id: ``str``
406
+
407
+ :rtype: JSON
408
+
409
+
410
+
411
+ .. rb:method:: add_load_balancer(server_id: @id, ip_id: nil, load_balancer_id: nil)
412
+
413
+ Add a load balancer to a server's IP.
414
+
415
+ :param server_id: the unique identifier for the server.
416
+ :type server_id: ``str``
417
+
418
+ :param ip_id: the unique identifier for the server's IP.
419
+ :type ip_id: ``str``
420
+
421
+ :param load_balancer_id: the unique identifier for the load balancer.
422
+ :type load_balancer_id: ``str``
423
+
424
+ :rtype: JSON
425
+
426
+
427
+
428
+ .. rb:method:: remove_load_balancer(server_id: @id, ip_id: nil, load_balancer_id: nil)
429
+
430
+ Remove a load balancer from a server's IP.
431
+
432
+ :param server_id: the unique identifier for the server.
433
+ :type server_id: ``str``
434
+
435
+ :param ip_id: the unique identifier for the server's IP.
436
+ :type ip_id: ``str``
437
+
438
+ :param load_balancer_id: the unique identifier for the load balancer.
439
+ :type load_balancer_id: ``str``
440
+
441
+ :rtype: JSON
442
+
443
+
444
+
445
+ .. rb:method:: status(server_id: @id)
446
+
447
+ Retrieve the server's current state.
448
+
449
+ :param server_id: the unique identifier for the server.
450
+ :type server_id: ``str``
451
+
452
+ :rtype: JSON
453
+
454
+
455
+
456
+ .. rb:method:: change_status(server_id: @id, action: nil, method: nil)
457
+
458
+ Modify a server's state.
459
+
460
+ :param server_id: the unique identifier for the server.
461
+ :type server_id: ``str``
462
+
463
+ :param action: the action to perform on the server. Possible values are ``'POWER_OFF'``, ``'POWER_ON'``, and ``'REBOOT'``.
464
+ :type action: ``str``
465
+
466
+ :param method: the action's method. Possible values are ``'SOFTWARE'`` or ``'HARDWARE'``.
467
+ :type method: ``str``
468
+
469
+ :rtype: JSON
470
+
471
+
472
+
473
+ .. rb:method:: dvd(server_id: @id)
474
+
475
+ Returns information about the DVD currently loaded into the server.
476
+
477
+ :param server_id: the unique identifier for the server.
478
+ :type server_id: ``str``
479
+
480
+ :rtype: JSON
481
+
482
+
483
+
484
+ .. rb:method:: load_dvd(server_id: @id, dvd_id: nil)
485
+
486
+ Loads a DVD into the server.
487
+
488
+ :param server_id: the unique identifier for the server.
489
+ :type server_id: ``str``
490
+
491
+ :param dvd_id: the unique identifier for the DVD.
492
+ :type dvd_id: ``str``
493
+
494
+ :rtype: JSON
495
+
496
+
497
+
498
+ .. rb:method:: eject_dvd(server_id: @id)
499
+
500
+ Eject the DVD from the server.
501
+
502
+ :param server_id: the unique identifier for the server.
503
+ :type server_id: ``str``
504
+
505
+ :rtype: JSON
506
+
507
+
508
+
509
+ .. rb:method:: private_networks(server_id: @id)
510
+
511
+ Returns a list of the server's private networks.
512
+
513
+ :param server_id: the unique identifier for the server.
514
+ :type server_id: ``str``
515
+
516
+ :rtype: JSON
517
+
518
+
519
+
520
+ .. rb:method:: private_network(server_id: @id, private_network_id: nil)
521
+
522
+ Returns information about a server's private network.
523
+
524
+ :param server_id: the unique identifier for the server.
525
+ :type server_id: ``str``
526
+
527
+ :param private_network_id: the unique identifier for the private network.
528
+ :type private_network_id: ``str``
529
+
530
+ :rtype: JSON
531
+
532
+
533
+
534
+ .. rb:method:: remove_private_network(server_id: @id, private_network_id: nil)
535
+
536
+ Removes a server from a private network.
537
+
538
+ :param server_id: the unique identifier for the server.
539
+ :type server_id: ``str``
540
+
541
+ :param private_network_id: the unique identifier for the private network.
542
+ :type private_network_id: ``str``
543
+
544
+ :rtype: JSON
545
+
546
+
547
+
548
+ .. rb:method:: add_private_network(server_id: @id, private_network_id: nil)
549
+
550
+ Add a server to a private network.
551
+
552
+ :param server_id: the unique identifier for the server.
553
+ :type server_id: ``str``
554
+
555
+ :param private_network_id: the unique identifier for the private network.
556
+ :type private_network_id: ``str``
557
+
558
+ :rtype: JSON
559
+
560
+
561
+
562
+ .. rb:method:: create_snapshot(server_id: @id)
563
+
564
+ Creates a server snapshot.
565
+
566
+ :param server_id: the unique identifier for the server.
567
+ :type server_id: ``str``
568
+
569
+ :rtype: JSON
570
+
571
+
572
+
573
+ .. rb:method:: snapshot(server_id: @id)
574
+
575
+ Returns information about a server's snapshot.
576
+
577
+ :param server_id: the unique identifier for the server.
578
+ :type server_id: ``str``
579
+
580
+ :rtype: JSON
581
+
582
+
583
+
584
+ .. rb:method:: restore_snapshot(server_id: @id, snapshot_id: nil)
585
+
586
+ Restore a server's snapshot.
587
+
588
+ :param server_id: the unique identifier for the server.
589
+ :type server_id: ``str``
590
+
591
+ :param snapshot_id: the unique identifier for the server snapshot.
592
+ :type snapshot_id: ``str``
593
+
594
+ :rtype: JSON
595
+
596
+
597
+
598
+ .. rb:method:: delete_snapshot(server_id: @id, snapshot_id: nil)
599
+
600
+ Remove a server's snapshot.
601
+
602
+ :param server_id: the unique identifier for the server.
603
+ :type server_id: ``str``
604
+
605
+ :param snapshot_id: the unique identifier for the server snapshot.
606
+ :type snapshot_id: ``str``
607
+
608
+ :rtype: JSON
609
+
610
+
611
+
612
+ .. rb:method:: clone(server_id: @id, name: nil)
613
+
614
+ Clone a server.
615
+
616
+ :param server_id: the unique identifier for the server to be cloned.
617
+ :type server_id: ``str``
618
+
619
+ :param name: the new server's name.
620
+ :type name: ``str``
621
+
622
+ :rtype: JSON
623
+
624
+
625
+
626
+ .. rb:method:: wait_for()
627
+
628
+ Polls the server until an "ACTIVE", "POWERED_ON", or "POWERED_OFF" state is returned. Use this when chaining actions.
629
+
630
+ :rtype: ``nil``