Class: Fog::QingCloud::Mock
- Inherits:
-
Object
- Object
- Fog::QingCloud::Mock
- Defined in:
- lib/fog/qingcloud/core.rb
Class Method Summary collapse
- .address_id ⇒ Object
- .image ⇒ Object
- .image_id ⇒ Object
- .instance_id ⇒ Object
- .ip_address ⇒ Object
- .job_id ⇒ Object
- .key_id ⇒ Object
- .key_material ⇒ Object
- .mac ⇒ Object
- .private_ip_address ⇒ Object
- .public_key ⇒ Object
- .security_group_id ⇒ Object
- .security_group_rule_id ⇒ Object
- .volume_id ⇒ Object
- .vxnet_id ⇒ Object
- .zone(region) ⇒ Object
Class Method Details
.address_id ⇒ Object
142 143 144 |
# File 'lib/fog/qingcloud/core.rb', line 142 def self.address_id "eip-#{Fog::Mock.random_hex(8)}" end |
.image ⇒ Object
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/fog/qingcloud/core.rb', line 105 def self.image { 'status' => 'available', 'processor_type' => '64bit', 'image_id' => image_id, 'sub_code' => 1, 'transition_status' => '', 'recommended_type' => 'small_b', 'image_name' => '', 'visibility' => 'private', 'platform' => 'linux', 'create_time' => '2013-08-07T18:16:32Z', 'os_family' => 'centos', 'provider' => 'self', 'owner' => 'usr-1234abcd', 'status_time' => '2013-08-17T08:16:33Z', 'size' => 20, 'description' => nil } end |
.image_id ⇒ Object
126 127 128 |
# File 'lib/fog/qingcloud/core.rb', line 126 def self.image_id "img-#{Fog::Mock.random_hex(8)}" end |
.instance_id ⇒ Object
134 135 136 |
# File 'lib/fog/qingcloud/core.rb', line 134 def self.instance_id "i-#{Fog::Mock.random_hex(8)}" end |
.ip_address ⇒ Object
138 139 140 |
# File 'lib/fog/qingcloud/core.rb', line 138 def self.ip_address Fog::Mock.random_ip end |
.job_id ⇒ Object
146 147 148 |
# File 'lib/fog/qingcloud/core.rb', line 146 def self.job_id "j-#{Fog::Mock.random_hex(8)}" end |
.key_id ⇒ Object
176 177 178 |
# File 'lib/fog/qingcloud/core.rb', line 176 def self.key_id "kp-#{Fog::Mock.random_hex(8)}" end |
.key_material ⇒ Object
154 155 156 |
# File 'lib/fog/qingcloud/core.rb', line 154 def self.key_material OpenSSL::PKey::RSA.generate(1024).to_s end |
.mac ⇒ Object
130 131 132 |
# File 'lib/fog/qingcloud/core.rb', line 130 def self.mac Fog::Mock.random_hex(12).scan(/.{2}/).join(':') end |
.private_ip_address ⇒ Object
150 151 152 |
# File 'lib/fog/qingcloud/core.rb', line 150 def self.private_ip_address "192.168.1.#{Fog::Mock.random_numbers(2)}" end |
.public_key ⇒ Object
158 159 160 161 162 |
# File 'lib/fog/qingcloud/core.rb', line 158 def self.public_key <<-EOS ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC5w3Cr/6b3lDQpX3XukEu0pM6vbMdfEWhoWTdiLpU4Gl7P+PyKlFqv528eU8/XIBqEIRBw/WCHAtY5mE7eo6ZxHvUWf/i3Mzy/3/xWHqkKjyTdZDP86xGmP0cQcN4xZ4oNgVu3bChFXvCxUj3X0EQHhED090ePQOQYPPw+sAKLngilaPAYGfzX30HXknRYWzCo/ucn8bl/k3lYEyjSb8orD4HeW/lhv0fUVgbbrvYBd3RVuQVNzso/gN7p/7O3BApkWdufq7iWPi84iQgYkeNFH4bWT4wl4NEkd23gymWF3IwvM0/JOjOdlzLnbhko9Q6eiY400d2/tcsNlf5qLGaz starrysky@sky EOS end |
.security_group_id ⇒ Object
168 169 170 |
# File 'lib/fog/qingcloud/core.rb', line 168 def self.security_group_id "sg-#{Fog::Mock.random_hex(8)}" end |
.security_group_rule_id ⇒ Object
180 181 182 |
# File 'lib/fog/qingcloud/core.rb', line 180 def self.security_group_rule_id "sgr-#{Fog::Mock.random_hex(8)}" end |
.volume_id ⇒ Object
164 165 166 |
# File 'lib/fog/qingcloud/core.rb', line 164 def self.volume_id "vol-#{Fog::Mock.random_hex(8)}" end |
.vxnet_id ⇒ Object
172 173 174 |
# File 'lib/fog/qingcloud/core.rb', line 172 def self.vxnet_id "vxnet-#{Fog::Mock.random_hex(8)}" end |
.zone(region) ⇒ Object
101 102 103 |
# File 'lib/fog/qingcloud/core.rb', line 101 def self.zone(region) "pek1" end |