Sha256: 37f70ba575f7d71f5534bf36f08db096ce4fe8dbfbd2b48f3ac94483055bb355

Contents?: true

Size: 936 Bytes

Versions: 19

Compression:

Stored size: 936 Bytes

Contents

module Yao::Resources
  class Router < Base
    friendly_attributes :tenant_id, :project_id, :name, :description, :admin_state_up, :status, :external_gateway_info,
                        :network_id, :enable_snat, :external_fixed_ips, :routes, :destination, :nexthop, :distributed,
                        :ha, :availability_zone_hints, :availability_zones

    self.service        = 'network'
    self.resource_name  = 'router'
    self.resources_name = 'routers'

    def interfaces
      Yao::Port.list(device_id: id)
    end

    class << self
      def add_interface(id, param)
        PUT(['routers', id, 'add_router_interface.json'].join('/'), param.to_json)
      end

      def remove_interface(id, param)
        PUT(['routers', id, 'remove_router_interface.json'].join('/'), param.to_json)
      end

      def get_by_name(name)
        self.list(name: name)
      end
      alias find_by_name get_by_name
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
yao-0.7.0 lib/yao/resources/router.rb
yao-0.6.3 lib/yao/resources/router.rb
yao-0.6.2 lib/yao/resources/router.rb
yao-0.6.1 lib/yao/resources/router.rb
yao-0.6.0 lib/yao/resources/router.rb
yao-0.5.0 lib/yao/resources/router.rb
yao-0.4.3 lib/yao/resources/router.rb
yao-0.4.2 lib/yao/resources/router.rb
yao-0.4.1 lib/yao/resources/router.rb
yao-0.4.0 lib/yao/resources/router.rb
yao-0.3.8 lib/yao/resources/router.rb
yao-0.3.7 lib/yao/resources/router.rb
yao-0.3.6 lib/yao/resources/router.rb
yao-0.3.5 lib/yao/resources/router.rb
yao-0.3.4 lib/yao/resources/router.rb
yao-0.3.3 lib/yao/resources/router.rb
yao-0.3.2 lib/yao/resources/router.rb
yao-0.3.1 lib/yao/resources/router.rb
yao-0.3.0 lib/yao/resources/router.rb