Sha256: d3d678dd55e285fd32999c158967e4356b661c4524d2690c2a617cb3d93d4b3f

Contents?: true

Size: 1008 Bytes

Versions: 3

Compression:

Stored size: 1008 Bytes

Contents

# frozen_string_literal: true
# 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

3 entries across 3 versions & 1 rubygems

Version Path
knife-openstack-2.1.0 lib/chef/knife/openstack_floating_ip_list.rb
knife-openstack-2.0.1 lib/chef/knife/openstack_floating_ip_list.rb
knife-openstack-2.0.0 lib/chef/knife/openstack_floating_ip_list.rb