lib/app42/command/setup.rb in app42-0.5.8 vs lib/app42/command/setup.rb in app42-0.5.9
- old
+ new
@@ -17,15 +17,29 @@
exit! if setup_cloud_api_res
end
# Delete App42 cloud API setup, return true or error code/message
def delete_cloud_api
- @options[:name] = get_setup_name if @options[:name].nil?
- response = delete_clouldapi @options[:name] if is_setup_name_exist? @options[:name]
+ @options[:setup] = get_setup_name if @options[:setup].nil?
+ response = delete_clouldapi @options[:setup] if is_setup_name_exist? @options[:setup]
exit! if response
end
+ # collect BPaaS setup name from user and proceed BPaaS start request
+ def start
+ @options[:setup] = get_setup_name if @options[:setup].nil?
+ response = clouldapi_operation __method__, @options[:setup] if is_setup_name_exist? @options[:setup]
+ exit! if response
+ end
+
+ # collect BPaaS setup name from user and proceed BPaaS stop request
+ def stop
+ @options[:setup] = get_setup_name if @options[:setup].nil?
+ response = clouldapi_operation __method__, @options[:setup] if is_setup_name_exist? @options[:setup]
+ exit! if response
+ end
+
# return setup type
def get_setup_type
setup_type_hash = {}
setup_type = App42::Command::Config.new.get_setup_type_fm_server
@@ -45,21 +59,21 @@
return flavour_id
end
# get details information of App42 cloud setup
def info
- @options[:name] = get_setup_name if @options[:name].nil?
+ @options[:setup] = get_setup_name if @options[:setup].nil?
query_params = params
- query_params.store('setupName', @options[:name])
- setup_info = build_get_request query_params, 'setup', "#{@options[:name]}"
+ query_params.store('setupName', @options[:setup])
+ setup_info = build_get_request query_params, 'setup', "#{@options[:setup]}"
rows, rows_header_final, rows_header = [], [], nil
if setup_info && setup_info['setupInfo']
rows_header = setup_info['setupInfo'].keys
rows << setup_info['setupInfo'].values
rows_header.map { |e| rows_header_final << camel_case_to_whitespace(e) }
- table = Terminal::Table.new :title => Paint["=== #{@options[:name]} Details ===", :green], :headings => rows_header_final, :rows => rows
+ table = Terminal::Table.new :title => Paint["=== #{@options[:setup]} Details ===", :green], :headings => rows_header_final, :rows => rows
puts table
end
end
# List all setups
\ No newline at end of file