herdst_worker 0.2.5 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f923f35476bb893010b8dfe3fd0ecd8d60cfe599d21b187d1ef2c615e721a8c0
4
- data.tar.gz: db24d82e075659d3cdb955e184f0504d44769f615341c53e33a8140ea022ed3d
3
+ metadata.gz: 82fb9bad92d2b9865305b6137a5404c8c97754ddc508e61bbd47a43ea19344ea
4
+ data.tar.gz: cc61282b4fcc954906f8eccec9e06ff48d77cbfb04a093a3bda616aeb09ef0b2
5
5
  SHA512:
6
- metadata.gz: 94aaf2d09122cdb0eb8b386cb91f3207d7cbb1a98dfc7ad3bbfecbcdedbded460162c73fd4d83daae306d885de83be76c517eb2efc27b0109c0c04302cf7cf12
7
- data.tar.gz: 4c1a7e468c82f9467eb6a57d020d5e64057185b15399ab8c8debae202eca047d2fd7fcae5ebed9da67a4a277ffb513ce6de8d6cd0eb9581c76040b9f40fd6a07
6
+ metadata.gz: 1abef9f675c2c85165fc1aeb7f30be9796cd710eb3602a1d08cd10e09753b7e4cce852260c3733c7747f91ccfa7862c747100a6e2c8d5291a2a8bdab9cc86125
7
+ data.tar.gz: b37f049af981ad89578e2d0af37094ad6c9bd0b77e578461f5bb8532c72091cdab49df25ddf244e4c12cc80eb8157127d48c128b5cb49a42a5929d8e11e6bc7e
@@ -63,7 +63,7 @@ module HerdstWorker
63
63
 
64
64
 
65
65
  def get_tasks_info
66
- metadata = make_request!(get_metadata_uri)
66
+ metadata = make_request!(get_task_metadata_uri)
67
67
 
68
68
  ecs_client = Aws::ECS::Client.new(
69
69
  :region => self.secrets["AWS_REGION"],
@@ -78,6 +78,24 @@ module HerdstWorker
78
78
  :include => ["TAGS"]
79
79
  )
80
80
  end
81
+
82
+
83
+ def get_services_info
84
+ info = self.get_tasks_info
85
+
86
+ ecs_client = Aws::ECS::Client.new(
87
+ :region => self.secrets["AWS_REGION"],
88
+ :credentials => self.aws_credentials
89
+ )
90
+
91
+ ecs_client.describe_services({
92
+ :cluster => info["tasks"][0]["cluster_arn"],
93
+ :services => [
94
+ info["tasks"][0]["group"].to_s.sub("services:", "")
95
+ ],
96
+ :include => ["TAGS"]
97
+ })
98
+ end
81
99
 
82
100
 
83
101
  def get_aws_credentials!
@@ -164,7 +182,7 @@ module HerdstWorker
164
182
 
165
183
 
166
184
  private
167
- def get_metadata_uri
185
+ def get_task_metadata_uri
168
186
  ENV["ECS_CONTAINER_METADATA_URI"].to_s + "/task"
169
187
  end
170
188
 
@@ -1,3 +1,3 @@
1
1
  module HerdstWorker
2
- VERSION = '0.2.5'
2
+ VERSION = '0.2.7'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: herdst_worker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Herd.St
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-06 00:00:00.000000000 Z
11
+ date: 2023-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport