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

bamboo.activity() returns 404 #1362

Open
timakamystery opened this issue Apr 4, 2024 · 1 comment
Open

bamboo.activity() returns 404 #1362

timakamystery opened this issue Apr 4, 2024 · 1 comment

Comments

@timakamystery
Copy link

timakamystery commented Apr 4, 2024

BAMBOO_URL = 'https://bamboo.example.com'
token = 'xxx'
bamboo = Bamboo(url=BAMBOO_URL, token=token)
...
bamboo.activity()
Traceback (most recent call last):
  File "/Users/tshklyarov/repos/node-api/prune.py", line 37, in <module>
    agent_status = bamboo.activity()
  File "/Users/tshklyarov/repos/node-api/venv/lib/python3.9/site-packages/atlassian/bamboo.py", line 1098, in activity
    return self.get("build/admin/ajax/getDashboardSummary.action")
  File "/Users/tshklyarov/repos/node-api/venv/lib/python3.9/site-packages/atlassian/rest_client.py", line 340, in get
    response = self.request(
  File "/Users/tshklyarov/repos/node-api/venv/lib/python3.9/site-packages/atlassian/rest_client.py", line 312, in request
    self.raise_for_status(response)
  File "/Users/tshklyarov/repos/node-api/venv/lib/python3.9/site-packages/atlassian/rest_client.py", line 547, in raise_for_status
    response.raise_for_status()
  File "/Users/tshklyarov/repos/node-api/venv/lib/python3.9/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error:  for url: https://bamboo.example.com/build/admin/ajax/getDashboardSummary.action

Compared to bamboo.agent_status(), which provides a response. But I need active agents, while agent_status() provides some list of inactive old agents hence trying to use activity() instead to see not building agents.

Also tried using rest api, but it doesn't show if an agent busy/not..

curl -H "Authorization: Bearer XXX" https://bamboo.example.com/rest/api/latest/agent/123456/status
{"online": "true"}%

atlassian_python_api-3.41.11

@timakamystery
Copy link
Author

was able to resolve my task using plugin: Bamboo Command Line Interface (CLI), but resolving / advising on this issue would be appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant