Class: Aws::OpsWorks::Resource
- Inherits:
-
Object
- Object
- Aws::OpsWorks::Resource
- Defined in:
- gems/aws-sdk-opsworks/lib/aws-sdk-opsworks/resource.rb
Overview
This class provides a resource oriented interface for OpsWorks. To create a resource object:
resource = Aws::OpsWorks::Resource.new(region: 'us-west-2')
You can supply a client object with custom configuration that will be used for all resource operations.
If you do not pass :client
, a default client will be constructed.
client = Aws::OpsWorks::Client.new(region: 'us-west-2')
resource = Aws::OpsWorks::Resource.new(client: client)
Actions collapse
Associations collapse
Instance Method Summary collapse
-
#client ⇒ Client
-
#initialize(options = {}) ⇒ Resource
constructor
A new instance of Resource.
Constructor Details
Instance Method Details
#client ⇒ Client
32 33 34 |
# File 'gems/aws-sdk-opsworks/lib/aws-sdk-opsworks/resource.rb', line 32 def client @client end |
#create_stack(options = {}) ⇒ Stack
356 357 358 359 360 361 362 |
# File 'gems/aws-sdk-opsworks/lib/aws-sdk-opsworks/resource.rb', line 356 def create_stack( = {}) resp = @client.create_stack() Stack.new( id: resp.data.stack_id, client: @client ) end |
#layer(id) ⇒ Layer
368 369 370 371 372 373 |
# File 'gems/aws-sdk-opsworks/lib/aws-sdk-opsworks/resource.rb', line 368 def layer(id) Layer.new( id: id, client: @client ) end |
#stack(id) ⇒ Stack
377 378 379 380 381 382 |
# File 'gems/aws-sdk-opsworks/lib/aws-sdk-opsworks/resource.rb', line 377 def stack(id) Stack.new( id: id, client: @client ) end |
#stacks(options = {}) ⇒ Stack::Collection
395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 |
# File 'gems/aws-sdk-opsworks/lib/aws-sdk-opsworks/resource.rb', line 395 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 |