Class: Awscli::As::Policies
- Inherits:
-
Object
- Object
- Awscli::As::Policies
- Defined in:
- lib/awscli/as.rb
Instance Method Summary collapse
- #create(options) ⇒ Object
- #destroy(name, group_name) ⇒ Object
-
#initialize(connection) ⇒ Policies
constructor
A new instance of Policies.
- #list ⇒ Object
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() @conn.policies.create() puts "Created auto scaling policy: #{[:id]}, for auto scaling group: #{[: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 |
#list ⇒ Object
269 270 271 |
# File 'lib/awscli/as.rb', line 269 def list @conn.policies.table end |