fog-digitalocean 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/fog-digitalocean.gemspec +1 -1
  4. data/lib/fog/digitalocean/requests/compute/change_kernel.rb +1 -1
  5. data/lib/fog/digitalocean/requests/compute/convert_to_snapshot.rb +2 -2
  6. data/lib/fog/digitalocean/requests/compute/detach_volume.rb +4 -4
  7. data/lib/fog/digitalocean/requests/compute/disable_backups.rb +1 -1
  8. data/lib/fog/digitalocean/requests/compute/enable_ipv6.rb +1 -1
  9. data/lib/fog/digitalocean/requests/compute/enable_private_networking.rb +1 -1
  10. data/lib/fog/digitalocean/requests/compute/get_droplet_action.rb +1 -1
  11. data/lib/fog/digitalocean/requests/compute/get_image_details.rb +23 -17
  12. data/lib/fog/digitalocean/requests/compute/list_droplet_actions.rb +1 -1
  13. data/lib/fog/digitalocean/requests/compute/list_images.rb +4 -2
  14. data/lib/fog/digitalocean/requests/compute/list_volume_actions.rb +1 -1
  15. data/lib/fog/digitalocean/requests/compute/password_reset.rb +1 -1
  16. data/lib/fog/digitalocean/requests/compute/power_cycle.rb +1 -1
  17. data/lib/fog/digitalocean/requests/compute/power_off.rb +1 -1
  18. data/lib/fog/digitalocean/requests/compute/power_on.rb +1 -1
  19. data/lib/fog/digitalocean/requests/compute/reboot_server.rb +1 -1
  20. data/lib/fog/digitalocean/requests/compute/rebuild.rb +1 -1
  21. data/lib/fog/digitalocean/requests/compute/rename.rb +1 -1
  22. data/lib/fog/digitalocean/requests/compute/resize.rb +1 -1
  23. data/lib/fog/digitalocean/requests/compute/resize_volume.rb +1 -1
  24. data/lib/fog/digitalocean/requests/compute/restore.rb +1 -1
  25. data/lib/fog/digitalocean/requests/compute/shutdown.rb +1 -1
  26. data/lib/fog/digitalocean/requests/compute/snapshot.rb +1 -1
  27. data/lib/fog/digitalocean/requests/compute/transfer_image.rb +1 -1
  28. data/lib/fog/digitalocean/requests/compute/upgrade.rb +1 -1
  29. data/lib/fog/digitalocean/version.rb +1 -1
  30. metadata +3 -5
  31. data/bin/fog +0 -78
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 513a6875f022151b9545f3b3f4d7fe8236ce6508
4
- data.tar.gz: 434ba36da2d1b3c13afdec9357e7268f46be641a
3
+ metadata.gz: 963a92d0264581f90db0dde01e2993275d87f62c
4
+ data.tar.gz: 0b829c4fe8e3e33dc0b9f3e4985b552f3013d6cf
5
5
  SHA512:
6
- metadata.gz: e7a0835e58e814fcb07ad1c80f5accf14f8ec62c6365c64616e0524e6d7e06b6aa1f745b8528a09b7bf97d00a4859330b8c6c8f42393c4086126440f8a0a3d75
7
- data.tar.gz: 30a58ff8c614d0c3d25a282be35d054cea85bb55ae17a8bcc3f114b886036e630bb464f166de39be3cabbd59e90fc060d7a161a018e5f5a3dda2474b3126de54
6
+ metadata.gz: 1e13717d588275a66606e21fe4f4bfceac858a2d956c72fac43e461f380ad196fa11c1c56968196dae5f26854618876bc9c900eab38955f3fe0f01d9e7aa01bb
7
+ data.tar.gz: 3aa26606dd654a3b677a6da21f489ede3129617b46ee5738bc75df687fc05705b624a3b866067fb494b9f7d77ff278785965f17e05bc2f3908aa5caa8fc9db9a
@@ -2,6 +2,12 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+ ## [0.3.0] - 2017-03-13
6
+ ### Fixed
7
+ - Removed binary (conflicts with fog/fog, may need alternate solution)
8
+ - fix get_image_details mock
9
+ - fix pagination in list_images mock
10
+
5
11
  ## [0.2.0] - 2016-09-28
6
12
  ### Added
7
13
  - Volume Support
