Skip to content

Commit

Permalink
fix elasticsearch token config and creation
Browse files Browse the repository at this point in the history
  • Loading branch information
alemsh committed Feb 12, 2025
1 parent 4cf3883 commit d0605e0
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions resources/progress_to_es.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ def main():
'FILE_CATALOG_URL': 'https://file-catalog.icecube.wisc.edu',
'ES_ADDRESS': 'https://elastic.icecube.aq',
'ES_INDEX': 'long-term-archive',
'ES_CLIENT_ID': 'elasticsearch',
'ES_CLIENT_SECRET': '',
'ES_TIMEOUT': 60.,
'START_DATE': '',
'END_DATE': '',
Expand All @@ -203,21 +205,15 @@ def main():
parser.add_argument('-n', '--dry-run', default=False, action='store_true',
help='do not ingest into ES, just print')
parser.add_argument('--log-level', default='info', choices=['debug', 'info', 'warning', 'error'])
parser.add_argument('--es_client_id',default=None,
help='ES oauth2 client id')
parser.add_argument('--es_client_secret',default=None,
help='ES oauth2 client secret')
parser.add_argument('--token_url',default=None,
help='ES oauth2 realm token url')
args = parser.parse_args()

logging.basicConfig(level=getattr(logging, args.log_level.upper()), format='%(asctime)s %(levelname)s %(name)s : %(message)s')

es_api = ClientCredentialsAuth(
address=config['ES_ADDRESS'],
token_url=args.token_url,
client_secret=args.es_client_secret,
client_id=args.es_client_id
token_url=config['OPENID_URL'],
client_secret=config['ES_CLIENT_SECRET'],
client_id=config['ES_CLIENT_ID']
)
es_token = es_api.make_access_token()

Expand Down

0 comments on commit d0605e0

Please sign in to comment.