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