Sha256: b40ca1f4457de31da2c88899741cc913585053d7ab24f2f58c5287b392c944da

Contents?: true

Size: 977 Bytes

Versions: 5

Compression:

Stored size: 977 Bytes

Contents

# Author:: Vasundhara Jagdale (<vasundhara.jagdale@clogeny.com>)
# Copyright:: Copyright (c) 2015 Chef Software, Inc.

require 'chef/knife/cloud/list_resource_command'
require 'chef/knife/openstack_helpers'
require 'chef/knife/cloud/openstack_service_options'

class Chef
  class Knife
    class Cloud
      class OpenstackFloatingIpList < ResourceListCommand
        include OpenstackHelpers
        include OpenstackServiceOptions

        banner 'knife openstack floating_ip list (options)'

        def before_exec_command
          # set columns_with_info map
          @columns_with_info = [
            { label: 'ID', key: 'id' },
            { label: 'Instance ID', key: 'instance_id' },
            { label: 'IP Address', key: 'ip' },
            { label: 'Fixed IP', key: 'fixed_ip' },
            { label: 'Floating IP Pool', key: 'pool' }
          ]
        end

        def query_resource
          @service.list_addresses
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
knife-openstack-1.3.2 lib/chef/knife/openstack_floating_ip_list.rb
knife-openstack-1.3.2.rc1 lib/chef/knife/openstack_floating_ip_list.rb
knife-openstack-1.3.2.pre.1 lib/chef/knife/openstack_floating_ip_list.rb
knife-openstack-1.3.2.pre lib/chef/knife/openstack_floating_ip_list.rb
knife-openstack-1.3.1 lib/chef/knife/openstack_floating_ip_list.rb