mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[rackspace|auto_scale] fixing example formatting
This commit is contained in:
parent
3f8b8a221c
commit
42c495ed4e
3 changed files with 7 additions and 17 deletions
|
@ -65,4 +65,4 @@ change = get_user_input_as_int "Enter change increment"
|
||||||
|
|
||||||
group.policies.create :name => policy_name, :cooldown => cooldown, :type => 'webhook', :change => change
|
group.policies.create :name => policy_name, :cooldown => cooldown, :type => 'webhook', :change => change
|
||||||
|
|
||||||
puts "Policy #{policy_name} was successfully added to group"
|
puts "\nPolicy #{policy_name} was successfully added to group"
|
|
@ -71,4 +71,4 @@ webhook_name = get_user_input "Enter name for webhook"
|
||||||
# create webhook
|
# create webhook
|
||||||
webhook = policy.webhooks.create :name => webhook_name
|
webhook = policy.webhooks.create :name => webhook_name
|
||||||
|
|
||||||
puts "Webhook #{webhook.name} was successfully added - #{webhook.execution_url}"
|
puts "\nWebhook #{webhook.name} was successfully added - #{webhook.execution_url}"
|
||||||
|
|
|
@ -78,7 +78,9 @@ max_entities = get_user_input_as_int "Enter maximum number of servers"
|
||||||
server_name = get_user_input "Enter base name for servers in scaling group '#{scaling_group_name}'"
|
server_name = get_user_input "Enter base name for servers in scaling group '#{scaling_group_name}'"
|
||||||
|
|
||||||
# retrieve list of images from computer service
|
# retrieve list of images from computer service
|
||||||
images = compute_service.images
|
print "Loading available server images...."
|
||||||
|
images = compute_service.images.all
|
||||||
|
puts "[DONE]"
|
||||||
|
|
||||||
# prompt for server image
|
# prompt for server image
|
||||||
image = select_image(images)
|
image = select_image(images)
|
||||||
|
@ -86,18 +88,6 @@ image = select_image(images)
|
||||||
# pick first server flavor
|
# pick first server flavor
|
||||||
flavor = compute_service.flavors.first
|
flavor = compute_service.flavors.first
|
||||||
|
|
||||||
# create server template
|
|
||||||
# server_template = compute_service.servers.new :name => server_name,
|
|
||||||
# :flavor_id => flavor.id,
|
|
||||||
# :image_id => image.id,
|
|
||||||
# :disk_config => "MANUAL",
|
|
||||||
# :metadata => { "created_by" => "autoscale sample script" },
|
|
||||||
# :networks => [INTERNET, SERVICE_NET],
|
|
||||||
# :personality => {
|
|
||||||
# "path" => "/root/.csivh",
|
|
||||||
# "contents" => "VGhpcyBpcyBhIHRlc3QgZmlsZS4="
|
|
||||||
# }
|
|
||||||
|
|
||||||
server_template = {
|
server_template = {
|
||||||
"name" => "autoscale_server",
|
"name" => "autoscale_server",
|
||||||
"imageRef" => image.id,
|
"imageRef" => image.id,
|
||||||
|
@ -125,7 +115,7 @@ server_template = {
|
||||||
}
|
}
|
||||||
|
|
||||||
# create launch configuration
|
# create launch configuration
|
||||||
launch_config = Fog::Rackspace::AutoScale::LaunchConfig.new :type => :launch_server, :args => {:server => s }
|
launch_config = Fog::Rackspace::AutoScale::LaunchConfig.new :type => :launch_server, :args => {:server => server_template }
|
||||||
|
|
||||||
# create group configuration
|
# create group configuration
|
||||||
group_config = Fog::Rackspace::AutoScale::GroupConfig.new :max_entities => max_entities,
|
group_config = Fog::Rackspace::AutoScale::GroupConfig.new :max_entities => max_entities,
|
||||||
|
@ -138,5 +128,5 @@ group_config = Fog::Rackspace::AutoScale::GroupConfig.new :max_entities => max_e
|
||||||
group = auto_scale_service.groups.create :group_config => group_config,
|
group = auto_scale_service.groups.create :group_config => group_config,
|
||||||
:launch_config => launch_config
|
:launch_config => launch_config
|
||||||
|
|
||||||
puts "Scaling Group #{scaling_group_name} (#{group.id}) was created!"
|
puts "\nScaling Group #{scaling_group_name} (#{group.id}) was created!"
|
||||||
puts "State: #{group.state}"
|
puts "State: #{group.state}"
|
||||||
|
|
Loading…
Reference in a new issue