Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tf_mod_aws_elasticsearch_cleanup
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
steamhaus
tf_mod_aws_elasticsearch_cleanup
Commits
55414424
Commit
55414424
authored
Sep 29, 2019
by
Paul Flowers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reinvoke snsn error messages
parent
faf4abd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
es-cleanup.py
files/es-cleanup.py
+18
-0
No files found.
files/es-cleanup.py
View file @
55414424
...
@@ -127,6 +127,24 @@ class ES_Cleanup(object):
...
@@ -127,6 +127,24 @@ class ES_Cleanup(object):
else
:
else
:
raise
# Stop retrying, re-raise exception
raise
# Stop retrying, re-raise exception
def
send_error
(
self
,
msg
):
"""Send SNS error
Args:
msg (str): error string
Returns:
None
"""
_msg
=
"[
%
s][
%
s]
%
s"
%
(
self
.
name
,
self
.
cur_account
,
msg
)
print
(
_msg
)
if
self
.
cfg
[
"sns_alert"
]
!=
""
:
sns_region
=
self
.
cfg
[
"sns_alert"
]
.
split
(
":"
)[
4
]
sns
=
boto3
.
client
(
"sns"
,
region_name
=
sns_region
)
response
=
sns
.
publish
(
TopicArn
=
self
.
cfg
[
"sns_alert"
],
Message
=
_msg
)
def
delete_index
(
self
,
index_name
):
def
delete_index
(
self
,
index_name
):
"""ES DELETE specific index
"""ES DELETE specific index
Args:
Args:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment