Class: Chef::Knife::Cloud::VcenterDatacenterList
- Inherits:
-
ResourceListCommand
- Object
- ResourceListCommand
- Chef::Knife::Cloud::VcenterDatacenterList
- Includes:
- VcenterServiceOptions
- Defined in:
- lib/chef/knife/vcenter_datacenter_list.rb
Overview
Extends the ResourceListCommand for specific vCenter
Instance Method Summary collapse
-
#before_exec_command ⇒ Object
Sets up the columns for listing out and sorts by name.
-
#query_resource ⇒ Object
Call service to get the list of hosts from vcenter.
Methods included from VcenterServiceOptions
Instance Method Details
#before_exec_command ⇒ Object
Sets up the columns for listing out and sorts by name
43 44 45 46 47 48 49 50 |
# File 'lib/chef/knife/vcenter_datacenter_list.rb', line 43 def before_exec_command @columns_with_info = [ { label: "ID", key: "datacenter" }, { label: "Name", key: "name" }, ] @sort_by_field = "name" end |
#query_resource ⇒ Object
Call service to get the list of hosts from vcenter
54 55 56 |
# File 'lib/chef/knife/vcenter_datacenter_list.rb', line 54 def query_resource service.list_datacenters end |