tugboat 1.3.1 → 2.0.0.RC1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/CHANGELOG.md +12 -8
  4. data/lib/tugboat/cli.rb +8 -7
  5. data/lib/tugboat/config.rb +8 -12
  6. data/lib/tugboat/middleware/add_key.rb +9 -6
  7. data/lib/tugboat/middleware/ask_for_credentials.rb +7 -8
  8. data/lib/tugboat/middleware/check_configuration.rb +1 -1
  9. data/lib/tugboat/middleware/check_credentials.rb +4 -2
  10. data/lib/tugboat/middleware/config.rb +3 -4
  11. data/lib/tugboat/middleware/create_droplet.rb +32 -26
  12. data/lib/tugboat/middleware/destroy_droplet.rb +6 -6
  13. data/lib/tugboat/middleware/destroy_image.rb +6 -6
  14. data/lib/tugboat/middleware/find_droplet.rb +20 -16
  15. data/lib/tugboat/middleware/find_image.rb +17 -10
  16. data/lib/tugboat/middleware/halt_droplet.rb +8 -8
  17. data/lib/tugboat/middleware/info_droplet.rb +38 -25
  18. data/lib/tugboat/middleware/info_image.rb +5 -5
  19. data/lib/tugboat/middleware/inject_client.rb +3 -9
  20. data/lib/tugboat/middleware/list_droplets.rb +6 -4
  21. data/lib/tugboat/middleware/list_images.rb +28 -23
  22. data/lib/tugboat/middleware/list_regions.rb +3 -3
  23. data/lib/tugboat/middleware/list_sizes.rb +3 -3
  24. data/lib/tugboat/middleware/list_ssh_keys.rb +5 -4
  25. data/lib/tugboat/middleware/password_reset.rb +7 -7
  26. data/lib/tugboat/middleware/rebuild_droplet.rb +8 -8
  27. data/lib/tugboat/middleware/resize_droplet.rb +7 -7
  28. data/lib/tugboat/middleware/restart_droplet.rb +8 -8
  29. data/lib/tugboat/middleware/snapshot_droplet.rb +6 -6
  30. data/lib/tugboat/middleware/ssh_droplet.rb +3 -1
  31. data/lib/tugboat/middleware/start_droplet.rb +6 -6
  32. data/lib/tugboat/middleware/wait_for_state.rb +6 -6
  33. data/lib/tugboat/version.rb +1 -1
  34. data/spec/cli/add_key_spec.rb +16 -9
  35. data/spec/cli/authorize_cli_spec.rb +24 -29
  36. data/spec/cli/config_cli_spec.rb +57 -0
  37. data/spec/cli/create_cli_spec.rb +18 -28
  38. data/spec/cli/debug_cli_spec.rb +8 -14
  39. data/spec/cli/destroy_cli_spec.rb +39 -50
  40. data/spec/cli/destroy_image_cli_spec.rb +33 -39
  41. data/spec/cli/droplets_cli_spec.rb +15 -12
  42. data/spec/cli/halt_cli_spec.rb +50 -46
  43. data/spec/cli/images_cli_spec.rb +134 -58
  44. data/spec/cli/info_cli_spec.rb +139 -139
  45. data/spec/cli/info_image_cli_spec.rb +113 -26
  46. data/spec/cli/keys_cli_spec.rb +7 -5
  47. data/spec/cli/password_reset_cli_spec.rb +46 -44
  48. data/spec/cli/rebuild_cli_spec.rb +187 -101
  49. data/spec/cli/regions_cli_spec.rb +13 -6
  50. data/spec/cli/resize_cli_spec.rb +51 -48
  51. data/spec/cli/restart_cli_spec.rb +41 -39
  52. data/spec/cli/sizes_cli_spec.rb +13 -8
  53. data/spec/cli/snapshot_cli_spec.rb +36 -37
  54. data/spec/cli/ssh_cli_spec.rb +7 -15
  55. data/spec/cli/start_cli_spec.rb +39 -35
  56. data/spec/cli/verify_cli_spec.rb +20 -12
  57. data/spec/cli/wait_cli_spec.rb +43 -27
  58. data/spec/config_spec.rb +19 -25
  59. data/spec/fixtures/create_droplet.json +44 -0
  60. data/spec/fixtures/create_ssh_key.json +4 -4
  61. data/spec/fixtures/create_ssh_key_from_file.json +8 -0
  62. data/spec/fixtures/droplet_start_response.json +13 -0
  63. data/spec/fixtures/not_found.json +4 -0
  64. data/spec/fixtures/password_reset_response.json +13 -0
  65. data/spec/fixtures/power_cycle_response.json +13 -0
  66. data/spec/fixtures/resize_droplet.json +13 -0
  67. data/spec/fixtures/restart_response.json +13 -0
  68. data/spec/fixtures/show_coreos_image.json +23 -0
  69. data/spec/fixtures/show_droplet.json +90 -11
  70. data/spec/fixtures/show_droplet_inactive.json +90 -11
  71. data/spec/fixtures/show_droplets.json +249 -30
  72. data/spec/fixtures/show_droplets_empty.json +5 -2
  73. data/spec/fixtures/show_image.json +14 -7
  74. data/spec/fixtures/show_images.json +1075 -13
  75. data/spec/fixtures/show_images_global.json +25 -16
  76. data/spec/fixtures/show_keys.json +15 -7
  77. data/spec/fixtures/show_redmine_image.json +24 -0
  78. data/spec/fixtures/show_regions.json +181 -12
  79. data/spec/fixtures/show_sizes.json +178 -9
  80. data/spec/fixtures/shutdown_response.json +13 -0
  81. data/spec/fixtures/snapshot_response.json +13 -0
  82. data/spec/fixtures/ubuntu_image_9801951.json +24 -0
  83. data/spec/middleware/check_credentials_spec.rb +4 -3
  84. data/spec/middleware/inject_client_spec.rb +2 -2
  85. data/spec/shared/environment.rb +6 -7
  86. data/spec/spec_helper.rb +1 -1
  87. data/tugboat.gemspec +39 -19
  88. metadata +50 -14
  89. data/spec/fixtures/show_droplet_fuzzy.json +0 -13
  90. data/spec/fixtures/show_droplets_fuzzy.json +0 -35
  91. data/spec/fixtures/show_droplets_inactive.json +0 -37
