Class: Fog::HP::Mock
- Inherits:
-
Object
- Object
- Fog::HP::Mock
- Defined in:
- lib/rackspace-fog/hp.rb
Class Method Summary collapse
- .etag ⇒ Object
- .instance_id ⇒ Object
- .ip_address ⇒ Object
- .key_fingerprint ⇒ Object
- .key_material ⇒ Object
- .user_id ⇒ Object
Class Method Details
.etag ⇒ Object
197 198 199 |
# File 'lib/rackspace-fog/hp.rb', line 197 def self.etag Fog::Mock.random_hex(32) end |
.instance_id ⇒ Object
219 220 221 |
# File 'lib/rackspace-fog/hp.rb', line 219 def self.instance_id Fog::Mock.random_numbers(6) end |
.ip_address ⇒ Object
223 224 225 226 227 228 229 |
# File 'lib/rackspace-fog/hp.rb', line 223 def self.ip_address ip = [] 4.times do ip << Fog::Mock.random_numbers(rand(3) + 1).to_i.to_s # remove leading 0 end ip.join('.') end |
.key_fingerprint ⇒ Object
201 202 203 204 205 206 207 |
# File 'lib/rackspace-fog/hp.rb', line 201 def self.key_fingerprint fingerprint = [] 20.times do fingerprint << Fog::Mock.random_hex(2) end fingerprint.join(':') end |
.key_material ⇒ Object
209 210 211 212 213 |
# File 'lib/rackspace-fog/hp.rb', line 209 def self.key_material private_key = OpenSSL::PKey::RSA.generate(1024) public_key = private_key.public_key return private_key.to_s, public_key.to_s end |
.user_id ⇒ Object
215 216 217 |
# File 'lib/rackspace-fog/hp.rb', line 215 def self.user_id "dev_" + Fog::Mock.random_numbers(14) end |