Class: Awscli::As::Policies

Inherits:
Object
  • Object
show all
Defined in:
lib/awscli/as.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ Policies

Returns a new instance of Policies.



265
266
267
# File 'lib/awscli/as.rb', line 265

def initialize(connection)
  @conn = connection
end

Instance Method Details

#create(options) ⇒ Object



273
274
275
276
# File 'lib/awscli/as.rb', line 273

def create(options)
  @conn.policies.create(options)
  puts "Created auto scaling policy: #{options[:id]}, for auto scaling group: #{options[:auto_scaling_group_name]}"
end

#destroy(name, group_name) ⇒ Object



278
279
280
281
282
283
284
285
# File 'lib/awscli/as.rb', line 278

def destroy(name, group_name)
  begin
    @conn.delete_policy(group_name, name)
    puts "Deleted auto scaling policy: #{name}"
  rescue Fog::AWS::AutoScaling::ValidationError
    puts "Validation Error: #{$!}"
  end
end

#listObject



269
270
271
# File 'lib/awscli/as.rb', line 269

def list
  @conn.policies.table
end