Sha256: f78c5c18f813fbc24421e8562b089f7d9db28a45e663e67effa0a526b3690031

Contents?: true

Size: 1.23 KB

Versions: 26

Compression:

Stored size: 1.23 KB

Contents

module Yao::Resources
  class LoadBalancerPool < Base
    friendly_attributes :lb_algorithm, :protocol, :description,
                        :admin_state_up, :provisioning_status,
                        :session_persistence, :operating_status, :name

    map_attribute_to_resources loadbalancers: LoadBalancer
    map_attribute_to_resources listeners: LoadBalancerListener

    def created_at
      Date.parse(self["created_at"])
    end

    def updated_at
      Date.parse(self["updated_at"])
    end

    def listeners
      self["listeners"].map do |listener|
        Yao::LoadBalancerListener.find listener["id"]
      end
    end

    def project
      if project_id = self["project_id"]
        Yao::Tenant.find project_id
      end
    end
    alias :tenant :project

    def members
      self["members"].map do |member|
        Yao::LoadBalancerPoolMember.find(self,member["id"])
      end
    end

    def healthmonitor
      if healthmonitor_id = self["healthmonitor_id"]
        Yao::LoadBalancerHealthMonitor.find healthmonitor_id
      end
    end

    self.service        = "load-balancer"
    self.api_version    = "v2.0"
    self.resource_name  = "pool"
    self.resources_name = "pools"
    self.resources_path = "lbaas/pools"
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
yao-0.13.4 lib/yao/resources/loadbalancer_pool.rb
yao-0.13.3 lib/yao/resources/loadbalancer_pool.rb
yao-0.13.2 lib/yao/resources/loadbalancer_pool.rb
yao-0.13.1 lib/yao/resources/loadbalancer_pool.rb
yao-0.13.0 lib/yao/resources/loadbalancer_pool.rb
yao-0.12.0 lib/yao/resources/loadbalancer_pool.rb
yao-0.11.3 lib/yao/resources/loadbalancer_pool.rb
yao-0.11.2 lib/yao/resources/loadbalancer_pool.rb
yao-0.11.1 lib/yao/resources/loadbalancer_pool.rb
yao-0.11.0 lib/yao/resources/loadbalancer_pool.rb
yao-0.10.1 lib/yao/resources/loadbalancer_pool.rb
yao-0.10.0 lib/yao/resources/loadbalancer_pool.rb
yao-0.9.1 lib/yao/resources/loadbalancer_pool.rb
yao-0.9.0 lib/yao/resources/loadbalancer_pool.rb
yao-0.8.0 lib/yao/resources/loadbalancer_pool.rb
yao-0.7.0 lib/yao/resources/loadbalancer_pool.rb
yao-0.6.3 lib/yao/resources/loadbalancer_pool.rb
yao-0.6.2 lib/yao/resources/loadbalancer_pool.rb
yao-0.6.1 lib/yao/resources/loadbalancer_pool.rb
yao-0.6.0 lib/yao/resources/loadbalancer_pool.rb