Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StatusCake API pagination creates duplicate entries #39

Open
copelco opened this issue May 3, 2022 · 0 comments
Open

StatusCake API pagination creates duplicate entries #39

copelco opened this issue May 3, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@copelco
Copy link
Member

copelco commented May 3, 2022

By default, the StatusCake API (beta) paginates uptime & SSL checks in blocks of 25. So currently if an account has >25 uptime checks, if the check that Ansible is searching for isn't found on the first page, it believes the check doesn't exist and will create a new entry:

def fetch_all(self):
self._request("get", self.url)
if self.response.status_code == 200:
logger.debug(
"All uptime checks in StatusCake: %s", self.response.json()["data"]
)
return self.response.json()["data"]
return []

This creates duplicate entries if the check does indeed exist beyond the first page. #38 increases the page size to 100, to fix the immediate issue, but in the future, the fetch_all method should probably support pagination.

@copelco copelco added the bug Something isn't working label May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant