Sha256: 4e1e346a385c3f4120c823333fd474a780c7f2649e03d77bca9bd6e5289a1c9a

Contents?: true

Size: 1.22 KB

Versions: 5

Compression:

Stored size: 1.22 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

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

    # @return [Yao::Resources::Network]
    def vip_network
      if vip_network_id = self["vip_network_id"]
        Yao::Network.find vip_network_id
      end
    end

    # @return [Yao::Resources::Port]
    def vip_port
      if vip_port_id = self["vip_port_id"]
        Yao::Port.find vip_port_id
      end
    end

    # @return [Yao::Resources::Subnet]
    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

5 entries across 5 versions & 1 rubygems

Version Path
yao-0.18.0 lib/yao/resources/loadbalancer.rb
yao-0.17.0 lib/yao/resources/loadbalancer.rb
yao-0.16.0 lib/yao/resources/loadbalancer.rb
yao-0.15.0 lib/yao/resources/loadbalancer.rb
yao-0.14.0 lib/yao/resources/loadbalancer.rb