Simple API for the SurvivalServers.com Control Panel using HTTP requests.
Project description
SSPanel
SSPanel is a simple API providing the basic functionality of the SurvivalServers.com Control Panel to Python
via HTTPS requests. It allows for starting, stopping, and restarting a server, as well as retrieving server info.
>>> import sspanel
>>> username, password, subuser = "aUserName", "aP@ssw0rd", False
>>> serverid = 123456
# Start the server.
>>> sspanel.start(username, password, subuser, serverid)
'Server is started'
# Retrieve basic server information.
>>> info = sspanel.info(username, password, subuser, serverid)
'Info gathered'
>>> print(info)
'title: ServerTitle'
'status: Started, Ready'
'players: 3/22'
'last start: 04/1/2021 04:20:00'
'game version: v0.123.4'
'ip address: 111.111.11.11'
'game port: 9876'
'query port: 9877'
# Alternatively: create a ControlPanel object; make sequential calls with the same server.
>>> panel = sspanel.ControlPanel(username, password, subuser, serverid)
>>> panel.restart()
'Server is started'
>>> panel.stop()
'Server is stopped'
Main Interface
-
sspanel.start(username, password, subuser, serverid)
- Attempts to start the server described by the credentials passed in.
-
sspanel.stop(username, password, subuser, serverid)
- Attempts to stop the server described by the credentials passed in.
-
sspanel.restart(username, password, subuser, serverid)
- Attempts to restart the server described by the credentials passed in.
-
sspanel.info(username, password, subuser, serverid)
- Attempts to retrieve and return info about the server described by the credentials passed in.
- Returns: a ServerInfo object.
Classes
-
sspanel.ControlPanel(username, password, subuser, serverid, limit=15)
- ControlPanel object which stores login credentials and serverid, allowing for sequential actions on the same server.
- limit parameter is the minimum time (in seconds) between sequential server actions (aside from .info(), which is not limited).
-
sspanel.ServerInfo
- ServerInfo object which stores all of the information retrieved from a ControlPanel.info() call.
Installing SSPanel
SSPanel is available on PyPI:
$ python -m pip install sspanel
Etc
Only tested with a Valheim server; that is all I have access to.
Makes use of the Requests library.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sspanel-0.1.1.tar.gz.
File metadata
- Download URL: sspanel-0.1.1.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1277e9fcb8252ddc75d2edf3f58f0ec0709664504c782db21f846c056f09a042
|
|
| MD5 |
85060dc8a78cb2088ca427caa7eedc0d
|
|
| BLAKE2b-256 |
c59e771b4dd0866419e91b79c0fe55fac3abada35b8a7981a6bd5aeff0998ddd
|
File details
Details for the file sspanel-0.1.1-py2.py3-none-any.whl.
File metadata
- Download URL: sspanel-0.1.1-py2.py3-none-any.whl
- Upload date:
- Size: 19.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2dc17fa19e9f0e5d1f51ac0cd239a35f567f41167f3dd66c2099ee1504bfbc0b
|
|
| MD5 |
40f3c07862dc89f3edacfd9dd90aca7d
|
|
| BLAKE2b-256 |
f3e504f91279a1f1f3754a7d120987e16816c4fa150c13c5791f5ccd12cfde3b
|