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

PYRO-87: Mock Client #11

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from
Draft

PYRO-87: Mock Client #11

wants to merge 23 commits into from

Conversation

sargon64
Copy link
Member

Mock client for emulating the petro pannel
todo:

  • add a gui
  • find out what the endpoints actually do
  • ???
  • profit

Copy link
Contributor

@fetchfern fetchfern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this, should be moved to alerion_datamodel and into multiple files eventually though.

@fetchfern
Copy link
Contributor

We're gonna need the mock client to request to the following alerion endpoints:

  • GET /api/servers/:uuid
  • DELETE /api/servers/:uuid
  • GET /api/servers/:uuid/logs
  • POST /api/servers/:uuid/power
  • POST /api/servers/:uuid/commands
  • POST /api/servers/:uuid/install
  • POST /api/servers/:uuid/reinstall
  • POST /api/servers/:uuid/ws

Plus, an interface to interact with the full websocket API.

References:
https://github.com/devnote-dev/ptero-notes/blob/main/wings/server.md
https://github.com/devnote-dev/ptero-notes/blob/main/wings/websocket.md

IMO, mock_client should be a library for interacting with alerion, pretending you're a panel. It can then be used for real scenario benchmarking/testing, security testing, etc. We can then implement alerion_benchmark, alerion_ui_client, etc.

Few concerns for now:

  • Why are there merge conflicts in alerion_core? This shouldn't touch anything in core alerion.
  • Most serde-related structs are going to be shared between core and mock and should be in alerion_datamodel. Please move those in alerion_datamodel; we can then integrate core with datamodel in a later PR.

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