knife-oneandone 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +12 -12
  3. data/.rspec +2 -2
  4. data/.rubocop.yml +29 -26
  5. data/.travis.yml +5 -5
  6. data/Gemfile +4 -4
  7. data/LICENSE +201 -201
  8. data/README.md +358 -278
  9. data/Rakefile +6 -6
  10. data/knife-oneandone.gemspec +30 -31
  11. data/lib/1and1/helpers.rb +29 -29
  12. data/lib/chef/knife/oneandone_appliance_list.rb +39 -39
  13. data/lib/chef/knife/oneandone_base.rb +32 -32
  14. data/lib/chef/knife/oneandone_block_storage_attach.rb +33 -0
  15. data/lib/chef/knife/oneandone_block_storage_create.rb +64 -0
  16. data/lib/chef/knife/oneandone_block_storage_delete.rb +59 -0
  17. data/lib/chef/knife/oneandone_block_storage_detach.rb +28 -0
  18. data/lib/chef/knife/oneandone_block_storage_list.rb +42 -0
  19. data/lib/chef/knife/oneandone_block_storage_rename.rb +38 -0
  20. data/lib/chef/knife/oneandone_datacenter_list.rb +33 -33
  21. data/lib/chef/knife/oneandone_firewall_create.rb +97 -97
  22. data/lib/chef/knife/oneandone_firewall_delete.rb +59 -59
  23. data/lib/chef/knife/oneandone_firewall_list.rb +33 -33
  24. data/lib/chef/knife/oneandone_ip_list.rb +39 -39
  25. data/lib/chef/knife/oneandone_loadbalancer_create.rb +147 -147
  26. data/lib/chef/knife/oneandone_loadbalancer_delete.rb +59 -59
  27. data/lib/chef/knife/oneandone_loadbalancer_list.rb +39 -39
  28. data/lib/chef/knife/oneandone_mp_list.rb +37 -37
  29. data/lib/chef/knife/oneandone_server_baremetal_model_list.rb +31 -0
  30. data/lib/chef/knife/oneandone_server_create.rb +193 -163
  31. data/lib/chef/knife/oneandone_server_delete.rb +63 -63
  32. data/lib/chef/knife/oneandone_server_hdd_add.rb +60 -60
  33. data/lib/chef/knife/oneandone_server_hdd_delete.rb +55 -55
  34. data/lib/chef/knife/oneandone_server_hdd_list.rb +44 -44
  35. data/lib/chef/knife/oneandone_server_hdd_resize.rb +59 -59
  36. data/lib/chef/knife/oneandone_server_list.rb +35 -35
  37. data/lib/chef/knife/oneandone_server_modify.rb +80 -80
  38. data/lib/chef/knife/oneandone_server_reboot.rb +41 -41
  39. data/lib/chef/knife/oneandone_server_rename.rb +37 -37
  40. data/lib/chef/knife/oneandone_server_size_list.rb +39 -39
  41. data/lib/chef/knife/oneandone_server_start.rb +35 -35
  42. data/lib/chef/knife/oneandone_server_stop.rb +41 -41
  43. data/lib/chef/knife/oneandone_ssh_key_create.rb +54 -0
  44. data/lib/chef/knife/oneandone_ssh_key_delete.rb +59 -0
  45. data/lib/chef/knife/oneandone_ssh_key_list.rb +44 -0
  46. data/lib/chef/knife/oneandone_ssh_key_rename.rb +37 -0
  47. data/lib/knife-oneandone/version.rb +5 -5
  48. metadata +24 -13