@@ -36,7 +36,7 @@ Gem::Specification.new do |s|
36
36
  s.require_paths = %w[lib]
37
37
 
38
38
  ## If your gem includes any executables, list them here.
39
- s.executables = ["fog"]
39
+ #s.executables = ["fog"]
40
40
 
41
41
  ## Specify any RDoc options here. You'll want to add your README and
42
42
  ## LICENSE files to the extra_rdoc_files list.
@@ -29,7 +29,7 @@ module Fog
29
29
  'status' => "in-progress",
30
30
  'type' => "change_kernel",
31
31
  'started_at' => "2014-11-14T16:31:00Z",
32
- 'completed_at' => null,
32
+ 'completed_at' => nil,
33
33
  'resource_id' => id,
34
34
  'resource_type' => "droplet",
35
35
  'region' => "nyc3",
@@ -32,8 +32,8 @@ module Fog
32
32
  'completed_at' => '2015-03-24T19:02:47Z',
33
33
  'resource_id' => 11060029,
34
34
  'resource_type' => 'image',
35
- 'region' => null,
36
- 'region_slug' => null
35
+ 'region' => nil,
36
+ 'region_slug' => nil
37
37
  }
38
38
  }
39
39
  response
@@ -44,8 +44,8 @@ module Fog
44
44
  "status" => "in-progress",
45
45
  "type" => "detach_volume",
46
46
  "started_at" => "2015-10-15T17:46:15Z",
47
- "completed_at" => null,
48
- "resource_id" => null,
47
+ "completed_at" => nil,
48
+ "resource_id" => nil,
49
49
  "resource_type" => "backend",
