Sha256: 9d1f0b4bda7bc6a0f051edb8401313a17ee763a5e19d456b89460ac55ecc18df

Contents?: true

Size: 916 Bytes

Versions: 3

Compression:

Stored size: 916 Bytes

Contents

# Author:: Prabhu Das (<prabhu.das@clogeny.com>)
# Copyright:: Copyright (c) 2014 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 OpenstackNetworkList < ResourceListCommand
        include OpenstackHelpers
        include OpenstackServiceOptions

        banner 'knife openstack network list (options)'

        def before_exec_command
          # set columns_with_info map
          @columns_with_info = [
            { label: 'Name', key: 'name' },
            { label: 'ID', key: 'id' },
            { label: 'Tenant', key: 'tenant_id' },
            { label: 'Shared', key: 'shared' }
          ]
          @sort_by_field = 'name'
        end

        def query_resource
          @service.list_networks
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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