fog-profitbricks 0.0.5 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (194) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/README.md +1465 -4
  4. data/Rakefile +3 -0
  5. data/examples/pb_demo.rb +83 -35
  6. data/fog-profitbricks.gemspec +10 -10
  7. data/gemfiles/Gemfile.1.8.7 +0 -1
  8. data/lib/fog/profitbricks.rb +4 -23
  9. data/lib/fog/profitbricks/compute.rb +1082 -1
  10. data/lib/fog/profitbricks/helpers/compute/data_helper.rb +12 -0
  11. data/lib/fog/profitbricks/models/base.rb +37 -0
  12. data/lib/fog/profitbricks/models/compute/datacenter.rb +64 -0
  13. data/lib/fog/{compute/profit_bricks/models → profitbricks/models/compute}/datacenters.rb +9 -4
  14. data/lib/fog/profitbricks/models/compute/firewall_rule.rb +101 -0
  15. data/lib/fog/profitbricks/models/compute/firewall_rules.rb +40 -0
  16. data/lib/fog/{compute/profit_bricks/models → profitbricks/models/compute}/flavor.rb +0 -0
  17. data/lib/fog/{compute/profit_bricks/models → profitbricks/models/compute}/flavors.rb +0 -0
  18. data/lib/fog/profitbricks/models/compute/image.rb +72 -0
  19. data/lib/fog/profitbricks/models/compute/images.rb +28 -0
  20. data/lib/fog/profitbricks/models/compute/ip_block.rb +58 -0
  21. data/lib/fog/profitbricks/models/compute/ip_blocks.rb +30 -0
  22. data/lib/fog/profitbricks/models/compute/lan.rb +89 -0
  23. data/lib/fog/profitbricks/models/compute/lans.rb +36 -0
  24. data/lib/fog/profitbricks/models/compute/load_balancer.rb +126 -0
  25. data/lib/fog/profitbricks/models/compute/load_balancers.rb +34 -0
  26. data/lib/fog/profitbricks/models/compute/location.rb +18 -0
  27. data/lib/fog/profitbricks/models/compute/locations.rb +28 -0
  28. data/lib/fog/profitbricks/models/compute/nic.rb +111 -0
  29. data/lib/fog/profitbricks/models/compute/nics.rb +38 -0
  30. data/lib/fog/{compute/profit_bricks/models → profitbricks/models/compute}/region.rb +0 -0
  31. data/lib/fog/{compute/profit_bricks/models → profitbricks/models/compute}/regions.rb +0 -0
  32. data/lib/fog/profitbricks/models/compute/request.rb +24 -0
  33. data/lib/fog/profitbricks/models/compute/requests.rb +37 -0
  34. data/lib/fog/profitbricks/models/compute/server.rb +263 -0
  35. data/lib/fog/profitbricks/models/compute/servers.rb +32 -0
  36. data/lib/fog/profitbricks/models/compute/snapshot.rb +81 -0
  37. data/lib/fog/profitbricks/models/compute/snapshots.rb +28 -0
  38. data/lib/fog/profitbricks/models/compute/volume.rb +123 -0
  39. data/lib/fog/profitbricks/models/compute/volumes.rb +33 -0
  40. data/lib/fog/profitbricks/requests/compute/associate_nic_to_load_balancer.rb +104 -0
  41. data/lib/fog/profitbricks/requests/compute/attach_cdrom.rb +88 -0
  42. data/lib/fog/profitbricks/requests/compute/attach_volume.rb +89 -0
  43. data/lib/fog/profitbricks/requests/compute/create_datacenter.rb +89 -0
  44. data/lib/fog/profitbricks/requests/compute/create_firewall_rule.rb +103 -0
  45. data/lib/fog/{compute/profit_bricks/requests → profitbricks/requests/compute}/create_flavor.rb +0 -0
  46. data/lib/fog/profitbricks/requests/compute/create_ip_block.rb +81 -0
  47. data/lib/fog/profitbricks/requests/compute/create_lan.rb +160 -0
  48. data/lib/fog/profitbricks/requests/compute/create_load_balancer.rb +87 -0
  49. data/lib/fog/profitbricks/requests/compute/create_nic.rb +124 -0
  50. data/lib/fog/profitbricks/requests/compute/create_server.rb +257 -0
  51. data/lib/fog/profitbricks/requests/compute/create_volume.rb +133 -0
  52. data/lib/fog/profitbricks/requests/compute/create_volume_snapshot.rb +113 -0
  53. data/lib/fog/profitbricks/requests/compute/delete_datacenter.rb +43 -0
  54. data/lib/fog/profitbricks/requests/compute/delete_firewall_rule.rb +47 -0
  55. data/lib/fog/profitbricks/requests/compute/delete_image.rb +43 -0
  56. data/lib/fog/profitbricks/requests/compute/delete_ip_block.rb +43 -0
  57. data/lib/fog/profitbricks/requests/compute/delete_lan.rb +44 -0
  58. data/lib/fog/profitbricks/requests/compute/delete_load_balancer.rb +44 -0
  59. data/lib/fog/profitbricks/requests/compute/delete_nic.rb +46 -0
  60. data/lib/fog/profitbricks/requests/compute/delete_server.rb +48 -0
  61. data/lib/fog/profitbricks/requests/compute/delete_snapshot.rb +43 -0
  62. data/lib/fog/profitbricks/requests/compute/delete_volume.rb +44 -0
  63. data/lib/fog/profitbricks/requests/compute/detach_cdrom.rb +52 -0
  64. data/lib/fog/profitbricks/requests/compute/detach_volume.rb +53 -0
  65. data/lib/fog/profitbricks/requests/compute/get_all_datacenters.rb +59 -0
  66. data/lib/fog/profitbricks/requests/compute/get_all_firewall_rules.rb +76 -0
  67. data/lib/fog/{compute/profit_bricks/requests → profitbricks/requests/compute}/get_all_flavors.rb +0 -0
  68. data/lib/fog/profitbricks/requests/compute/get_all_images.rb +66 -0
  69. data/lib/fog/profitbricks/requests/compute/get_all_ip_blocks.rb +56 -0
  70. data/lib/fog/profitbricks/requests/compute/get_all_lans.rb +120 -0
  71. data/lib/fog/profitbricks/requests/compute/get_all_load_balanced_nics.rb +100 -0
  72. data/lib/fog/profitbricks/requests/compute/get_all_load_balancers.rb +117 -0
  73. data/lib/fog/profitbricks/requests/compute/get_all_locations.rb +44 -0
  74. data/lib/fog/profitbricks/requests/compute/get_all_nic.rb +102 -0
  75. data/lib/fog/profitbricks/requests/compute/get_all_requests.rb +43 -0
  76. data/lib/fog/profitbricks/requests/compute/get_all_servers.rb +134 -0
  77. data/lib/fog/profitbricks/requests/compute/get_all_snapshots.rb +66 -0
  78. data/lib/fog/profitbricks/requests/compute/get_all_volumes.rb +78 -0
  79. data/lib/fog/profitbricks/requests/compute/get_attached_cdrom.rb +78 -0
  80. data/lib/fog/profitbricks/requests/compute/get_attached_volume.rb +79 -0
  81. data/lib/fog/profitbricks/requests/compute/get_datacenter.rb +65 -0
  82. data/lib/fog/profitbricks/requests/compute/get_firewall_rule.rb +71 -0
  83. data/lib/fog/{compute/profit_bricks/requests → profitbricks/requests/compute}/get_flavor.rb +0 -0
  84. data/lib/fog/profitbricks/requests/compute/get_image.rb +71 -0
  85. data/lib/fog/profitbricks/requests/compute/get_ip_block.rb +58 -0
  86. data/lib/fog/profitbricks/requests/compute/get_lan.rb +120 -0
  87. data/lib/fog/profitbricks/requests/compute/get_load_balanced_nic.rb +99 -0
  88. data/lib/fog/profitbricks/requests/compute/get_load_balancer.rb +116 -0
  89. data/lib/fog/profitbricks/requests/compute/get_location.rb +49 -0
  90. data/lib/fog/profitbricks/requests/compute/get_nic.rb +98 -0
  91. data/lib/fog/profitbricks/requests/compute/get_request.rb +61 -0
  92. data/lib/fog/profitbricks/requests/compute/get_request_status.rb +50 -0
  93. data/lib/fog/profitbricks/requests/compute/get_server.rb +133 -0
  94. data/lib/fog/profitbricks/requests/compute/get_snapshot.rb +70 -0
  95. data/lib/fog/profitbricks/requests/compute/get_volume.rb +73 -0
  96. data/lib/fog/profitbricks/requests/compute/list_attached_cdroms.rb +74 -0
  97. data/lib/fog/profitbricks/requests/compute/list_attached_volumes.rb +75 -0
  98. data/lib/fog/profitbricks/requests/compute/reboot_server.rb +47 -0
  99. data/lib/fog/profitbricks/requests/compute/remove_nic_association.rb +44 -0
  100. data/lib/fog/profitbricks/requests/compute/restore_volume_snapshot.rb +61 -0
  101. data/lib/fog/profitbricks/requests/compute/start_server.rb +49 -0
  102. data/lib/fog/profitbricks/requests/compute/stop_server.rb +50 -0
  103. data/lib/fog/profitbricks/requests/compute/update_datacenter.rb +73 -0
  104. data/lib/fog/profitbricks/requests/compute/update_firewall_rule.rb +87 -0
  105. data/lib/fog/profitbricks/requests/compute/update_image.rb +90 -0
  106. data/lib/fog/profitbricks/requests/compute/update_lan.rb +126 -0
  107. data/lib/fog/profitbricks/requests/compute/update_load_balancer.rb +70 -0
  108. data/lib/fog/profitbricks/requests/compute/update_nic.rb +107 -0
  109. data/lib/fog/profitbricks/requests/compute/update_server.rb +147 -0
  110. data/lib/fog/profitbricks/requests/compute/update_snapshot.rb +90 -0
  111. data/lib/fog/profitbricks/requests/compute/update_volume.rb +82 -0
  112. data/lib/fog/profitbricks/version.rb +1 -1
  113. data/tests/profitbricks/requests/compute/composite_create_tests.rb +241 -0
  114. data/tests/profitbricks/requests/compute/location_tests.rb +24 -12
  115. data/tests/profitbricks/requests/compute/nic_tests.rb +290 -0
  116. data/tests/profitbricks/requests/compute/request_tests.rb +52 -0
  117. data/tests/profitbricks/requests/compute/server_tests.rb +398 -175
  118. metadata +140 -133
  119. data/lib/fog/compute/profit_bricks.rb +0 -217
  120. data/lib/fog/compute/profit_bricks/models/datacenter.rb +0 -60
  121. data/lib/fog/compute/profit_bricks/models/image.rb +0 -27
  122. data/lib/fog/compute/profit_bricks/models/images.rb +0 -22
  123. data/lib/fog/compute/profit_bricks/models/interface.rb +0 -61
  124. data/lib/fog/compute/profit_bricks/models/interfaces.rb +0 -23
  125. data/lib/fog/compute/profit_bricks/models/server.rb +0 -104
  126. data/lib/fog/compute/profit_bricks/models/servers.rb +0 -22
  127. data/lib/fog/compute/profit_bricks/models/volume.rb +0 -71
  128. data/lib/fog/compute/profit_bricks/models/volumes.rb +0 -23
  129. data/lib/fog/compute/profit_bricks/requests/clear_data_center.rb +0 -51
  130. data/lib/fog/compute/profit_bricks/requests/connect_storage_to_server.rb +0 -83
  131. data/lib/fog/compute/profit_bricks/requests/create_data_center.rb +0 -62
  132. data/lib/fog/compute/profit_bricks/requests/create_nic.rb +0 -79
  133. data/lib/fog/compute/profit_bricks/requests/create_server.rb +0 -105
  134. data/lib/fog/compute/profit_bricks/requests/create_storage.rb +0 -96
  135. data/lib/fog/compute/profit_bricks/requests/delete_data_center.rb +0 -60
  136. data/lib/fog/compute/profit_bricks/requests/delete_nic.rb +0 -64
  137. data/lib/fog/compute/profit_bricks/requests/delete_server.rb +0 -64
  138. data/lib/fog/compute/profit_bricks/requests/delete_storage.rb +0 -64
  139. data/lib/fog/compute/profit_bricks/requests/disconnect_storage_from_server.rb +0 -76
  140. data/lib/fog/compute/profit_bricks/requests/get_all_data_centers.rb +0 -31
  141. data/lib/fog/compute/profit_bricks/requests/get_all_images.rb +0 -65
  142. data/lib/fog/compute/profit_bricks/requests/get_all_locations.rb +0 -44
  143. data/lib/fog/compute/profit_bricks/requests/get_all_nic.rb +0 -53
  144. data/lib/fog/compute/profit_bricks/requests/get_all_servers.rb +0 -57
  145. data/lib/fog/compute/profit_bricks/requests/get_all_storages.rb +0 -56
  146. data/lib/fog/compute/profit_bricks/requests/get_data_center.rb +0 -38
  147. data/lib/fog/compute/profit_bricks/requests/get_data_center_state.rb +0 -42
  148. data/lib/fog/compute/profit_bricks/requests/get_image.rb +0 -69
  149. data/lib/fog/compute/profit_bricks/requests/get_location.rb +0 -48
  150. data/lib/fog/compute/profit_bricks/requests/get_nic.rb +0 -63
  151. data/lib/fog/compute/profit_bricks/requests/get_server.rb +0 -98
  152. data/lib/fog/compute/profit_bricks/requests/get_storage.rb +0 -63
  153. data/lib/fog/compute/profit_bricks/requests/reset_server.rb +0 -49
  154. data/lib/fog/compute/profit_bricks/requests/set_internet_access.rb +0 -59
  155. data/lib/fog/compute/profit_bricks/requests/start_server.rb +0 -58
  156. data/lib/fog/compute/profit_bricks/requests/stop_server.rb +0 -58
  157. data/lib/fog/compute/profit_bricks/requests/update_data_center.rb +0 -54
  158. data/lib/fog/compute/profit_bricks/requests/update_nic.rb +0 -74
  159. data/lib/fog/compute/profit_bricks/requests/update_server.rb +0 -79
  160. data/lib/fog/compute/profit_bricks/requests/update_storage.rb +0 -73
  161. data/lib/fog/models/profit_bricks/base.rb +0 -11
  162. data/lib/fog/parsers/compute.rb +0 -37
  163. data/lib/fog/parsers/compute/profit_bricks/base.rb +0 -51
  164. data/lib/fog/parsers/compute/profit_bricks/clear_data_center.rb +0 -22
  165. data/lib/fog/parsers/compute/profit_bricks/connect_storage_to_server.rb +0 -22
  166. data/lib/fog/parsers/compute/profit_bricks/create_data_center.rb +0 -22
  167. data/lib/fog/parsers/compute/profit_bricks/create_nic.rb +0 -22
  168. data/lib/fog/parsers/compute/profit_bricks/create_server.rb +0 -22
  169. data/lib/fog/parsers/compute/profit_bricks/create_storage.rb +0 -22
  170. data/lib/fog/parsers/compute/profit_bricks/delete_data_center.rb +0 -20
  171. data/lib/fog/parsers/compute/profit_bricks/delete_nic.rb +0 -22
  172. data/lib/fog/parsers/compute/profit_bricks/delete_server.rb +0 -22
  173. data/lib/fog/parsers/compute/profit_bricks/delete_storage.rb +0 -22
  174. data/lib/fog/parsers/compute/profit_bricks/disconnect_storage_from_server.rb +0 -22
  175. data/lib/fog/parsers/compute/profit_bricks/get_all_data_centers.rb +0 -26
  176. data/lib/fog/parsers/compute/profit_bricks/get_all_images.rb +0 -30
  177. data/lib/fog/parsers/compute/profit_bricks/get_all_nic.rb +0 -30
  178. data/lib/fog/parsers/compute/profit_bricks/get_all_servers.rb +0 -57
  179. data/lib/fog/parsers/compute/profit_bricks/get_all_storages.rb +0 -33
  180. data/lib/fog/parsers/compute/profit_bricks/get_data_center.rb +0 -23
  181. data/lib/fog/parsers/compute/profit_bricks/get_data_center_state.rb +0 -20
  182. data/lib/fog/parsers/compute/profit_bricks/get_image.rb +0 -26
  183. data/lib/fog/parsers/compute/profit_bricks/get_nic.rb +0 -27
  184. data/lib/fog/parsers/compute/profit_bricks/get_server.rb +0 -57
  185. data/lib/fog/parsers/compute/profit_bricks/get_storage.rb +0 -30
  186. data/lib/fog/parsers/compute/profit_bricks/reset_server.rb +0 -20
  187. data/lib/fog/parsers/compute/profit_bricks/set_internet_access.rb +0 -22
  188. data/lib/fog/parsers/compute/profit_bricks/update_data_center.rb +0 -22
  189. data/lib/fog/parsers/compute/profit_bricks/update_nic.rb +0 -22
  190. data/lib/fog/parsers/compute/profit_bricks/update_server.rb +0 -22
  191. data/lib/fog/parsers/compute/profit_bricks/update_storage.rb +0 -22
  192. data/lib/fog/profitbricks/storage.rb +0 -1
  193. data/tests/profitbricks/requests/compute/image_tests.rb +0 -50
  194. data/tests/profitbricks/requests/compute/interface_tests.rb +0 -101
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2512dc161ee5bac644a032f17656b8708d46b08e
4
- data.tar.gz: 605b148c0a0efaca88bebaa697cd59effa196081
3
+ metadata.gz: da98864bbc8f591efae223f144a400046870c7fb
4
+ data.tar.gz: 392b05d4ae791fc4f06ecd199a137f82e96824db
5
5
  SHA512:
