Sha256: bc1bdbc63dd19d5e885dfcfd288b56a5c930d944cd2b08adaffaee32dc22183c

Contents?: true

Size: 697 Bytes

Versions: 5

Compression:

Stored size: 697 Bytes

Contents

require 'vagrant-conoha/command/openstack_command'

module VagrantPlugins
  module ConoHa
    module Command
      class SubnetList < OpenstackCommand
        def self.synopsis
          I18n.t('vagrant_openstack.command.subnet_list_synopsis')
        end

        def cmd(name, argv, env)
          fail Errors::NoArgRequiredForCommand, cmd: name unless argv.size == 0
          rows = []
          env[:openstack_client].neutron.get_subnets(env).each do |subnet|
            rows << [subnet.id, subnet.name, subnet.cidr, subnet.enable_dhcp, subnet.network_id]
          end
          display_table(env, ['ID', 'Name', 'CIDR', 'DHCP', 'Network ID'], rows)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vagrant-conoha-0.1.10 lib/vagrant-conoha/command/subnet_list.rb
vagrant-conoha-0.1.9 lib/vagrant-conoha/command/subnet_list.rb
vagrant-conoha-0.1.8 lib/vagrant-conoha/command/subnet_list.rb
vagrant-conoha-0.1.7 lib/vagrant-conoha/command/subnet_list.rb
vagrant-conoha-0.1.6 lib/vagrant-conoha/command/subnet_list.rb