Sha256: d353ab8b6a87d2a8b2d6a2e7d4e383fa5af43492fc4cd32444819dde42de81b6

Contents?: true

Size: 730 Bytes

Versions: 4

Compression:

Stored size: 730 Bytes

Contents

require 'fog/compute/models/server'
require 'fog/compute/huaweicloud/models/metadata'

module Fog
  module Compute
    class HuaweiCloud
      class Host < Fog::HuaweiCloud::Model
        attribute :host_name
        attribute :service_name
        attribute :details
        attribute :zone

        def initialize(attributes)
          attributes["service_name"] = attributes.delete "service"
          # Old 'connection' is renamed as service and should be used instead
          prepare_service_value(attributes)
          super
        end

        def details
          service.get_host_details(host_name).body['host']
        rescue Fog::Compute::HuaweiCloud::NotFound
          nil
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fog-huaweicloud-0.0.3 lib/fog/compute/huaweicloud/models/host.rb
fog-huaweicloud-0.0.2 lib/fog/compute/huaweicloud/models/host.rb
fog-huaweicloud-0.1.3 lib/fog/compute/huaweicloud/models/host.rb
fog-huaweicloud-0.1.2 lib/fog/compute/huaweicloud/models/host.rb