Sha256: 12b373c4f5aea1a973c6bdb8f690f0e0bc25c0ea1a1632ce7a3af7215ec3041d

Contents?: true

Size: 1.5 KB

Versions: 26

Compression:

Stored size: 1.5 KB

Contents

module Yao::Resources
  class LoadBalancerPoolMember < Base
    friendly_attributes :monitor_port, :name, :weight,
                        :admin_state_up, :provisioning_status,
                        :monitor_address, :address,
                        :protocol_port, :operating_status

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

    def subnet
      if subnet_id = self["subnet_id"]
        Yao::Subnet.find subnet_id
      end
    end

    self.service        = "load-balancer"
    self.api_version    = "v2.0"
    self.resource_name  = "member"
    self.resources_name = "members"

    class << self

      def list(pool, query={})
        self.resources_path = member_resources_path(pool)
        super(query)
      end

      def get(pool, id_or_permalink, query={})
        self.resources_path = member_resources_path(pool)
        super(id_or_permalink, query)
      end
      alias find get

      def create(pool, resource_params)
        self.resources_path = member_resources_path(pool)
        super(resource_params)
      end

      def update(pool, id, resource_params)
        self.resources_path = member_resources_path(pool)
        super(id, resource_params)
      end

      def destroy(pool, id)
        self.resources_path = member_resources_path(pool)
        super(id)
      end

      private
      def member_resources_path(pool)
        "lbaas/pools/#{pool.id}/#{self.resources_name}"
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

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