ruby_aem_aws 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 34448f0994323f7e43c692f579291e49bc7b8d6d
4
- data.tar.gz: 6ae2d4f79cf7cecb8ce3e3f958c6d1242d931533
3
+ metadata.gz: ff1811700428fb65c37eb7e1483880d021409248
4
+ data.tar.gz: 0a9a738540c1b4ef71c36b4a7d87720f92dc21ca
5
5
  SHA512:
6
- metadata.gz: aa09b1af950044949917e929bf65db54a81ee86a22afc23d344896c5b93876651f8b500560794ecfcd68cba0bafd30857f1aa1dfc059365e27e89d5122a8ead7
7
- data.tar.gz: cb1e8f21104881a61379c9238fe213806b9a6e58925273f3c5f6c5e9aac474b492438963bfd2e947545d74b2143790c3af54aea03eeebc3a767a5947d64f3618
6
+ metadata.gz: dde9e65199958cda617db9e1c0025c572afd05b66233773ac642dc424003d5913b9b88ee20492ae63dc24c011e082e914ffa58aaaf7ee63b629e4ffd8fc4ac99
7
+ data.tar.gz: '0342921e2739eb702196395a0f2a9bcbe89395fb631a352ebb7a211453f42a435b3513a8c6b680ddfa7cfdd265e60263d4544bdc4ea40cf5cf37084d5b38f5c4'
@@ -23,7 +23,7 @@ module RubyAemAws
23
23
  include InstanceDescriber
24
24
 
25
25
  def to_s
26
- "#{self.class.name.split('::').last}(#{@descriptor.stack_prefix unless @descriptor.nil?})"
26
+ "#{self.class.name.split('::').last}(#{@descriptor&.stack_prefix})"
27
27
  end
28
28
 
29
29
  private
@@ -12,9 +12,9 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- require_relative '../abstract/single_component'
15
+ require_relative '../abstract/grouped_component'
16
16
  require_relative '../abstract/snapshot'
17
- require_relative '../mixins/healthy_state_verifier'
17
+ require_relative '../mixins/healthy_resource_verifier'
18
18
  require_relative '../mixins/metric_verifier'
19
19
  require_relative '../mixins/snapshot_verifier'
20
20
 
@@ -23,10 +23,9 @@ module RubyAemAws
23
23
  # Interface to the AWS instance running the ChaosMonkey component of a full-set AEM stack.
24
24
  class ChaosMonkey
25
25
  attr_reader :descriptor, :ec2_resource, :asg_client, :cloud_watch_client, :cloud_watch_log_client
26
- include AbstractSingleComponent
26
+ include AbstractGroupedComponent
27
27
  include AbstractSnapshot
28
- # Can't verify state by count as there's no ELB.
29
- include HealthyStateVerifier
28
+ include HealthyResourceVerifier
30
29
  include MetricVerifier
31
30
  include SnapshotVerifier
32
31
 
@@ -49,9 +48,19 @@ module RubyAemAws
49
48
  @ec2_resource = params[:Ec2Resource]
50
49
  end
51
50
 
52
- # def terminate_all_instances
51
+ def terminate_all_instances
52
+ get_all_instances.each do |i|
53
+ next if i.nil?
54
+ i.terminate
55
+ i.wait_until_terminated
56
+ end
57
+ end
53
58
 
54
- # def terminate_random_instance
59
+ def terminate_random_instance
60
+ instance = get_random_instance
61
+ instance.terminate
62
+ instance.wait_until_terminated
63
+ end
55
64
  end
56
65
  end
57
66
  end
@@ -12,9 +12,9 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- require_relative '../abstract/single_component'
15
+ require_relative '../abstract/grouped_component'
16
16
  require_relative '../abstract/snapshot'
17
- require_relative '../mixins/healthy_state_verifier'
17
+ require_relative '../mixins/healthy_resource_verifier'
18
18
  require_relative '../mixins/metric_verifier'
19
19
  require_relative '../mixins/snapshot_verifier'
20
20
 
@@ -23,10 +23,9 @@ module RubyAemAws
23
23
  # Interface to the AWS instance running the Orchestrator component of a full-set AEM stack.
24
24
  class Orchestrator
25
25
  attr_reader :descriptor, :ec2_resource, :asg_client, :cloud_watch_client, :cloud_watch_log_client
26
- include AbstractSingleComponent
26
+ include AbstractGroupedComponent
27
27
  include AbstractSnapshot
28
- # Can't verify state by count as there's no ELB.
29
- include HealthyStateVerifier
28
+ include HealthyResourceVerifier
30
29
  include MetricVerifier
31
30
  include SnapshotVerifier
32
31
 
@@ -49,9 +48,19 @@ module RubyAemAws
49
48
  @ec2_resource = params[:Ec2Resource]
50
49
  end
51
50
 
52
- # def terminate_all_instances
51
+ def terminate_all_instances
52
+ get_all_instances.each do |i|
53
+ next if i.nil?
54
+ i.terminate
55
+ i.wait_until_terminated
56
+ end
57
+ end
53
58
 
54
- # def terminate_random_instance
59
+ def terminate_random_instance
60
+ instance = get_random_instance
61
+ instance.terminate
62
+ instance.wait_until_terminated
63
+ end
55
64
  end
56
65
  end
57
66
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_aem_aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shine Solutions
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-13 00:00:00.000000000 Z
11
+ date: 2019-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -119,7 +119,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
119
119
  requirements:
120
120
  - - ">="
121
121
  - !ruby/object:Gem::Version
122
- version: '2.1'
122
+ version: '2.3'
123
123
  required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  requirements:
125
125
  - - ">="
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  version: '0'
128
128
  requirements: []
129
129
  rubyforge_project:
130
- rubygems_version: 2.6.14
130
+ rubygems_version: 2.6.14.4
131
131
  signing_key:
132
132
  specification_version: 4
133
133
  summary: AEM on AWS API Ruby client