Sha256: cd39d7637ba72c37dd4845f9f2af62673e87e555fc9aa5c85128dbadfc4c84ab

Contents?: true

Size: 1.08 KB

Versions: 16

Compression:

Stored size: 1.08 KB

Contents

module Yao::Resources
  class LoadBalancer < Base
    friendly_attributes :provider, :description, :admin_state_up, :provisioning_status,
                        :vip_address, :operationg_status, :name

    map_attribute_to_resources listeners: LoadBalancerListener
    map_attribute_to_resources pools: LoadBalancerListener

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

    def vip_network
      if vip_network_id = self["vip_network_id"]
        Yao::Network.find vip_network_id
      end
    end

    def vip_port
      if vip_port_id = self["vip_port_id"]
        Yao::Port.find vip_port_id
      end
    end

    def vip_subnet
      if vip_subnet_id = self["vip_subnet_id"]
        Yao::Subnet.find vip_subnet_id
      end
    end

    self.service        = "load-balancer"
    self.api_version    = "v2.0"
    self.resource_name  = "loadbalancer"
    self.resources_name = "loadbalancers"
    self.resources_path = "lbaas/loadbalancers"

    class << self
      alias :delete :destroy
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
yao-0.10.1 lib/yao/resources/loadbalancer.rb
yao-0.10.0 lib/yao/resources/loadbalancer.rb
yao-0.9.1 lib/yao/resources/loadbalancer.rb
yao-0.9.0 lib/yao/resources/loadbalancer.rb
yao-0.8.0 lib/yao/resources/loadbalancer.rb
yao-0.7.0 lib/yao/resources/loadbalancer.rb
yao-0.6.3 lib/yao/resources/loadbalancer.rb
yao-0.6.2 lib/yao/resources/loadbalancer.rb
yao-0.6.1 lib/yao/resources/loadbalancer.rb
yao-0.6.0 lib/yao/resources/loadbalancer.rb
yao-0.5.0 lib/yao/resources/loadbalancer.rb
yao-0.4.3 lib/yao/resources/loadbalancer.rb
yao-0.4.2 lib/yao/resources/loadbalancer.rb
yao-0.4.1 lib/yao/resources/loadbalancer.rb
yao-0.4.0 lib/yao/resources/loadbalancer.rb
yao-0.3.8 lib/yao/resources/loadbalancer.rb