class Chef::Knife::Cloud::OraclecloudOrchestrationList

Public Instance Methods

before_exec_command() click to toggle source
# File lib/chef/knife/oraclecloud_orchestration_list.rb, line 36
def before_exec_command
  @columns_with_info = [
    { label: 'Orchestration ID',  key: 'name_with_container' },
    { label: 'Description',       key: 'description' },
    { label: 'Status',            key: 'status', value_callback: method(:format_status_value) },
    { label: 'Instance Count',    key: 'instance_count' }
  ]

  @sort_by_field = 'name_with_container'
end
format_status_value(status) click to toggle source
# File lib/chef/knife/oraclecloud_orchestration_list.rb, line 51
def format_status_value(status)
  status = status.downcase
  status_color = case status
                 when 'ready'
                   :green
                 when 'stopped'
                   :red
                 else
                   :yellow
                 end

  ui.color(status, status_color)
end
query_resource() click to toggle source
# File lib/chef/knife/oraclecloud_orchestration_list.rb, line 47
def query_resource
  service.list_orchestrations
end