fog-fifo 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/fog-fifo.gemspec +1 -1
- data/lib/fog/fifo.rb +3 -0
- data/lib/fog/fifo/compute.rb +2 -1
- data/lib/fog/fifo/models/compute/datasets.rb +2 -2
- data/lib/fog/fifo/models/compute/server.rb +7 -0
- data/lib/fog/fifo/models/compute/servers.rb +4 -3
- data/lib/fog/fifo/requests/compute/create_vm.rb +1 -2
- data/lib/fog/fifo/requests/compute/delete_vm.rb +28 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2de723d0d14e0215b68bc3cb6813019404b5cce
|
4
|
+
data.tar.gz: d38aeceec77c764411c6d64a7cb825f711850fef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb2e725d9b844d02a4df5f36eeab954eb65bcb1bd333ff02509af4cd69e76d9637a8e5a1674c68f5f6f0d59cba63c32b9194f118db820cb2cca3d1089cb5948b
|
7
|
+
data.tar.gz: 4cd8b8f209f123b8565b8c2d74b885951b25f387092be5f39403bb2d7c54860accb604be302fb86e75cf962ca9884a6af18d9aedd02b38ddd5ee6e5886965afd
|
data/fog-fifo.gemspec
CHANGED
data/lib/fog/fifo.rb
CHANGED
data/lib/fog/fifo/compute.rb
CHANGED
@@ -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::
|
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
|
-
|
17
|
-
|
18
|
-
|
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 = {})
|
@@ -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.
|
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-
|
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
|