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

[RFE] Restore the old quads --host functionality for simple current cloud membership #512

Open
sadsfae opened this issue Aug 27, 2024 · 2 comments

Comments

@sadsfae
Copy link
Member

sadsfae commented Aug 27, 2024

in QUADS 1.1.x quads-cli --host $HOST returned the current cloud something was in:

(root@quads11) - (12:41) - (~)
# quads --host d16-h01-000-r650.rdu2.example.com
cloud37

In QUADS 2.0 it returns this, but also a gigantic return of all cloud and host breakdown.

# quads --host d16-h01-000-r650.rdu2.example.com | head -n 10
cloud01:
  - d17-h27-000-r650.rdu2.example.com
  - d17-h28-000-r650.rdu2.example.com
  - d17-h29-000-r650.rdu2.example.com
-- SNIP --
@sadsfae
Copy link
Member Author

sadsfae commented Aug 28, 2024

FWIW there's two additional ways to get this information, though I think the old functionality should be restored.

  • via --ls-schedule
quads --ls-schedule --host e33-h15-000-r650.rdu2.example.com | grep "Current cloud" | sed 's/Current cloud://'
 cloud27
  • via the API
curl -s -X GET "https://quads2.example.com/api/v3/hosts?name=e33-h15-000-r650.rdu2.example.com" | jq | grep -C5 "\"cloud\":" | grep "name" | sed 's/\"name\"\://'
       "cloud27"

@sadsfae
Copy link
Member Author

sadsfae commented Sep 12, 2024

So this has an added effect that if you typo something with --host* in it (like forgetting a sub-command for `--add-schedule) it return this too.

[root@quads2-stage ~]# quads --host-list /tmp/3753 --schedule-start "2024-09-12 12:00" --schedule-end "2024-09-13 12:00" --schedule-cloud cloud04
  • Note above I ommitted the --add-schedule command and the argparse fell back and matched instead --host

cloud01:

  • f30-h17-000-dl360.stage.rdu2.example.com
  • f24-h16-000-r630.stage.rdu2.example.com
  • f06-h31-000-1029p.stage.rdu2.example.com
  • f18-h31-000-1029p.stage.rdu2.example.com
  • f28-h01-000-r930.stage.rdu2.example.com
  • e22-h26-b01-fc640.stage.rdu2.example.com
  • e22-h26-b02-fc640.stage.rdu2.example.com
  • e22-h26-b03-fc640.stage.rdu2.example.com
  • e22-h26-b04-fc640.stage.rdu2.example.com
  • e28-h26-000-r650.stage.rdu2.example.com
  • f18-h29-000-1029p.stage.rdu2.example.com
  • f18-h30-000-1029p.stage.rdu2.example.com
  • f12-h03-000-1029u.stage.rdu2.example.com
    cloud05:
  • f07-h36-000-1029u.stage.rdu2.example.com
  • f36-h21-000-r640.stage.rdu2.example.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: To do
Development

No branches or pull requests

1 participant