6
- metadata.gz: 7134d5bcff9866922cbf17bbe181724c4fe4f38a1a4f678aaaabeeb3f806125fe02cf33b88a06dabf44343db64c0c53c2bcd98f41e7ba43663a65a2d2201a09d
7
- data.tar.gz: ead3e45240ffb2551745e74f9eeac84393a406a2c47044f6cff26058f1d149be5ffd3f4e2cf2b03b5c58b3254d7bf120d3b2bccfd8f64c484da45bfdc4fa5fa6
6
+ metadata.gz: 0fcb8d3b8754800884dc37c6fdea7a2dbef8ee8f37656f6e4441203ed1eb720435a0ef37f46af7ab5634c77c403b809f0eb4d6754686463c525c44b4f9bf7383
7
+ data.tar.gz: 0506d6d67589b01003818ef527e14a7ae76d5ebcd792e33529349fdc7979c4da6f353e7f90b5e16d94424620198a48760bed58afcdea53d9cb71814ccb77b5bb
data/.gitignore CHANGED
@@ -22,3 +22,4 @@ tmp
22
22
  mkmf.log
23
23
  gemfiles/*.lock
24
24
  .fog
25
+ .idea/
data/README.md CHANGED
@@ -2,9 +2,103 @@
2
2
 
3
3
  ![Gem Version](https://badge.fury.io/rb/fog-profitbricks.svg) [![Build Status](https://travis-ci.org/fog/fog-profitbricks.svg?branch=master)](https://travis-ci.org/fog/fog-profitbricks) [![Dependency Status](https://gemnasium.com/fog/fog-profitbricks.svg)](https://gemnasium.com/fog/fog-profitbricks) [![Coverage Status](https://img.shields.io/coveralls/fog/fog-profitbricks.svg)](https://coveralls.io/r/fog/fog-profitbricks?branch=master) [![Code Climate](https://codeclimate.com/github/fog/fog-profitbricks.png)](https://codeclimate.com/github/fog/fog-profitbricks)
4
4
 
5
- Module for the 'fog' gem to support ProfitBricks
5
+ Module for the 'fog' gem to support ProfitBricks Cloud API.
6
6
 
7
- ## Installation
7
+ ## Table of Contents
8
+
9
+ * [Getting Started](#getting-started)
10
+ * [Installation](#installation)
11
+ * [Authentication](#authentication)
12
+ * [Operations](#operations)
13
+ * [Data Centers](#data-centers)
14
+ * [List Data Centers](#list-data-centers)
15
+ * [Retrieve a Data Center](#retrieve-a-data-center)
16
+ * [Create a Data Centers](#create-a-data-center)
17
+ * [Update a Data Centers](#update-a-data-center)
18
+ * [Delete a Data Centers](#delete-a-data-center)
19
+ * [Locations](#locations)
20
+ * [List Locations](#list-locations)
21
+ * [Get a Location](#get-a-location)
22
+ * [Servers](#servers)
23
+ * [List Servers](#list-servers)
24
+ * [Retrieve a Server](#retrieve-a-server)
25
+ * [Create a Server](#create-a-server)
26
+ * [Update a Server](#update-a-server)
27
+ * [Delete a Server](#delete-a-server)
28
+ * [List Attached Volumes](#list-attached-volumes)
29
+ * [Attach a Volume](#attach-a-volume)
30
+ * [Retrieve an Attached Volume](#retrieve-an-attached-volume)
31
+ * [Detach a Volume](#detach-a-volume)
32
+ * [List Attached CD-ROMs](#list-attached-cd-roms)
33
+ * [Attach a CD-ROM](#attach-a-cd-rom)
34
+ * [Retrieve an Attached CD-ROM](retrieve-an-attached-cd-rom)
35
+ * [Detach a CD-ROM](#detach-a-cd-rom)
36
+ * [Reboot a Server](#reboot-a-server)
37
+ * [Start a Server](#start-a-server)
38
+ * [Stop a Server](#stop-a-server)
39
+ * [Volumes](#volumes)
40
+ * [List Volumes](#list-volumes)
41
+ * [Get a Volume](#get-a-volume)
42
+ * [Create a Volume](#create-a-volume)
43
+ * [Update a Volume](#update-a-volume)
44
+ * [Delete a Volume](#delete-a-volume)
45
+ * [Create a Volume Snapshot](#create-a-volume-snapshot)
46
+ * [Restore a Volume Snapshot](#restore-a-volume-snapshot)
47
+ * [Snapshots](#snapshots)
48
+ * [List Snapshots](#list-snapshots)
49
+ * [Get a Snapshot](#get-a-snapshot)
50
+ * [Update a Snapshot](#update-a-snapshot)
51
+ * [Delete a Snapshot](#delete-a-snapshot)
52
+ * [Load Balancers](#load-balancers)
53
+ * [List Load Balancers](#list-load-balancers)
54
+ * [Get a Load Balancer](#get-a-load-balancer)
55
+ * [Create a Load Balancer](#create-a-load-balancer)
56
+ * [Update a Load Balancer](#update-a-load-balancer)
57
+ * [List Load Balanced NICs](#list-load-balanced-nics)
58
+ * [Get a Load Balanced NIC](#get-a-load-balanced-nic)
59
+ * [Associate NIC to a Load Balancer](#associate-nic-to-a-load-balancer)
60
+ * [Remove a NIC Association](#remove-a-nic-association)
61
+ * [Firewall Rules](#firewall-rules)
62
+ * [List Firewall Rules](#list-firewall-rules)
63
+ * [Get a Firewall Rule](#get-a-firewall-rule)
64
+ * [Create a Firewall Rule](#create-a-firewall-rule)
65
+ * [Update a Firewall Rule](#update-a-firewall-rule)
66
+ * [Delete a Firewall Rule](#delete-a-firewall-rule)
67
+ * [Images](#images)
68
+ * [List Images](#list-images)
69
+ * [Get an Image](#get-an-image)
70
+ * [Update an Image](#update-an-image)
71
+ * [Delete an Image](#delete-an-image)
72
+ * [Network Interfaces (NICs)](#network-interfaces-nics)
73
+ * [List NICs](#list-nics)
74
+ * [Get a NIC](#get-a-nic)
75
+ * [Create a NIC](#create-a-nic)
76
+ * [Update a NIC](#update-a-nic)
77
+ * [Delete a NIC](#delete-a-nic)
78
+ * [IP Blocks](#ip-blocks)
79
+ * [List IP Blocks](#list-ip-blocks)
80
+ * [Get an IP Block](#get-an-ip-block)
81
+ * [Create an IP Block](#create-an-ip-block)
82
+ * [Delete an IP Block](#delete-an-ip-block)
83
+ * [Requests](#requests)
84
+ * [List Requests](#list-requests)
85
+ * [Get a Request](#get-a-request)
86
+ * [Get a Request Status](#get-a-request-status)
87
+ * [LANs](#lans)
88
+ * [List LANs](#list-lans)
89
+ * [Create a LAN](#create-a-lan)
90
+ * [Get a LAN](#get-a-lan)
91
+ * [Update a LAN](#update-a-lan)
92
+ * [Delete a LAN](#delete-a-lan)
93
+ * [Contributing](#contributing)
94
+
95
+ ## Getting Started
96
+
97
+ Before you begin, you will need to have signed up for a ProfitBricks account. The credentials you create during sign-up will be used to authenticate against the API.
98
+
99
+ For more information on ProfitBricks REST API, visit the [API documentation](https://devops.profitbricks.com/api/cloud/v2/) page.
100
+
101
+ ### Installation
8
102
 
9
103
  Add this line to your application's Gemfile:
10
104
 
@@ -18,9 +112,1376 @@ Or install it yourself as:
18
112
 
19
113
  $ gem install fog-profitbricks
20
114
 
21
- ## Usage
115
+ ### Authentication
116
+
117
+ Provide your credentials when creating a compute object:
118
+
119
+ ```
120
+ compute = Fog::Compute.new(:provider => 'ProfitBricks', :profitbricks_username => 'username', :profitbricks_password => 'password')
121
+ ```
122
+
123
+ ## Operations
124
+
125
+ ### Data Centers
126
+
127
+ Virtual Data Centers (VDCs) are the foundation of the ProfitBricks platform. VDCs act as logical containers for all other objects you will be creating, e.g., servers. You can provision as many data centers as you want. Data centers have their own private network and are logically segmented from each other to create isolation.
128
+
129
+ #### List Data Centers
130
+
131
+ ```
132
+ compute.datacenters.all
133
+ ```
134
+ ---
135
+
136
+ #### Retrieve a Data Center
137
+
138
+ The following table describes the request arguments:
139
+
140
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
141
+ |---|---|---|---|
142
+ | datacenter_id | string | The unique ID of the data center. | Yes |
143
+
144
+ ```
145
+ compute.datacenters.get('datacenter_id')
146
+ ```
147
+ ---
148
+
149
+ #### Create a Data Center
150
+
151
+ The following table describes the request arguments:
152
+
153
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
154
+ |---|---|---|---|
155
+ | name | string | The name of the data center. | Yes |
156
+ | location | string | The physical location where the data center will be created. This will be where all of your servers live. | Yes |
157
+ | name | string | A description for the data center, e.g. staging, production. | No|
158
+
159
+ The following table outlines the locations currently supported:
160
+
161
+ | VALUE| COUNTRY | CITY |
162
+ |---|---|---|
163
+ | us/las | United States | Las Vegas |
164
+ | de/fra | Germany | Frankfurt |
165
+ | de/fkb | Germany | Karlsruhe |
166
+
167
+ ```
168
+ datacenter = compute.datacenters.create(:name => 'My data center', :location => 'us/las', :description => 'My data center description')
169
+ ```
170
+
171
+ *NOTES*:
172
+ - The value for `name` cannot contain the following characters: (@, /, , |, ‘’, ‘).
173
+ - You cannot change a data center's `location` once it has been provisioned.
174
+
175
+ ---
176
+
177
+ #### Update a Data Center
178
+
179
+ After retrieving a data center, either by getting it by id, or as a create response object, you can change it's properties and call the `update` method:
180
+
181
+ ```
182
+ datacenter.name = 'My data center updated name'
183
+ datacenter.update
184
+ ```
185
+
186
+ The following table describes the request arguments:
187
+
188
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
189
+ | --- | --- | --- | --- |
190
+ | name | string | The new name of the data center. | No|
191
+ | description | string | The new description of the data center. | No |
192
+
193
+ ---
194
+
195
+ #### Delete a Data Center
196
+
197
+ This will remove all objects within the data center and remove the data center object itself.
198
+
199
+ **NOTE**: This is a highly destructive operation which should be used with extreme caution.
200
+
201
+ ```
202
+ datacenter.delete
203
+ ```
204
+
205
+ ---
206
+
207
+ ### Locations
208
+
209
+ Locations represent regions where you can provision your Virtual Data Centers.
210
+
211
+ #### List Locations
212
+
213
+ ```
214
+ compute.locations.all
215
+ ```
216
+
217
+ ---
218
+
219
+ #### Get a Location
220
+
221
+ Retrieves the attributes of a given location.
222
+
223
+ The following table describes the request arguments:
224
+
225
+ | NAME | TYPE | DESCRIPTION | REQUIRED |
226
+ | --- | --- | --- | --- |
227
+ | location_id | string | The resource's unique identifier consisting of country/city. | Yes|
228
+
229
+ ```
230
+ compute.locations.get('us/las')
231
+ ```
232
+
233
+ ---
234
+
235
+ ### Servers
236
+
237
+ #### List Servers
238
+
239
+ You can retrieve a list of all servers within a data center.
240
+
241
+ The following table describes the request arguments:
242
+
243
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
244
+ |---|---|---|---|
245
+ | datacenter_id | string | The unique ID of the data center. | Yes |
246
+
247
+ ```
248
+ compute.servers.all('datacenter_id')
249
+ ```
250
+
251
+ ---
252
+
253
+ #### Retrieve a Server
254
+
255
+ Returns information about a server such as its configuration, provisioning status, etc.
256
+
257
+ The following table describes the request arguments:
258
+
259
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
260
+ |---|---|---|---|
261
+ | datacenter_id | string | The unique ID of the data center. | Yes |
262
+ | server-id | string | The unique ID of the server. | Yes |
263
+
264
+ ```
265
+ compute.servers.get('datacenter_id', 'server-id')
266
+ ```
267
+
268
+ ---
269
+
270
+ #### Create a Server
271
+
272
+ Creates a server within an existing data center. You can configure additional properties such as specifying a boot volume and connecting the server to an existing LAN.
273
+
274
+ The following table describes the request arguments:
275
+
276
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
277
+ |---|---|---|---|
278
+ | datacenter_id | string | The unique ID of the data center. | Yes |
279
+ | name | string | The hostname of the server. | Yes |
280
+ | cores | int | The total number of cores for the server. | Yes |
281
+ | ram | int | The amount of memory for the server in MB, e.g. 2048. Size must be specified in multiples of 256 MB with a minimum of 256 MB; however, if you set ramHotPlug to TRUE then you must use a minimum of 1024 MB. | Yes |
282
+ | availabilityZone | string |The availability zone in which the server should exist. | No |
283
+ | licenceType | string | Sets the OS type of the server. If undefined the OS type will be inherited from the boot image or boot volume. | No* |
284
+ | bootVolume | string | Reference to a Volume used for booting. If not ‘null’ then bootCdrom has to be ‘null’. | No |
285
+ | bootCdrom | string | Reference to a CD-ROM used for booting. If not 'null' then bootVolume has to be 'null'. | No |
286
+ | volumes | collection | A collection of volume IDs that you want to connect to the server. If the volume does not exist it will be created implicitly. | No |
287
+ | nics | collection | A collection of NICs you wish to create at the time the server is provisioned. | No |
288
+ | cpuFamily | string | Sets the CPU type. "AMD_OPTERON" or "INTEL_XEON". Defaults to "AMD_OPTERON". | No |
289
+
290
+ The following table outlines the various licence types you can define:
291
+
292
+ | LICENCE TYPE | COMMENT |
293
+ |---|---|
294
+ | WINDOWS | You must specify this if you are using your own, custom Windows image due to Microsoft's licensing terms. |
295
+ | LINUX ||
296
+ | UNKNOWN | If you are using an image uploaded to your account your OS Type will inherit as UNKNOWN. |
297
+
298
+ The following table outlines the availability zones currently supported:
299
+
300
+ | LICENCE TYPE | COMMENT |
301
+ |---|---|
302
+ | AUTO | Automatically Selected Zone |
303
+ | ZONE_1 | Fire Zone 1 |
304
+ | ZONE_2 | Fire Zone 2 |
305
+
306
+ ```
307
+ compute.servers.create(:datacenter_id => 'datacenter_id', :name => 'My server', :cores => 2, :ram => 2048, :availability_zone => 'AUTO', :licence_type => 'LINUX')
308
+ ```
309
+
310
+ **NOTE**: When creating a volume, you must specify either the `licence_type` or an `image`.
311
+
312
+ ---
313
+
314
+ #### Update a Server
315
+
316
+ Perform updates to attributes of a server.
317
+
318
+ The following table describes the request arguments:
319
+
320
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
321
+ |---|---|---|---|
322
+ | datacenter_id | string | The unique ID of the data center. | Yes |
323
+ | server-id | string | The unique ID of the server. | Yes |
324
+ | name | string | The name of the server. | No |
325
+ | cores | int | The number of cores for the server. | No |
326
+ | ram | int | The amount of memory in the server. | No |
327
+ | availabilityZone | string | The new availability zone for the server. | No |
328
+ | licenceType | string | The licence type for the server. | No |
329
+ | bootVolume | string | Reference to a Volume used for booting. If not ‘null’ then bootCdrom has to be ‘null’ | No |
330
+ | bootCdrom | string | Reference to a CD-ROM used for booting. If not 'null' then bootVolume has to be 'null'. | No |
331
+
332
+ After retrieving a server, either by getting it by id, or as a create response object, you can change it's properties and call the `update` method:
333
+
334
+ ```
335
+ server = compute.servers.get('datacenter_id', 'server-id')
336
+ server.name = 'Updated server name'
337
+ server.ram = 1024
338
+ server.update
339
+ ```
340
+
341
+ ---
342
+
343
+ #### Delete a Server
344
+
345
+ This will remove a server from a data center. NOTE: This will not automatically remove the storage volume(s) attached to a server. A separate API call is required to perform that action.
346
+
347
+ The following table describes the request arguments:
348
+
349
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
350
+ |---|---|---|---|
351
+ | datacenter_id | string | The unique ID of the data center. | Yes |
352
+ | server-id | string | The unique ID of the server. | Yes |
353
+
354
+ After retrieving a server, either by getting it by id, or as a create response object, you can call the `delete` method directly on the object:
355
+
356
+ ```
357
+ server = compute.servers.get('datacenter_id', 'server-id')
358
+ server.delete
359
+ ```
360
+
361
+ ---
362
+
363
+ #### List Attached Volumes
364
+
365
+ Retrieves a list of volumes attached to the server.
366
+
367
+ The following table describes the request arguments:
368
+
369
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
370
+ |---|---|---|---|
371
+ | datacenter_id | string | The unique ID of the data center. | Yes |
372
+ | server-id | string | The unique ID of the server. | Yes |
373
+
374
+ After retrieving a server, either by getting it by id, or as a create response object, you can call the `get_volumes` method directly on the object:
375
+
376
+ ```
377
+ server = compute.servers.get('datacenter_id', 'server-id')
378
+ server.get_volumes
379
+ ```
380
+
381
+ ---
382
+
383
+ #### Attach a Volume
384
+
385
+ This will attach a pre-existing storage volume to the server.
386
+
387
+ The following table describes the request arguments:
388
+
389
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
390
+ |---|---|---|---|
391
+ | datacenter_id | string | The unique ID of the data center. | Yes |
392
+ | server-id | string | The unique ID of the server. | Yes |
393
+ | storage-id | string | The unique ID of a storage volume. | Yes |
394
+
395
+ After retrieving a server, either by getting it by id, or as a create response object, you can call the `attach_volume` method directly on the object:
396
+
397
+ ```
398
+ server = compute.servers.get('datacenter_id', 'server-id')
399
+ server.attach_volume('storage-id')
400
+ ```
401
+
402
+ ---
403
+
404
+ #### Retrieve an Attached Volume
405
+
406
+ This will retrieve the properties of an attached volume.
407
+
408
+ The following table describes the request arguments:
409
+
410
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
411
+ |---|---|---|---|
412
+ | datacenter_id | string | The unique ID of the data center. | Yes |
413
+ | server-id | string | The unique ID of the server. | Yes |
414
+ | volume-id | string | The unique ID of the attached volume. | Yes |
415
+
416
+ After retrieving a server, either by getting it by id, or as a create response object, you can call the `get_attached_volume` method directly on the object:
417
+
418
+ ```
419
+ server = compute.servers.get('datacenter_id', 'server-id')
420
+ server.get_attached_volume('volume-id')
421
+ ```
422
+
423
+ ---
424
+
425
+ #### Detach a Volume
426
+
427
+ This will detach the volume from the server. Depending on the volume "hot_unplug" settings, this may result in the server being rebooted.
428
+
429
+ This will NOT delete the volume from your data center. You will need to make a separate request to delete a volume.
430
+
431
+ The following table describes the request arguments:
432
+
433
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
434
+ |---|---|---|---|
435
+ | datacenter_id | string | The unique ID of the data center. | Yes |
436
+ | server-id | string | The unique ID of the server. | Yes |
437
+ | volume-id | string | The unique ID of the attached volume. | Yes |
438
+
439
+ After retrieving a server, either by getting it by id, or as a create response object, you can call the `detach_volume` method directly on the object:
440
+
441
+ ```
442
+ server = compute.servers.get('datacenter_id', 'server-id')
443
+ server.detach_volume('volume-id')
444
+ ```
445
+
446
+ ---
447
+
448
+ #### List Attached CD-ROMs
449
+
450
+ Retrieves a list of CD-ROMs attached to the server.
451
+
452
+ The following table describes the request arguments:
453
+
454
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
455
+ |---|---|---|---|
456
+ | datacenter_id | string | The unique ID of the data center. | Yes |
457
+ | server-id | string | The unique ID of the server. | Yes |
458
+
459
+ After retrieving a server, either by getting it by id, or as a create response object, you can call the `get_cdroms` method directly on the object:
460
+
461
+ ```
462
+ server = compute.servers.get('datacenter_id', 'server-id')
463
+ server.get_cdroms
464
+ ```
465
+
466
+ ---
467
+
468
+ #### Attach a CD-ROM
469
+
470
+ You can attach a CD-ROM to an existing server.
471
+
472
+ The following table describes the request arguments:
473
+
474
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
475
+ |---|---|---|---|
476
+ | datacenter_id | string | The unique ID of the data center. | Yes |
477
+ | server-id | string | The unique ID of the server. | Yes |
478
+ | cdrom-image-id | string | The unique ID of a CD-ROM. | Yes |
479
+
480
+ After retrieving a server, either by getting it by id, or as a create response object, you can call the `attach_cdrom` method directly on the object:
481
+
482
+ ```
483
+ server = compute.servers.get('datacenter_id', 'server-id')
484
+ server.attach_cdrom('cdrom-image-id')
485
+ ```
486
+
487
+ ---
488
+
489
+ #### Retrieve an Attached CD-ROM
490
+
491
+ You can retrieve a specific CD-ROM attached to the server.
492
+
493
+ The following table describes the request arguments:
494
+
495
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
496
+ |---|---|---|---|
497
+ | datacenter_id | string | The unique ID of the data center. | Yes |
498
+ | server-id | string | The unique ID of the server. | Yes |
499
+ | cdrom-id | string | The unique ID of the attached CD-ROM. | Yes |
500
+
501
+ After retrieving a server, either by getting it by id, or as a create response object, you can call the `get_attached_cdrom` method directly on the object:
502
+
503
+ ```
504
+ server = compute.servers.get('datacenter_id', 'server-id')
505
+ server.get_attached_cdrom('cdrom-id')
506
+ ```
507
+
508
+ ---
509
+
510
+ #### Detach a CD-ROM
511
+
512
+ This will detach a CD-ROM from the server.
513
+
514
+ The following table describes the request arguments:
515
+
516
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
517
+ |---|---|---|---|
518
+ | datacenter_id | string | The unique ID of the data center. | Yes |
519
+ | server-id | string | The unique ID of the server. | Yes |
520
+ | cdrom-id | string | The unique ID of the attached CD-ROM. | Yes |
521
+
522
+ After retrieving a server, either by getting it by id, or as a create response object, you can call the `detach_cdrom` method directly on the object:
523
+
524
+ ```
525
+ server = compute.servers.get('datacenter_id', 'server-id')
526
+ server.detach_cdrom('cdrom-id')
527
+ ```
528
+
529
+ ---
530
+
531
+ #### Reboot a Server
532
+
533
+ This will force a hard reboot of the server. Do not use this method if you want to gracefully reboot the machine. This is the equivalent of powering off the machine and turning it back on.
534
+
535
+ The following table describes the request arguments:
536
+
537
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
538
+ |---|---|---|---|
539
+ | datacenter_id | string | The unique ID of the data center. | Yes |
540
+ | server-id | string | The unique ID of the server. | Yes |
541
+
542
+ After retrieving a server, either by getting it by id, or as a create response object, you can call the `reboot` method directly on the object:
543
+
544
+ ```
545
+ server = compute.servers.get('datacenter_id', 'server-id')
546
+ server.reboot
547
+ ```
548
+
549
+ ---
550
+
551
+ #### Start a Server
552
+
553
+ This will start a server. If the server's public IP was deallocated then a new IP will be assigned.
554
+
555
+ The following table describes the request arguments:
556
+
557
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
558
+ |---|---|---|---|
559
+ | datacenter_id | string | The unique ID of the data center. | Yes |
560
+ | server-id | string | The unique ID of the server. | Yes |
561
+
562
+ After retrieving a server, either by getting it by id, or as a create response object, you can call the `start` method directly on the object:
563
+
564
+ ```
565
+ server = compute.servers.get('datacenter_id', 'server-id')
566
+ server.start
567
+ ```
568
+
569
+ ---
570
+
571
+ #### Stop a Server
572
+
573
+ This will stop a server. The machine will be forcefully powered off, billing will cease, and the public IP, if one is allocated, will be deallocated.
574
+
575
+ The following table describes the request arguments:
576
+
577
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
578
+ |---|---|---|---|
579
+ | datacenter_id | string | The unique ID of the data center. | Yes |
580
+ | server-id | string | The unique ID of the server. | Yes |
581
+
582
+ After retrieving a server, either by getting it by id, or as a create response object, you can call the `stop` method directly on the object:
583
+
584
+ ```
585
+ server = compute.servers.get('datacenter_id', 'server-id')
586
+ server.stop
587
+ ```
588
+
589
+ ---
590
+
591
+ ### Volumes
592
+
593
+ #### List Volumes
594
+
595
+ Retrieve a list of volumes within the data center. If you want to retrieve a list of volumes attached to a server please see the [Servers](#servers) section for examples on how to do so.
596
+
597
+ The following table describes the request arguments:
598
+
599
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
600
+ |---|---|---|---|
601
+ | datacenter_id | string | The unique ID of the data center. | Yes |
602
+
603
+ ```
604
+ compute.volumes.all('datacenter_id')
605
+ ```
606
+
607
+ ---
608
+
609
+ #### Get a Volume
610
+
611
+ Retrieves the attributes of a given volume.
612
+
613
+ The following table describes the request arguments:
614
+
615
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
616
+ |---|---|---|---|
617
+ | datacenter_id | string | The unique ID of the data center. | Yes |
618
+ | volume-id | string | The unique ID of the volume. | Yes |
619
+
620
+ ```
621
+ compute.volumes.get('datacenter_id', 'volume-id')
622
+ ```
623
+
624
+ ---
625
+
626
+ #### Create a Volume
627
+
628
+ Creates a volume within the data center. This will NOT attach the volume to a server. Please see the [Servers](#servers) section for details on how to attach storage volumes.
629
+
630
+ The following table describes the request arguments:
631
+
632
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
633
+ |---|---|---|---|
634
+ | datacenter_id | string | The unique ID of the data center. | Yes |
635
+ | name | string | The name of the volume. | No |
636
+ | size | int | The size of the volume in GB. | Yes |
637
+ | bus | string | The bus type of the volume (VIRTIO or IDE). Default: VIRTIO. | No |
638
+ | image | string | The image or snapshot ID. | Yes* |
639
+ | type | string | The volume type, HDD or SSD. | Yes |
640
+ | licenceType | string | The licence type of the volume. Options: LINUX, WINDOWS, UNKNOWN, OTHER | Yes* |
641
+ | imagePassword | string | One-time password is set on the Image for the appropriate account. This field may only be set in creation requests. When reading, it always returns null. Password has to contain 8-50 characters. Only these characters are allowed: [abcdefghjkmnpqrstuvxABCDEFGHJKLMNPQRSTUVX23456789] | No |
642
+ | sshKeys | string | SSH keys to allow access to the volume via SSH | No |
643
+
644
+ *You will need to provide either the image or the licenceType parameters. licenceType is required, but if image is supplied, it will already have a licenceType set.
645
+
646
+ ```
647
+ volume = compute.volumes.create(:datacenter_id => 'datacenter_id', :size => 5, :type => 'HDD', :licence_type => 'LINUX')
648
+ ```
649
+
650
+ ---
651
+
652
+ #### Update a Volume
653
+
654
+ You can update -- in full or partially -- various attributes on the volume; however, some restrictions are in place:
655
+
656
+ You can increase the size of an existing storage volume. You cannot reduce the size of an existing storage volume. The volume size will be increased without reboot if the hot plug settings have been set to true. The additional capacity is not added to any partition therefore you will need to partition it afterwards. Once you have increased the volume size you cannot decrease the volume size.
657
+
658
+ Since an existing volume is being modified , none of the request parameters are specifically required as long as the changes being made satisfy the requirements for creating a volume.
659
+
660
+ After retrieving a volume, either by getting it by id, or as a create response object, you can change it's properties and call the `update` method:
661
+
662
+ ```
663
+ volume = compute.volumes.get('datacenter_id', 'volume-id')
664
+ volume.name = 'My volume'
665
+ volume.update
666
+ ```
667
+
668
+ ---
669
+
670
+ #### Delete a Volume
671
+
672
+ Deletes the specified volume. This will result in the volume being removed from your data center. Use this with caution.
673
+
674
+ After retrieving a volume, either by getting it by id, or as a create response object, you can call the `delete` method directly on the object:
675
+
676
+ ```
677
+ volume = compute.volumes.get('datacenter_id', 'volume-id')
678
+ volume.delete
679
+ ```
680
+
681
+ ---
682
+
683
+ #### Create a Volume Snapshot
684
+
685
+ Creates a snapshot of a volume within the data center. You can use a snapshot to create a new storage volume or to restore a storage volume.
686
+
687
+ The following table describes the request arguments:
688
+
689
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
690
+ |---|---|---|---|
691
+ | name | string | The name of the snapshot. ||
692
+ | description | string | The description of the snapshot. ||
693
+
694
+ After retrieving a volume, either by getting it by id, or as a create response object, you can call the `create_snapshot` method directly on the object:
695
+
696
+ ```
697
+ volume = compute.volumes.get('datacenter_id', 'volume-id')
698
+ volume.create_snapshot('My snapshot', 'My snapshot description')
699
+ ```
700
+
701
+ ---
702
+
703
+ #### Restore a Volume Snapshot
704
+
705
+ This will restore a snapshot onto a volume. A snapshot is created as just another image that can be used to create new volumes or to restore an existing volume.
706
+
707
+ The following table describes the request arguments:
708
+
709
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
710
+ |---|---|---|---|
711
+ | snapshotId | string | The ID of the snapshot. | Yes |
712
+
713
+ After retrieving a volume, either by getting it by id, or as a create response object, you can call the `restore_snapshot` method directly on the object:
714
+
715
+ ```
716
+ volume = compute.volumes.get('datacenter_id', 'volume-id')
717
+ volume.restore_snapshot('snapshotId')
718
+ ```
719
+
720
+ ---
721
+
722
+ ### Snapshots
723
+
724
+ #### List Snapshots
725
+
726
+ You can retrieve a list of all snapshots.
727
+
728
+ ```
729
+ compute.snapshots.all
730
+ ```
731
+
732
+ ---
733
+
734
+ #### Get a Snapshot
735
+
736
+ Retrieves the attributes of a specific snapshot.
737
+
738
+ The following table describes the request arguments:
739
+
740
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
741
+ |---|---|---|---|
742
+ | snapshotId | string | The ID of the snapshot. | Yes |
743
+
744
+ ```
745
+ compute.snapshots.get('snapshotId')
746
+ ```
747
+
748
+ ---
749
+
750
+ #### Update a Snapshot
751
+
752
+ Perform updates to attributes of a snapshot.
753
+
754
+ The following table describes the request arguments:
755
+
756
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
757
+ |---|---|---|---|
758
+ | snapshotId | string | The ID of the snapshot. | Yes |
759
+ | name | string | The name of the snapshot. ||
760
+ | description | string | The description of the snapshot. ||
761
+ | cpuHotPlug | bool | This volume is capable of CPU hot plug (no reboot required) ||
762
+ | cpuHotUnplug | bool | This volume is capable of CPU hot unplug (no reboot required) ||
763
+ | ramHotPlug | bool | This volume is capable of memory hot plug (no reboot required) ||
764
+ | ramHotUnplug | bool | This volume is capable of memory hot unplug (no reboot required) ||
765
+ | nicHotPlug | bool | This volume is capable of NIC hot plug (no reboot required) ||
766
+ | nicHotUnplug | bool | This volume is capable of NIC hot unplug (no reboot required) ||
767
+ | discVirtioHotPlug | bool | This volume is capable of Virt-IO drive hot plug (no reboot required) ||
768
+ | discVirtioHotUnplug | bool | This volume is capable of Virt-IO drive hot unplug (no reboot required) ||
769
+ | discScsiHotPlug | bool | This volume is capable of SCSI drive hot plug (no reboot required) ||
770
+ | discScsiHotUnplug | bool | This volume is capable of SCSI drive hot unplug (no reboot required) ||
771
+ | licencetype | string | The snapshot's licence type: LINUX, WINDOWS, or UNKNOWN. ||
772
+
773
+ After retrieving a snapshot, either by getting it by id, or as a create response object, you can change it's properties and call the `update` method:
774
+
775
+ ```
776
+ snapshot = compute.snapshots.get('snapshotId')
777
+ snapshot.name = 'Updated snapshot name'
778
+ snapshot.description = 'Updated snapshot description'
779
+ snapshot.nic_hot_plug = true
780
+ snapshot.nic_hot_unplug = true
781
+ snapshot.update
782
+ ```
783
+
784
+ ---
785
+
786
+ #### Delete a Snapshot
787
+
788
+ Deletes the specified snapshot.
789
+
790
+ The following table describes the request arguments:
791
+
792
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
793
+ |---|---|---|---|
794
+ | snapshotId | string | The ID of the snapshot. | Yes |
795
+
796
+ After retrieving a snapshot, either by getting it by id, or as a create response object, you can call the `delete` method directly on the object:
797
+
798
+ ```
799
+ snapshot = compute.snapshots.get('snapshotId')
800
+ snapshot.delete
801
+ ```
802
+
803
+ ---
804
+
805
+ ### Load Balancers
806
+
807
+ #### List Load Balancers
808
+
809
+ Retrieve a list of load balancers within the data center.
810
+
811
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
812
+ |---|---|---|---|
813
+ | datacenter_id | string | The unique ID of the data center. | Yes |
814
+
815
+ ```
816
+ compute.load_balancers.all('datacenter_id')
817
+ ```
818
+
819
+ ---
820
+
821
+ #### Get a Load Balancer
822
+
823
+ Retrieves the attributes of a given load balancer.
824
+
825
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
826
+ |---|---|---|---|
827
+ | datacenter_id | string | The unique ID of the data center. | Yes |
828
+ | load_balancer_id | string | The unique ID of the load balancer. | Yes |
829
+
830
+ ```
831
+ compute.load_balancers.get('datacenter_id', 'load_balancer_id')
832
+ ```
833
+
834
+ ---
835
+
836
+ #### Create a Load Balancer
837
+
838
+ Creates a load balancer within the data center. Load balancers can be used for public or private IP traffic.
839
+
840
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
841
+ |---|---|---|---|
842
+ | datacenter_id | string | The unique ID of the data center. | Yes |
843
+ | name | string | The name of the load balancer. | Yes |
844
+ | ip | string | IPv4 address of the load balancer. All attached NICs will inherit this IP. | No |
845
+ | dhcp | bool | Indicates if the load balancer will reserve an IP using DHCP. | No |
846
+ | balancednics | string collection | List of NICs taking part in load-balancing. All balanced nics inherit the IP of the load balancer. | No |
847
+
848
+ ```
849
+ compute.load_balancers.create(:datacenter_id => 'datacenter_id', :name => 'My load balancer')
850
+ ```
851
+
852
+ ---
853
+
854
+ #### Update a Load Balancer
855
+
856
+ Perform updates to attributes of a load balancer.
857
+
858
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
859
+ |---|---|---|---|
860
+ | datacenter_id | string | The unique ID of the data center. | Yes |
861
+ | name | string | The name of the load balancer. | No |
862
+ | ip | string | The IP of the load balancer. | No |
863
+ | dhcp | bool | Indicates if the load balancer will reserve an IP using DHCP. | No |
864
+
865
+ After retrieving a load balancer, either by getting it by id, or as a create response object, you can change it's properties and call the `update` method:
866
+
867
+ ```
868
+ load_balancer = compute.load_balancers.get('datacenter_id', 'load_balancer_id')
869
+ load_balancer.name = 'Updated load balancer name'
870
+ load_balancer.update
871
+ ```
872
+
873
+ ---
874
+
875
+ #### Delete a Load Balancer
876
+
877
+ Deletes the specified load balancer.
878
+
879
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
880
+ |---|---|---|---|
881
+ | datacenter_id | string | The unique ID of the data center. | Yes |
882
+ | load_balancer_id | string | The unique ID of the load balancer. | Yes |
883
+
884
+ After retrieving a load balancer, either by getting it by id, or as a create response object, you can call the `delete` method directly on the object:
885
+
886
+ ```
887
+ load_balancer = compute.load_balancers.get('datacenter_id', 'load_balancer_id')
888
+ load_balancer.delete
889
+ ```
890
+
891
+ ---
892
+
893
+ #### List Load Balanced NICs
894
+
895
+ This will retrieve a list of NICs associated with the load balancer.
896
+
897
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
898
+ |---|---|---|---|
899
+ | datacenter_id | string | The unique ID of the data center. | Yes |
900
+ | load_balancer_id | string | The unique ID of the load balancer. | Yes |
901
+
902
+ After retrieving a load balancer, either by getting it by id, or as a create response object, you can call the `get_nics` method directly on the object:
903
+
904
+ ```
905
+ load_balancer = compute.load_balancers.get('datacenter_id', 'load_balancer_id')
906
+ load_balancer.get_nics
907
+ ```
908
+
909
+ ---
910
+
911
+ #### Get a Load Balanced NIC
912
+
913
+ Retrieves the attributes of a given load balanced NIC.
914
+
915
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
916
+ |---|---|---|---|
917
+ | datacenter_id | string | The unique ID of the data center. | Yes |
918
+ | load_balancer_id | string | The unique ID of the load balancer. | Yes |
919
+ | nic_id | string | The unique ID of the load balancer. | Yes |
920
+
921
+ After retrieving a load balancer, either by getting it by id, or as a create response object, you can call the `get_nic` method directly on the object:
922
+
923
+ ```
924
+ load_balancer = compute.load_balancers.get('datacenter_id', 'load_balancer_id')
925
+ load_balancer.get_nic('nic_id')
926
+ ```
927
+
928
+ ---
929
+
930
+ #### Associate NIC to a Load Balancer
931
+
932
+ This will associate a NIC to a Load Balancer, enabling the NIC to participate in load-balancing.
933
+
934
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
935
+ |---|---|---|---|
936
+ | datacenter_id | string | The unique ID of the data center. | Yes |
937
+ | load_balancer_id | string | The unique ID of the load balancer. | Yes |
938
+ | nic_id | string | The unique ID of the load balancer. | Yes |
939
+
940
+ After retrieving a load balancer, either by getting it by id, or as a create response object, you can call the `associate_nic` method directly on the object:
941
+
942
+ ```
943
+ load_balancer = compute.load_balancers.get('datacenter_id', 'load_balancer_id')
944
+ load_balancer.associate_nic('nic_id')
945
+ ```
946
+
947
+ ---
948
+
949
+ #### Remove a NIC Association
950
+
951
+ Removes the association of a NIC with a load balancer.
952
+
953
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
954
+ |---|---|---|---|
955
+ | datacenter_id | string | The unique ID of the data center. | Yes |
956
+ | load_balancer_id | string | The unique ID of the load balancer. | Yes |
957
+ | nic_id | string | The unique ID of the load balancer. | Yes |
958
+
959
+ After retrieving a load balancer, either by getting it by id, or as a create response object, you can call the `remove_nic_association` method directly on the object:
960
+
961
+ ```
962
+ load_balancer = compute.load_balancers.get('datacenter_id', 'load_balancer_id')
963
+ load_balancer.remove_nic_association('nic_id')
964
+ ```
965
+
966
+ ---
967
+
968
+ ### Firewall Rules
969
+
970
+ #### List Firewall Rules
971
+
972
+ Retrieves a list of firewall rules associated with a particular NIC.
973
+
974
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
975
+ |---|---|---|---|
976
+ | datacenter_id | string | The unique ID of the data center. | Yes |
977
+ | server_id | string | The unique ID of the server. | Yes |
978
+ | nic_id | string | The unique ID of the NIC. | Yes |
979
+
980
+ ```
981
+ compute.firewall_rules.all('datacenter_id', 'server_id', 'nic_id')
982
+ ```
983
+
984
+ ---
985
+
986
+ #### Get a Firewall Rule
987
+
988
+ Retrieves the attributes of a given firewall rule.
989
+
990
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
991
+ |---|---|---|---|
992
+ | datacenter_id | string | The unique ID of the data center. | Yes |
993
+ | server_id | string | The unique ID of the server. | Yes |
994
+ | nic_id | string | The unique ID of the NIC. | Yes |
995
+ | firewall_rule_id | string | The unique ID of the firewall rule. | Yes |
996
+
997
+ ```
998
+ fwr = compute.firewall_rules.get('datacenter_id', 'server_id', 'nic_id', 'firewall_rule_id')
999
+ ```
1000
+
1001
+ ---
1002
+
1003
+ #### Create a Firewall Rule
1004
+
1005
+ This will add a firewall rule to the NIC.
1006
+
1007
+ The following table describes the request arguments:
1008
+
1009
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1010
+ |---|---|---|---|
1011
+ | datacenter_id | string | The unique ID of the data center. | Yes |
1012
+ | server_id | string | The unique ID of the server. | Yes |
1013
+ | nic_id | string | The unique ID of the NIC. | Yes |
1014
+ | name | string | The name of the Firewall Rule. ||
1015
+ | protocol | string | The protocol for the rule: TCP, UDP, ICMP, ANY. | Yes |
1016
+ | sourceMac | string | Only traffic originating from the respective MAC address is allowed. Valid format: aa:bb:cc:dd:ee:ff. Value null allows all source MAC address. ||
1017
+ | sourceIp | string | Only traffic originating from the respective IPv4 address is allowed. Value null allows all source IPs. ||
1018
+ | targetIp | string | In case the target NIC has multiple IP addresses, only traffic directed to the respective IP address of the NIC is allowed. Value null allows all target IPs. ||
1019
+ | portRangeStart | string | Defines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd value null to allow all ports. ||
1020
+ | portRangeEnd | string | Defines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports. ||
1021
+ | icmpType | string | Defines the allowed type (from 0 to 254) if the protocol ICMP is chosen. Value null allows all types. ||
1022
+ | icmpCode | string | Defines the allowed code (from 0 to 254) if protocol ICMP is chosen. Value null allows all codes. ||
1023
+
1024
+ ```
1025
+ fwr = compute.firewall_rules.create(:datacenter_id => 'datacenter_id', :server_id => 'server-id', :nic_id => 'nic_id', :name => 'My firewall rule', :protocol => 'ANY')
1026
+ ```
1027
+
1028
+ ---
1029
+
1030
+ #### Update a Firewall Rule
1031
+
1032
+ Perform updates to attributes of a firewall rule.
1033
+
1034
+ The following table describes the request arguments:
1035
+
1036
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1037
+ |---|---|---|---|
1038
+ | datacenter_id | string | The unique ID of the data center. | Yes |
1039
+ | server_id | string | The unique ID of the server. | Yes |
1040
+ | nic_id | string | The unique ID of the NIC. | Yes |
1041
+ | firewall_rule_id | string | The unique ID of the firewall rule. | Yes |
1042
+ | name | string | The name of the Firewall Rule. ||
1043
+ | sourceMac | string | Only traffic originating from the respective MAC address is allowed. Valid format: aa:bb:cc:dd:ee:ff. Value null allows all source MAC address. ||
1044
+ | sourceIp | string | Only traffic originating from the respective IPv4 address is allowed. Value null allows all source IPs. ||
1045
+ | targetIp | string | In case the target NIC has multiple IP addresses, only traffic directed to the respective IP address of the NIC is allowed. Value null allows all target IPs. ||
1046
+ | portRangeStart | string | Defines the start range of the allowed port (from 1 to 65534) if protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd value null to allow all ports. ||
1047
+ | portRangeEnd | string | Defines the end range of the allowed port (from 1 to 65534) if the protocol TCP or UDP is chosen. Leave portRangeStart and portRangeEnd null to allow all ports. ||
1048
+ | icmpType | string | Defines the allowed type (from 0 to 254) if the protocol ICMP is chosen. Value null allows all types. ||
1049
+ | icmpCode | string | Defines the allowed code (from 0 to 254) if protocol ICMP is chosen. Value null allows all codes. ||
1050
+
1051
+ After retrieving a firewall rule, either by getting it by id, or as a create response object, you can change its properties and call the `update` method:
1052
+
1053
+ ```
1054
+ fwr = compute.firewall_rules.get('datacenter_id', 'server_id', 'nic_id', 'firewall_rule_id')
1055
+ fwr.name = 'Updated firewall rule name'
1056
+ fwr.update
1057
+ ```
1058
+
1059
+ ---
1060
+
1061
+ #### Delete a Firewall Rule
1062
+
1063
+ Removes the specific firewall rule.
1064
+
1065
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1066
+ |---|---|---|---|
1067
+ | datacenter_id | string | The unique ID of the data center. | Yes |
1068
+ | server_id | string | The unique ID of the server. | Yes |
1069
+ | nic_id | string | The unique ID of the NIC. | Yes |
1070
+ | firewall_rule_id | string | The unique ID of the firewall rule. | Yes |
1071
+
1072
+ After retrieving a firewall rule, either by getting it by id, or as a create response object, you can call the `delete` method directly on the object:
1073
+
1074
+ ```
1075
+ fwr = compute.firewall_rules.get('datacenter_id', 'server_id', 'nic_id', 'firewall_rule_id')
1076
+ fwr.delete
1077
+ ```
1078
+
1079
+ ---
1080
+
1081
+ ### Images
1082
+
1083
+ #### List Images
1084
+
1085
+ Retrieve a list of images.
1086
+
1087
+ ```
1088
+ compute.images.all
1089
+ ```
1090
+
1091
+ ---
1092
+
1093
+ #### Get an Image
1094
+
1095
+ Retrieves the attributes of a specific image.
1096
+
1097
+ The following table describes the request arguments:
1098
+
1099
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1100
+ |---|---|---|---|
1101
+ | image-id | string | The unique ID of the image. | Yes |
1102
+
1103
+ ```
1104
+ compute.images.get('image-id')
1105
+ ```
1106
+
1107
+ ---
1108
+
1109
+ #### Update an Image
1110
+
1111
+ Perform updates to attributes of an image.
1112
+
1113
+ The following table describes the request arguments:
1114
+
1115
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1116
+ |---|---|---|---|
1117
+ | image-id | string | The unique ID of the image. | Yes |
1118
+ | name | string | The name of the image. ||
1119
+ | description | string | The description of the image. ||
1120
+ | licencetype | string | The image's licence type: LINUX, WINDOWS, or UNKNOWN. ||
1121
+ | cpuHotPlug | bool | This volume is capable of CPU hot plug (no reboot required) ||
1122
+ | cpuHotUnplug | bool | This volume is capable of CPU hot unplug (no reboot required) ||
1123
+ | ramHotPlug | bool | This volume is capable of memory hot plug (no reboot required) ||
1124
+ | ramHotUnplug | bool | This volume is capable of memory hot unplug (no reboot required) ||
1125
+ | nicHotPlug | bool | This volume is capable of NIC hot plug (no reboot required) ||
1126
+ | nicHotUnplug | bool | This volume is capable of NIC hot unplug (no reboot required) ||
1127
+ | discVirtioHotPlug | bool | This volume is capable of Virt-IO drive hot plug (no reboot required) ||
1128
+ | discVirtioHotUnplug | bool | This volume is capable of Virt-IO drive hot unplug (no reboot required) ||
1129
+ | discScsiHotPlug | bool | This volume is capable of SCSI drive hot plug (no reboot required) ||
1130
+ | discScsiHotUnplug | bool | This volume is capable of SCSI drive hot unplug (no reboot required) ||
1131
+
1132
+ After retrieving an image, either by getting it by id, or as a create response object, you can change it's properties and call the `update` method:
1133
+
1134
+ ```
1135
+ image = compute.snapshots.get('snapshotId')
1136
+ image.name = 'Updated snapshot name'
1137
+ image.description = 'Updated snapshot description'
1138
+ image.ram_hot_plug = true
1139
+ image.ram_hot_unplug = true
1140
+ image.update
1141
+ ```
1142
+
1143
+ ---
1144
+
1145
+ #### Delete an Image
1146
+
1147
+ Deletes the specified image.
1148
+
1149
+ The following table describes the request arguments:
1150
+
1151
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1152
+ |---|---|---|---|
1153
+ | image-id | string | The unique ID of the image. | Yes |
1154
+
1155
+ After retrieving an image, either by getting it by id, or as a create response object, you can call the `delete` method directly on the object:
1156
+
1157
+ ```
1158
+ image = compute.images.get('image-id')
1159
+ image.delete
1160
+ ```
1161
+
1162
+ ---
1163
+
1164
+ ### Network Interfaces (NICs)
1165
+
1166
+ #### List NICs
1167
+
1168
+ Retrieve a list of LANs within the data center.
1169
+
1170
+ The following table describes the request arguments:
1171
+
1172
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1173
+ |---|---|---|---|
1174
+ | datacenter_id | string | The unique ID of the data center. | Yes |
1175
+ | server-id | string | The unique ID of the server. | Yes |
1176
+
1177
+ ```
1178
+ compute.nics.all('datacenter_id')
1179
+ ```
1180
+
1181
+ ---
1182
+
1183
+ #### Get a NIC
1184
+
1185
+ Retrieves the attributes of a given NIC.
1186
+
1187
+ The following table describes the request arguments:
1188
+
1189
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1190
+ |---|---|---|---|
1191
+ | datacenter_id | string | The unique ID of the data center. | Yes |
1192
+ | server-id | string | The unique ID of the server. | Yes |
1193
+ | nic-id | string | The unique ID of the NIC. | Yes |
1194
+
1195
+ ```
1196
+ compute.nics.get('datacenter_id', 'server-id', 'nic-id')
1197
+ ```
1198
+
1199
+ ---
1200
+
1201
+ #### Create a NIC
1202
+
1203
+ Adds a NIC to the target server.
1204
+
1205
+ The following table describes the request arguments:
1206
+
1207
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1208
+ |---|---|---|---|
1209
+ | datacenter_id | string | The unique ID of the data center. | Yes |
1210
+ | server_id | string| The unique ID of the server. | Yes |
1211
+ | name | string | The name of the NIC. ||
1212
+ | ips | string collection | IPs assigned to the NIC. This can be a collection. ||
1213
+ | dhcp | bool | Set to FALSE if you wish to disable DHCP on the NIC. Default: TRUE. ||
1214
+ | lan | int | The LAN ID the NIC will sit on. If the LAN ID does not exist it will be created. | Yes |
1215
+ | firewallActive | bool | Once you add a firewall rule this will reflect a true value. ||
1216
+ | firewallrules | string collection | A list of firewall rules associated to the NIC represented as a collection. ||
1217
+
1218
+ ```
1219
+ compute.nics.create(:datacenter_id => 'datacenter_id', :server_id => 'server_id', :name = 'Internal NIC', :dhcp => true, :lan => 1)
1220
+ ```
1221
+
1222
+ ---
1223
+
1224
+ #### Update a NIC
1225
+
1226
+ You can update -- in full or partially -- various attributes on the NIC; however, some restrictions are in place:
1227
+
1228
+ The primary address of a NIC connected to a load balancer can only be changed by changing the IP of the load balancer. You can also add additional reserved, public IPs to the NIC.
1229
+
1230
+ The user can specify and assign private IPs manually. Valid IP addresses for private networks are 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16.
1231
+
1232
+ The following table describes the request arguments:
1233
+
1234
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1235
+ |---|---|---|---|
1236
+ | datacenter_id | string | The unique ID of the data center. | Yes |
1237
+ | server_id | string| The unique ID of the server. | Yes |
1238
+ | nic-id | string| The unique ID of the NIC. | Yes |
1239
+ | name | string | The name of the NIC. ||
1240
+ | ips | string collection | IPs assigned to the NIC represented as a collection. ||
1241
+ | dhcp | bool | Boolean value that indicates if the NIC is using DHCP or not. ||
1242
+ | lan | int | The LAN ID the NIC sits on. ||
1243
+
1244
+ After retrieving a NIC, either by getting it by id, or as a create response object, you can call the `update` method directly on the object:
1245
+
1246
+ ```
1247
+ nic = compute.nics.get('datacenter_id', 'server-id', 'nic-id')
1248
+ nic.name = 'Internal NIC updated'
1249
+ nic.ips = ['10.0.0.7']
1250
+ nic.update
1251
+ ```
1252
+
1253
+ ---
1254
+
1255
+ #### Delete a NIC
1256
+
1257
+ Deletes the specified NIC.
1258
+
1259
+ The following table describes the request arguments:
1260
+
1261
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1262
+ |---|---|---|---|
1263
+ | datacenter_id | string | The unique ID of the data center. | Yes |
1264
+ | server_id | string| The unique ID of the server. | Yes |
1265
+ | nic-id | string| The unique ID of the NIC. | Yes |
1266
+
1267
+ After retrieving a NIC, either by getting it by id, or as a create response object, you can call the `delete` method directly on the object:
1268
+
1269
+ ```
1270
+ nic = compute.nics.get('datacenter_id', 'server-id', 'nic-id')
1271
+ nic.delete
1272
+ ```
1273
+
1274
+ ---
1275
+
1276
+ ### IP Blocks
1277
+
1278
+ #### List IP Blocks
1279
+
1280
+ Retrieve a list of IP Blocks.
1281
+
1282
+ ```
1283
+ compute.ip_blocks.all
1284
+ ```
1285
+
1286
+ ---
1287
+
1288
+ #### Get an IP Block
1289
+
1290
+ Retrieves the attributes of a specific IP Block.
1291
+
1292
+ The following table describes the request arguments:
1293
+
1294
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1295
+ |---|---|---|---|
1296
+ | ipblock-id | string | The unique ID of the IP block. | Yes |
1297
+
1298
+ ```
1299
+ compute.ip_blocks.get('ipblock-id')
1300
+ ```
1301
+
1302
+ ---
1303
+
1304
+ #### Create an IP Block
1305
+
1306
+ Creates an IP block.
1307
+
1308
+ The following table describes the request arguments:
1309
+
1310
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1311
+ |---|---|---|---|
1312
+ | location | string | This must be one of the locations: us/las, de/fra, de/fkb. | Yes |
1313
+ | size | int | The size of the IP block you want. | Yes |
1314
+ | name | string | A descriptive name for the IP block | No |
1315
+
1316
+ ```
1317
+ compute.ip_blocks.create(:location => 'de/fkb', :size => 1, :name => 'Fog test IP block')
1318
+ ```
1319
+
1320
+ ---
1321
+
1322
+ #### Delete an IP Block
1323
+
1324
+ Deletes the specified IP Block.
1325
+
1326
+ The following table describes the request arguments:
1327
+
1328
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1329
+ |---|---|---|---|
1330
+ | ipblock-id | string | The unique ID of the IP block. | Yes |
1331
+
1332
+ After retrieving an IP block, either by getting it by id, or as a create response object, you can call the `delete` method directly on the object:
1333
+
1334
+ ```
1335
+ ipb = compute.ip_blocks.get('ipblock-id')
1336
+ ipb.delete
1337
+ ```
1338
+
1339
+ ```
1340
+ compute.ip_blocks.get('ipblock-id')
1341
+ ```
1342
+
1343
+ ---
1344
+
1345
+ ### Requests
1346
+
1347
+ #### List Requests
1348
+
1349
+ Retrieve a list of requests.
1350
+
1351
+ ```
1352
+ compute.requests.all
1353
+ ```
1354
+
1355
+ ---
1356
+
1357
+ #### Get a Request
1358
+
1359
+ Retrieves the attributes of a specific request.
1360
+
1361
+ The following table describes the request arguments:
1362
+
1363
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1364
+ |---|---|---|---|
1365
+ | request-id | string | The unique ID of the request. | Yes |
1366
+
1367
+ ```
1368
+ compute.requests.get('request-id')
1369
+ ```
1370
+
1371
+ ---
1372
+
1373
+ #### Get a Request Status
1374
+
1375
+ Retrieves the status of a request.
1376
+
1377
+ The following table describes the request arguments:
1378
+
1379
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1380
+ |---|---|---|---|
1381
+ | request-id | string | The unique ID of the request. | Yes |
1382
+
1383
+ ```
1384
+ compute.requests.get_status('request-id')
1385
+ ```
1386
+
1387
+ ---
1388
+
1389
+ ### LANs
1390
+
1391
+ #### List LANs
1392
+
1393
+ Retrieve a list of LANs within the data center.
1394
+
1395
+ The following table describes the request arguments:
1396
+
1397
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1398
+ |---|---|---|---|
1399
+ | datacenter_id | string | The unique ID of the data center. | Yes |
1400
+
1401
+ ```
1402
+ compute.lans.all('datacenter_id')
1403
+ ```
1404
+
1405
+ ---
1406
+
1407
+ #### Create a LAN
1408
+
1409
+ Creates a LAN within a data center.
1410
+
1411
+ The following table describes the request arguments:
1412
+
1413
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1414
+ |---|---|---|---|
1415
+ | datacenter_id | string | The unique ID of the data center. | Yes |
1416
+ | name | string | The name of your LAN. ||
1417
+ | public | bool | Boolean indicating if the LAN faces the public Internet or not. ||
1418
+ | nics | string collection | A collection of NICs associated with the LAN. ||
1419
+
1420
+ ```
1421
+ compute.lans.create(:datacenter_id => 'datacenter_id', :name => 'My lan', :public => false)
1422
+ ```
1423
+
1424
+ ---
1425
+
1426
+ #### Get a LAN
1427
+
1428
+ Retrieves the attributes of a given LAN.
1429
+
1430
+ The following table describes the request arguments:
1431
+
1432
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1433
+ |---|---|---|---|
1434
+ | datacenter_id | string | The unique ID of the data center. | Yes |
1435
+ | lan-id | string | The unique ID of the LAN. | Yes |
1436
+
1437
+ ```
1438
+ compute.lans.get('datacenter_id', 'lan-id')
1439
+ ```
1440
+
1441
+ ---
1442
+
1443
+ #### Update a LAN
1444
+
1445
+ Perform updates to attributes of a LAN.
1446
+
1447
+ The following table describes the request arguments:
1448
+
1449
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1450
+ |---|---|---|---|
1451
+ | datacenter_id | string | The unique ID of the data center. | Yes |
1452
+ | lan-id | string | The unique ID of the LAN. | Yes |
1453
+ | name | string | A descriptive name for the LAN. ||
1454
+ | public | bool | Boolean indicating if the LAN faces the public Internet or not. ||
1455
+
1456
+ After retrieving a LAN, either by getting it by id, or as a create response object, you can change it's properties and call the `update` method:
1457
+
1458
+ ```
1459
+ lan = compute.lans.get('datacenter_id', 'lan-id')
1460
+ lan.name = 'Updated LAN name'
1461
+ lan.update
1462
+ ```
1463
+
1464
+ ---
1465
+
1466
+ #### Delete a LAN
1467
+
1468
+ Deletes the specified LAN.
1469
+
1470
+ The following table describes the request arguments:
1471
+
1472
+ | NAME| TYPE | DESCRIPTION | REQUIRED |
1473
+ |---|---|---|---|
1474
+ | datacenter_id | string | The unique ID of the data center. | Yes |
1475
+ | lan-id | string | The unique ID of the LAN. | Yes |
1476
+
1477
+ After retrieving a LAN, either by getting it by id, or as a create response object, you can call the `delete` method directly on the object:
1478
+
1479
+ ```
1480
+ lan = compute.lans.get('datacenter_id', 'lan-id')
1481
+ lan.delete
1482
+ ```
22
1483
 
23
- TODO: Write usage instructions here
1484
+ ---
24
1485
 
25
1486
  ## Contributing
26
1487