50
50
  "region" => {
51
51
  "name" => "New York 1",
@@ -84,8 +84,8 @@ module Fog
84
84
  "status" => "in-progress",
85
85
  "type" => "detach_volume",
86
86
  "started_at" => "2015-10-15T17:46:15Z",
87
- "completed_at" => null,
88
- "resource_id" => null,
87
+ "completed_at" => nil,
88
+ "resource_id" => nil,
89
89
  "resource_type" => "backend",
90
90
  "region" => {
91
91
  "name" => "New York 1",
@@ -29,7 +29,7 @@ module Fog
29
29
  'status' => "in-progress",
30
30
  'type' => "disable_backups",
31
31
  'started_at' => "2014-11-14T16:31:00Z",
32
- 'completed_at' => null,
32
+ 'completed_at' => nil,
33
33
  'resource_id' => id,
34
34
  'resource_type' => "droplet",
35
35
  'region' => "nyc3",
@@ -29,7 +29,7 @@ module Fog
29
29
  'status' => "in-progress",
30
30
  'type' => "enable_ipv6",
31
31
  'started_at' => "2014-11-14T16:31:00Z",
32
- 'completed_at' => null,
32
+ 'completed_at' => nil,
33
33
  'resource_id' => id,
34
34
  'resource_type' => "droplet",
35
35
  'region' => "nyc3",
@@ -29,7 +29,7 @@ module Fog
29
29
  'status' => "in-progress",
30
30
  'type' => "enable_private_networking",
31
31
  'started_at' => "2014-11-14T16:31:00Z",
32
- 'completed_at' => null,
32
+ 'completed_at' => nil,
33
33
  'resource_id' => id,
34
34
  'resource_type' => "droplet",
35
35
  'region' => "nyc3",
@@ -21,7 +21,7 @@ module Fog
21
21
  'status' => "in-progress",
22
22
  'type' => "change_kernel",
23
23
  'started_at' => "2014-11-14T16:31:00Z",
24
- 'completed_at' => null,
24
+ 'completed_at' => nil,
25
25
  'resource_id' => id,
26
26
  'resource_type' => "droplet",
27
27
  'region' => "nyc3",
@@ -13,26 +13,32 @@ module Fog
13
13
 
14
14
  # noinspection RubyStringKeysInHashInspection
15
15
  class Mock
16
- def get_image_details(_)
16
+ def get_image_details(id_or_slug)
17
17
  response = Excon::Response.new
18
- response.status = 200
19
18
 
20
- response.body = {
21
- 'image' =>
22
- {
23
- 'id' => 7555620,
24
- 'name' => 'Nifty New Snapshot',
25
- 'distribution' => 'Ubuntu',
26
- 'slug' => null,
27
- 'public' => false,
28
- 'regions' => [
29
- 'nyc2',
30
- 'nyc2'
31
- ],
32
- 'created_at' => '2014-11-04T22:23:02Z',
33
- 'min_disk_size' => 20
19
+ if [7555620, 'nifty-new-snapshot-ubuntu'].include?(id_or_slug)
20
+ response.status = 200
21
+
22
+ response.body = {
23
+ 'image' =>
24
+ {
25
+ 'id' => 7555620,
26
+ 'name' => 'Nifty New Snapshot',
27
+ 'distribution' => 'Ubuntu',
28
+ 'slug' => 'nifty-new-snapshot-ubuntu',
29
+ 'public' => false,
30
+ 'regions' => [
31
+ 'nyc2',
32
+ 'nyc2'
33
+ ],
34
+ 'created_at' => '2014-11-04T22:23:02Z',
35
+ 'min_disk_size' => 20
36
+ }
34
37
  }
35
- }
38
+ else
39
+ response.status = 404
40
+ raise(Fog::Compute::DigitalOcean::NotFound.new("Expected([200]) <=> Actual(404 Not Found)"))
41
+ end
36
42
 
37
43
  response
38
44
  end
@@ -22,7 +22,7 @@ module Fog
22
22
  'status' => "in-progress",
23
23
  'type' => "change_kernel",
24
24
  'started_at' => "2014-11-14T16:31:00Z",
25
- 'completed_at' => null,
25
+ 'completed_at' => nil,
26
26
  'resource_id' => id,
27
27
  'resource_type' => "droplet",
28
28
  'region' => "nyc3",
@@ -15,6 +15,8 @@ module Fog
15
15
  # noinspection RubyStringKeysInHashInspection
16
16
  class Mock
17
17
  def list_images(filters = {})
18
+ next_page = (filters[:page] || 1).to_i + 1
19
+
18
20
  response = Excon::Response.new
19
21
  response.status = 200
20
22
  response.body = {
@@ -24,7 +26,7 @@ module Fog
24
26
  'id' => 7555620,
25
27
  'name' => 'Nifty New Snapshot',
26
28
  'distribution' => 'Ubuntu',
27
- 'slug' => nil,
29
+ 'slug' => 'nifty-new-snapshot-ubuntu',
28
30
  'public' => false,
29
31
  'regions' => %w(nyc2 nyc3),
30
32
  'created_at' => '2014-11-04T22:23:02Z',
@@ -35,7 +37,7 @@ module Fog
35
37
  'links' => {
36
38
  'pages' => {
37
39
  'last' => 'https://api.digitalocean.com/v2/images?page=56&per_page=1',
38
- 'next' => 'https://api.digitalocean.com/v2/images?page=2&per_page=1'
40
+ 'next' => "https://api.digitalocean.com/v2/images?page=#{next_page}&per_page=1"
39
41
  }
40
42
  },
41
43
  'meta' => {
@@ -23,7 +23,7 @@ module Fog
23
23
  "type" => "attach_volume",
24
24
  "started_at" => "2015-11-21T21:51:09Z",
25
25
  "completed_at" => "2015-11-21T21:51:09Z",
26
- "resource_id" => null,
26
+ "resource_id" => nil,
27
27
  "resource_type" => "volume",
28
28
  "region" => {
29
29
  "name" => "New York 1",
@@ -29,7 +29,7 @@ module Fog
29
29
  'status' => "in-progress",
30
30
  'type' => "password_reset",
31
31
  'started_at' => "2014-11-14T16:31:00Z",
32
- 'completed_at' => null,
32
+ 'completed_at' => nil,
33
33
  'resource_id' => id,
34
34
  'resource_type' => "droplet",
35
35
  'region' => "nyc3",
@@ -29,7 +29,7 @@ module Fog
29
29
  'status' => "in-progress",
30
30
  'type' => "power_cycle",
31
31
  'started_at' => "2014-11-14T16:31:00Z",
32
- 'completed_at' => null,
32
+ 'completed_at' => nil,
33
33
  'resource_id' => id,
34
34
  'resource_type' => "droplet",
35
35
  'region' => "nyc3",
@@ -29,7 +29,7 @@ module Fog
29
29
  'status' => "in-progress",
30
30
  'type' => "power_off",
31
31
  'started_at' => "2014-11-14T16:31:00Z",
32
- 'completed_at' => null,
32
+ 'completed_at' => nil,
33
33
  'resource_id' => id,
34
34
  'resource_type' => "droplet",
35
35
  'region' => "nyc3",
@@ -29,7 +29,7 @@ module Fog
29
29
  'status' => "in-progress",
30
30
  'type' => "power_on",
31
31
  'started_at' => "2014-11-14T16:31:00Z",
32
- 'completed_at' => null,
32
+ 'completed_at' => nil,
33
33
  'resource_id' => id,
34
34
  'resource_type' => "droplet",
35
35
  'region' => "nyc3",
@@ -29,7 +29,7 @@ module Fog
29
29
  'status' => "in-progress",
30
30
  'type' => "reboot",
31
31
  'started_at' => "2014-11-14T16:31:00Z",
32
- 'completed_at' => null,
32
+ 'completed_at' => nil,
33
33
  'resource_id' => id,
34
34
  'resource_type' => "droplet",
35
35
  'region' => "nyc3",
@@ -29,7 +29,7 @@ module Fog
29
29
  'status' => "in-progress",
30
30
  'type' => "rebuild",
31
31
  'started_at' => "2014-11-14T16:31:00Z",
32
- 'completed_at' => null,
32
+ 'completed_at' => nil,
33
33
  'resource_id' => id,
34
34
  'resource_type' => "droplet",
35
35
  'region' => "nyc3",
@@ -29,7 +29,7 @@ module Fog
29
29
  'status' => "in-progress",
30
30
  'type' => "rename",
31
31
  'started_at' => "2014-11-14T16:31:00Z",
32
- 'completed_at' => null,
32
+ 'completed_at' => nil,
33
33
  'resource_id' => id,
34
34
  'resource_type' => "droplet",
35
35
  'region' => "nyc3",
@@ -33,7 +33,7 @@ module Fog
33
33
  'status' => "in-progress",
34
34
  'type' => "resize",
35
35
  'started_at' => "2014-11-14T16:31:00Z",
36
- 'completed_at' => null,
36
+ 'completed_at' => nil,
37
37
  'resource_id' => id,
38
38
  'resource_type' => "droplet",
39
39
  'region' => "nyc3",
@@ -30,7 +30,7 @@ module Fog
30
30
  "type" => "resize",
31
31
  "started_at" => "2015-11-12T17:51:03Z",
32
32
  "completed_at" => "2015-11-12T17:51:14Z",
33
- "resource_id" => null,
33
+ "resource_id" => nil,
34
34
  "resource_type" => "volume",
35
35
  "region" => {
36
36
  "name" => "New York 1",
@@ -29,7 +29,7 @@ module Fog
29
29
  'status' => "in-progress",
30
30
  'type' => "restore",
31
31
  'started_at' => "2014-11-14T16:31:00Z",
32
- 'completed_at' => null,
32
+ 'completed_at' => nil,
33
33
  'resource_id' => id,
34
34
  'resource_type' => "droplet",
35
35
  'region' => "nyc3",
@@ -29,7 +29,7 @@ module Fog
29
29
  'status' => "in-progress",
30
30
  'type' => "shutdown",
31
31
  'started_at' => "2014-11-14T16:31:00Z",
32
- 'completed_at' => null,
32
+ 'completed_at' => nil,
33
33
  'resource_id' => id,
34
34
  'resource_type' => "droplet",
35
35
  'region' => "nyc3",
@@ -29,7 +29,7 @@ module Fog
29
29
  'status' => "in-progress",
30
30
  'type' => "snapshot",
31
31
  'started_at' => "2014-11-14T16:31:00Z",
32
- 'completed_at' => null,
32
+ 'completed_at' => nil,
33
33
  'resource_id' => id,
34
34
  'resource_type' => "droplet",
35
35
  'region' => "nyc3",
@@ -29,7 +29,7 @@ module Fog
29
29
  'status' => 'in-progress',
30
30
  'type' => 'transfer',
31
31
  'started_at' => '2014-11-14T16:42:45Z',
32
- 'completed_at' => null,
32
+ 'completed_at' => nil,
33
33
  'resource_id' => 7938269,
34
34
  'resource_type' => 'image',
35
35
  'region' => 'nyc3',
@@ -29,7 +29,7 @@ module Fog
29
29
  'status' => "in-progress",
30
30
  'type' => "upgrade",
31
31
  'started_at' => "2014-11-14T16:31:00Z",
32
- 'completed_at' => null,
32
+ 'completed_at' => nil,
33
33
  'resource_id' => id,
34
34
  'resource_type' => "droplet",
35
35
  'region' => "nyc3",
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Digitalocean
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-digitalocean
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JJ Asghar
@@ -169,8 +169,7 @@ description: DigitalOcean fog provider gem
169
169
  email:
170
170
  - jj@chef.io
171
171
  - surajshirvankar@gmail.com
172
- executables:
173
- - fog
172
+ executables: []
174
173
  extensions: []
175
174
  extra_rdoc_files:
176
175
  - README.md
@@ -190,7 +189,6 @@ files:
190
189
  - README.md
191
190
  - RELEASE.md
192
191
  - Rakefile
193
- - bin/fog
194
192
  - fog-digitalocean.gemspec
195
193
  - gemfiles/Gemfile-edge
196
194
  - lib/fog/bin/digitalocean.rb
@@ -291,7 +289,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
291
289
  version: '0'
292
290
  requirements: []
293
291
  rubyforge_project:
294
- rubygems_version: 2.4.5.1
292
+ rubygems_version: 2.5.1
295
293
  signing_key:
296
294
  specification_version: 2
297
295
  summary: DigitalOcean fog provider gem
data/bin/fog DELETED
@@ -1,78 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'fog'))
4
- require 'optparse'
5
- require 'irb'
6
- require 'yaml'
7
-
8
- options = OptionParser.new do |opts|
9
- opts.banner = 'usage: fog [options] CREDENTIAL'
10
-
11
- opts.on('-C', '--credentials-path FILE', 'Path to the credentials file') do |file|
12
- Fog.credentials_path = file
13
- end
14
-
15
- opts.on_tail('-v', '--version', 'Prints the version') do
16
- puts Fog::VERSION
17
- exit
18
- end
19
-
20
- opts.on_tail('-h', '--help', 'Prints this message') do
21
- puts opts
22
- exit
23
- end
24
- end
25
- options.parse!
26
-
27
- Fog.credential = ARGV.first ? ARGV.first.to_sym : nil
28
- Fog.mock! if ENV['FOG_MOCK']
29
- if Fog.credentials.empty?
30
- begin
31
- Fog::Errors.missing_credentials
32
- rescue Fog::Errors::LoadError => error
33
- abort error.message
34
- end
35
- end
36
-
37
- require 'fog/bin'
38
-
39
- providers = Fog.available_providers
40
- providers = if providers.length > 1
41
- providers[0...-1].join(', ') << ' and ' << providers[-1]
42
- else
43
- providers.first
44
- end
45
-
46
- if ARGV.length > 1
47
-
48
- result = instance_eval(ARGV[1..-1].join(' '))
49
- puts(Fog::JSON.encode(result))
50
-
51
- else
52
-
53
- ARGV.clear # Avoid passing args to IRB
54
- IRB.setup(nil)
55
- @irb = IRB::Irb.new(nil)
56
- IRB.conf[:MAIN_CONTEXT] = @irb.context
57
- IRB.conf[:PROMPT][:FOG] = IRB.conf[:PROMPT][:SIMPLE].dup
58
- IRB.conf[:PROMPT][:FOG][:RETURN] = "%s\n"
59
- @irb.context.prompt_mode = :FOG
60
- @irb.context.workspace = IRB::WorkSpace.new(binding)
61
-
62
- trap 'INT' do
63
- @irb.signal_handle
64
- end
65
-
66
- Fog::Formatador.display_line('Welcome to fog interactive!')
67
- Fog::Formatador.display_line(":#{Fog.credential} provides #{providers}")
68
- providers = Fog.providers
69
-
70
- # FIXME: hacks until we can `include Fog` in bin
71
- CDN = Fog::CDN
72
- Compute = Fog::Compute
73
- DNS = Fog::DNS
74
- Storage = Fog::Storage
75
-
76
- catch(:IRB_EXIT) { @irb.eval_input }
77
-
78
- end