fog-fifo 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 36b4e9f87e2cdc5911f01bf44a857b45c9813c4f
4
- data.tar.gz: e31dee1fa24928a148d47fb9cedc1a7253917dc5
3
+ metadata.gz: b2de723d0d14e0215b68bc3cb6813019404b5cce
4
+ data.tar.gz: d38aeceec77c764411c6d64a7cb825f711850fef
5
5
  SHA512:
6
- metadata.gz: db94411dd1046cca9039ed96bcd8ab40b3c340736a3f447c70ceec2d8dc606f96659e6597648f17bd7b938b925a8fbf569fa789607731d8bbec25670d50cc587
7
- data.tar.gz: 0135958f45ee3760ea5e53823ce35768f2033a4ce49ba28ab4ebb32bab65644cfd76854cd5a4e48b9f840570014a9a94d524011ca958c3cbd580a4bd0ab04e33
6
+ metadata.gz: fb2e725d9b844d02a4df5f36eeab954eb65bcb1bd333ff02509af4cd69e76d9637a8e5a1674c68f5f6f0d59cba63c32b9194f118db820cb2cca3d1089cb5948b
7
+ data.tar.gz: 4cd8b8f209f123b8565b8c2d74b885951b25f387092be5f39403bb2d7c54860accb604be302fb86e75cf962ca9884a6af18d9aedd02b38ddd5ee6e5886965afd
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "fog-fifo"
5
- spec.version = '0.1.0'
5
+ spec.version = '0.1.1'
6
6
  spec.authors = [ "Brian Akins" ]
7
7
  spec.email = [ "brian@akins.org" ]
8
8
  spec.description = %q{fifo support for fog}
@@ -1,5 +1,8 @@
1
1
  require 'fog/core'
2
2
 
3
+ #For https endpoints...
4
+ Excon.defaults[:ssl_verify_peer] = false
5
+
3
6
  module Fog
4
7
  module Fifo
5
8
  extend Fog::Provider
@@ -35,6 +35,7 @@ module Fog
35
35
  request :stop_vm
36
36
  request :start_vm
37
37
  request :create_vm
38
+ request :delete_vm
38
39
 
39
40
  if false
40
41
  request :create_machine
@@ -147,12 +148,12 @@ module Fog
147
148
  end
148
149
 
149
150
  opts[:path] = create_path(opts[:path])
151
+
150
152
  response = @connection.request(opts)
151
153
  if response.headers["Content-Type"] == "application/json"
152
154
  response.body = json_decode(response.body)
153
155
  end
154
156
 
155
- #pp response
156
157
  response
157
158
  rescue Excon::Errors::HTTPStatusError => e
158
159
  raise_if_error!(e.request, e.response)
@@ -7,10 +7,10 @@ module Fog
7
7
  class Fifo
8
8
  class Datasets < Fog::Collection
9
9
 
10
- model Fog::Compute::Fifo::Datasets
10
+ model Fog::Compute::Fifo::Dataset
11
11
 
12
12
  def all
13
- service.list_datasets().body
13
+ service.list_datasets().body.map{|id| get(id)}
14
14
  end
15
15
 
16
16
  def get(id)
@@ -11,6 +11,7 @@ module Fog
11
11
  attribute :config
12
12
  attribute :package
13
13
  attribute :network
14
+ attribute :log
14
15
 
15
16
  def dataset
16
17
  requires :uuid
@@ -61,6 +62,12 @@ module Fog
61
62
  true
62
63
  end
63
64
 
65
+ def delete
66
+ requires :uuid
67
+ service.delete_vm(uuid)
68
+ true
69
+ end
70
+
64
71
  end
65
72
  end
66
73
  end
@@ -13,9 +13,10 @@ module Fog
13
13
  end
14
14
 
15
15
  def create(params = {})
16
- data = service.create_vm(params).body
17
- server = new(data)
18
- server
16
+ resp = service.create_vm(params)
17
+
18
+ #This will retrn a 303 with location = new vm url, so just get it.
19
+ get(resp.headers['location'].split('/').last)
19
20
  end
20
21
 
21
22
  def bootstrap(new_attributes = {})
@@ -17,11 +17,10 @@ module Fog
17
17
 
18
18
  class Real
19
19
  def create_vm(params)
20
- pp params
21
20
  request(
22
21
  :method => "POST",
23
22
  :path => "vms",
24
- :expects => [200],
23
+ :expects => [303],
25
24
  :body => params
26
25
  )
27
26
  end
@@ -0,0 +1,28 @@
1
+ module Fog
2
+ module Compute
3
+ class Fifo
4
+
5
+ class Mock
6
+ def delete_vm(uuid)
7
+ if vm = self.data[:vms][uuid]
8
+ res = Excon::Response.new
9
+ res.status = 200
10
+ res
11
+ else
12
+ raise Excon::Errors::NotFound, "Not Found"
13
+ end
14
+ end
15
+ end
16
+
17
+ class Real
18
+ def delete_vm(id)
19
+ request(
20
+ :method => "DELETE",
21
+ :path => "vms/#{id}",
22
+ :expects => [200]
23
+ )
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-fifo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Akins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-17 00:00:00.000000000 Z
11
+ date: 2014-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog
@@ -49,6 +49,7 @@ files:
49
49
  - lib/fog/fifo/models/compute/server.rb
50
50
  - lib/fog/fifo/models/compute/servers.rb
51
51
  - lib/fog/fifo/requests/compute/create_vm.rb
52
+ - lib/fog/fifo/requests/compute/delete_vm.rb
52
53
  - lib/fog/fifo/requests/compute/get_dataset.rb
53
54
  - lib/fog/fifo/requests/compute/get_iprange.rb
54
55
  - lib/fog/fifo/requests/compute/get_network.rb