Class: AwsRo::ElasticLoadBalancingV2::TargetGroup
- Inherits:
-
Object
- Object
- AwsRo::ElasticLoadBalancingV2::TargetGroup
- Extended by:
- Forwardable
- Defined in:
- lib/aws_ro/elastic_load_balancing_v2/load_balancer.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#target_group_arn ⇒ Object
(also: #arn)
readonly
Returns the value of attribute target_group_arn.
Instance Method Summary collapse
- #health(instance_id = nil) ⇒ Object
-
#initialize(arn, client) ⇒ TargetGroup
constructor
A new instance of TargetGroup.
- #instances(ec2_repository = nil) ⇒ Object
- #target_group ⇒ Object
Constructor Details
#initialize(arn, client) ⇒ TargetGroup
76 77 78 79 |
# File 'lib/aws_ro/elastic_load_balancing_v2/load_balancer.rb', line 76 def initialize(arn, client) @target_group_arn = arn @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
72 73 74 |
# File 'lib/aws_ro/elastic_load_balancing_v2/load_balancer.rb', line 72 def client @client end |
#target_group_arn ⇒ Object (readonly) Also known as: arn
Returns the value of attribute target_group_arn.
72 73 74 |
# File 'lib/aws_ro/elastic_load_balancing_v2/load_balancer.rb', line 72 def target_group_arn @target_group_arn end |
Instance Method Details
#health(instance_id = nil) ⇒ Object
81 82 83 84 |
# File 'lib/aws_ro/elastic_load_balancing_v2/load_balancer.rb', line 81 def health(instance_id = nil) return health_descriptions[instance_id] if instance_id health_descriptions.values end |
#instances(ec2_repository = nil) ⇒ Object
90 91 92 93 94 95 96 |
# File 'lib/aws_ro/elastic_load_balancing_v2/load_balancer.rb', line 90 def instances(ec2_repository = nil) ec2_repository ||= AwsRo::EC2::Repository.new( region: client.config.region, credentials: client.config.credentials ) health_descriptions.empty? ? [] : ec2_repository.instance_ids(health_descriptions.keys) end |
#target_group ⇒ Object
86 87 88 |
# File 'lib/aws_ro/elastic_load_balancing_v2/load_balancer.rb', line 86 def target_group @target_group ||= client.describe_target_groups(target_group_arns: [arn]).target_groups.first end |