Module: Fog::Softlayer
- Extended by:
- Provider
- Defined in:
- lib/fog/softlayer/core.rb,
lib/fog/softlayer/version.rb,
lib/fog/softlayer/compute/shared.rb
Defined Under Namespace
Modules: Compute
Constant Summary collapse
- SL_API_URL =
'api.softlayer.com/rest/v3'- SL_STORAGE_AUTH_URL =
'objectstorage.softlayer.net/auth/v1.0'- VERSION =
"0.1.0"
Class Method Summary collapse
-
.escape(str, extra_exclude_chars = '') ⇒ Object
CGI.escape, but without special treatment on spaces.
- .mock_account_id ⇒ Object
- .mock_global_identifier ⇒ Object
- .mock_vm_id ⇒ Object
- .valid_request?(required, passed) ⇒ Boolean
Class Method Details
.escape(str, extra_exclude_chars = '') ⇒ Object
CGI.escape, but without special treatment on spaces
40 41 42 43 44 |
# File 'lib/fog/softlayer/core.rb', line 40 def self.escape(str,extra_exclude_chars = '') str.gsub(/([^a-zA-Z0-9_.-#{extra_exclude_chars}]+)/) do '%' + $1.unpack('H2' * $1.bytesize).join('%').upcase end end |
.mock_account_id ⇒ Object
23 24 25 |
# File 'lib/fog/softlayer/core.rb', line 23 def self.mock_account_id Fog.mocking? and @sl_account_id ||= Fog::Mock.random_numbers(7) end |
.mock_global_identifier ⇒ Object
31 32 33 |
# File 'lib/fog/softlayer/core.rb', line 31 def self.mock_global_identifier Fog::UUID.uuid end |
.mock_vm_id ⇒ Object
27 28 29 |
# File 'lib/fog/softlayer/core.rb', line 27 def self.mock_vm_id Fog::Mock.random_numbers(7) end |
.valid_request?(required, passed) ⇒ Boolean
35 36 37 |
# File 'lib/fog/softlayer/core.rb', line 35 def self.valid_request?(required, passed) required.all? {|k| k = k.to_sym; passed.key?(k) and !passed[k].nil?} end |