Skip to content

Commit

Permalink
Add verify_ssl to series count functions
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorbonas committed May 9, 2024
1 parent f0b77c0 commit 3b040cd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tools/python/influx-migration/influx_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ def backup(backup_path, root_token, src_host, bucket_name=None, full=False, skip
duration = time.time() - start_time
log_performance_metrics("backup", start_time, duration)

def report_all_bucket_series_count(host, token, org_name=None):
with InfluxDBClient(url=host, token=token) as client:
def report_all_bucket_series_count(host, token, org_name=None, skip_verify=False):
with InfluxDBClient(url=host, token=token, verify_ssl=not skip_verify) as client:
# CSV migration may use an all access token, meaning buckets will be scoped to an organization
if org_name is not None:
client.org = org_name
Expand All @@ -119,14 +119,15 @@ def report_all_bucket_series_count(host, token, org_name=None):
while len(buckets.buckets) > 0:
for bucket in buckets.buckets:
if not bucket.name.startswith("_"):
report_bucket_series_count(bucket_name=bucket.name, host=host, token=token, org_name=org_name)
report_bucket_series_count(bucket_name=bucket.name, host=host, token=token,
org_name=org_name, skip_verify=skip_verify)
offset += BUCKET_PAGINATION_LIMIT
buckets = client.buckets_api().find_buckets(limit=BUCKET_PAGINATION_LIMIT,
offset=offset)

def report_bucket_series_count(bucket_name, host, token, org_name=None):
def report_bucket_series_count(bucket_name, host, token, org_name=None, skip_verify=False):
try:
with InfluxDBClient(url=host, token=token) as client:
with InfluxDBClient(url=host, token=token, verify_ssl=not skip_verify) as client:
if org_name is not None:
client.org = org_name
buckets = client.buckets_api().find_buckets(name=bucket_name) \
Expand Down

0 comments on commit 3b040cd

Please sign in to comment.