Skip to main content

簡單存取Pterodactyl api

Project description

pteropy

適用於Pterodactyl api的python庫

安裝

pip install pteropy

Pterodactyl_Application範例

key創建位置:/admin/api

基本設置

run.py

from pteropy import Pterodactyl_Application
#導入套件

base_url = "https://面板網址"
api_key = "api key"
#key創建位置:/admin/api

#基本設定

ptero = Pterodactyl_Application(base_url, api_key)
#傳給套件

套件範例

run.py

from pteropy import Pterodactyl_Application
base_url = "https://面板網址"
api_key = "api key"
ptero = Pterodactyl_Application(base_url, api_key)

#創建用戶
ptero.create_user(username="用戶名",email="用戶email", password="密碼")
#所有用戶
ptero.list_users()

Pterodactyl_Client範例

key創建位置:/account/api

基本設置

run.py

from pteropy import Pterodactyl_Client
#導入套件

base_url = "https://面板網址"
api_key = "api key"
#key創建位置:/account/api

#基本設定

ptero = Pterodactyl_Client(base_url, api_key)
#傳給套件

套件範例

run.py

from pteropy import Pterodactyl_Client
base_url = "https://面板網址"
api_key = "api key"
ptero = Pterodactyl_Client(base_url, api_key)

#獲得伺服器資料
ptero.get_server("3fa3d78d")
#獲得伺服器列表
ptero.list_servers()

#啟動伺服器
ptero.start_server("3fa3d78d")
#重啟伺服器
ptero.restart_server("3fa3d78d")
#關閉伺服器
ptero.stop_server("3fa3d78d")
#強制關閉伺服器
ptero.kill_server("3fa3d78d")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pteropy-0.1.2.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pteropy-0.1.2-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file pteropy-0.1.2.tar.gz.

File metadata

  • Download URL: pteropy-0.1.2.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.12

File hashes

Hashes for pteropy-0.1.2.tar.gz
Algorithm Hash digest
SHA256 28f9ac9da5446653cccdc3c6915f75718c477bc021f95108ed3fb80b9f39c691
MD5 7648ebf4445282bac1ffa77d244a0997
BLAKE2b-256 a4595efdc9adffa7269ddf05c1c7e437c7810d74f5b73b8061fb3ac48aec3ff9

See more details on using hashes here.

File details

Details for the file pteropy-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pteropy-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.12

File hashes

Hashes for pteropy-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 36128ae6dfce02aabfb7b5b01cf2e1233d47a4fcb78278b9ca68a399e36fe031
MD5 2a14288abdbbe201b030b33d9fcf42b0
BLAKE2b-256 82b7880ad3c4543618b738eaf9bcfe62b153cb19ee9cd30f6788371baa7af224

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page