knife-digital_ocean 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/CHANGELOG.md +6 -0
- data/knife-digital_ocean.gemspec +2 -0
- data/lib/chef/knife/digital_ocean_droplet_create.rb +17 -1
- data/lib/knife-digital_ocean/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/droplet.yml +76 -0
- data/spec/fixtures/vcr_cassettes/image.yml +164 -0
- data/spec/fixtures/vcr_cassettes/region.yml +73 -0
- data/spec/fixtures/vcr_cassettes/sizes.yml +65 -0
- data/spec/fixtures/vcr_cassettes/sshkey.yml +67 -0
- data/spec/lib/chef/knife/digital_ocean_droplet_list_spec.rb +34 -1
- data/spec/lib/chef/knife/digital_ocean_image_list_spec.rb +34 -1
- data/spec/lib/chef/knife/digital_ocean_region_list_spec.rb +36 -1
- data/spec/lib/chef/knife/digital_ocean_size_list_spec.rb +36 -1
- data/spec/lib/chef/knife/digital_ocean_sshkey_list_spec.rb +36 -1
- data/spec/spec_helper.rb +7 -0
- metadata +40 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 529ea199eb79dd265a5596c4829c33c544625119
|
4
|
+
data.tar.gz: dc1b77c699eaaaf00f840a86c278266fe01cf344
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b8777968d4b48e0d3cfb3bbdff2953443456ddd4aade58392db60c1ce8eb7559881627a9c1af581db3408d7f2785dde44d20a950c9e852f134c3811a6ae42e2
|
7
|
+
data.tar.gz: 4705cb3ded89d46759fc75be597d764e7e6f552e85afa28857738fb096d41728c2a3703f189a3372f37739ade06ce4f13b64da69cdff5ee033a5d6af665b41c0
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## 2.1.0 / 2014-11-09
|
2
|
+
|
3
|
+
* Better test coverage
|
4
|
+
* -6 --ipv6-enabled option to enable ipv6
|
5
|
+
* -b --backups-enabled option to enable backups, thanks to [@salemine](https://github.com/salemine) [PR #45]
|
6
|
+
|
1
7
|
## 2.0.0 / 2014-11-07
|
2
8
|
|
3
9
|
* Now using Digital Ocean apiv2.
|
data/knife-digital_ocean.gemspec
CHANGED
@@ -20,6 +20,8 @@ Gem::Specification.new do |gem|
|
|
20
20
|
gem.add_development_dependency 'rubocop', '~> 0.27'
|
21
21
|
gem.add_development_dependency 'rake'
|
22
22
|
gem.add_development_dependency 'knife-solo'
|
23
|
+
gem.add_development_dependency 'webmock', '~> 1.20'
|
24
|
+
gem.add_development_dependency 'vcr', '~> 2.9'
|
23
25
|
|
24
26
|
gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
25
27
|
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
@@ -145,6 +145,18 @@ class Chef
|
|
145
145
|
default: '22',
|
146
146
|
proc: proc { |port| Chef::Config[:knife][:ssh_port] = port }
|
147
147
|
|
148
|
+
option :backups,
|
149
|
+
short: '-b',
|
150
|
+
long: '--backups-enabled',
|
151
|
+
description: 'Enables backups for the created droplet',
|
152
|
+
default: false
|
153
|
+
|
154
|
+
option :ipv6,
|
155
|
+
short: '-6',
|
156
|
+
long: '--ipv6-enabled',
|
157
|
+
description: 'Enables ipv6 for the created droplet',
|
158
|
+
default: false
|
159
|
+
|
148
160
|
def run
|
149
161
|
$stdout.sync = true
|
150
162
|
|
@@ -189,7 +201,11 @@ class Chef
|
|
189
201
|
image: locate_config_value(:image),
|
190
202
|
region: locate_config_value(:location),
|
191
203
|
ssh_keys: locate_config_value(:ssh_key_ids).split(/, ?/),
|
192
|
-
private_networking: locate_config_value(:private_networking)
|
204
|
+
private_networking: locate_config_value(:private_networking),
|
205
|
+
backups: locate_config_value(:backups),
|
206
|
+
ipv6: locate_config_value(:ipv6)
|
207
|
+
)
|
208
|
+
|
193
209
|
|
194
210
|
server = client.droplets.create(droplet)
|
195
211
|
|
@@ -0,0 +1,76 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.digitalocean.com/v2/droplets?page=1&per_page=20
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
Authorization:
|
13
|
+
- Bearer FAKE_ACCESS_TOKEN
|
14
|
+
User-Agent:
|
15
|
+
- Faraday v0.9.0
|
16
|
+
Accept-Encoding:
|
17
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
18
|
+
Accept:
|
19
|
+
- "*/*"
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- cloudflare-nginx
|
27
|
+
Date:
|
28
|
+
- Mon, 10 Nov 2014 02:37:07 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Transfer-Encoding:
|
32
|
+
- chunked
|
33
|
+
Connection:
|
34
|
+
- keep-alive
|
35
|
+
Set-Cookie:
|
36
|
+
- __cfduid=d333cb27b09f6cb1055ec559839ab87f71415587026763; expires=Mon, 23-Dec-2019
|
37
|
+
23:50:00 GMT; path=/; domain=.digitalocean.com; HttpOnly
|
38
|
+
Status:
|
39
|
+
- 200 OK
|
40
|
+
X-Frame-Options:
|
41
|
+
- SAMEORIGIN
|
42
|
+
X-Xss-Protection:
|
43
|
+
- 1; mode=block
|
44
|
+
X-Content-Type-Options:
|
45
|
+
- nosniff
|
46
|
+
Ratelimit-Limit:
|
47
|
+
- '1200'
|
48
|
+
Ratelimit-Remaining:
|
49
|
+
- '1172'
|
50
|
+
Ratelimit-Reset:
|
51
|
+
- '1415588063'
|
52
|
+
Cache-Control:
|
53
|
+
- max-age=0, private, must-revalidate
|
54
|
+
X-Request-Id:
|
55
|
+
- acc15f8d-427c-433c-9111-f1f5574fe266
|
56
|
+
X-Runtime:
|
57
|
+
- '0.252064'
|
58
|
+
Cf-Ray:
|
59
|
+
- 186eddc547260ec7-EWR
|
60
|
+
body:
|
61
|
+
encoding: UTF-8
|
62
|
+
string: '{"droplets":[{"id":2257086,"name":"www.gregf.org","memory":512,"vcpus":1,"disk":20,"locked":false,"status":"active","kernel":{"id":952,"name":"Debian
|
63
|
+
7.0 x64 vmlinuz-3.2.0-4-amd64 (3.2.54-2)","version":"3.2.0-4-amd64"},"created_at":"2014-08-05T01:54:38Z","features":["private_networking","virtio"],"backup_ids":[],"snapshot_ids":[],"image":{"id":3445812,"name":"Debian
|
64
|
+
7.0 x64","distribution":"Debian","slug":null,"public":false,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","nyc2"],"created_at":"2014-05-02T18:16:21Z","min_size":"512mb"},"size_slug":"512mb","networks":{"v4":[{"ip_address":"10.128.210.209","netmask":"255.255.0.0","gateway":"10.128.1.1","type":"private"},{"ip_address":"162.243.243.162","netmask":"255.255.255.0","gateway":"162.243.243.1","type":"public"}],"v6":[]},"region":{"name":"New
|
65
|
+
York 2","slug":"nyc2","sizes":[],"features":["virtio","private_networking","backups"],"available":null}},{"id":2463964,"name":"xmpp.gregf.org","memory":512,"vcpus":1,"disk":20,"locked":false,"status":"active","kernel":{"id":952,"name":"Debian
|
66
|
+
7.0 x64 vmlinuz-3.2.0-4-amd64 (3.2.54-2)","version":"3.2.0-4-amd64"},"created_at":"2014-08-27T02:08:43Z","features":["virtio"],"backup_ids":[],"snapshot_ids":[],"image":{"id":5808360,"name":"xmpp-snapshot","distribution":"Debian","slug":null,"public":false,"regions":["nyc3"],"created_at":"2014-08-26T23:33:44Z","min_size":"512mb"},"size_slug":"512mb","networks":{"v4":[{"ip_address":"104.131.39.115","netmask":"255.255.192.0","gateway":"104.131.0.1","type":"public"}],"v6":[]},"region":{"name":"New
|
67
|
+
York 3","slug":"nyc3","sizes":[],"features":["virtio","private_networking","backups","ipv6","metadata"],"available":null}},{"id":2475760,"name":"mc.redneckscraft.com","memory":2048,"vcpus":2,"disk":40,"locked":false,"status":"active","kernel":{"id":952,"name":"Debian
|
68
|
+
7.0 x64 vmlinuz-3.2.0-4-amd64 (3.2.54-2)","version":"3.2.0-4-amd64"},"created_at":"2014-08-27T20:50:17Z","features":["private_networking","ipv6","virtio"],"backup_ids":[],"snapshot_ids":[],"image":{"id":5562742,"name":"Debian
|
69
|
+
7.0 x64","distribution":"Debian","slug":null,"public":false,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc2"],"created_at":"2014-08-07T19:10:55Z","min_size":"512mb"},"size_slug":"2gb","networks":{"v4":[{"ip_address":"10.132.252.47","netmask":"255.255.0.0","gateway":"10.132.0.1","type":"private"},{"ip_address":"104.131.47.109","netmask":"255.255.192.0","gateway":"104.131.0.1","type":"public"}],"v6":[{"ip_address":"2604:A880:0800:0010:0000:0000:0043:F001","netmask":64,"gateway":"2604:A880:0800:0010:0000:0000:0000:0001","type":"public"}]},"region":{"name":"New
|
70
|
+
York 3","slug":"nyc3","sizes":[],"features":["virtio","private_networking","backups","ipv6","metadata"],"available":null}},{"id":3117221,"name":"testing.gregf.org","memory":512,"vcpus":1,"disk":20,"locked":false,"status":"active","kernel":{"id":952,"name":"Debian
|
71
|
+
7.0 x64 vmlinuz-3.2.0-4-amd64 (3.2.54-2)","version":"3.2.0-4-amd64"},"created_at":"2014-11-10T02:29:08Z","features":["virtio"],"backup_ids":[],"snapshot_ids":[7753256],"image":{"id":6372526,"name":"7.0
|
72
|
+
x64","distribution":"Debian","slug":"debian-7-0-x64","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-09-26T16:52:46Z","min_size":"512mb"},"size_slug":"512mb","networks":{"v4":[{"ip_address":"104.236.29.97","netmask":"255.255.192.0","gateway":"104.236.0.1","type":"public"}],"v6":[]},"region":{"name":"New
|
73
|
+
York 3","slug":"nyc3","sizes":[],"features":["virtio","private_networking","backups","ipv6","metadata"],"available":null}}],"links":{},"meta":{"total":4}}'
|
74
|
+
http_version:
|
75
|
+
recorded_at: Mon, 10 Nov 2014 02:37:07 GMT
|
76
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,164 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.digitalocean.com/v2/images?page=1&per_page=20
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
Authorization:
|
13
|
+
- Bearer FAKE_ACCESS_TOKEN
|
14
|
+
User-Agent:
|
15
|
+
- Faraday v0.9.0
|
16
|
+
Accept-Encoding:
|
17
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
18
|
+
Accept:
|
19
|
+
- "*/*"
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- cloudflare-nginx
|
27
|
+
Date:
|
28
|
+
- Mon, 10 Nov 2014 02:32:48 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Transfer-Encoding:
|
32
|
+
- chunked
|
33
|
+
Connection:
|
34
|
+
- keep-alive
|
35
|
+
Set-Cookie:
|
36
|
+
- __cfduid=dc1adbcb8ce64ae81957e073335347f051415586762639; expires=Mon, 23-Dec-2019
|
37
|
+
23:50:00 GMT; path=/; domain=.digitalocean.com; HttpOnly
|
38
|
+
Status:
|
39
|
+
- 200 OK
|
40
|
+
X-Frame-Options:
|
41
|
+
- SAMEORIGIN
|
42
|
+
X-Xss-Protection:
|
43
|
+
- 1; mode=block
|
44
|
+
X-Content-Type-Options:
|
45
|
+
- nosniff
|
46
|
+
Ratelimit-Limit:
|
47
|
+
- '1200'
|
48
|
+
Ratelimit-Remaining:
|
49
|
+
- '1174'
|
50
|
+
Ratelimit-Reset:
|
51
|
+
- '1415588063'
|
52
|
+
Cache-Control:
|
53
|
+
- max-age=0, private, must-revalidate
|
54
|
+
X-Request-Id:
|
55
|
+
- 042b0474-f56d-4bfd-a8f6-89dc199df63a
|
56
|
+
X-Runtime:
|
57
|
+
- '6.100066'
|
58
|
+
Cf-Ray:
|
59
|
+
- 186ed75277160ec7-EWR
|
60
|
+
body:
|
61
|
+
encoding: UTF-8
|
62
|
+
string: '{"images":[{"id":7753256,"name":"test-snapshot","distribution":"Debian","slug":null,"public":false,"regions":["nyc3","nyc3"],"created_at":"2014-11-10T02:30:17Z","min_size":"512mb"},{"id":7665753,"name":"CoreOS
|
63
|
+
(alpha) 493.0.0","distribution":"CoreOS","slug":"coreos-alpha","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-11-07T20:11:14Z","min_size":"512mb"},{"id":7111572,"name":"14.10
|
64
|
+
x32","distribution":"Ubuntu","slug":"ubuntu-14-10-x32","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-10-23T14:30:12Z","min_size":"512mb"},{"id":6882384,"name":"444.5.0
|
65
|
+
(beta)","distribution":"CoreOS","slug":"coreos-beta","public":true,"regions":["sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-10-16T17:43:33Z","min_size":"512mb"},{"id":6886342,"name":"444.5.0
|
66
|
+
(stable)","distribution":"CoreOS","slug":"coreos-stable","public":true,"regions":["sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-10-16T20:36:29Z","min_size":"512mb"},{"id":6370882,"name":"20
|
67
|
+
x64","distribution":"Fedora","slug":"fedora-20-x64","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-09-26T15:29:01Z","min_size":"512mb"},{"id":6370885,"name":"20
|
68
|
+
x32","distribution":"Fedora","slug":"fedora-20-x32","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-09-26T15:29:18Z","min_size":"512mb"},{"id":6370968,"name":"19
|
69
|
+
x64","distribution":"Fedora","slug":"fedora-19-x64","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-09-26T15:33:05Z","min_size":"512mb"},{"id":6370969,"name":"19
|
70
|
+
x32","distribution":"Fedora","slug":"fedora-19-x32","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-09-26T15:33:39Z","min_size":"512mb"},{"id":6372105,"name":"6.5
|
71
|
+
x32","distribution":"CentOS","slug":"centos-6-5-x32","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-09-26T16:28:33Z","min_size":"512mb"},{"id":6372108,"name":"6.5
|
72
|
+
x64","distribution":"CentOS","slug":"centos-6-5-x64","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-09-26T16:28:43Z","min_size":"512mb"},{"id":6372321,"name":"5.10
|
73
|
+
x64","distribution":"CentOS","slug":"centos-5-8-x64","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-09-26T16:40:18Z","min_size":"512mb"},{"id":6372425,"name":"5.10
|
74
|
+
x32","distribution":"CentOS","slug":"centos-5-8-x32","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-09-26T16:45:29Z","min_size":"512mb"},{"id":6372526,"name":"7.0
|
75
|
+
x64","distribution":"Debian","slug":"debian-7-0-x64","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-09-26T16:52:46Z","min_size":"512mb"},{"id":6372528,"name":"7.0
|
76
|
+
x32","distribution":"Debian","slug":"debian-7-0-x32","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-09-26T16:53:06Z","min_size":"512mb"},{"id":6372581,"name":"6.0
|
77
|
+
x64","distribution":"Debian","slug":"debian-6-0-x64","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-09-26T16:56:00Z","min_size":"512mb"},{"id":6372662,"name":"6.0
|
78
|
+
x32","distribution":"Debian","slug":"debian-6-0-x32","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-09-26T17:00:21Z","min_size":"512mb"},{"id":6374124,"name":"10.04
|
79
|
+
x64","distribution":"Ubuntu","slug":"ubuntu-10-04-x64","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-09-26T18:16:06Z","min_size":"512mb"},{"id":6374125,"name":"10.04
|
80
|
+
x32","distribution":"Ubuntu","slug":"ubuntu-10-04-x32","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-09-26T18:16:15Z","min_size":"512mb"},{"id":6374128,"name":"12.04.5
|
81
|
+
x64","distribution":"Ubuntu","slug":"ubuntu-12-04-x64","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-09-26T18:16:53Z","min_size":"512mb"}],"links":{"pages":{"last":"https://api.digitalocean.com/v2/images?page=2&per_page=20","next":"https://api.digitalocean.com/v2/images?page=2&per_page=20"}},"meta":{"total":39}}'
|
82
|
+
http_version:
|
83
|
+
recorded_at: Mon, 10 Nov 2014 02:32:48 GMT
|
84
|
+
- request:
|
85
|
+
method: get
|
86
|
+
uri: https://api.digitalocean.com/v2/images?page=2&per_page=20
|
87
|
+
body:
|
88
|
+
encoding: US-ASCII
|
89
|
+
string: ''
|
90
|
+
headers:
|
91
|
+
Content-Type:
|
92
|
+
- application/json
|
93
|
+
Authorization:
|
94
|
+
- Bearer FAKE_ACCESS_TOKEN
|
95
|
+
User-Agent:
|
96
|
+
- Faraday v0.9.0
|
97
|
+
Accept-Encoding:
|
98
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
99
|
+
Accept:
|
100
|
+
- "*/*"
|
101
|
+
response:
|
102
|
+
status:
|
103
|
+
code: 200
|
104
|
+
message: OK
|
105
|
+
headers:
|
106
|
+
Server:
|
107
|
+
- cloudflare-nginx
|
108
|
+
Date:
|
109
|
+
- Mon, 10 Nov 2014 02:32:54 GMT
|
110
|
+
Content-Type:
|
111
|
+
- application/json; charset=utf-8
|
112
|
+
Transfer-Encoding:
|
113
|
+
- chunked
|
114
|
+
Connection:
|
115
|
+
- keep-alive
|
116
|
+
Set-Cookie:
|
117
|
+
- __cfduid=d67caa735e3afb313a6442b6df38630b01415586768954; expires=Mon, 23-Dec-2019
|
118
|
+
23:50:00 GMT; path=/; domain=.digitalocean.com; HttpOnly
|
119
|
+
Status:
|
120
|
+
- 200 OK
|
121
|
+
X-Frame-Options:
|
122
|
+
- SAMEORIGIN
|
123
|
+
X-Xss-Protection:
|
124
|
+
- 1; mode=block
|
125
|
+
X-Content-Type-Options:
|
126
|
+
- nosniff
|
127
|
+
Ratelimit-Limit:
|
128
|
+
- '1200'
|
129
|
+
Ratelimit-Remaining:
|
130
|
+
- '1173'
|
131
|
+
Ratelimit-Reset:
|
132
|
+
- '1415588063'
|
133
|
+
Cache-Control:
|
134
|
+
- max-age=0, private, must-revalidate
|
135
|
+
X-Request-Id:
|
136
|
+
- 6a3f5918-4ef6-4164-8607-3e8e98242fcb
|
137
|
+
X-Runtime:
|
138
|
+
- '5.477524'
|
139
|
+
Cf-Ray:
|
140
|
+
- 186ed779f5f60ecd-EWR
|
141
|
+
body:
|
142
|
+
encoding: UTF-8
|
143
|
+
string: '{"images":[{"id":6374130,"name":"12.04.5 x32","distribution":"Ubuntu","slug":"ubuntu-12-04-x32","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-09-26T18:17:23Z","min_size":"512mb"},{"id":6918735,"name":"14.04
|
144
|
+
x32","distribution":"Ubuntu","slug":"ubuntu-14-04-x32","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-10-17T20:13:41Z","min_size":"512mb"},{"id":6918990,"name":"14.04
|
145
|
+
x64","distribution":"Ubuntu","slug":"ubuntu-14-04-x64","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-10-17T20:24:33Z","min_size":"512mb"},{"id":7053293,"name":"7.0
|
146
|
+
x64","distribution":"CentOS","slug":"centos-7-0-x64","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-10-21T21:51:45Z","min_size":"512mb"},{"id":7111343,"name":"14.10
|
147
|
+
x64","distribution":"Ubuntu","slug":"ubuntu-14-10-x64","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-10-23T14:21:38Z","min_size":"512mb"},{"id":6376601,"name":"Ruby
|
148
|
+
on Rails on 14.04 (Nginx + Unicorn)","distribution":"Ubuntu","slug":"ruby-on-rails","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc1"],"created_at":"2014-09-26T20:20:24Z","min_size":"512mb"},{"id":6423475,"name":"WordPress
|
149
|
+
on 14.04","distribution":"Ubuntu","slug":"wordpress","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc1"],"created_at":"2014-09-28T21:34:48Z","min_size":"512mb"},{"id":6734697,"name":"Django
|
150
|
+
on 14.04","distribution":"Ubuntu","slug":"django","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-10-10T18:34:55Z","min_size":"512mb"},{"id":6884371,"name":"Magento
|
151
|
+
1.9.0.1 on 14.04","distribution":"Ubuntu","slug":"magento","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-10-16T19:14:18Z","min_size":"512mb"},{"id":7284647,"name":"Ghost
|
152
|
+
0.5.3 on 14.04","distribution":"Ubuntu","slug":"ghost","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-10-28T19:34:10Z","min_size":"512mb"},{"id":7354580,"name":"Docker
|
153
|
+
1.3.1 on 14.04","distribution":"Ubuntu","slug":"docker","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-10-30T18:12:32Z","min_size":"512mb"},{"id":7518201,"name":"GitLab
|
154
|
+
7.4.3 CE on 14.04","distribution":"Ubuntu","slug":"gitlab","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-11-03T23:32:54Z","min_size":"512mb"},{"id":6732690,"name":"LEMP
|
155
|
+
on 14.04","distribution":"Ubuntu","slug":"lemp","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-10-10T16:31:45Z","min_size":"512mb"},{"id":6732691,"name":"LAMP
|
156
|
+
on 14.04","distribution":"Ubuntu","slug":"lamp","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-10-10T16:31:57Z","min_size":"512mb"},{"id":6734341,"name":"node-v0.10.32
|
157
|
+
on 14.04","distribution":"Ubuntu","slug":"node","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-10-10T18:13:34Z","min_size":"512mb"},{"id":6738037,"name":"Dokku
|
158
|
+
v0.2.3 on 14.04 (w/ Docker 1.2.0)","distribution":"Ubuntu","slug":"dokku","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-10-10T22:20:30Z","min_size":"512mb"},{"id":6798184,"name":"MEAN
|
159
|
+
on 14.04","distribution":"Ubuntu","slug":"mean","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-10-13T15:13:39Z","min_size":"512mb"},{"id":6854006,"name":"Drupal
|
160
|
+
7.32 on 14.04","distribution":"Ubuntu","slug":"drupal","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","nyc3"],"created_at":"2014-10-15T21:17:06Z","min_size":"512mb"},{"id":7572830,"name":"Redmine
|
161
|
+
on 14.04","distribution":"Ubuntu","slug":"redmine","public":true,"regions":["nyc1","ams1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","ams3"],"created_at":"2014-11-05T09:12:04Z","min_size":"512mb"}],"links":{"pages":{"first":"https://api.digitalocean.com/v2/images?page=1&per_page=20","prev":"https://api.digitalocean.com/v2/images?page=1&per_page=20"}},"meta":{"total":39}}'
|
162
|
+
http_version:
|
163
|
+
recorded_at: Mon, 10 Nov 2014 02:32:54 GMT
|
164
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,73 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.digitalocean.com/v2/regions
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
Authorization:
|
13
|
+
- Bearer FAKE_ACCESS_TOKEN
|
14
|
+
User-Agent:
|
15
|
+
- Faraday v0.9.0
|
16
|
+
Accept-Encoding:
|
17
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
18
|
+
Accept:
|
19
|
+
- "*/*"
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- cloudflare-nginx
|
27
|
+
Date:
|
28
|
+
- Mon, 10 Nov 2014 02:00:37 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Transfer-Encoding:
|
32
|
+
- chunked
|
33
|
+
Connection:
|
34
|
+
- keep-alive
|
35
|
+
Set-Cookie:
|
36
|
+
- __cfduid=d8994d408033b66f3179aa41ee3dc9ba41415584837157; expires=Mon, 23-Dec-2019
|
37
|
+
23:50:00 GMT; path=/; domain=.digitalocean.com; HttpOnly
|
38
|
+
Status:
|
39
|
+
- 200 OK
|
40
|
+
X-Frame-Options:
|
41
|
+
- SAMEORIGIN
|
42
|
+
X-Xss-Protection:
|
43
|
+
- 1; mode=block
|
44
|
+
X-Content-Type-Options:
|
45
|
+
- nosniff
|
46
|
+
Ratelimit-Limit:
|
47
|
+
- '1200'
|
48
|
+
Ratelimit-Remaining:
|
49
|
+
- '1185'
|
50
|
+
Ratelimit-Reset:
|
51
|
+
- '1415584945'
|
52
|
+
Cache-Control:
|
53
|
+
- max-age=0, private, must-revalidate
|
54
|
+
X-Request-Id:
|
55
|
+
- b5c82235-3b53-451a-acf1-ba2e15076ee0
|
56
|
+
X-Runtime:
|
57
|
+
- '0.049556'
|
58
|
+
Cf-Ray:
|
59
|
+
- 186ea85036a60ec7-EWR
|
60
|
+
body:
|
61
|
+
encoding: UTF-8
|
62
|
+
string: '{"regions":[{"name":"New York 1","slug":"nyc1","sizes":["32gb","16gb","2gb","1gb","4gb","8gb","512mb","64gb","48gb"],"features":["virtio","backups"],"available":true},{"name":"Amsterdam
|
63
|
+
1","slug":"ams1","sizes":["16gb","2gb","1gb","4gb","8gb","512mb"],"features":["virtio","backups"],"available":true},{"name":"San
|
64
|
+
Francisco 1","slug":"sfo1","sizes":["32gb","16gb","2gb","1gb","4gb","8gb","512mb","64gb","48gb"],"features":["virtio","backups","metadata"],"available":true},{"name":"New
|
65
|
+
York 2","slug":"nyc2","sizes":["32gb","16gb","2gb","1gb","4gb","8gb","512mb","64gb","48gb"],"features":["virtio","private_networking","backups"],"available":true},{"name":"Amsterdam
|
66
|
+
2","slug":"ams2","sizes":["32gb","16gb","2gb","1gb","4gb","8gb","512mb","64gb","48gb"],"features":["virtio","private_networking","backups","metadata"],"available":true},{"name":"Singapore
|
67
|
+
1","slug":"sgp1","sizes":["32gb","16gb","2gb","1gb","4gb","8gb","512mb","64gb","48gb"],"features":["virtio","private_networking","backups","ipv6","metadata"],"available":true},{"name":"London
|
68
|
+
1","slug":"lon1","sizes":["32gb","16gb","2gb","1gb","4gb","8gb","512mb","64gb","48gb"],"features":["virtio","private_networking","backups","ipv6","metadata"],"available":true},{"name":"New
|
69
|
+
York 3","slug":"nyc3","sizes":["32gb","16gb","2gb","1gb","4gb","8gb","512mb","64gb","48gb"],"features":["virtio","private_networking","backups","ipv6","metadata"],"available":true},{"name":"Amsterdam
|
70
|
+
3","slug":"ams3","sizes":["32gb","16gb","2gb","1gb","4gb","8gb","512mb","64gb","48gb"],"features":["virtio","private_networking","backups","ipv6","metadata"],"available":true}],"links":{},"meta":{"total":9}}'
|
71
|
+
http_version:
|
72
|
+
recorded_at: Mon, 10 Nov 2014 02:00:37 GMT
|
73
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,65 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.digitalocean.com/v2/sizes
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
Authorization:
|
13
|
+
- Bearer FAKE_ACCESS_TOKEN
|
14
|
+
User-Agent:
|
15
|
+
- Faraday v0.9.0
|
16
|
+
Accept-Encoding:
|
17
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
18
|
+
Accept:
|
19
|
+
- "*/*"
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- cloudflare-nginx
|
27
|
+
Date:
|
28
|
+
- Mon, 10 Nov 2014 01:24:21 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Transfer-Encoding:
|
32
|
+
- chunked
|
33
|
+
Connection:
|
34
|
+
- keep-alive
|
35
|
+
Set-Cookie:
|
36
|
+
- __cfduid=dd2fb220cc590a1eb7c152aae6cfb7e8f1415582661858; expires=Mon, 23-Dec-2019
|
37
|
+
23:50:00 GMT; path=/; domain=.digitalocean.com; HttpOnly
|
38
|
+
Status:
|
39
|
+
- 200 OK
|
40
|
+
X-Frame-Options:
|
41
|
+
- SAMEORIGIN
|
42
|
+
X-Xss-Protection:
|
43
|
+
- 1; mode=block
|
44
|
+
X-Content-Type-Options:
|
45
|
+
- nosniff
|
46
|
+
Ratelimit-Limit:
|
47
|
+
- '1200'
|
48
|
+
Ratelimit-Remaining:
|
49
|
+
- '1186'
|
50
|
+
Ratelimit-Reset:
|
51
|
+
- '1415584036'
|
52
|
+
Cache-Control:
|
53
|
+
- max-age=0, private, must-revalidate
|
54
|
+
X-Request-Id:
|
55
|
+
- e51b841b-035f-4741-af11-aab7e4bc1acd
|
56
|
+
X-Runtime:
|
57
|
+
- '0.034502'
|
58
|
+
Cf-Ray:
|
59
|
+
- 186e7334998b0ecd-EWR
|
60
|
+
body:
|
61
|
+
encoding: UTF-8
|
62
|
+
string: '{"sizes":[{"slug":"512mb","memory":512,"vcpus":1,"disk":20,"transfer":1.0,"price_monthly":5.0,"price_hourly":0.00744,"regions":["nyc1","sgp1","ams1","ams2","sfo1","nyc2","lon1","nyc3","ams3"]},{"slug":"1gb","memory":1024,"vcpus":1,"disk":30,"transfer":2.0,"price_monthly":10.0,"price_hourly":0.01488,"regions":["nyc2","sgp1","ams1","sfo1","lon1","nyc3","ams3","ams2","nyc1"]},{"slug":"2gb","memory":2048,"vcpus":2,"disk":40,"transfer":3.0,"price_monthly":20.0,"price_hourly":0.02976,"regions":["nyc2","sfo1","ams1","sgp1","ams2","lon1","nyc3","ams3","nyc1"]},{"slug":"4gb","memory":4096,"vcpus":2,"disk":60,"transfer":4.0,"price_monthly":40.0,"price_hourly":0.05952,"regions":["nyc2","sfo1","ams1","sgp1","ams2","lon1","nyc3","ams3","nyc1"]},{"slug":"8gb","memory":8192,"vcpus":4,"disk":80,"transfer":5.0,"price_monthly":80.0,"price_hourly":0.11905,"regions":["nyc2","sfo1","sgp1","ams1","ams2","nyc1","lon1","nyc3","ams3"]},{"slug":"16gb","memory":16384,"vcpus":8,"disk":160,"transfer":6.0,"price_monthly":160.0,"price_hourly":0.2381,"regions":["sgp1","nyc1","sfo1","ams2","nyc3","lon1","nyc2","ams1","ams3"]},{"slug":"32gb","memory":32768,"vcpus":12,"disk":320,"transfer":7.0,"price_monthly":320.0,"price_hourly":0.47619,"regions":["nyc2","sgp1","ams2","nyc1","sfo1","lon1","ams3","nyc3"]},{"slug":"48gb","memory":49152,"vcpus":16,"disk":480,"transfer":8.0,"price_monthly":480.0,"price_hourly":0.71429,"regions":["sgp1","ams2","sfo1","nyc1","lon1","nyc2","ams3","nyc3"]},{"slug":"64gb","memory":65536,"vcpus":20,"disk":640,"transfer":9.0,"price_monthly":640.0,"price_hourly":0.95238,"regions":["sgp1","nyc1","nyc2","sfo1","lon1","ams3","ams2","nyc3"]}],"links":{},"meta":{"total":9}}'
|
63
|
+
http_version:
|
64
|
+
recorded_at: Mon, 10 Nov 2014 01:24:21 GMT
|
65
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,67 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.digitalocean.com/v2/account/keys
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
Authorization:
|
13
|
+
- Bearer FAKE_ACCESS_TOKEN
|
14
|
+
User-Agent:
|
15
|
+
- Faraday v0.9.0
|
16
|
+
Accept-Encoding:
|
17
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
18
|
+
Accept:
|
19
|
+
- "*/*"
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- cloudflare-nginx
|
27
|
+
Date:
|
28
|
+
- Mon, 10 Nov 2014 02:04:36 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Transfer-Encoding:
|
32
|
+
- chunked
|
33
|
+
Connection:
|
34
|
+
- keep-alive
|
35
|
+
Set-Cookie:
|
36
|
+
- __cfduid=d4428f6ec41d83ee8c8696f777e2b3b601415585076141; expires=Mon, 23-Dec-2019
|
37
|
+
23:50:00 GMT; path=/; domain=.digitalocean.com; HttpOnly
|
38
|
+
Status:
|
39
|
+
- 200 OK
|
40
|
+
X-Frame-Options:
|
41
|
+
- SAMEORIGIN
|
42
|
+
X-Xss-Protection:
|
43
|
+
- 1; mode=block
|
44
|
+
X-Content-Type-Options:
|
45
|
+
- nosniff
|
46
|
+
Ratelimit-Limit:
|
47
|
+
- '1200'
|
48
|
+
Ratelimit-Remaining:
|
49
|
+
- '1185'
|
50
|
+
Ratelimit-Reset:
|
51
|
+
- '1415584945'
|
52
|
+
Cache-Control:
|
53
|
+
- max-age=0, private, must-revalidate
|
54
|
+
X-Request-Id:
|
55
|
+
- 40c86c6c-4d40-46b2-83c6-3cba42230153
|
56
|
+
X-Runtime:
|
57
|
+
- '0.032191'
|
58
|
+
Cf-Ray:
|
59
|
+
- 186eae25ebeb0ecd-EWR
|
60
|
+
body:
|
61
|
+
encoding: UTF-8
|
62
|
+
string: '{"ssh_keys":[{"id":42795,"fingerprint":"e0:1a:1b:30:7f:bd:b2:cf:d2:3f:3b:35:07:77:46:1c","public_key":"ssh-rsa
|
63
|
+
AAAAB3NzaC1yc2EAAAADAQABAAABAQDAu9RilgAABwriIMucsw8WqjVorUaIkLB/ge7qs3nrpCf+5x7Nb7LDeg7IYSVVSBkQ6soxcCg+7h45yOykQieXKuzHENCMQ4rrY0n3YPaADf+I4cIIFu3Wf54jELdkIHIo7CR0XOTAjgWmDFhKYDeQayE7TWkYEfV2JN+9W7MdwSd35Eq7eFrZ4iU/kv7ipxy4O6Se/7yoFynvPwr10cffqfkQz2+Vt/O/iUU0dXMTzSjQQteREu2JzfkOHtvJ2xT9KMW8d/I1rFuVHRfXup3m3tgi+aPFwplGfZLsMJY7EFCQdttmEcvlje065l3SnQXNrkX/Uzh3Sm1Z1HSUSyAR
|
64
|
+
gregf@jerk","name":"gregf"}],"links":{},"meta":{"total":1}}'
|
65
|
+
http_version:
|
66
|
+
recorded_at: Mon, 10 Nov 2014 02:04:36 GMT
|
67
|
+
recorded_with: VCR 2.9.3
|
@@ -1,5 +1,38 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Chef::Knife::DigitalOceanDropletList do
|
4
|
-
|
4
|
+
|
5
|
+
subject { Chef::Knife::DigitalOceanDropletList.new }
|
6
|
+
|
7
|
+
let(:access_token) { ENV['DIGITALOCEAN_ACCESS_TOKEN'] }
|
8
|
+
|
9
|
+
before :each do
|
10
|
+
Chef::Knife::DigitalOceanDropletList.load_deps
|
11
|
+
Chef::Config['knife']['digital_ocean_access_token'] = access_token
|
12
|
+
Chef::Config['knife']['public_droplets'] = true
|
13
|
+
allow(subject).to receive(:puts)
|
14
|
+
end
|
15
|
+
|
16
|
+
describe "#run" do
|
17
|
+
it "should validate the Digital Ocean config keys exist" do
|
18
|
+
VCR.use_cassette('droplet') do
|
19
|
+
expect(subject).to receive(:validate!)
|
20
|
+
subject.run
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should output the column headers" do
|
25
|
+
VCR.use_cassette('droplet') do
|
26
|
+
expect(subject).to receive(:puts).with(/^ID\s+Name\s+Size\s+Region\s+IPv4\s+Image\s+Status\n/)
|
27
|
+
subject.run
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should output a list of the available Digital Ocean Droplets" do
|
32
|
+
VCR.use_cassette('droplet') do
|
33
|
+
expect(subject).to receive(:puts).with(/\b2257086\b/)
|
34
|
+
subject.run
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
5
38
|
end
|
@@ -1,5 +1,38 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Chef::Knife::DigitalOceanImageList do
|
4
|
-
|
4
|
+
|
5
|
+
subject { Chef::Knife::DigitalOceanImageList.new }
|
6
|
+
|
7
|
+
let(:access_token) { ENV['DIGITALOCEAN_ACCESS_TOKEN'] }
|
8
|
+
|
9
|
+
before :each do
|
10
|
+
Chef::Knife::DigitalOceanImageList.load_deps
|
11
|
+
Chef::Config['knife']['digital_ocean_access_token'] = access_token
|
12
|
+
Chef::Config['knife']['public_images'] = true
|
13
|
+
allow(subject).to receive(:puts)
|
14
|
+
end
|
15
|
+
|
16
|
+
describe "#run" do
|
17
|
+
it "should validate the Digital Ocean config keys exist" do
|
18
|
+
VCR.use_cassette('image') do
|
19
|
+
expect(subject).to receive(:validate!)
|
20
|
+
subject.run
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should output the column headers" do
|
25
|
+
VCR.use_cassette('image') do
|
26
|
+
expect(subject).to receive(:puts).with(/^ID\s+Distribution\s+Name\s+Slug\n/)
|
27
|
+
subject.run
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should output a list of the available Digital Ocean Images" do
|
32
|
+
VCR.use_cassette('image') do
|
33
|
+
expect(subject).to receive(:puts).with(/\b7753256\s+Debian\s+test-snapshot\s+\n/)
|
34
|
+
subject.run
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
5
38
|
end
|
@@ -1,5 +1,40 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Chef::Knife::DigitalOceanRegionList do
|
4
|
-
|
4
|
+
|
5
|
+
subject do
|
6
|
+
s = Chef::Knife::DigitalOceanRegionList.new
|
7
|
+
s
|
8
|
+
end
|
9
|
+
|
10
|
+
let(:access_token) { ENV['DIGITALOCEAN_ACCESS_TOKEN'] }
|
11
|
+
|
12
|
+
before :each do
|
13
|
+
Chef::Knife::DigitalOceanRegionList.load_deps
|
14
|
+
Chef::Config['knife']['digital_ocean_access_token'] = access_token
|
15
|
+
allow(subject).to receive(:puts)
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "#run" do
|
19
|
+
it "should validate the Digital Ocean config keys exist" do
|
20
|
+
VCR.use_cassette('region') do
|
21
|
+
expect(subject).to receive(:validate!)
|
22
|
+
subject.run
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should output the column headers" do
|
27
|
+
VCR.use_cassette('region') do
|
28
|
+
expect(subject).to receive(:puts).with(/^Name\s+Slug\n/)
|
29
|
+
subject.run
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should output a list of the available Digital Ocean flavors" do
|
34
|
+
VCR.use_cassette('region') do
|
35
|
+
expect(subject).to receive(:puts).with(/\bNew York 1\b/)
|
36
|
+
subject.run
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
5
40
|
end
|
@@ -1,5 +1,40 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Chef::Knife::DigitalOceanSizeList do
|
4
|
-
|
4
|
+
|
5
|
+
subject do
|
6
|
+
s = Chef::Knife::DigitalOceanSizeList.new
|
7
|
+
s
|
8
|
+
end
|
9
|
+
|
10
|
+
let(:access_token) { ENV['DIGITALOCEAN_ACCESS_TOKEN'] }
|
11
|
+
|
12
|
+
before :each do
|
13
|
+
Chef::Knife::DigitalOceanSizeList.load_deps
|
14
|
+
Chef::Config['knife']['digital_ocean_access_token'] = access_token
|
15
|
+
allow(subject).to receive(:puts)
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "#run" do
|
19
|
+
it "should validate the Digital Ocean config keys exist" do
|
20
|
+
VCR.use_cassette('sizes') do
|
21
|
+
expect(subject).to receive(:validate!)
|
22
|
+
subject.run
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should output the column headers" do
|
27
|
+
VCR.use_cassette('sizes') do
|
28
|
+
expect(subject).to receive(:puts).with(/^Slug \n/)
|
29
|
+
subject.run
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should output a list of the available Digital Ocean sizes" do
|
34
|
+
VCR.use_cassette('sizes') do
|
35
|
+
expect(subject).to receive(:puts).with(/\b512mb\b/)
|
36
|
+
subject.run
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
5
40
|
end
|
@@ -1,5 +1,40 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Chef::Knife::DigitalOceanSshkeyList do
|
4
|
-
|
4
|
+
|
5
|
+
subject do
|
6
|
+
s = Chef::Knife::DigitalOceanSshkeyList.new
|
7
|
+
s
|
8
|
+
end
|
9
|
+
|
10
|
+
let(:access_token) { ENV['DIGITALOCEAN_ACCESS_TOKEN'] }
|
11
|
+
|
12
|
+
before :each do
|
13
|
+
Chef::Knife::DigitalOceanSshkeyList.load_deps
|
14
|
+
Chef::Config['knife']['digital_ocean_access_token'] = access_token
|
15
|
+
allow(subject).to receive(:puts)
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "#run" do
|
19
|
+
it "should validate the Digital Ocean config keys exist" do
|
20
|
+
VCR.use_cassette('sshkey') do
|
21
|
+
expect(subject).to receive(:validate!)
|
22
|
+
subject.run
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should output the column headers" do
|
27
|
+
VCR.use_cassette('sshkey') do
|
28
|
+
expect(subject).to receive(:puts).with(/^ID\s+Name\s+Fingerprint\s+\n/)
|
29
|
+
subject.run
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should output a list of the available Digital Ocean ssh keys" do
|
34
|
+
VCR.use_cassette('sshkey') do
|
35
|
+
expect(subject).to receive(:puts).with(/\bgregf\b/)
|
36
|
+
subject.run
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
5
40
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
2
2
|
require 'droplet_kit'
|
3
3
|
require 'hashie'
|
4
|
+
require 'vcr'
|
4
5
|
|
5
6
|
require 'chef/knife'
|
6
7
|
require 'chef/knife/digital_ocean_droplet_create'
|
@@ -12,3 +13,9 @@ require 'chef/knife/digital_ocean_size_list'
|
|
12
13
|
require 'chef/knife/digital_ocean_sshkey_list'
|
13
14
|
|
14
15
|
Dir['./spec/support/**/*.rb'].sort.each { |f| require f }
|
16
|
+
|
17
|
+
VCR.configure do |c|
|
18
|
+
c.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
|
19
|
+
c.hook_into :webmock
|
20
|
+
c.filter_sensitive_data('FAKE_ACCESS_TOKEN') { ENV['DIGITALOCEAN_ACCESS_TOKEN'] }
|
21
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-digital_ocean
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roland Moriz
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-11-
|
12
|
+
date: 2014-11-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: chef
|
@@ -95,6 +95,34 @@ dependencies:
|
|
95
95
|
- - ">="
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: webmock
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - "~>"
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '1.20'
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - "~>"
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '1.20'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: vcr
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - "~>"
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '2.9'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - "~>"
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '2.9'
|
98
126
|
description: A plugin for chef's knife to manage instances of DigitalOcean servers
|
99
127
|
email:
|
100
128
|
- roland@moriz.de
|
@@ -122,6 +150,11 @@ files:
|
|
122
150
|
- lib/chef/knife/digital_ocean_sshkey_list.rb
|
123
151
|
- lib/knife-digital_ocean.rb
|
124
152
|
- lib/knife-digital_ocean/version.rb
|
153
|
+
- spec/fixtures/vcr_cassettes/droplet.yml
|
154
|
+
- spec/fixtures/vcr_cassettes/image.yml
|
155
|
+
- spec/fixtures/vcr_cassettes/region.yml
|
156
|
+
- spec/fixtures/vcr_cassettes/sizes.yml
|
157
|
+
- spec/fixtures/vcr_cassettes/sshkey.yml
|
125
158
|
- spec/lib/chef/knife/digital_ocean_droplet_create_spec.rb
|
126
159
|
- spec/lib/chef/knife/digital_ocean_droplet_destroy_spec.rb
|
127
160
|
- spec/lib/chef/knife/digital_ocean_droplet_list_spec.rb
|
@@ -156,6 +189,11 @@ signing_key:
|
|
156
189
|
specification_version: 4
|
157
190
|
summary: A plugin for chef's knife to manage instances of DigitalOcean servers
|
158
191
|
test_files:
|
192
|
+
- spec/fixtures/vcr_cassettes/droplet.yml
|
193
|
+
- spec/fixtures/vcr_cassettes/image.yml
|
194
|
+
- spec/fixtures/vcr_cassettes/region.yml
|
195
|
+
- spec/fixtures/vcr_cassettes/sizes.yml
|
196
|
+
- spec/fixtures/vcr_cassettes/sshkey.yml
|
159
197
|
- spec/lib/chef/knife/digital_ocean_droplet_create_spec.rb
|
160
198
|
- spec/lib/chef/knife/digital_ocean_droplet_destroy_spec.rb
|
161
199
|
- spec/lib/chef/knife/digital_ocean_droplet_list_spec.rb
|