class Chef::Knife::Cloud::VraServerList

Public Instance Methods

before_exec_command() click to toggle source
# File lib/chef/knife/vra_server_list.rb, line 40
def before_exec_command
  @columns_with_info = [
    { label: "Resource ID",  key: "id" },
    { label: "Name",         key: "name" },
    { label: "Status",       key: "status", value_callback: method(:format_status_value) },
    { label: "Catalog Name", key: "catalog_name" },
  ]

  @sort_by_field = "name"
end
format_status_value(status) click to toggle source
# File lib/chef/knife/vra_server_list.rb, line 51
def format_status_value(status)
  status = status.downcase
  status_color = case status
                 when "active"
                   :green
                 when "deleted"
                   :red
                 else
                   :yellow
                 end
  ui.color(status, status_color)
end