Class: Aws::OpsWorks::Resource
- Inherits:
-
Object
- Object
- Aws::OpsWorks::Resource
- Defined in:
- lib/aws-sdk-opsworks/resource.rb
Actions collapse
Associations collapse
Instance Method Summary collapse
- #client ⇒ Client
-
#initialize(options = {}) ⇒ Resource
constructor
A new instance of Resource.
Constructor Details
#initialize(options = {}) ⇒ Resource
Returns a new instance of Resource.
13 14 15 |
# File 'lib/aws-sdk-opsworks/resource.rb', line 13 def initialize( = {}) @client = [:client] || Client.new() end |
Instance Method Details
#create_stack(options = {}) ⇒ Stack
321 322 323 324 325 326 327 |
# File 'lib/aws-sdk-opsworks/resource.rb', line 321 def create_stack( = {}) resp = @client.create_stack() Stack.new( id: resp.data.stack_id, client: @client ) end |
#layer(id) ⇒ Layer
333 334 335 336 337 338 |
# File 'lib/aws-sdk-opsworks/resource.rb', line 333 def layer(id) Layer.new( id: id, client: @client ) end |
#stack(id) ⇒ Stack
342 343 344 345 346 347 |
# File 'lib/aws-sdk-opsworks/resource.rb', line 342 def stack(id) Stack.new( id: id, client: @client ) end |
#stacks(options = {}) ⇒ Stack::Collection
360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 |
# File 'lib/aws-sdk-opsworks/resource.rb', line 360 def stacks( = {}) batches = Enumerator.new do |y| batch = [] resp = @client.describe_stacks() resp.data.stacks.each do |s| batch << Stack.new( id: s.stack_id, data: s, client: @client ) end y.yield(batch) end Stack::Collection.new(batches) end |