Skip to content

Commit

Permalink
Merge pull request #181 from kensuio-oss/feature/lds-names
Browse files Browse the repository at this point in the history
Use dedicated endpoint to obtain available LDSs
  • Loading branch information
SammyEK authored Oct 15, 2024
2 parents 3cd8ddf + 87f3808 commit 893d3ee
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions kensu/sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,17 +253,17 @@ def get_all_rules_for_ds(self, ds_id):

def get_logical_datasources(self):
logical_data_sources = {'data': []}
limit = 500
limit = 5000
offset = 0

ds = {'data': [None]}
while ds['data']:
ds = {'data': [None]}

while len(ds['data']) > 0:
try:
ds = self.requests_get_json(f"/business/services/views/v1/logical-datasources?offset={offset}&limit={limit}")
ds = self.requests_get_json(f"/api/services/v2/logical-datasource-names?offset={offset}&limit={limit}")
logical_data_sources['data'].extend(ds['data'])
offset += limit

except Exception as e:
print(f"Error fetching data: {e}")
break # Exit loop on error
Expand Down

0 comments on commit 893d3ee

Please sign in to comment.