Sha256: 1f0636791f8a5009fde133cbbf8936c6defab7bb88d0a88341d43b40e90dd269

Contents?: true

Size: 812 Bytes

Versions: 5

Compression:

Stored size: 812 Bytes

Contents

require 'fog/core/collection'
require 'fog/openstack/models/network/lb_health_monitor'

module Fog
  module Network
    class OpenStack
      class LbHealthMonitors < Fog::Collection
        attribute :filters

        model Fog::Network::OpenStack::LbHealthMonitor

        def initialize(attributes)
          self.filters ||= {}
          super
        end

        def all(filters_arg = filters)
          filters = filters_arg
          load(service.list_lb_health_monitors(filters).body['health_monitors'])
        end

        def get(health_monitor_id)
          if health_monitor = service.get_lb_health_monitor(health_monitor_id).body['health_monitor']
            new(health_monitor)
          end
        rescue Fog::Network::OpenStack::NotFound
          nil
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fog-1.31.0 lib/fog/openstack/models/network/lb_health_monitors.rb
fog-1.30.0 lib/fog/openstack/models/network/lb_health_monitors.rb
fog-1.29.0 lib/fog/openstack/models/network/lb_health_monitors.rb
fog-1.28.0 lib/fog/openstack/models/network/lb_health_monitors.rb
fog-1.27.0 lib/fog/openstack/models/network/lb_health_monitors.rb