Class: Aws::AutoScaling::Resource
- Inherits:
-
Object
- Object
- Aws::AutoScaling::Resource
- Defined in:
- lib/aws-sdk-autoscaling/resource.rb
Actions collapse
- #create_group(options = {}) ⇒ AutoScalingGroup
- #create_launch_configuration(options = {}) ⇒ LaunchConfiguration
Associations collapse
- #activities(options = {}) ⇒ Activity::Collection
- #activity(id) ⇒ Activity
- #group(name) ⇒ AutoScalingGroup
- #groups(options = {}) ⇒ AutoScalingGroup::Collection
- #instances(options = {}) ⇒ Instance::Collection
- #launch_configuration(name) ⇒ LaunchConfiguration
- #launch_configurations(options = {}) ⇒ LaunchConfiguration::Collection
- #policies(options = {}) ⇒ ScalingPolicy::Collection
- #policy(name) ⇒ ScalingPolicy
- #scheduled_action(name) ⇒ ScheduledAction
- #scheduled_actions(options = {}) ⇒ ScheduledAction::Collection
- #tags(options = {}) ⇒ Tag::Collection
Instance Method Summary collapse
- #client ⇒ Client
-
#initialize(options = {}) ⇒ Resource
constructor
A new instance of Resource.
Constructor Details
Instance Method Details
#activities(options = {}) ⇒ Activity::Collection
492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 |
# File 'lib/aws-sdk-autoscaling/resource.rb', line 492 def activities( = {}) batches = Enumerator.new do |y| resp = @client.describe_scaling_activities() resp.each_page do |page| batch = [] page.data.activities.each do |a| batch << Activity.new( id: a.activity_id, data: a, client: @client ) end y.yield(batch) end end Activity::Collection.new(batches) end |
#activity(id) ⇒ Activity
512 513 514 515 516 517 |
# File 'lib/aws-sdk-autoscaling/resource.rb', line 512 def activity(id) Activity.new( id: id, client: @client ) end |
#client ⇒ Client
18 19 20 |
# File 'lib/aws-sdk-autoscaling/resource.rb', line 18 def client @client end |
#create_group(options = {}) ⇒ AutoScalingGroup
237 238 239 240 241 242 243 |
# File 'lib/aws-sdk-autoscaling/resource.rb', line 237 def create_group( = {}) resp = @client.create_auto_scaling_group() AutoScalingGroup.new( name: [:auto_scaling_group_name], client: @client ) end |
#create_launch_configuration(options = {}) ⇒ LaunchConfiguration
466 467 468 469 470 471 472 |
# File 'lib/aws-sdk-autoscaling/resource.rb', line 466 def create_launch_configuration( = {}) resp = @client.create_launch_configuration() LaunchConfiguration.new( name: [:launch_configuration_name], client: @client ) end |
#group(name) ⇒ AutoScalingGroup
521 522 523 524 525 526 |
# File 'lib/aws-sdk-autoscaling/resource.rb', line 521 def group(name) AutoScalingGroup.new( name: name, client: @client ) end |
#groups(options = {}) ⇒ AutoScalingGroup::Collection
539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 |
# File 'lib/aws-sdk-autoscaling/resource.rb', line 539 def groups( = {}) batches = Enumerator.new do |y| resp = @client.describe_auto_scaling_groups() resp.each_page do |page| batch = [] page.data.auto_scaling_groups.each do |a| batch << AutoScalingGroup.new( name: a.auto_scaling_group_name, data: a, client: @client ) end y.yield(batch) end end AutoScalingGroup::Collection.new(batches) end |
#instances(options = {}) ⇒ Instance::Collection
568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 |
# File 'lib/aws-sdk-autoscaling/resource.rb', line 568 def instances( = {}) batches = Enumerator.new do |y| resp = @client.describe_auto_scaling_instances() resp.each_page do |page| batch = [] page.data.auto_scaling_instances.each do |a| batch << Instance.new( group_name: a.auto_scaling_group_name, id: a.instance_id, data: a, client: @client ) end y.yield(batch) end end Instance::Collection.new(batches) end |
#launch_configuration(name) ⇒ LaunchConfiguration
589 590 591 592 593 594 |
# File 'lib/aws-sdk-autoscaling/resource.rb', line 589 def launch_configuration(name) LaunchConfiguration.new( name: name, client: @client ) end |
#launch_configurations(options = {}) ⇒ LaunchConfiguration::Collection
606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 |
# File 'lib/aws-sdk-autoscaling/resource.rb', line 606 def launch_configurations( = {}) batches = Enumerator.new do |y| resp = @client.describe_launch_configurations() resp.each_page do |page| batch = [] page.data.launch_configurations.each do |l| batch << LaunchConfiguration.new( name: l.launch_configuration_name, data: l, client: @client ) end y.yield(batch) end end LaunchConfiguration::Collection.new(batches) end |
#policies(options = {}) ⇒ ScalingPolicy::Collection
643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 |
# File 'lib/aws-sdk-autoscaling/resource.rb', line 643 def policies( = {}) batches = Enumerator.new do |y| resp = @client.describe_policies() resp.each_page do |page| batch = [] page.data.scaling_policies.each do |s| batch << ScalingPolicy.new( name: s.policy_name, data: s, client: @client ) end y.yield(batch) end end ScalingPolicy::Collection.new(batches) end |
#policy(name) ⇒ ScalingPolicy
663 664 665 666 667 668 |
# File 'lib/aws-sdk-autoscaling/resource.rb', line 663 def policy(name) ScalingPolicy.new( name: name, client: @client ) end |
#scheduled_action(name) ⇒ ScheduledAction
672 673 674 675 676 677 |
# File 'lib/aws-sdk-autoscaling/resource.rb', line 672 def scheduled_action(name) ScheduledAction.new( name: name, client: @client ) end |
#scheduled_actions(options = {}) ⇒ ScheduledAction::Collection
702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 |
# File 'lib/aws-sdk-autoscaling/resource.rb', line 702 def scheduled_actions( = {}) batches = Enumerator.new do |y| resp = @client.describe_scheduled_actions() resp.each_page do |page| batch = [] page.data.scheduled_update_group_actions.each do |s| batch << ScheduledAction.new( name: s.scheduled_action_name, data: s, client: @client ) end y.yield(batch) end end ScheduledAction::Collection.new(batches) end |
#tags(options = {}) ⇒ Tag::Collection
735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 |
# File 'lib/aws-sdk-autoscaling/resource.rb', line 735 def ( = {}) batches = Enumerator.new do |y| resp = @client.() resp.each_page do |page| batch = [] page.data..each do |t| batch << Tag.new( key: t.key, resource_id: t.resource_id, resource_type: t.resource_type, data: t, client: @client ) end y.yield(batch) end end Tag::Collection.new(batches) end |