lib/app42/command/base.rb in app42-0.5.3 vs lib/app42/command/base.rb in app42-0.5.4
- old
+ new
@@ -37,11 +37,11 @@
# get supported virtual machine type by app42paas
def get_vm_types
vm_type = App42::Command::Config.new.get_vm_type
vm_type_array = vm_type['deploymentType'].map(&:capitalize)
- input "Select Virtual Machine Type", vm_type_array, true
+ input "Select Instance Type", vm_type_array, true
end
# @return iaas providers
def get_iaas_providers
iaas_provider_hash = {}
@@ -60,11 +60,11 @@
collect_vm_details app_name, iaas, vm_type
end
# Ask application name from user and
# will wait for user response (user will enter application name)
- def get_app_name(prompt = Paint['Application Name', :cyan])
+ def get_app_name(prompt = Paint['Enter App Name', :cyan])
app_name = ask(prompt) {|q| q.each = true}
valid_app_name = validate_app_and_service_name "App name", app_name.strip
valid_app_name ? (return valid_app_name) : get_app_name
end
@@ -182,11 +182,11 @@
# check app availabilities
def app_url_availability app_name
query_params = params
query_params.store('appName', app_name)
- response = with_progress(Paint["\nChecking App Name Availability", :yellow]) do |s|
+ response = with_progress(Paint["Checking App Name Availability", :yellow]) do |s|
build_get_request query_params, 'app', 'availability'
end
if response["success"]
print_new_line
@@ -231,11 +231,11 @@
}}}.to_json
query_params = params
query_params.store('body', body)
- response = with_progress(Paint["Creating Infrastructure", :yellow]) do |s|
+ response = with_progress(Paint["Setting up the infrastructure", :yellow]) do |s|
build_post_request body, query_params, 'app', nil
end
if response["success"] == true && response["transactionId"]
transaction_success = check_transaction_status response["transactionId"], previous_completed = 0, 'created'
@@ -246,11 +246,11 @@
transaction_params.store('appName', app_name)
host_response = build_get_request transaction_params, "app", "#{app_name}"
end
if host_response['success']
- puts Paint["Default Application Deployed. URL is: #{host_response['appInfo']['appUrl']}", :green]
+ puts Paint["Default application has been deployed. You can visit '#{host_response['appInfo']['appUrl']}' to see the default application.", :green]
return true
else
puts Paint["#{response['description']}", :red]
end
rescue Interrupt
@@ -500,21 +500,21 @@
# reset service password and fetch service latest details
#
# ==== Parameters
# service_name = service name provided by user
- # old_password = service old password
+ # service_token = service token
#
# ==== return
# true:: if reset password successful
# OR
# ERROR message in case failed
- def reset_password service_name, old_password
+ def reset_password service_name, service_token
begin
- body = {'app42' => {"request"=> {
+ body = {'app42' => {"request"=> {
"serviceName" => service_name,
- "password" => old_password
+ "token" => service_token
}}}.to_json
query_params = params
query_params.store('body', body)
@@ -640,10 +640,10 @@
#
def get_instance obj
instance = @options[:instance] if @options[:instance]
unless instance
instance = nil
- instance = ask Paint[ obj == 'new_vm' ? "No of instances you want?" : "#{obj.capitalize} by instance(s)", :cyan]
+ instance = ask Paint[ obj == 'new_vm' ? "No of instances you want?" : "#{obj.capitalize} by instance(s)", :cyan], :default => 1
end
instance_count = number_valid? instance
\ No newline at end of file