@@ -1,14 +1,93 @@
1
1
  {
2
- "status": "OK",
3
2
  "droplet": {
4
- "backups_active": null,
5
- "id": 100823,
6
- "image_id": 420,
7
- "name": "foo",
8
- "ip_address": "33.33.33.10",
9
- "private_ip_address": "10.20.30.40",
10
- "region_id": 1,
11
- "size_id": 33,
12
- "status": "off"
3
+ "id": 3164494,
4
+ "name": "example.com",
5
+ "memory": 512,
6
+ "vcpus": 1,
7
+ "disk": 20,
8
+ "locked": false,
9
+ "status": "off",
10
+ "kernel": {
11
+ "id": 2233,
12
+ "name": "Ubuntu 14.04 x64 vmlinuz-3.13.0-37-generic",
13
+ "version": "3.13.0-37-generic"
14
+ },
15
+ "created_at": "2014-11-14T16:36:31Z",
16
+ "features": [
17
+ "ipv6",
18
+ "virtio"
19
+ ],
20
+ "backup_ids": [
21
+
22
+ ],
23
+ "snapshot_ids": [
24
+ 7938206
25
+ ],
26
+ "image": {
27
+ "id": 6918990,
28
+ "name": "14.04 x64",
29
+ "distribution": "Ubuntu",
30
+ "slug": "ubuntu-14-04-x64",
31
+ "public": true,
32
+ "regions": [
33
+ "nyc1",
34
+ "ams1",
35
+ "sfo1",
36
+ "nyc2",
37
+ "ams2",
38
+ "sgp1",
39
+ "lon1",
40
+ "nyc3",
41
+ "ams3",
42
+ "nyc3"
43
+ ],
44
+ "created_at": "2014-10-17T20:24:33Z",
45
+ "type": "snapshot",
46
+ "min_disk_size": 20
47
+ },
48
+ "size": {
49
+ },
50
+ "size_slug": "512mb",
51
+ "networks": {
52
+ "v4": [
53
+ {
54
+ "ip_address": "104.131.186.241",
55
+ "netmask": "255.255.240.0",
56
+ "gateway": "104.131.176.1",
57
+ "type": "public"
58
+ }
59
+ ],
60
+ "v6": [
61
+ {
62
+ "ip_address": "2604:A880:0800:0010:0000:0000:031D:2001",
63
+ "netmask": 64,
64
+ "gateway": "2604:A880:0800:0010:0000:0000:0000:0001",
65
+ "type": "public"
66
+ }
67
+ ]
68
+ },
69
+ "region": {
70
+ "name": "New York 3",
71
+ "slug": "nyc3",
72
+ "sizes": [
73
+ "32gb",
74
+ "16gb",
75
+ "2gb",
76
+ "1gb",
77
+ "4gb",
78
+ "8gb",
79
+ "512mb",
80
+ "64gb",
81
+ "48gb"
82
+ ],
83
+ "features": [
84
+ "virtio",
85
+ "private_networking",
86
+ "backups",
87
+ "ipv6",
88
+ "metadata"
89
+ ],
90
+ "available": true
91
+ }
13
92
  }
14
- }
93
+ }
@@ -1,37 +1,256 @@
1
1
  {
2
- "status": "OK",
3
2
  "droplets": [
4
3
  {
5
- "ip_address": "33.33.33.10",
6
- "private_ip_address": "10.20.30.1",
7
- "backups_active": null,
8
- "id": 100823,
9
- "image_id": 420,
10
- "name": "test222",
11
- "region_id": 1,
12
- "size_id": 33,
13
- "status": "active"
4
+ "id": 6918990,
5
+ "name": "example.com",
6
+ "memory": 512,
7
+ "vcpus": 1,
8
+ "disk": 20,
9
+ "locked": false,
10
+ "status": "active",
11
+ "kernel": {
12
+ "id": 2233,
13
+ "name": "Ubuntu 14.04 x64 vmlinuz-3.13.0-37-generic",
14
+ "version": "3.13.0-37-generic"
15
+ },
16
+ "created_at": "2014-11-14T16:29:21Z",
17
+ "features": [
18
+ "backups",
19
+ "ipv6",
20
+ "virtio"
21
+ ],
22
+ "backup_ids": [
23
+ 7938002
24
+ ],
25
+ "snapshot_ids": [
26
+
27
+ ],
28
+ "image": {
29
+ "id": 6918990,
30
+ "name": "14.04 x64",
31
+ "distribution": "Ubuntu",
32
+ "slug": "ubuntu-14-04-x64",
33
+ "public": true,
34
+ "regions": [
35
+ "nyc1",
36
+ "ams1",
37
+ "sfo1",
38
+ "nyc2",
39
+ "ams2",
40
+ "sgp1",
41
+ "lon1",
42
+ "nyc3",
43
+ "ams3",
44
+ "nyc3"
45
+ ],
46
+ "created_at": "2014-10-17T20:24:33Z",
47
+ "min_disk_size": 20
48
+ },
49
+ "size_slug": "512mb",
50
+ "networks": {
51
+ "v4": [
52
+ {
53
+ "ip_address": "104.236.32.182",
54
+ "netmask": "255.255.192.0",
55
+ "gateway": "104.236.0.1",
56
+ "type": "public"
57
+ }
58
+ ],
59
+ "v6": [
60
+ {
61
+ "ip_address": "2604:A880:0800:0010:0000:0000:02DD:4001",
62
+ "netmask": 64,
63
+ "gateway": "2604:A880:0800:0010:0000:0000:0000:0001",
64
+ "type": "public"
65
+ }
66
+ ]
67
+ },
68
+ "region": {
69
+ "name": "New York 3",
70
+ "slug": "nyc3",
71
+ "sizes": [
72
+
73
+ ],
74
+ "features": [
75
+ "virtio",
76
+ "private_networking",
77
+ "backups",
78
+ "ipv6",
79
+ "metadata"
80
+ ],
81
+ "available": null
82
+ }
14
83
  },
15
84
  {
16
- "ip_address": "33.33.33.10",
17
- "backups_active": null,
18
- "id": 100823,
19
- "image_id": 420,
20
- "name": "test223",
21
- "region_id": 1,
22
- "size_id": 33,
23
- "status": "active"
85
+ "id": 3164956,
86
+ "name": "example2.com",
87
+ "memory": 512,
88
+ "vcpus": 1,
89
+ "disk": 20,
90
+ "locked": false,
91
+ "status": "active",
92
+ "kernel": {
93
+ "id": 2233,
94
+ "name": "Ubuntu 14.04 x64 vmlinuz-3.13.0-37-generic",
95
+ "version": "3.13.0-37-generic"
96
+ },
97
+ "created_at": "2014-08-14T16:29:21Z",
98
+ "features": [
99
+ "backups",
100
+ "ipv6",
101
+ "virtio"
102
+ ],
103
+ "backup_ids": [
104
+ 7938002
105
+ ],
106
+ "snapshot_ids": [
107
+
108
+ ],
109
+ "image": {
110
+ "id": 6918990,
111
+ "name": "14.04 x64",
112
+ "distribution": "Ubuntu",
113
+ "slug": "ubuntu-14-04-x64",
114
+ "public": true,
115
+ "regions": [
116
+ "nyc1",
117
+ "ams1",
118
+ "sfo1",
119
+ "nyc2",
120
+ "ams2",
121
+ "sgp1",
122
+ "lon1",
123
+ "nyc3",
124
+ "ams3",
125
+ "nyc3"
126
+ ],
127
+ "created_at": "2014-10-17T20:24:33Z",
128
+ "min_disk_size": 20
129
+ },
130
+ "size_slug": "512mb",
131
+ "networks": {
132
+ "v4": [
133
+ {
134
+ "ip_address": "104.236.32.172",
135
+ "netmask": "255.255.192.0",
136
+ "gateway": "104.236.0.1",
137
+ "type": "public"
138
+ }
139
+ ],
140
+ "v6": [
141
+ {
142
+ "ip_address": "2604:A880:0800:0010:0000:0000:02DD:4001",
143
+ "netmask": 64,
144
+ "gateway": "2604:A880:0800:0010:0000:0000:0000:0001",
145
+ "type": "public"
146
+ }
147
+ ]
148
+ },
149
+ "region": {
150
+ "name": "New York 3",
151
+ "slug": "nyc3",
152
+ "sizes": [
153
+
154
+ ],
155
+ "features": [
156
+ "virtio",
157
+ "private_networking",
158
+ "backups",
159
+ "ipv6",
160
+ "metadata"
161
+ ],
162
+ "available": null
163
+ }
24
164
  },
25
- {
26
- "ip_address": "33.33.33.10",
27
- "private_ip_address": "10.20.30.40",
28
- "backups_active": null,
29
- "id": 100823,
30
- "image_id": 420,
31
- "name": "foo",
32
- "region_id": 1,
33
- "size_id": 33,
34
- "status": "active"
165
+ {
166
+ "id": 3164444,
167
+ "name": "example3.com",
168
+ "memory": 512,
169
+ "vcpus": 1,
170
+ "disk": 20,
171
+ "locked": false,
172
+ "status": "off",
173
+ "kernel": {
174
+ "id": 2233,
175
+ "name": "Ubuntu 14.04 x64 vmlinuz-3.13.0-37-generic",
176
+ "version": "3.13.0-37-generic"
177
+ },
178
+ "created_at": "2014-08-14T16:29:21Z",
179
+ "features": [
180
+ "backups",
181
+ "ipv6",
182
+ "virtio"
183
+ ],
184
+ "backup_ids": [
185
+ 7938002
186
+ ],
187
+ "snapshot_ids": [
188
+
189
+ ],
190
+ "image": {
191
+ "id": 6918990,
192
+ "name": "14.04 x64",
193
+ "distribution": "Ubuntu",
194
+ "slug": "ubuntu-14-04-x64",
195
+ "public": true,
196
+ "regions": [
197
+ "nyc1",
198
+ "ams1",
199
+ "sfo1",
200
+ "nyc2",
201
+ "ams2",
202
+ "sgp1",
203
+ "lon1",
204
+ "nyc3",
205
+ "ams3",
206
+ "nyc3"
207
+ ],
208
+ "created_at": "2014-10-17T20:24:33Z",
209
+ "min_disk_size": 20
210
+ },
211
+ "size_slug": "512mb",
212
+ "networks": {
213
+ "v4": [
214
+ {
215
+ "ip_address": "104.236.32.173",
216
+ "netmask": "255.255.192.0",
217
+ "gateway": "104.236.0.1",
218
+ "type": "public"
219
+ }
220
+ ],
221
+ "v6": [
222
+ {
223
+ "ip_address": "2604:A880:0800:0010:0000:0000:02DD:4001",
224
+ "netmask": 64,
225
+ "gateway": "2604:A880:0800:0010:0000:0000:0000:0001",
226
+ "type": "public"
227
+ }
228
+ ]
229
+ },
230
+ "region": {
231
+ "name": "New York 3",
232
+ "slug": "nyc3",
233
+ "sizes": [
234
+
235
+ ],
236
+ "features": [
237
+ "virtio",
238
+ "private_networking",
239
+ "backups",
240
+ "ipv6",
241
+ "metadata"
242
+ ],
243
+ "available": null
244
+ }
245
+ }
246
+ ],
247
+ "links": {
248
+ "pages": {
249
+ "last": "https://api.digitalocean.com/v2/droplets?page=3&per_page=1",
250
+ "next": "https://api.digitalocean.com/v2/droplets?page=2&per_page=1"
35
251
  }
36
- ]
37
- }
252
+ },
253
+ "meta": {
254
+ "total": 4
255
+ }
256
+ }
@@ -1,4 +1,7 @@
1
1
  {
2
- "status":"OK",
3
- "droplets":[]
2
+ "droplets": [],
3
+ "links": {},
4
+ "meta": {
5
+ "total": 0
6
+ }
4
7
  }
@@ -1,8 +1,15 @@
1
1
  {
2
- "image": {
3
- "distribution": "Ubuntu",
4
- "id": 478,
5
- "name": "NLP Final"
6
- },
7
- "status": "OK"
8
- }
2
+ "image": {
3
+ "id": 6376601,
4
+ "name": "My application image",
5
+ "distribution": "Ubuntu",
6
+ "slug": null,
7
+ "public": false,
8
+ "regions": [
9
+ "nyc2",
10
+ "nyc2"
11
+ ],
12
+ "created_at": "2014-11-04T22:23:02Z",
13
+ "min_disk_size": 20
14
+ }
15
+ }