Class: Chef::Knife::Cloud::VcenterDatacenterList
- Inherits:
-
ResourceListCommand
- Object
- ResourceListCommand
- Chef::Knife::Cloud::VcenterDatacenterList
- Includes:
- VcenterServiceHelpers, 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
Methods included from VcenterServiceHelpers
#check_for_missing_config_values!, #create_service_instance, #validate!, #verify_ssl?
Instance Method Details
#before_exec_command ⇒ Object
Sets up the columns for listing out and sorts by name
40 41 42 43 44 45 46 47 |
# File 'lib/chef/knife/vcenter_datacenter_list.rb', line 40 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
51 52 53 |
# File 'lib/chef/knife/vcenter_datacenter_list.rb', line 51 def query_resource service.list_datacenters end |