class Chef::Knife::Cloud::GoogleZoneList

Public Instance Methods

before_exec_command() click to toggle source
# File lib/chef/knife/google_zone_list.rb, line 41
def before_exec_command
  @columns_with_info = [
    { label: "Zone",   key: "name" },
    { label: "Status", key: "status", value_callback: method(:format_status_value) },
  ]

  @sort_by_field = "name"
end
format_status_value(status) click to toggle source
# File lib/chef/knife/google_zone_list.rb, line 50
def format_status_value(status)
  status = status.downcase
  status_color = if status == "up"
                   :green
                 else
                   :red
                 end

  ui.color(status, status_color)
end
query_resource() click to toggle source
# File lib/chef/knife/google_zone_list.rb, line 61
def query_resource
  service.list_zones
end
validate_params!() click to toggle source
Calls superclass method
# File lib/chef/knife/google_zone_list.rb, line 36
def validate_params!
  check_for_missing_config_values!
  super
end