class Chef::Knife::Cloud::GoogleImageList

Public Instance Methods

before_exec_command() click to toggle source
# File lib/chef/knife/google_image_list.rb, line 40
def before_exec_command
  @columns_with_info = [
    { label: "NAME", key: "name" },
    { label: "PROJECT", key: "self_link", value_callback: method(:find_project_name) },
    { label: "FAMILY", key: "family" },
    { label: "DISK SIZE", key: "disk_size_gb", value_callback: method(:format_disk_size_value) },
    { label: "STATUS", key: "status" },
  ]
end
find_project_name(self_link) click to toggle source
# File lib/chef/knife/google_image_list.rb, line 50
def find_project_name(self_link)
  self_link[%r{projects\/(.*?)\/}m, 1]
end
format_disk_size_value(disk_size) click to toggle source
# File lib/chef/knife/google_image_list.rb, line 54
def format_disk_size_value(disk_size)
  "#{disk_size} GB"
end
query_resource() click to toggle source
# File lib/chef/knife/google_image_list.rb, line 58
def query_resource
  service.list_images
end
validate_params!() click to toggle source
Calls superclass method
# File lib/chef/knife/google_image_list.rb, line 35
def validate_params!
  check_for_missing_config_values!
  super
end