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.check()  #檢查api連線狀態

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.check()  #檢查api連線狀態

ptero.account_details()  #帳戶資訊

ptero.details_2FA()  #生成TOTP 二維碼圖像以允許設置 2FA

ptero.enable_2FA()  #使用 details_2FA 請求生成的二維碼啟用 TOTP 2FA

ptero.disable_2FA()  #禁用帳戶上的 TOTP 2FA

ptero.update_email()  #更新帳戶的電子郵件位址

ptero.update_password()  #更新帳戶的密碼

ptero.list_API_keys()  #列出 API 金鑰

ptero.create_API_key()  #生成新的 API 金鑰

ptero.delete_API_key()  #刪除指定的 API 金鑰

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

ptero.list_servers()  #獲得伺服器列表

ptero.rename_server("3fa3d78d","名子")  #重命名伺服器

ptero.send_command("3fa3d78d","指令")  #發送指令

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.7.tar.gz (4.0 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.7-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pteropy-0.1.7.tar.gz
  • Upload date:
  • Size: 4.0 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.7.tar.gz
Algorithm Hash digest
SHA256 601c59c594d9fae0bc5775d231ed1c7347893f02d0894f180181dfb7f69637f5
MD5 567f76cb0500dd7e538d18bb927701b4
BLAKE2b-256 78b80f3ff9bf48ef71376c78cc24708bc62c2d4d8a29a9d0956eff86edc27a82

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pteropy-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 4.8 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e3b2c6617a3d43354f160000f741f3605c0ecf4446cd17367e19861f307cfc19
MD5 1a9853fc6e8fa8fe0017ff7a22dd2f53
BLAKE2b-256 62083f8476111e80e6ac80537b7cc61c485830052f444e5a4d02bbd6625544f7

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