fog-softlayer 1.1.3 → 1.1.4
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/lib/fog/softlayer.rb +81 -81
- data/lib/fog/softlayer/models/compute/image.rb +33 -32
- data/lib/fog/softlayer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e1eff6fc6abce4fdce9aa517257812f4c893336
|
4
|
+
data.tar.gz: de9ba25fccc2be2229799ef3ca492699afdf3180
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f72f5c6e7c6498e2088cd395b2b003f818b878f795ffff752fbed438ce12a70e2a11fb659c69502877669e0e7259cb9d0255830b89a06fecf63790c371f5c4f7
|
7
|
+
data.tar.gz: 8abb0e3a3e19687389fea01c4b7e0939277b66c28eb2f95978d6808b520d1999ddfdb77a174c49d436f6194cb820e45e7506fb66357e11e1b85758f81168442e
|
data/lib/fog/softlayer.rb
CHANGED
@@ -1,81 +1,81 @@
|
|
1
|
-
#
|
2
|
-
# Author:: Matt Eldridge (<matt.eldridge@us.ibm.com>)
|
3
|
-
# © Copyright IBM Corporation 2014.
|
4
|
-
#
|
5
|
-
# LICENSE: MIT (http://opensource.org/licenses/MIT)
|
6
|
-
#
|
7
|
-
|
8
|
-
require 'fog/core'
|
9
|
-
require 'fog/json'
|
10
|
-
require 'time'
|
11
|
-
require File.expand_path('../softlayer/version', __FILE__)
|
12
|
-
require File.expand_path('../softlayer/ext/string', __FILE__)
|
13
|
-
require File.expand_path('../softlayer/ext/hash', __FILE__) unless {}.respond_to? :deep_merge
|
14
|
-
|
15
|
-
module Fog
|
16
|
-
module Account
|
17
|
-
autoload :Softlayer, File.expand_path('../softlayer/account', __FILE__)
|
18
|
-
end
|
19
|
-
|
20
|
-
module Compute
|
21
|
-
autoload :Softlayer, File.expand_path('../softlayer/compute', __FILE__)
|
22
|
-
end
|
23
|
-
|
24
|
-
module DNS
|
25
|
-
autoload :Softlayer, File.expand_path('../softlayer/dns', __FILE__)
|
26
|
-
end
|
27
|
-
|
28
|
-
module Network
|
29
|
-
autoload :Softlayer, File.expand_path('../softlayer/network', __FILE__)
|
30
|
-
end
|
31
|
-
|
32
|
-
module Storage
|
33
|
-
autoload :Softlayer, File.expand_path('../softlayer/storage', __FILE__)
|
34
|
-
end
|
35
|
-
|
36
|
-
module Softlayer
|
37
|
-
extend Fog::Provider
|
38
|
-
|
39
|
-
autoload :Product, File.expand_path('../softlayer/product', __FILE__)
|
40
|
-
autoload :Slapi, File.expand_path('../softlayer/slapi', __FILE__)
|
41
|
-
|
42
|
-
SL_API_URL = 'api.softlayer.com/rest/v3' unless defined? SL_API_URL
|
43
|
-
SL_STORAGE_AUTH_URL = 'objectstorage.softlayer.net/auth/v1.0' unless defined? SL_STORAGE_AUTH_URL
|
44
|
-
|
45
|
-
service(:account, 'Account')
|
46
|
-
service(:compute, 'Compute')
|
47
|
-
service(:dns, 'DNS')
|
48
|
-
service(:network, 'Network')
|
49
|
-
service(:product, 'Product')
|
50
|
-
service(:storage, 'Storage')
|
51
|
-
|
52
|
-
def self.mock_account_id
|
53
|
-
Fog.mocking? and @sl_account_id ||= Fog::Mock.random_numbers(7)
|
54
|
-
end
|
55
|
-
|
56
|
-
def self.mock_vm_id
|
57
|
-
Fog::Mock.random_numbers(7)
|
58
|
-
end
|
59
|
-
|
60
|
-
def self.mock_global_identifier
|
61
|
-
Fog::UUID.uuid
|
62
|
-
end
|
63
|
-
|
64
|
-
def self.valid_request?(required, passed)
|
65
|
-
required.all? {|k| k = k.to_sym; passed.key?(k) and !passed[k].nil?}
|
66
|
-
end
|
67
|
-
|
68
|
-
# CGI.escape, but without special treatment on spaces
|
69
|
-
def self.escape(str,extra_exclude_chars = '')
|
70
|
-
str.gsub(/([^a-zA-Z0-9_.-#{extra_exclude_chars}]+)/) do
|
71
|
-
'%' + $1.unpack('H2' * $1.bytesize).join('%').upcase
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
def self.stringify_keys(obj)
|
76
|
-
return obj.inject({}){|memo,(k,v)| memo[k.to_s] = stringify_keys(v); memo} if obj.is_a? Hash
|
77
|
-
return obj.inject([]){|memo,v | memo << stringify_keys(v); memo} if obj.is_a? Array
|
78
|
-
obj
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
1
|
+
#
|
2
|
+
# Author:: Matt Eldridge (<matt.eldridge@us.ibm.com>)
|
3
|
+
# © Copyright IBM Corporation 2014.
|
4
|
+
#
|
5
|
+
# LICENSE: MIT (http://opensource.org/licenses/MIT)
|
6
|
+
#
|
7
|
+
|
8
|
+
require 'fog/core'
|
9
|
+
require 'fog/json'
|
10
|
+
require 'time'
|
11
|
+
require File.expand_path('../softlayer/version', __FILE__)
|
12
|
+
require File.expand_path('../softlayer/ext/string', __FILE__)
|
13
|
+
require File.expand_path('../softlayer/ext/hash', __FILE__) unless {}.respond_to? :deep_merge
|
14
|
+
|
15
|
+
module Fog
|
16
|
+
module Account
|
17
|
+
autoload :Softlayer, File.expand_path('../softlayer/account', __FILE__)
|
18
|
+
end
|
19
|
+
|
20
|
+
module Compute
|
21
|
+
autoload :Softlayer, File.expand_path('../softlayer/compute', __FILE__)
|
22
|
+
end
|
23
|
+
|
24
|
+
module DNS
|
25
|
+
autoload :Softlayer, File.expand_path('../softlayer/dns', __FILE__)
|
26
|
+
end
|
27
|
+
|
28
|
+
module Network
|
29
|
+
autoload :Softlayer, File.expand_path('../softlayer/network', __FILE__)
|
30
|
+
end
|
31
|
+
|
32
|
+
module Storage
|
33
|
+
autoload :Softlayer, File.expand_path('../softlayer/storage', __FILE__)
|
34
|
+
end
|
35
|
+
|
36
|
+
module Softlayer
|
37
|
+
extend Fog::Provider
|
38
|
+
|
39
|
+
autoload :Product, File.expand_path('../softlayer/product', __FILE__)
|
40
|
+
autoload :Slapi, File.expand_path('../softlayer/slapi', __FILE__)
|
41
|
+
|
42
|
+
SL_API_URL = ENV['SL_API_URL'] ? ENV['SL_API_URL'] : 'api.softlayer.com/rest/v3' unless defined? SL_API_URL
|
43
|
+
SL_STORAGE_AUTH_URL = ENV['SL_STORAGE_AUTH_URL'] ? ENV['SL_STORAGE_AUTH_URL'] : 'objectstorage.softlayer.net/auth/v1.0' unless defined? SL_STORAGE_AUTH_URL
|
44
|
+
|
45
|
+
service(:account, 'Account')
|
46
|
+
service(:compute, 'Compute')
|
47
|
+
service(:dns, 'DNS')
|
48
|
+
service(:network, 'Network')
|
49
|
+
service(:product, 'Product')
|
50
|
+
service(:storage, 'Storage')
|
51
|
+
|
52
|
+
def self.mock_account_id
|
53
|
+
Fog.mocking? and @sl_account_id ||= Fog::Mock.random_numbers(7)
|
54
|
+
end
|
55
|
+
|
56
|
+
def self.mock_vm_id
|
57
|
+
Fog::Mock.random_numbers(7)
|
58
|
+
end
|
59
|
+
|
60
|
+
def self.mock_global_identifier
|
61
|
+
Fog::UUID.uuid
|
62
|
+
end
|
63
|
+
|
64
|
+
def self.valid_request?(required, passed)
|
65
|
+
required.all? {|k| k = k.to_sym; passed.key?(k) and !passed[k].nil?}
|
66
|
+
end
|
67
|
+
|
68
|
+
# CGI.escape, but without special treatment on spaces
|
69
|
+
def self.escape(str,extra_exclude_chars = '')
|
70
|
+
str.gsub(/([^a-zA-Z0-9_.-#{extra_exclude_chars}]+)/) do
|
71
|
+
'%' + $1.unpack('H2' * $1.bytesize).join('%').upcase
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
def self.stringify_keys(obj)
|
76
|
+
return obj.inject({}){|memo,(k,v)| memo[k.to_s] = stringify_keys(v); memo} if obj.is_a? Hash
|
77
|
+
return obj.inject([]){|memo,v | memo << stringify_keys(v); memo} if obj.is_a? Array
|
78
|
+
obj
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -1,32 +1,33 @@
|
|
1
|
-
#
|
2
|
-
# Author:: Matt Eldridge (<matt.eldridge@us.ibm.com>)
|
3
|
-
# © Copyright IBM Corporation 2014.
|
4
|
-
#
|
5
|
-
# LICENSE: MIT (http://opensource.org/licenses/MIT)
|
6
|
-
#
|
7
|
-
|
8
|
-
module Fog
|
9
|
-
module Compute
|
10
|
-
class Softlayer
|
11
|
-
|
12
|
-
class Image < Fog::Model
|
13
|
-
|
14
|
-
identity :id, :aliases => 'globalIdentifier'
|
15
|
-
attribute :name
|
16
|
-
attribute :note
|
17
|
-
attribute :parent_id, :aliases => 'parentId'
|
18
|
-
attribute :public_flag, :aliases => 'publicFlag'
|
19
|
-
attribute :status_id, :aliases => 'statusId'
|
20
|
-
attribute :summary
|
21
|
-
attribute :transaction_id, :aliases => 'transactionId'
|
22
|
-
attribute :user_record_id, :aliases => 'userRecordId'
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
end
|
1
|
+
#
|
2
|
+
# Author:: Matt Eldridge (<matt.eldridge@us.ibm.com>)
|
3
|
+
# © Copyright IBM Corporation 2014.
|
4
|
+
#
|
5
|
+
# LICENSE: MIT (http://opensource.org/licenses/MIT)
|
6
|
+
#
|
7
|
+
|
8
|
+
module Fog
|
9
|
+
module Compute
|
10
|
+
class Softlayer
|
11
|
+
|
12
|
+
class Image < Fog::Model
|
13
|
+
|
14
|
+
identity :id, :aliases => 'globalIdentifier'
|
15
|
+
attribute :name
|
16
|
+
attribute :note
|
17
|
+
attribute :parent_id, :aliases => 'parentId'
|
18
|
+
attribute :public_flag, :aliases => 'publicFlag'
|
19
|
+
attribute :status_id, :aliases => 'statusId'
|
20
|
+
attribute :summary
|
21
|
+
attribute :transaction_id, :aliases => 'transactionId'
|
22
|
+
attribute :user_record_id, :aliases => 'userRecordId'
|
23
|
+
attribute :account_id, :aliases => 'accountId'
|
24
|
+
|
25
|
+
def public?
|
26
|
+
public_flag == 1
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-softlayer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Eldridge
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-core
|