Sha256: e25d4935a89c5c00f4a3443932ebb224ee3599b0d6b6a1e56d8fdb24206bd881

Contents?: true

Size: 1.07 KB

Versions: 8

Compression:

Stored size: 1.07 KB

Contents

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

    map_attribute_to_resources listeners: LoadBalancerListener
    map_attribute_to_resources pools: LoadBalancerPool

    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

8 entries across 8 versions & 1 rubygems

Version Path
yao-0.13.4 lib/yao/resources/loadbalancer.rb
yao-0.13.3 lib/yao/resources/loadbalancer.rb
yao-0.13.2 lib/yao/resources/loadbalancer.rb
yao-0.13.1 lib/yao/resources/loadbalancer.rb
yao-0.13.0 lib/yao/resources/loadbalancer.rb
yao-0.12.0 lib/yao/resources/loadbalancer.rb
yao-0.11.3 lib/yao/resources/loadbalancer.rb
yao-0.11.2 lib/yao/resources/loadbalancer.rb