Class: Fog::AWS::Mock
- Inherits:
-
Object
- Object
- Fog::AWS::Mock
- Defined in:
- lib/fog/aws.rb
Class Method Summary collapse
- .etag ⇒ Object
- .instance_id ⇒ Object
- .ip_address ⇒ Object
- .key_fingerprint ⇒ Object
- .key_material ⇒ Object
- .owner_id ⇒ Object
- .request_id ⇒ Object
- .snapshot_id ⇒ Object
- .volume_id ⇒ Object
Class Method Details
.etag ⇒ Object
24 25 26 |
# File 'lib/fog/aws.rb', line 24 def self.etag hex(32) end |
.instance_id ⇒ Object
36 37 |
# File 'lib/fog/aws.rb', line 36 def self.instance_id end |
.ip_address ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/fog/aws.rb', line 39 def self.ip_address ip = [] 4.times do ip << numbers(rand(3) + 1).to_i.to_s # remove leading 0 end ip.join('.') end |
.key_fingerprint ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/fog/aws.rb', line 28 def self.key_fingerprint fingerprint = [] 20.times do fingerprint << hex(2) end fingerprint.join(':') end |
.key_material ⇒ Object
47 48 49 50 51 52 53 54 55 |
# File 'lib/fog/aws.rb', line 47 def self.key_material key_material = ['-----BEGIN RSA PRIVATE KEY-----'] 20.times do key_material << base64(76) end key_material << base64(67) + '=' key_material << '-----END RSA PRIVATE KEY-----' key_material.join("\n") end |
.owner_id ⇒ Object
57 58 59 |
# File 'lib/fog/aws.rb', line 57 def self.owner_id numbers(12) end |
.request_id ⇒ Object
61 62 63 64 65 66 67 68 69 |
# File 'lib/fog/aws.rb', line 61 def self.request_id request_id = [] request_id << hex(8) 3.times do request_id << hex(4) end request_id << hex(12) request_id.join('-') end |
.snapshot_id ⇒ Object
71 72 73 |
# File 'lib/fog/aws.rb', line 71 def self.snapshot_id "snap-#{hex(8)}" end |
.volume_id ⇒ Object
75 76 77 |
# File 'lib/fog/aws.rb', line 75 def self.volume_id "vol-#{hex(8)}" end |