Class: Chef::Knife::Cloud::OraclecloudOrchestrationShow

Inherits:
Command
  • Object
show all
Includes:
OraclecloudServiceHelpers, OraclecloudServiceOptions
Defined in:
lib/chef/knife/oraclecloud_orchestration_show.rb

Instance Method Summary collapse

Methods included from OraclecloudServiceOptions

included

Methods included from OraclecloudServiceHelpers

#check_for_missing_config_values!, #create_service_instance, #verify_ssl?

Instance Method Details

#execute_commandObject



50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/chef/knife/oraclecloud_orchestration_show.rb', line 50

def execute_command
  orchestration = service.get_orchestration(@name_args.first)

  ui.msg(ui.color('Orchestration Summary', :bold))
  service.orchestration_summary(orchestration)
  ui.msg('')

  orchestration.instances.each do |instance|
    ui.msg(ui.color("Instance #{instance.id}", :bold))
    service.server_summary(instance)
    ui.msg('')
  end
end

#validate_params!Object



36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/chef/knife/oraclecloud_orchestration_show.rb', line 36

def validate_params!
  if @name_args.empty?
    ui.error('You must supply an Orchestration ID for an orchestration to display.')
    exit 1
  end

  if @name_args.size > 1
    ui.error('You may only supply one Orchestration ID.')
    exit 1
  end

  super
end