fog-serverlove 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/fog-serverlove.gemspec +4 -1
- data/lib/fog/bin/serverlove.rb +1 -1
- data/lib/fog/compute/serverlove.rb +8 -8
- data/lib/fog/compute/serverlove/models/image.rb +3 -3
- data/lib/fog/compute/serverlove/models/server.rb +11 -11
- data/lib/fog/compute/serverlove/password_generator.rb +1 -1
- data/lib/fog/compute/serverlove/requests/create_image.rb +3 -3
- data/lib/fog/compute/serverlove/requests/create_server.rb +5 -5
- data/lib/fog/serverlove.rb +5 -5
- data/lib/fog/serverlove/compute.rb +1 -0
- data/lib/fog/serverlove/version.rb +1 -1
- metadata +2 -3
- data/.hound.yml +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 217fe23d90cf438d61bed021782cf37273e4d4e1
|
4
|
+
data.tar.gz: d50e8999d921909a726ceb59ee9e476a7c3c5738
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2316dae856cfe4ce0bf720f38c3c8e225422eb2aef003d7c58e79f9238614a4e66beaf0f707c406a49f5c5b3d1e41289cbb459f9a6e73274e7a16859e9ae38c2
|
7
|
+
data.tar.gz: a937c37d39c3661d7d7fac5cb09f7faf27358e6905af9d1b97239402f8954514fec28c967f9bce5d2663497631b739d69ba8217163540bab2241996ea6a2cac7
|
data/.rubocop.yml
CHANGED
data/fog-serverlove.gemspec
CHANGED
@@ -14,7 +14,10 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.homepage = ""
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
|
-
|
17
|
+
files = `git ls-files -z`.split("\x0")
|
18
|
+
files.delete(".hound.yml")
|
19
|
+
spec.files = files
|
20
|
+
|
18
21
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
22
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
23
|
spec.require_paths = ["lib"]
|
data/lib/fog/bin/serverlove.rb
CHANGED
@@ -14,7 +14,7 @@ class Serverlove < Fog::Bin
|
|
14
14
|
hash[key] = case key
|
15
15
|
when :compute
|
16
16
|
Fog::Logger.warning("Serverlove[:compute] is not recommended, use Compute[:serverlove] for portability")
|
17
|
-
Fog::Compute.new(:provider =>
|
17
|
+
Fog::Compute.new(:provider => "Serverlove")
|
18
18
|
else
|
19
19
|
raise ArgumentError, "Unrecognized service: #{key.inspect}"
|
20
20
|
end
|
@@ -1,24 +1,24 @@
|
|
1
1
|
module Fog
|
2
2
|
module Compute
|
3
3
|
class Serverlove < Fog::Service
|
4
|
-
autoload :Image,
|
5
|
-
autoload :Images,
|
6
|
-
autoload :Server,
|
7
|
-
autoload :Servers,
|
8
|
-
autoload :PasswordGenerator,
|
4
|
+
autoload :Image, File.expand_path("../serverlove/models/image", __FILE__)
|
5
|
+
autoload :Images, File.expand_path("../serverlove/models/images", __FILE__)
|
6
|
+
autoload :Server, File.expand_path("../serverlove/models/server", __FILE__)
|
7
|
+
autoload :Servers, File.expand_path("../serverlove/models/servers", __FILE__)
|
8
|
+
autoload :PasswordGenerator, File.expand_path("../serverlove/password_generator", __FILE__)
|
9
9
|
|
10
10
|
API_HOST = "api.z1-man.serverlove.com"
|
11
11
|
|
12
12
|
requires :serverlove_uuid, :serverlove_api_key
|
13
13
|
recognizes :serverlove_api_url
|
14
14
|
|
15
|
-
model_path
|
15
|
+
model_path "fog/compute/serverlove/models"
|
16
16
|
model :image
|
17
17
|
collection :images
|
18
18
|
model :server
|
19
19
|
collection :servers
|
20
20
|
|
21
|
-
request_path
|
21
|
+
request_path "fog/compute/serverlove/requests"
|
22
22
|
# Image
|
23
23
|
request :get_image
|
24
24
|
request :get_images
|
@@ -86,7 +86,7 @@ module Fog
|
|
86
86
|
def raise_if_error!(response)
|
87
87
|
case response.status
|
88
88
|
when 400 then
|
89
|
-
raise
|
89
|
+
raise "omg"
|
90
90
|
end
|
91
91
|
end
|
92
92
|
end
|
@@ -2,7 +2,7 @@ module Fog
|
|
2
2
|
module Compute
|
3
3
|
class Serverlove
|
4
4
|
class Image < Fog::Model
|
5
|
-
identity :id, :aliases =>
|
5
|
+
identity :id, :aliases => "drive"
|
6
6
|
|
7
7
|
attribute :name
|
8
8
|
attribute :user
|
@@ -10,7 +10,7 @@ module Fog
|
|
10
10
|
attribute :claimed
|
11
11
|
attribute :status
|
12
12
|
attribute :imaging
|
13
|
-
attribute :encryption_cipher, :aliases =>
|
13
|
+
attribute :encryption_cipher, :aliases => "encryption:cipher"
|
14
14
|
|
15
15
|
def save
|
16
16
|
attributes = {}
|
@@ -33,7 +33,7 @@ module Fog
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def ready?
|
36
|
-
status.upcase ==
|
36
|
+
status.upcase == "ACTIVE"
|
37
37
|
end
|
38
38
|
|
39
39
|
def destroy
|
@@ -2,25 +2,25 @@ module Fog
|
|
2
2
|
module Compute
|
3
3
|
class Serverlove
|
4
4
|
class Server < Fog::Model
|
5
|
-
identity :id, :aliases =>
|
5
|
+
identity :id, :aliases => "server"
|
6
6
|
|
7
7
|
attribute :name
|
8
8
|
attribute :cpu
|
9
9
|
attribute :mem
|
10
10
|
attribute :smp
|
11
|
-
attribute :ide_0_0, :aliases =>
|
12
|
-
attribute :ide_0_1, :aliases =>
|
13
|
-
attribute :ide_1_0, :aliases =>
|
14
|
-
attribute :ide_1_1, :aliases =>
|
11
|
+
attribute :ide_0_0, :aliases => "ide:0:0"
|
12
|
+
attribute :ide_0_1, :aliases => "ide:0:1"
|
13
|
+
attribute :ide_1_0, :aliases => "ide:1:0"
|
14
|
+
attribute :ide_1_1, :aliases => "ide:1:1"
|
15
15
|
attribute :boot
|
16
16
|
attribute :persistent
|
17
17
|
attribute :vnc
|
18
|
-
attribute :vnc_password, :aliases =>
|
18
|
+
attribute :vnc_password, :aliases => "vnc:password"
|
19
19
|
attribute :status
|
20
20
|
attribute :user
|
21
21
|
attribute :started
|
22
|
-
attribute :nic_0_model, :aliases =>
|
23
|
-
attribute :nic_0_dhcp, :aliases =>
|
22
|
+
attribute :nic_0_model, :aliases => "nic:0:model"
|
23
|
+
attribute :nic_0_dhcp, :aliases => "nic:0:dhcp"
|
24
24
|
|
25
25
|
def save
|
26
26
|
attributes = {}
|
@@ -56,9 +56,9 @@ module Fog
|
|
56
56
|
def self.defaults
|
57
57
|
# TODO: Document default settings.
|
58
58
|
# Note that VNC password standards are strict (need explaining)
|
59
|
-
{
|
60
|
-
|
61
|
-
|
59
|
+
{ "nic:0:model" => "e1000", "nic:0:dhcp" => "auto",
|
60
|
+
"smp" => "auto", "vnc" => "auto",
|
61
|
+
"vnc:password" => Fog::Compute::Serverlove::PasswordGenerator.generate
|
62
62
|
}
|
63
63
|
end
|
64
64
|
end
|
@@ -14,9 +14,9 @@ module Fog
|
|
14
14
|
response.status = 200
|
15
15
|
|
16
16
|
data = {
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
"drive" => Fog::Mock.random_numbers(1000000).to_s,
|
18
|
+
"name" => options["name"] || "Test",
|
19
|
+
"size" => options["size"] || 12345
|
20
20
|
}
|
21
21
|
|
22
22
|
response.body = data
|
@@ -14,11 +14,11 @@ module Fog
|
|
14
14
|
response.status = 200
|
15
15
|
|
16
16
|
data = {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
"server" => Fog::Mock.random_numbers(1000000).to_s,
|
18
|
+
"name" => options["name"] || "Test",
|
19
|
+
"cpu" => options["cpu"] || 1000,
|
20
|
+
"persistent" => options["persistent"] || false,
|
21
|
+
"vnc:password" => options["vnc:password"] || "T35tServER!"
|
22
22
|
}
|
23
23
|
|
24
24
|
response.body = data
|
data/lib/fog/serverlove.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
1
|
+
require "fog/core"
|
2
|
+
require "fog/json"
|
3
|
+
require File.expand_path("../serverlove/version", __FILE__)
|
4
4
|
|
5
5
|
module Fog
|
6
6
|
module Compute
|
7
|
-
autoload :Serverlove,
|
7
|
+
autoload :Serverlove, File.expand_path("../compute/serverlove", __FILE__)
|
8
8
|
end
|
9
9
|
|
10
10
|
module Serverlove
|
11
11
|
extend Fog::Provider
|
12
12
|
|
13
|
-
service(:compute,
|
13
|
+
service(:compute, "Compute")
|
14
14
|
end
|
15
15
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
# This file was intentionally left blank
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-serverlove
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paulo Henrique Lopes Ribeiro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-core
|
@@ -146,7 +146,6 @@ extensions: []
|
|
146
146
|
extra_rdoc_files: []
|
147
147
|
files:
|
148
148
|
- ".gitignore"
|
149
|
-
- ".hound.yml"
|
150
149
|
- ".rubocop.yml"
|
151
150
|
- ".ruby-gemset"
|
152
151
|
- ".ruby-version"
|
data/.hound.yml
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Metrics/LineLength:
|
2
|
-
Enabled: false
|
3
|
-
|
4
|
-
Style/EachWithObject:
|
5
|
-
Enabled: false
|
6
|
-
|
7
|
-
Style/Encoding:
|
8
|
-
EnforcedStyle: when_needed
|
9
|
-
|
10
|
-
Style/FormatString:
|
11
|
-
Enabled: false
|
12
|
-
|
13
|
-
Style/HashSyntax:
|
14
|
-
EnforcedStyle: hash_rockets
|
15
|
-
|
16
|
-
Style/SignalException:
|
17
|
-
EnforcedStyle: only_raise
|
18
|
-
|
19
|
-
Style/StringLiterals:
|
20
|
-
EnforcedStyle: double_quotes
|