Method: Fog::Compute::HuaweiCloud::Mock#list_public_addresses
- Defined in:
- lib/fog/compute/huaweicloud/requests/list_public_addresses.rb
#list_public_addresses(server_id) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/fog/compute/huaweicloud/requests/list_public_addresses.rb', line 15 def list_public_addresses(server_id) response = Excon::Response.new server = list_servers_detail.body['servers'].find { |srv| srv['id'] == server_id } if server response.status = [200, 203][rand(2)] response.body = {'public' => server['addresses']['public']} response else raise Fog::Compute::HuaweiCloud::NotFound end end |