pterodactyl / panel

Pterodactyl® is a free, open-source game server management panel built with PHP, React, and Go. Designed with security in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive UI to end users.
https://pterodactyl.io
Other
6.81k stars 1.74k forks source link

Extend the API to allow for more control and information about servers #3182

Closed CubitsDev closed 3 years ago

CubitsDev commented 3 years ago

Is your feature request related to a problem? Please describe. It's not a problem, however it feels like the API provides good information on the servers running, but would be extremely helpful to show more.

Describe the solution you'd like Simply adding the current power state to the result of GET /servers and GET /server/{id} would already be extremely helpful, and to even go the extra mile, additional PATCH routes to change the power state allowing for remote rebooting, etc.

Describe alternatives you've considered Building a mod on to open my own API points, but this seems like something that should be in core functionality, and would be especially useful for remote control of servers.

Additional context Current API link. Proposed changes are under any /servers endpoint - both client and application

trenutoo commented 3 years ago

Power state can be already changed with POST to /api/client/servers/<uid>/power and is documented in the API docs that you've linked

CubitsDev commented 3 years ago

@Software-Noob Missed that - having that in the application route would also be beneficial for when you want to do it with an app wide API key

trenutoo commented 3 years ago

@Software-Noob Missed that - having that in the application route would also be beneficial for when you want to do it with an app wide API key

New endpoints might be useful, that's up to Dane.

At this moment you can retrieve power state when you perform a resource usage lookup /api/client/servers/<uid>/resources where it will be displayed with current_state

matthewpi commented 3 years ago

The panel is not aware of any server states or resource usage and has to query it from wings. So adding that information to the GET /api/client/servers or GET /api/client/server/{server} endpoints isn't going to happen. The application api is being overhauled with react-admin due to the need of more endpoints and data, however I don't think adding anything resource/status endpoints within access of the application api will happen.

DaneEveritt commented 3 years ago

@matthewpi is correct here, adding power state to any of these endpoints is a non-starter due to the way it works. Since that seems to be what this issue is about I'm going to close it. Perhaps we can look into a way to return all of the power details for a single node? If so feel free to edit this issue and we can re-open it if that would do what you need.