herdst_worker 0.2.5 → 0.2.6

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: 69a6b8037b56c968110ba5faf884dba06e7657a183f29e54a579c895271d6fcd
4
+ data.tar.gz: 14a40a92fe51da5820b3db3b6832b82d975a174d562f7863a899db49f050a36c
5
5
  SHA512:
6
- metadata.gz: 94aaf2d09122cdb0eb8b386cb91f3207d7cbb1a98dfc7ad3bbfecbcdedbded460162c73fd4d83daae306d885de83be76c517eb2efc27b0109c0c04302cf7cf12
7
- data.tar.gz: 4c1a7e468c82f9467eb6a57d020d5e64057185b15399ab8c8debae202eca047d2fd7fcae5ebed9da67a4a277ffb513ce6de8d6cd0eb9581c76040b9f40fd6a07
6
+ metadata.gz: 02ba88a9e9258a8b125f6a237b31d176e5ad99b23e1eaec5b7d7ece07124b24e2915f4f8d3d56f1491f978e85e5d282d71f04c3b5a0e6a1b135ca58e120bbcb4
7
+ data.tar.gz: 2cc884209904ff5a829fb19c0fd3a5a66317fe76de7c4d8c313f112f6fb9f9b048cbb40779e7b72156e04ebd415084aa8f7b251a27a51849615d3ef0b3b7d6b5
@@ -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"].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.6'
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.6
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