data/README.md CHANGED
@@ -1,278 +1,358 @@
1
- # Knife::Oneandone
2
-
3
- ## Description
4
-
5
- 1&1 Chef Knife plugin for managing 1&1 Cloud servers
6
-
7
- ## Requirements
8
-
9
- * Chef 12.3.0 or higher
10
- * Ruby 2.1.x or higher
11
-
12
- ## Installation
13
-
14
- Add this line to your application's Gemfile:
15
-
16
- ```ruby
17
- gem 'knife-oneandone'
18
- ```
19
-
20
- And then execute:
21
-
22
- $ bundle
23
-
24
- Or install it yourself as:
25
-
26
- $ gem install knife-oneandone
27
-
28
-
29
- ## Configuration
30
-
31
- The 1&1 Chef Knife plugin requires a valid 1&1 API key. Add your 1&1 API key in a ```knife.rb``` configuration file (for example in ```~/.chef/knife.rb```).
32
-
33
- ```ruby
34
- knife[:oneandone_api_key] = '_YOUR_API_KEY_'
35
- ```
36
-
37
- ## Sub Commands
38
-
39
- The following sub-commands are available with the plugin:
40
-
41
- ### knife oneandone appliance list
42
-
43
- Lists all server appliances.
44
-
45
- ### knife oneandone datacenter list
46
-
47
- Lists all data centers.
48
-
49
- ### knife oneandone firewall create
50
-
51
- Creates a new firewall policy.
52
-
53
- ### knife oneandone firewall delete
54
-
55
- Deletes one or more firewall policies.
56
-
57
- ### knife oneandone firewall list
58
-
59
- Lists available firewall policies.
60
-
61
- ### knife oneandone ip list
62
-
63
- Lists allocated public IPs.
64
-
65
- ### knife oneandone loadbalancer create
66
-
67
- Creates a new load balancer.
68
-
69
- ### knife oneandone loadbalancer delete
70
-
71
- Deletes one or more load balancers.
72
-
73
- ### knife oneandone loadbalancer list
74
-
75
- Lists available load balancers.
76
-
77
- ### knife oneandone mp list
78
-
79
- Lists available monitoring policies.
80
-
81
- ### knife oneandone server create
82
-
83
- Creates a new server.
84
-
85
- ### knife oneandone server delete
86
-
87
- Deletes one or more servers.
88
-
89
- ### knife oneandone server hdd add
90
-
91
- Adds one or more hard disks to server.
92
-
93
- ### knife oneandone server hdd delete
94
-
95
- Removes server's hard disk.
96
-
97
- ### knife oneandone server hdd list
98
-
99
- Lists server's hard disks.
100
-
101
- ### knife oneandone server hdd resize
102
-
103
- Resizes server's hard disk.
104
-
105
- ### knife oneandone server list
106
-
107
- Lists available servers.
108
-
109
- ### knife oneandone server modify
110
-
111
- Modifies server's hardware configuration: CPU/cores count, RAM amount and/or fixed server size.
112
-
113
- ### knife oneandone server reboot
114
-
115
- Reboots one or more servers.
116
-
117
- ### knife oneandone server rename
118
-
119
- Updates server's name and/or description.
120
-
121
- ### knife oneandone server size list
122
-
123
- Lists available fixed-server-size configurations.
124
-
125
- ### knife oneandone server start
126
-
127
- Starts one or more servers.
128
-
129
- ### knife oneandone server stop
130
-
131
- Stops one or more servers.
132
-
133
- ## Usage
134
-
135
- Before deploying a server to your 1&1 Cloud environment, you may want set up a dedicated firewall policy or a load balancer for the server.
136
-
137
- To create a firewall policy and allow the access from any IP address:
138
-
139
- ```
140
- knife oneandone firewall create -n my-firewall -p TCP,UDP,ICMP --port-from 80,161 --port-to 80,162
141
- ```
142
-
143
- A load balancer can be created as follows:
144
-
145
- ```
146
- knife oneandone loadbalancer create -n my-LB -m ROUND_ROBIN \
147
- -p TCP,UDP --port-balancer 80,161 --port-server 8080,161
148
- ```
149
-
150
- To restrict the access to a particular IP address or network, specify ```--source``` option for the load balancer and firewall policy.
151
-
152
- **Note:** When multiple (firewall or load balancer) rules are specified, make sure that the protocols, ports and sources are separated by a comma and in the same order. In a firewall policy create command, specify GRE, ICMP and IPSEC protocols last, for instance
153
- ```--protocol TCP,TCP,UDP,TCP/UDP,GRE,ICMP,IPSEC```.
154
-
155
-
156
- Furthermore, use the list commands to find out IDs of the fixed-size configurations, server appliances, monitoring policies, existing IPs, data centers etc.
157
-
158
- ```
159
- knife oneandone server size list
160
- ID Name RAM (GB) Processor No. Cores per Processor Disk Size (GB)
161
- 65929629F35BBFBA63022008F773F3EB M 1 1 1 40
162
- 591A7FEF641A98B38D1C4F7C99910121 L 2 2 1 80
163
- E903FA4F907B5AAF17A7E987FFCDCC6B XL 4 2 1 120
164
- 57862AE452473D551B1673938DD3DFFE XXL 8 4 1 160
165
- 3D4C49EAEDD42FBC23DB58FE3DEF464F S 0.5 1 1 30
166
- 6A2383038420110058C77057D261A07C 3XL 16 8 1 240
167
- EED49B709368C3715382730A604E9F6A 4XL 32 12 1 360
168
- EE48ACD55FEFE57E2651862A348D1254 5XL 48 16 1 500
169
- ```
170
-
171
- The format option may be used with the list commands to output JSON or yaml (e.g. ```-F json```, ```--format yaml```).
172
-
173
-
174
- To create a server, you can either specify a fixed-size ID or a flex configuration of the hardware.
175
-
176
- ```
177
- knife oneandone server create -n Demo-Server \
178
- --appliance-id FF696FFE6FB96FC54638DB47E9321E25 \
179
- --datacenter-id 5091F6D8CBFEF9C26ACE957C652D5D49 \
180
- --fixed-size-id 65929629F35BBFBA63022008F773F3EB
181
- Deploying, wait for the operation to complete...
182
- ID: D67F6B24C9C0AED76B8573D267B0EDAB
183
- Name: Demo-Server
184
- First IP: 109.228.53.48
185
- First Password: Qc9knjVAK1
186
- done
187
- ```
188
-
189
- ```
190
- knife oneandone server create -n FS1 -I B5F778B85C041347BCDCFC3172AB3F3C -P 2 -C 1 -r 2 -H 40 -F yaml
191
- Deploying, wait for the operation to complete...
192
- ---
193
- id: 341EB3FF15E861309C4D1C3BC6A8B17B
194
- cloudpanel_id: 23A0543
195
- name: FS1
196
- description: ''
197
- datacenter:
198
- id: 908DC2072407C94C8054610AD5A53B8C
199
- country_code: US
200
- location: United States of America
201
- creation_date: '2016-08-05T12:26:27+00:00'
202
- first_password: Zf1jtd1WH9
203
- rsa_key: 0
204
- status:
205
- state: POWERED_ON
206
- percent:
207
- hardware:
208
- fixed_instance_size_id:
209
- vcore: 2
210
- cores_per_processor: 1
211
- ram: 2
212
- hdds:
213
- - id: 430C1E70E1737690E5A71F9D63BE80B2
214
- size: 40
215
- is_main: true
216
- image:
217
- id: B5F778B85C041347BCDCFC3172AB3F3C
218
- name: centos7-64std
219
- dvd:
220
- snapshot:
221
- ips:
222
- - id: DC9F635EA2B3144FC047532C6FD56B84
223
- ip: 62.151.178.250
224
- type: IPV4
225
- reverse_dns:
226
- firewall_policy:
227
- id: A4D6302FA44955C797772E34880CBA42
228
- name: centos7-64cpanel
229
- load_balancers: []
230
- alerts: []
231
- monitoring_policy:
232
- private_networks:
233
- ```
234
-
235
- To attach new hard disks to the server, specify a size for each new volume:
236
-
237
- ```
238
- knife oneandone server hdd add 20 80 160 --server-id 341EB3FF15E861309C4D1C3BC6A8B17B
239
- ```
240
-
241
- List the server disks in the following way:
242
-
243
- ```
244
- knife oneandone server hdd list 341EB3FF15E861309C4D1C3BC6A8B17B
245
- ID Size (GB) Main
246
- 430C1E70E1737690E5A71F9D63BE80B2 40 true
247
- 26D593F10CF0FE666004A594A08B5C0A 20 false
248
- 602690CAA4BFE5724356148112918C79 80 false
249
- BA5486B5C0F1861307F80DEB880A4041 160 false
250
- ```
251
-
252
- Specify the ID of any server you intend to start, stop, reboot or delete. The next example shows a delete operation
253
- with auto-confirming all prompts for deletion.
254
-
255
- ```
256
- knife oneandone server delete 341EB3FF15E861309C4D1C3BC6A8B17B D67F6B24C9C0AED76B8573D267B0EDAB -y
257
- ```
258
-
259
- ## Development
260
-
261
- After checking out the repository, run `bundle install` to install dependencies.
262
-
263
- Use the bundler to run the tests. Declare ONEANDONE_API_KEY environment variable before running the tests.
264
-
265
- $ export ONEANDONE_API_KEY="_YOUR_API_KEY_"
266
- $ bundle exec rspec
267
-
268
- To install this gem onto your local machine, run `bundle exec rake install`.
269
-
270
- ## Contributing
271
-
272
- 1. Fork the repository (`https://github.com/1and1/oneandone-cloudserver-chef/fork`).
273
- 2. Create a new feature branch (`git checkout -b my-new-feature`).
274
- 3. Commit the changes (`git commit -am 'New feature description'`).
275
- 4. Push to the branch (`git push origin my-new-feature`).
276
- 5. Create a new pull request.
277
-
278
- Bug reports and pull requests are welcome.
1
+ # 1&1 Chef Knife Plugin
2
+
3
+ ## Table of Contents
4
+ * [Description](#description)
5
+ * [Requirements](#requirements)
6
+ * [Installation](#installation)
7
+ * [Configuration](#configuration)
8
+ * [Sub-Commands](#sub-commands)
9
+ * [Usage](#usage)
10
+ * [Development](#development)
11
+ * [Contribute to the Project](#contribute-to-the-project)
12
+
13
+ ## Description
14
+
15
+ 1&1 Chef Knife plugin for managing 1&1 Cloud servers. For more information on the 1&1 Chef Knife plugin, see the [1&1 Community Portal](https://www.1and1.com/cloud-community/).
16
+
17
+ ## Requirements
18
+
19
+ * Chef 12.3.0 or higher
20
+ * Ruby 2.1.x or higher
21
+
22
+ ## Installation
23
+
24
+ Add this line to your application's Gemfile:
25
+
26
+ ```ruby
27
+ gem 'knife-oneandone'
28
+ ```
29
+
30
+ And then execute:
31
+
32
+ $ bundle
33
+
34
+ Or install it yourself as:
35
+
36
+ $ gem install knife-oneandone
37
+
38
+
39
+ ## Configuration
40
+
41
+ The 1&1 Chef Knife plugin requires a valid 1&1 API key. Add your 1&1 API key in a ```knife.rb``` configuration file (for example in ```~/.chef/knife.rb```).
42
+
43
+ ```ruby
44
+ knife[:oneandone_api_key] = '_YOUR_API_KEY_'
45
+ ```
46
+
47
+ ## Sub-Commands
48
+
49
+ The following sub-commands are available with the plugin.
50
+
51
+ **List all server appliances**
52
+
53
+ knife oneandone appliance list
54
+
55
+ **List all data centers**
56
+
57
+ knife oneandone datacenter list
58
+
59
+ **Create a new firewall policy**
60
+
61
+ knife oneandone firewall create
62
+
63
+ **Delete one or more firewall policies**
64
+
65
+ knife oneandone firewall delete
66
+
67
+ **List available firewall policies**
68
+
69
+ knife oneandone firewall list
70
+
71
+ **List allocated public IP addresses**
72
+
73
+ knife oneandone ip list
74
+
75
+ **Create a new load balancer**
76
+
77
+ knife oneandone loadbalancer create
78
+
79
+ **Delete one or more load balancers**
80
+
81
+ knife oneandone loadbalancer delete
82
+
83
+ **List available load balancers**
84
+
85
+ knife oneandone loadbalancer list
86
+
87
+ **List available monitoring policies**
88
+
89
+ knife oneandone mp list
90
+
91
+ **Create a new server**
92
+
93
+ knife oneandone server create
94
+
95
+ **Delete one or more servers**
96
+
97
+ knife oneandone server delete
98
+
99
+ **Add one or more hard disks to server**
100
+
101
+ knife oneandone server hdd add
102
+
103
+ **Remove server's hard disk**
104
+
105
+ knife oneandone server hdd delete
106
+
107
+ **List server's hard disks**
108
+
109
+ knife oneandone server hdd list
110
+
111
+ **Resize server's hard disk**
112
+
113
+ knife oneandone server hdd resize
114
+
115
+ **List available servers**
116
+
117
+ knife oneandone server list
118
+
119
+ **Modify server's hardware configuration: CPU/cores count, RAM amount and/or fixed server size.**
120
+
121
+ knife oneandone server modify
122
+
123
+ **Reboot one or more servers**
124
+
125
+ knife oneandone server reboot
126
+
127
+ **Update server's name and/or description**
128
+
129
+ knife oneandone server rename
130
+
131
+ **List available fixed-server-size configurations**
132
+
133
+ knife oneandone server size list
134
+
135
+ **Start one or more servers**
136
+
137
+ knife oneandone server start
138
+
139
+ **Stop one or more servers**
140
+
141
+ knife oneandone server stop
142
+
143
+ **Creates a new block storage**
144
+
145
+ knife oneandone block storage create
146
+
147
+ **Lists available block storages.**
148
+
149
+ knife oneandone block storage list
150
+
151
+ **Updates block storage's name and/or description**
152
+
153
+ knife oneandone block storage rename
154
+
155
+ **Deletes one or more block storages**
156
+
157
+ knife oneandone block storage delete
158
+
159
+ **Attaches a block storage to a server**
160
+
161
+ knife oneandone block storage attach
162
+
163
+ **Detaches a block storage from a server**
164
+
165
+ knife oneandone block storage detach
166
+
167
+ **Creates a new ssh key**
168
+
169
+ knife oneandone ssh key create
170
+
171
+ **Lists available ssh keys**
172
+
173
+ knife oneandone ssh key list
174
+
175
+ **Updates ssh key's name and/or description**
176
+
177
+ knife oneandone ssh key rename
178
+
179
+ **Deletes one or more ssh keys**
180
+
181
+ knife oneandone ssh key delete
182
+
183
+ ## Usage
184
+
185
+ Before deploying a server to your 1&1 Cloud environment, you may want set up a dedicated firewall policy or a load balancer for the server.
186
+
187
+ To create a firewall policy and allow the access from any IP address:
188
+
189
+ ```
190
+ knife oneandone firewall create -n my-firewall -p TCP,UDP,ICMP --port-from 80,161 --port-to 80,162
191
+ ```
192
+
193
+ A load balancer can be created as follows:
194
+
195
+ ```
196
+ knife oneandone loadbalancer create -n my-LB -m ROUND_ROBIN \
197
+ -p TCP,UDP --port-balancer 80,161 --port-server 8080,161
198
+ ```
199
+
200
+ To restrict the access to a particular IP address or network, specify ```--source``` option for the load balancer and firewall policy.
201
+
202
+ **Note:** When multiple (firewall or load balancer) rules are specified, make sure that the protocols, ports and sources are separated by a comma and in the same order. In a firewall policy create command, specify GRE, ICMP and IPSEC protocols last, for instance
203
+ ```--protocol TCP,TCP,UDP,TCP/UDP,GRE,ICMP,IPSEC```.
204
+
205
+
206
+ Furthermore, use the list commands to find out IDs of the fixed-size configurations, server appliances, monitoring policies, existing IPs, data centers etc.
207
+
208
+ ```
209
+ knife oneandone server size list
210
+ ID Name RAM (GB) Processor No. Cores per Processor Disk Size (GB)
211
+ 65929629F35BBFBA63022008F773F3EB M 1 1 1 40
212
+ 591A7FEF641A98B38D1C4F7C99910121 L 2 2 1 80
213
+ E903FA4F907B5AAF17A7E987FFCDCC6B XL 4 2 1 120
214
+ 57862AE452473D551B1673938DD3DFFE XXL 8 4 1 160
215
+ 3D4C49EAEDD42FBC23DB58FE3DEF464F S 0.5 1 1 30
216
+ 6A2383038420110058C77057D261A07C 3XL 16 8 1 240
217
+ EED49B709368C3715382730A604E9F6A 4XL 32 12 1 360
218
+ EE48ACD55FEFE57E2651862A348D1254 5XL 48 16 1 500
219
+ ```
220
+
221
+ The format option may be used with the list commands to output JSON or yaml (e.g. ```-F json```, ```--format yaml```).
222
+
223
+
224
+ To create a cloud server, you can either specify a fixed-size ID or a flex configuration of the hardware. For baremetal servers, you have to specify a baremetal_model_id.
225
+
226
+ ```
227
+ knife oneandone server create -n Demo-Server \
228
+ --appliance-id FF696FFE6FB96FC54638DB47E9321E25 \
229
+ --datacenter-id 5091F6D8CBFEF9C26ACE957C652D5D49 \
230
+ --fixed-size-id 65929629F35BBFBA63022008F773F3EB
231
+ Deploying, wait for the operation to complete...
232
+ ID: D67F6B24C9C0AED76B8573D267B0EDAB
233
+ Name: Demo-Server
234
+ First IP: 109.228.53.48
235
+ First Password: Qc9knjVAK1
236
+ done
237
+ ```
238
+
239
+ ```
240
+ knife oneandone server create -n chef-baremetal-server \
241
+ --appliance-id 33352CCE1E710AF200CD1234BFD18862 \
242
+ --datacenter-id 4EFAD5836CE43ACA502FD5B99BEE44EF \
243
+ --baremetal-model-id 81504C620D98BCEBAA5202D145203B4B \
244
+ --server-type baremetal
245
+ Deploying, wait for the operation to complete...
246
+ ID: A022DD2CD1629BBCD7873086C113C1D4
247
+ Name: chef-baremetal-server
248
+ First IP: 82.165.251.137
249
+ First Password: Ur37Ncwwpf
250
+ done
251
+ ```
252
+
253
+ ```
254
+ knife oneandone server create -n FS1 -I B5F778B85C041347BCDCFC3172AB3F3C -P 2 -C 1 -r 2 -H 40 -F yaml
255
+ Deploying, wait for the operation to complete...
256
+ ---
257
+ id: 341EB3FF15E861309C4D1C3BC6A8B17B
258
+ cloudpanel_id: 23A0543
259
+ name: FS1
260
+ description: ''
261
+ datacenter:
262
+ id: 908DC2072407C94C8054610AD5A53B8C
263
+ country_code: US
264
+ location: United States of America
265
+ creation_date: '2016-08-05T12:26:27+00:00'
266
+ first_password: Zf1jtd1WH9
267
+ rsa_key: 0
268
+ status:
269
+ state: POWERED_ON
270
+ percent:
271
+ hardware:
272
+ fixed_instance_size_id:
273
+ vcore: 2
274
+ cores_per_processor: 1
275
+ ram: 2
276
+ hdds:
277
+ - id: 430C1E70E1737690E5A71F9D63BE80B2
278
+ size: 40
279
+ is_main: true
280
+ image:
281
+ id: B5F778B85C041347BCDCFC3172AB3F3C
282
+ name: centos7-64std
283
+ dvd:
284
+ snapshot:
285
+ ips:
286
+ - id: DC9F635EA2B3144FC047532C6FD56B84
287
+ ip: 62.151.178.250
288
+ type: IPV4
289
+ reverse_dns:
290
+ firewall_policy:
291
+ id: A4D6302FA44955C797772E34880CBA42
292
+ name: centos7-64cpanel
293
+ load_balancers: []
294
+ alerts: []
295
+ monitoring_policy:
296
+ private_networks:
297
+ ```
298
+
299
+ To attach new hard disks to the server, specify a size for each new volume:
300
+
301
+ ```
302
+ knife oneandone server hdd add 20 80 160 --server-id 341EB3FF15E861309C4D1C3BC6A8B17B
303
+ ```
304
+
305
+ List the server disks in the following way:
306
+
307
+ ```
308
+ knife oneandone server hdd list 341EB3FF15E861309C4D1C3BC6A8B17B
309
+ ID Size (GB) Main
310
+ 430C1E70E1737690E5A71F9D63BE80B2 40 true
311
+ 26D593F10CF0FE666004A594A08B5C0A 20 false
312
+ 602690CAA4BFE5724356148112918C79 80 false
313
+ BA5486B5C0F1861307F80DEB880A4041 160 false
314
+ ```
315
+
316
+ Specify the ID of any server you intend to start, stop, reboot or delete. The next example shows a delete operation with auto-confirming all prompts for deletion.
317
+
318
+ ```
319
+ knife oneandone server delete 341EB3FF15E861309C4D1C3BC6A8B17B D67F6B24C9C0AED76B8573D267B0EDAB -y
320
+ ```
321
+
322
+ A block storage can be created as follows:
323
+
324
+ ```
325
+ knife oneandone block storage create -n chef-blk -s 30 --description test_chef_blkstore -D 5091F6D8CBFEF9C26ACE957C652D5D49
326
+ ```
327
+
328
+ An ssh key can be created as follows:
329
+
330
+ ```
331
+ knife oneandone ssh key create -n chef-ssh-key --description test_chef_sshkey
332
+ ```
333
+
334
+ To create a server with ssh keys, pass the comma-separated list of ssh key ids (or just a single id) using `--public-key` parameter:
335
+ ```
336
+ knife oneandone server create -n chef-serverssh -I C5A349786169F140BCBC335675014C08 -P 2 -C 1 -r 2 -H 40 --public-key E07CA9CA5D8F09A2872FC27160EE28D2
337
+ ```
338
+
339
+ ## Development
340
+
341
+ After checking out the repository, run `bundle install` to install dependencies.
342
+
343
+ Use the bundler to run the tests. Declare the `ONEANDONE_API_KEY` environment variable before running the tests.
344
+
345
+ $ export ONEANDONE_API_KEY="_YOUR_API_KEY_"
346
+ $ bundle exec rspec
347
+
348
+ To install this gem onto your local machine, run `bundle exec rake install`.
349
+
350
+ ## Contribute to the Project
351
+
352
+ 1. Fork the repository (`https://github.com/1and1/oneandone-cloudserver-chef/fork`).
353
+ 2. Create a new feature branch (`git checkout -b my-new-feature`).
354
+ 3. Commit the changes (`git commit -am 'New feature description'`).
355
+ 4. Push to the branch (`git push origin my-new-feature`).
356
+ 5. Create a new pull request.
357
+
358
+ Bug reports and pull requests are welcome.