Class: Fog::AWS::Mock

Inherits:
Object
  • Object
show all
Defined in:
lib/fog/aws.rb

Class Method Summary collapse

Class Method Details

.etagObject



24
25
26
# File 'lib/fog/aws.rb', line 24

def self.etag
  hex(32)
end

.instance_idObject



36
37
# File 'lib/fog/aws.rb', line 36

def self.instance_id
end

.ip_addressObject



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_fingerprintObject



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_materialObject



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_idObject



57
58
59
# File 'lib/fog/aws.rb', line 57

def self.owner_id
  numbers(12)
end

.request_idObject



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_idObject



71
72
73
# File 'lib/fog/aws.rb', line 71

def self.snapshot_id
  "snap-#{hex(8)}"
end

.volume_idObject



75
76
77
# File 'lib/fog/aws.rb', line 75

def self.volume_id
  "vol-#{hex(8)}"
end