feat: full ISPConfig remote API coverage + re-runnable generator (v0.2)

v0.1 shipped ~15 hand-audited methods across sites/dns/mail/databases/clients.
That's enough for daily ops but every new Tort Host / cWHO feature has been
hitting the wall at the edge of that coverage. This extends the SDK to wrap
every method the panel exposes — 312 of them as of Rackham 2026-04-22,
verified against the live list_functions() introspection call with only one
name-mismatch (``__construct``, a PHP lifecycle artifact, not a real API
method).

The hand-audited helpers stay where they are. Every module now has two
clearly-delimited sections: an auto-generated block at the top (emitted by
tools/gen_methods.py from tools/method_inventory.json), and a HAND-EDIT ONLY
BELOW block at the bottom that survives regeneration. Name collisions
between auto and hand always resolve in favor of the hand version — the
generator emits a ``# skipped foo: hand-audited helper takes precedence``
comment in the auto block for traceability.

Pipeline:
- tools/extract_inventory.py reads remote.*.inc.php + remoting.inc.php,
  pulls docblocks + param defaults, dumps one JSON record per method.
  Regex is balanced-paren aware so ``$params = array()`` defaults don't
  truncate the signature at the wrong close-paren (that footgun hid three
  methods from the first run — sites_aps_available_packages_list,
  sites_aps_instance_delete, openvz_vm_add_from_template).
- tools/method_inventory.json is the committed inventory — future ISPConfig
  upgrades diff against this file to see scope at a glance.
- tools/gen_methods.py groups by method-name prefix onto the module classes
  listed in the README table, emits a 1:1 Python wrapper per method with
  the original PHP filename + line number in the docstring, and ensures
  ``from typing import Any`` is present in preexisting modules before
  emitting ``Any`` type annotations.

New submodules (all auto-generated, wired into ISPConfigClient.__init__):
admin, aps, backups, cron, domains, ftp, misc, monitor, openvz, server,
shell, webdav. Existing modules (sites, dns, mail, databases, clients) got
their auto block filled in and their hand-audited helpers preserved.

Escape hatches on the top-level client:
- raw_call(method, *args) routes an arbitrary method name through the same
  session-management + retry + fault-mapping pipeline the typed wrappers
  use. Fix for "panel shipped a new method, SDK hasn't caught up" —
  callers don't have to reach back into _soap.
- list_functions() wraps get_function_list() for panel introspection.

Fault mapping widened: ``no_client_found`` and "no user account" messages
now map to NotFoundError instead of FaultError, matching the existing
``no_domain_found`` convention. Older code that caught raw FaultError
there will still work (NotFoundError extends ISPConfigError) but callers
can now catch the specific type.

Testing:
- tests/test_unit.py — 12 existing pure-unit tests pass unchanged.
- tests/test_smoke.py — extended from 4 read-only calls to 21. One probe
  per new auto-generated module plus raw_call and list_functions smoke
  tests. Methods gated behind admin permission skip gracefully with a
  documented reason (kayos is a reseller, not admin): monitor_jobqueue_count,
  sites_cron_get, sites_ftp_user_get, openvz_get_free_ip,
  quota_get_by_user. Results against Rackham 2026-04-22:
  28 passed, 5 skipped (all documented admin-only), 0 failed.
- ISPCONFIG_TEST_VERIFY_SSL=0 env-var knob added to conftest for panels
  with self-signed or mismatched certs.

Version bump 0.1.0 -> 0.2.0. README restructured into Hand-audited /
Auto-generated / Escape hatch / Footguns sections with a regeneration
recipe for future ISPConfig upgrades. Ruff per-file SLF001 ignore extended
to every submodule (submodules are all authorized callers of the client's
private ``_call`` dispatcher by design). mypy strict passes; ruff check
passes; ruff format applied across src / tools / tests.
This commit is contained in:
Sulkta 2026-04-22 13:58:38 -07:00
parent fb6e235f2d
commit 04b10427f5
28 changed files with 14173 additions and 184 deletions

View file

@ -95,14 +95,14 @@ class SoapTransport:
arg_xml = "".join(_encode_arg(name, value) for name, value in args)
return (
'<?xml version="1.0" encoding="UTF-8"?>'
'<SOAP-ENV:Envelope'
"<SOAP-ENV:Envelope"
' xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"'
' xmlns:ns1="urn:ispconfig"'
' xmlns:xsd="http://www.w3.org/2001/XMLSchema"'
' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'
' xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">'
f'<SOAP-ENV:Body><ns1:{method}>{arg_xml}</ns1:{method}></SOAP-ENV:Body>'
'</SOAP-ENV:Envelope>'
f"<SOAP-ENV:Body><ns1:{method}>{arg_xml}</ns1:{method}></SOAP-ENV:Body>"
"</SOAP-ENV:Envelope>"
)
@staticmethod
@ -148,7 +148,7 @@ def _encode_arg(name: str, value: Any) -> str:
if isinstance(value, Mapping):
items = "".join(
f'<item><key xsi:type="xsd:string">{xml_escape(str(k))}</key>'
f'{_encode_value_tag("value", v)}</item>'
f"{_encode_value_tag('value', v)}</item>"
for k, v in value.items()
)
return f'<{name} xsi:type="ns2:Map" xmlns:ns2="http://xml.apache.org/xml-soap">{items}</{name}>'
@ -223,10 +223,7 @@ def _is_map(el: ET.Element) -> bool:
return False
if not all(_local(k.tag) == "item" for k in kids):
return False
return any(
any(_local(gk.tag) == "key" for gk in item)
for item in kids
)
return any(any(_local(gk.tag) == "key" for gk in item) for item in kids)
def _is_array(el: ET.Element) -> bool:

177
src/ispconfig/admin.py Normal file
View file

@ -0,0 +1,177 @@
"""``admin.*`` — auto-generated ISPConfig remote-API wrappers.
This module is produced by ``tools/gen_methods.py`` from the
``tools/method_inventory.json`` catalog. Hand-edits go below the
``---- HAND-EDIT ONLY BELOW ----`` marker they survive regeneration.
"""
from __future__ import annotations
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from .client import ISPConfigClient
class AdminModule:
"""Auto-generated module: Admin.
All methods below the ``AUTO-GENERATED START`` marker are produced
by ``tools/gen_methods.py``. Do not hand-edit that block changes
will be overwritten on the next regeneration. Add helpers and
overrides below the ``HAND-EDIT ONLY BELOW`` marker instead.
"""
def __init__(self, client: ISPConfigClient) -> None:
self._c = client
# ---- AUTO-GENERATED START (do not hand-edit above this line) ----
# Regenerate with: python3 tools/gen_methods.py
def config_value_add(self, group: Any, name: Any, value: Any) -> Any:
"""
Auto-generated wrapper for ``config_value_add``.
Source: ``admin.inc.php`` line 181.
PHP signature: ``config_value_add($session_id, $group, $name, $value)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("config_value_add", ("group", group), ("name", name), ("value", value))
def config_value_delete(self, group: Any, name: Any) -> Any:
"""
Auto-generated wrapper for ``config_value_delete``.
Source: ``admin.inc.php`` line 252.
PHP signature: ``config_value_delete($session_id, $group, $name)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("config_value_delete", ("group", group), ("name", name))
def config_value_get(self, group: Any, name: Any) -> Any:
"""
Auto-generated wrapper for ``config_value_get``.
Source: ``admin.inc.php`` line 162.
PHP signature: ``config_value_get($session_id, $group, $name)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("config_value_get", ("group", group), ("name", name))
def config_value_replace(self, group: Any, name: Any, value: Any) -> Any:
"""
Auto-generated wrapper for ``config_value_replace``.
Source: ``admin.inc.php`` line 229.
PHP signature: ``config_value_replace($session_id, $group, $name, $value)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("config_value_replace", ("group", group), ("name", name), ("value", value))
def config_value_update(self, group: Any, name: Any, value: Any) -> Any:
"""
Auto-generated wrapper for ``config_value_update``.
Source: ``admin.inc.php`` line 205.
PHP signature: ``config_value_update($session_id, $group, $name, $value)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("config_value_update", ("group", group), ("name", name), ("value", value))
def sys_datalog_get(self, datalog_id: Any, newer: Any = False) -> Any:
"""
Auto-generated wrapper for ``sys_datalog_get``.
Source: ``admin.inc.php`` line 294.
PHP signature: ``sys_datalog_get($session_id, $datalog_id, $newer = false)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sys_datalog_get", ("datalog_id", datalog_id), ("newer", newer))
def sys_datalog_get_by_tstamp(self, tstamp: Any) -> Any:
"""
Auto-generated wrapper for ``sys_datalog_get_by_tstamp``.
Source: ``admin.inc.php`` line 276.
PHP signature: ``sys_datalog_get_by_tstamp($session_id, $tstamp)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sys_datalog_get_by_tstamp", ("tstamp", tstamp))
def system_config_get(self, section: str, key: str | None = None) -> Any:
"""
Get the values of the system configuration
Source: ``admin.inc.php`` line 137.
PHP signature: ``system_config_get($session_id, $section, $key = null)``.
Params (from PHPDoc):
session (int): id
section (string): of the config field in the table. Could be 'web', 'dns', 'mail', 'dns', 'cron', etc
key (string|null): of the option that you want to get
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("system_config_get", ("section", section), ("key", key))
def system_config_set(self, section: str, key: str, value: Any) -> Any:
"""
Set a value in the system configuration
Source: ``admin.inc.php`` line 113.
PHP signature: ``system_config_set($session_id, $section, $key, $value)``.
Params (from PHPDoc):
session (int): id
section (string): of the config field in the table. Could be 'web', 'dns', 'mail', 'dns', 'cron', etc
key (string): of the option that you want to set
option (string): value that you want to set
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("system_config_set", ("section", section), ("key", key), ("value", value))
def update_record_permissions(
self, tablename: Any, index_field: str, index_value: str, permissions: dict[str, Any] | list[Any]
) -> Any:
"""
set record permissions in any table
Source: ``admin.inc.php`` line 51.
PHP signature: ``update_record_permissions($session_id, $tablename, $index_field, $index_value, $permissions)``.
Params (from PHPDoc):
index_field (string)
index_value (string)
permissions (array)
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"update_record_permissions",
("tablename", tablename),
("index_field", index_field),
("index_value", index_value),
("permissions", permissions),
)
# ---- AUTO-GENERATED END ----
# ---- HAND-EDIT ONLY BELOW ----

154
src/ispconfig/aps.py Normal file
View file

@ -0,0 +1,154 @@
"""``aps.*`` — auto-generated ISPConfig remote-API wrappers.
This module is produced by ``tools/gen_methods.py`` from the
``tools/method_inventory.json`` catalog. Hand-edits go below the
``---- HAND-EDIT ONLY BELOW ----`` marker they survive regeneration.
"""
from __future__ import annotations
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from .client import ISPConfigClient
class ApsModule:
"""Auto-generated module: Aps.
All methods below the ``AUTO-GENERATED START`` marker are produced
by ``tools/gen_methods.py``. Do not hand-edit that block changes
will be overwritten on the next regeneration. Add helpers and
overrides below the ``HAND-EDIT ONLY BELOW`` marker instead.
"""
def __init__(self, client: ISPConfigClient) -> None:
self._c = client
# ---- AUTO-GENERATED START (do not hand-edit above this line) ----
# Regenerate with: python3 tools/gen_methods.py
def sites_aps_available_packages_list(self, params: Any = None) -> Any:
"""
Auto-generated wrapper for ``sites_aps_available_packages_list``.
Source: ``aps.inc.php`` line 56.
PHP signature: ``sites_aps_available_packages_list($session_id, $params = array())``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_aps_available_packages_list", ("params", params))
def sites_aps_change_package_status(self, primary_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_aps_change_package_status``.
Source: ``aps.inc.php`` line 201.
PHP signature: ``sites_aps_change_package_status($session_id, $primary_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"sites_aps_change_package_status", ("primary_id", primary_id), ("params", params)
)
def sites_aps_get_package_details(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_aps_get_package_details``.
Source: ``aps.inc.php`` line 78.
PHP signature: ``sites_aps_get_package_details($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_aps_get_package_details", ("primary_id", primary_id))
def sites_aps_get_package_file(self, primary_id: Any, filename: Any) -> Any:
"""
Auto-generated wrapper for ``sites_aps_get_package_file``.
Source: ``aps.inc.php`` line 118.
PHP signature: ``sites_aps_get_package_file($session_id, $primary_id, $filename)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_aps_get_package_file", ("primary_id", primary_id), ("filename", filename))
def sites_aps_get_package_settings(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_aps_get_package_settings``.
Source: ``aps.inc.php`` line 163.
PHP signature: ``sites_aps_get_package_settings($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_aps_get_package_settings", ("primary_id", primary_id))
def sites_aps_install_package(self, primary_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_aps_install_package``.
Source: ``aps.inc.php`` line 231.
PHP signature: ``sites_aps_install_package($session_id, $primary_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_aps_install_package", ("primary_id", primary_id), ("params", params))
def sites_aps_instance_delete(self, primary_id: Any, params: Any = None) -> Any:
"""
Auto-generated wrapper for ``sites_aps_instance_delete``.
Source: ``aps.inc.php`` line 331.
PHP signature: ``sites_aps_instance_delete($session_id, $primary_id, $params = array())``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_aps_instance_delete", ("primary_id", primary_id), ("params", params))
def sites_aps_instance_get(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_aps_instance_get``.
Source: ``aps.inc.php`` line 303.
PHP signature: ``sites_aps_instance_get($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_aps_instance_get", ("primary_id", primary_id))
def sites_aps_instance_settings_get(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_aps_instance_settings_get``.
Source: ``aps.inc.php`` line 317.
PHP signature: ``sites_aps_instance_settings_get($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_aps_instance_settings_get", ("primary_id", primary_id))
def sites_aps_update_package_list(self) -> Any:
"""
Auto-generated wrapper for ``sites_aps_update_package_list``.
Source: ``aps.inc.php`` line 38.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_aps_update_package_list")
# ---- AUTO-GENERATED END ----
# ---- HAND-EDIT ONLY BELOW ----

59
src/ispconfig/backups.py Normal file
View file

@ -0,0 +1,59 @@
"""``backups.*`` — auto-generated ISPConfig remote-API wrappers.
This module is produced by ``tools/gen_methods.py`` from the
``tools/method_inventory.json`` catalog. Hand-edits go below the
``---- HAND-EDIT ONLY BELOW ----`` marker they survive regeneration.
"""
from __future__ import annotations
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from .client import ISPConfigClient
class BackupsModule:
"""Auto-generated module: Backups.
All methods below the ``AUTO-GENERATED START`` marker are produced
by ``tools/gen_methods.py``. Do not hand-edit that block changes
will be overwritten on the next regeneration. Add helpers and
overrides below the ``HAND-EDIT ONLY BELOW`` marker instead.
"""
def __init__(self, client: ISPConfigClient) -> None:
self._c = client
# ---- AUTO-GENERATED START (do not hand-edit above this line) ----
# Regenerate with: python3 tools/gen_methods.py
def sites_web_domain_backup(self, primary_id: Any, action_type: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_domain_backup``.
Source: ``sites.inc.php`` line 926.
PHP signature: ``sites_web_domain_backup($session_id, $primary_id, $action_type)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"sites_web_domain_backup", ("primary_id", primary_id), ("action_type", action_type)
)
def sites_web_domain_backup_list(self, site_id: Any = None) -> Any:
"""
Auto-generated wrapper for ``sites_web_domain_backup_list``.
Source: ``sites.inc.php`` line 912.
PHP signature: ``sites_web_domain_backup_list($session_id, $site_id = null)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_web_domain_backup_list", ("site_id", site_id))
# ---- AUTO-GENERATED END ----
# ---- HAND-EDIT ONLY BELOW ----

View file

@ -8,11 +8,23 @@ from typing import Any
from . import exceptions as _exc
from ._soap import SoapFault, SoapTransport
from .admin import AdminModule
from .aps import ApsModule
from .backups import BackupsModule
from .clients import ClientsModule
from .cron import CronModule
from .databases import DatabasesModule
from .dns import DnsModule
from .domains import DomainsModule
from .ftp import FtpModule
from .mail import MailModule
from .misc import MiscModule
from .monitor import MonitorModule
from .openvz import OpenvzModule
from .server import ServerModule
from .shell import ShellModule
from .sites import SitesModule
from .webdav import WebdavModule
log = logging.getLogger("ispconfig")
@ -48,11 +60,26 @@ class ISPConfigClient:
self._transport = SoapTransport(url, verify_ssl=verify_ssl, timeout=timeout)
self._session_id: str | None = None
# Hand-audited modules (stable API).
self.sites = SitesModule(self)
self.dns = DnsModule(self)
self.mail = MailModule(self)
self.databases = DatabasesModule(self)
self.clients = ClientsModule(self)
# Auto-generated modules (full surface, param shapes not yet
# verified in prod use — see per-method docstrings).
self.admin = AdminModule(self)
self.aps = ApsModule(self)
self.backups = BackupsModule(self)
self.cron = CronModule(self)
self.domains = DomainsModule(self)
self.ftp = FtpModule(self)
self.misc = MiscModule(self)
self.monitor = MonitorModule(self)
self.openvz = OpenvzModule(self)
self.server = ServerModule(self)
self.shell = ShellModule(self)
self.webdav = WebdavModule(self)
# ---- context manager ---------------------------------------------
@ -105,6 +132,38 @@ class ISPConfigClient:
"""Read-only accessor — exposed for debugging, not for API calls."""
return self._session_id
# ---- escape hatches ----------------------------------------------
def raw_call(self, method: str, *args: Any) -> Any:
"""Invoke an arbitrary ISPConfig remote method by name.
Use this when the SDK doesn't yet wrap the method you need —
newer ISPConfig versions may expose calls our inventory hasn't
caught up with. Args are passed positionally; names are cosmetic
on the wire, so we auto-number them as ``arg1``, ``arg2``, ...
If the call fails, capture ``FaultError.faultcode`` /
``FaultError.faultstring`` and file an issue against
``Sulkta-OSS/ispconfig-py`` so we can add the method properly.
"""
named_args = tuple((f"arg{i + 1}", v) for i, v in enumerate(args))
return self._call(method, *named_args)
def list_functions(self) -> list[str]:
"""Introspect the panel: return the list of remote methods it exposes.
Wrapper for ISPConfig's own ``get_function_list``. Handy when
checking whether your panel version supports a given call before
attempting it via :meth:`raw_call`.
"""
result = self._call("get_function_list")
if isinstance(result, list):
return [str(x) for x in result]
if isinstance(result, dict):
# Some versions return a map keyed by integer index.
return [str(v) for v in result.values()]
return []
# ---- the hot path ------------------------------------------------
def _call(self, method: str, *args: tuple[str, Any]) -> Any:

View file

@ -11,7 +11,7 @@ ISPConfig's client model has two IDs you'll trip over:
from __future__ import annotations
from typing import TYPE_CHECKING, cast
from typing import TYPE_CHECKING, Any, cast
from .types import Client
@ -23,6 +23,284 @@ class ClientsModule:
def __init__(self, client: ISPConfigClient) -> None:
self._c = client
# ---- AUTO-GENERATED START (do not hand-edit above this line) ----
# Regenerate with: python3 tools/gen_methods.py
def client_add(self, reseller_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``client_add``.
Source: ``client.inc.php`` line 157.
PHP signature: ``client_add($session_id, $reseller_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("client_add", ("reseller_id", reseller_id), ("params", params))
def client_change_password(self, client_id: Any, new_password: Any) -> Any:
"""
Changes client password
Source: ``client.inc.php`` line 537.
PHP signature: ``client_change_password($session_id, $client_id, $new_password)``.
Params (from PHPDoc):
session (int): id
client (int): id
new (string): password
Returns: bool - true if success
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"client_change_password", ("client_id", client_id), ("new_password", new_password)
)
def client_delete(self, client_id: Any) -> Any:
"""
Auto-generated wrapper for ``client_delete``.
Source: ``client.inc.php`` line 372.
PHP signature: ``client_delete($session_id, $client_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("client_delete", ("client_id", client_id))
def client_delete_everything(self, client_id: Any) -> Any:
"""
Auto-generated wrapper for ``client_delete_everything``.
Source: ``client.inc.php`` line 390.
PHP signature: ``client_delete_everything($session_id, $client_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("client_delete_everything", ("client_id", client_id))
def client_get(self, client_id: Any) -> Any:
"""
Auto-generated wrapper for ``client_get``.
Source: ``client.inc.php`` line 51.
PHP signature: ``client_get($session_id, $client_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("client_get", ("client_id", client_id))
def client_get_all(self) -> Any:
"""
Get All client_id's from database
Source: ``client.inc.php`` line 512.
Params (from PHPDoc):
Returns: Array - of all client_id's
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("client_get_all")
def client_get_by_customer_no(self, customer_no: Any) -> Any:
"""
Auto-generated wrapper for ``client_get_by_customer_no``.
Source: ``client.inc.php`` line 485.
PHP signature: ``client_get_by_customer_no($session_id, $customer_no)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("client_get_by_customer_no", ("customer_no", customer_no))
def client_get_by_groupid(self, group_id: Any) -> Any:
"""
Auto-generated wrapper for ``client_get_by_groupid``.
Source: ``client.inc.php`` line 688.
PHP signature: ``client_get_by_groupid($session_id, $group_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("client_get_by_groupid", ("group_id", group_id))
def client_get_by_username(self, username: Any) -> Any:
"""
Get sys_user information by username
Source: ``client.inc.php`` line 469.
PHP signature: ``client_get_by_username($session_id, $username)``.
Params (from PHPDoc):
session (int): id
user (string): 's name
Returns: mixed - false if error
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("client_get_by_username", ("username", username))
def client_get_emailcontact(self, client_id: Any) -> Any:
"""
Auto-generated wrapper for ``client_get_emailcontact``.
Source: ``client.inc.php`` line 118.
PHP signature: ``client_get_emailcontact($session_id, $client_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("client_get_emailcontact", ("client_id", client_id))
def client_get_groupid(self, client_id: Any) -> Any:
"""
Auto-generated wrapper for ``client_get_groupid``.
Source: ``client.inc.php`` line 137.
PHP signature: ``client_get_groupid($session_id, $client_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("client_get_groupid", ("client_id", client_id))
def client_get_id(self, sys_userid: Any) -> Any:
"""
Auto-generated wrapper for ``client_get_id``.
Source: ``client.inc.php`` line 96.
PHP signature: ``client_get_id($session_id, $sys_userid)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("client_get_id", ("sys_userid", sys_userid))
def client_get_sites_by_user(self, sys_userid: Any, sys_groupid: Any) -> Any:
"""
Gets sites by $sys_userid & $sys_groupid
Source: ``sites.inc.php`` line 835.
PHP signature: ``client_get_sites_by_user($session_id, $sys_userid, $sys_groupid)``.
Params (from PHPDoc):
session (int): id
user (int): id
list (array): of groups
Returns: mixed - array with sites by user
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"client_get_sites_by_user", ("sys_userid", sys_userid), ("sys_groupid", sys_groupid)
)
def client_login_get(self, username: Any, password: Any, remote_ip: Any = "") -> Any:
"""
Auto-generated wrapper for ``client_login_get``.
Source: ``client.inc.php`` line 576.
PHP signature: ``client_login_get($session_id,$username,$password,$remote_ip = '')``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"client_login_get", ("username", username), ("password", password), ("remote_ip", remote_ip)
)
def client_template_additional_add(self, client_id: Any, template_id: Any) -> Any:
"""
Auto-generated wrapper for ``client_template_additional_add``.
Source: ``client.inc.php`` line 296.
PHP signature: ``client_template_additional_add($session_id, $client_id, $template_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"client_template_additional_add", ("client_id", client_id), ("template_id", template_id)
)
def client_template_additional_delete(self, client_id: Any, assigned_template_id: Any) -> Any:
"""
Auto-generated wrapper for ``client_template_additional_delete``.
Source: ``client.inc.php`` line 334.
PHP signature: ``client_template_additional_delete($session_id, $client_id, $assigned_template_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"client_template_additional_delete",
("client_id", client_id),
("assigned_template_id", assigned_template_id),
)
def client_template_additional_get(self, client_id: Any) -> Any:
"""
Auto-generated wrapper for ``client_template_additional_get``.
Source: ``client.inc.php`` line 258.
PHP signature: ``client_template_additional_get($session_id, $client_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("client_template_additional_get", ("client_id", client_id))
def client_templates_get_all(self) -> Any:
"""
Get all client templates
Source: ``client.inc.php`` line 566.
Params (from PHPDoc):
session (int): id
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("client_templates_get_all")
def client_update(self, client_id: Any, reseller_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``client_update``.
Source: ``client.inc.php`` line 187.
PHP signature: ``client_update($session_id, $client_id, $reseller_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"client_update", ("client_id", client_id), ("reseller_id", reseller_id), ("params", params)
)
# ---- AUTO-GENERATED END ----
# ---- HAND-EDIT ONLY BELOW ----
# ---- HAND-EDIT ONLY BELOW ----
# ---- HAND-EDIT ONLY BELOW ----
def get(self, primary_id: int) -> Client:
return cast(Client, self._c._call("client_get", ("primary_id", int(primary_id))))

83
src/ispconfig/cron.py Normal file
View file

@ -0,0 +1,83 @@
"""``cron.*`` — auto-generated ISPConfig remote-API wrappers.
This module is produced by ``tools/gen_methods.py`` from the
``tools/method_inventory.json`` catalog. Hand-edits go below the
``---- HAND-EDIT ONLY BELOW ----`` marker they survive regeneration.
"""
from __future__ import annotations
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from .client import ISPConfigClient
class CronModule:
"""Auto-generated module: Cron.
All methods below the ``AUTO-GENERATED START`` marker are produced
by ``tools/gen_methods.py``. Do not hand-edit that block changes
will be overwritten on the next regeneration. Add helpers and
overrides below the ``HAND-EDIT ONLY BELOW`` marker instead.
"""
def __init__(self, client: ISPConfigClient) -> None:
self._c = client
# ---- AUTO-GENERATED START (do not hand-edit above this line) ----
# Regenerate with: python3 tools/gen_methods.py
def sites_cron_add(self, client_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_cron_add``.
Source: ``sites.inc.php`` line 59.
PHP signature: ``sites_cron_add($session_id, $client_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_cron_add", ("client_id", client_id), ("params", params))
def sites_cron_delete(self, cron_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_cron_delete``.
Source: ``sites.inc.php`` line 80.
PHP signature: ``sites_cron_delete($session_id, $cron_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_cron_delete", ("cron_id", cron_id))
def sites_cron_get(self, cron_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_cron_get``.
Source: ``sites.inc.php`` line 45.
PHP signature: ``sites_cron_get($session_id, $cron_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_cron_get", ("cron_id", cron_id))
def sites_cron_update(self, client_id: Any, cron_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_cron_update``.
Source: ``sites.inc.php`` line 69.
PHP signature: ``sites_cron_update($session_id, $client_id, $cron_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"sites_cron_update", ("client_id", client_id), ("cron_id", cron_id), ("params", params)
)
# ---- AUTO-GENERATED END ----
# ---- HAND-EDIT ONLY BELOW ----

View file

@ -20,6 +20,132 @@ class DatabasesModule:
def __init__(self, client: ISPConfigClient) -> None:
self._c = client
# ---- AUTO-GENERATED START (do not hand-edit above this line) ----
# Regenerate with: python3 tools/gen_methods.py
def sites_database_add(self, client_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_database_add``.
Source: ``sites.inc.php`` line 108.
PHP signature: ``sites_database_add($session_id, $client_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_database_add", ("client_id", client_id), ("params", params))
def sites_database_delete(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_database_delete``.
Source: ``sites.inc.php`` line 185.
PHP signature: ``sites_database_delete($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_database_delete", ("primary_id", primary_id))
def sites_database_get(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_database_get``.
Source: ``sites.inc.php`` line 93.
PHP signature: ``sites_database_get($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_database_get", ("primary_id", primary_id))
def sites_database_get_all_by_user(self, client_id: Any) -> Any:
"""
Get all databases by user
Source: ``sites.inc.php`` line 898.
PHP signature: ``sites_database_get_all_by_user($session_id, $client_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_database_get_all_by_user", ("client_id", client_id))
def sites_database_update(self, client_id: Any, primary_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_database_update``.
Source: ``sites.inc.php`` line 151.
PHP signature: ``sites_database_update($session_id, $client_id, $primary_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"sites_database_update", ("client_id", client_id), ("primary_id", primary_id), ("params", params)
)
def sites_database_user_add(self, client_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_database_user_add``.
Source: ``sites.inc.php`` line 217.
PHP signature: ``sites_database_user_add($session_id, $client_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_database_user_add", ("client_id", client_id), ("params", params))
def sites_database_user_delete(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_database_user_delete``.
Source: ``sites.inc.php`` line 258.
PHP signature: ``sites_database_user_delete($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_database_user_delete", ("primary_id", primary_id))
def sites_database_user_get(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_database_user_get``.
Source: ``sites.inc.php`` line 203.
PHP signature: ``sites_database_user_get($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_database_user_get", ("primary_id", primary_id))
def sites_database_user_update(self, client_id: Any, primary_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_database_user_update``.
Source: ``sites.inc.php`` line 228.
PHP signature: ``sites_database_user_update($session_id, $client_id, $primary_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"sites_database_user_update",
("client_id", client_id),
("primary_id", primary_id),
("params", params),
)
# ---- AUTO-GENERATED END ----
# ---- HAND-EDIT ONLY BELOW ----
# ---- HAND-EDIT ONLY BELOW ----
# ---- HAND-EDIT ONLY BELOW ----
def get(self, primary_id: int) -> Database:
return self._c.sites.database_get(primary_id)

File diff suppressed because it is too large Load diff

95
src/ispconfig/domains.py Normal file
View file

@ -0,0 +1,95 @@
"""``domains.*`` — auto-generated ISPConfig remote-API wrappers.
This module is produced by ``tools/gen_methods.py`` from the
``tools/method_inventory.json`` catalog. Hand-edits go below the
``---- HAND-EDIT ONLY BELOW ----`` marker they survive regeneration.
"""
from __future__ import annotations
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from .client import ISPConfigClient
class DomainsModule:
"""Auto-generated module: Domains.
All methods below the ``AUTO-GENERATED START`` marker are produced
by ``tools/gen_methods.py``. Do not hand-edit that block changes
will be overwritten on the next regeneration. Add helpers and
overrides below the ``HAND-EDIT ONLY BELOW`` marker instead.
"""
def __init__(self, client: ISPConfigClient) -> None:
self._c = client
# ---- AUTO-GENERATED START (do not hand-edit above this line) ----
# Regenerate with: python3 tools/gen_methods.py
def domains_domain_add(self, client_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``domains_domain_add``.
Source: ``domains.inc.php`` line 59.
PHP signature: ``domains_domain_add($session_id, $client_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("domains_domain_add", ("client_id", client_id), ("params", params))
def domains_domain_delete(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``domains_domain_delete``.
Source: ``domains.inc.php`` line 79.
PHP signature: ``domains_domain_delete($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("domains_domain_delete", ("primary_id", primary_id))
def domains_domain_get(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``domains_domain_get``.
Source: ``domains.inc.php`` line 45.
PHP signature: ``domains_domain_get($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("domains_domain_get", ("primary_id", primary_id))
def domains_domain_update(self, client_id: Any, primary_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``domains_domain_update``.
Source: ``domains.inc.php`` line 69.
PHP signature: ``domains_domain_update($session_id, $client_id, $primary_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"domains_domain_update", ("client_id", client_id), ("primary_id", primary_id), ("params", params)
)
def domains_get_all_by_user(self, group_id: Any) -> Any:
"""
Auto-generated wrapper for ``domains_get_all_by_user``.
Source: ``domains.inc.php`` line 90.
PHP signature: ``domains_get_all_by_user($session_id, $group_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("domains_get_all_by_user", ("group_id", group_id))
# ---- AUTO-GENERATED END ----
# ---- HAND-EDIT ONLY BELOW ----

View file

@ -47,11 +47,14 @@ def map_fault(faultcode: str, faultstring: str) -> ISPConfigError:
return AuthError(faultstring)
if "permission denied" in msg or "you do not have the permissions" in msg or "not allowed" in msg:
return PermissionError(faultstring)
code_low = faultcode.lower()
if (
"no records found" in msg
or "not found" in msg
or "no record found" in msg
or "no_domain_found" in faultcode.lower()
or "no_domain_found" in code_low
or "no_client_found" in code_low
or "no user account" in msg
or "invalid domain name" in msg
):
return NotFoundError(faultstring)

95
src/ispconfig/ftp.py Normal file
View file

@ -0,0 +1,95 @@
"""``ftp.*`` — auto-generated ISPConfig remote-API wrappers.
This module is produced by ``tools/gen_methods.py`` from the
``tools/method_inventory.json`` catalog. Hand-edits go below the
``---- HAND-EDIT ONLY BELOW ----`` marker they survive regeneration.
"""
from __future__ import annotations
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from .client import ISPConfigClient
class FtpModule:
"""Auto-generated module: Ftp.
All methods below the ``AUTO-GENERATED START`` marker are produced
by ``tools/gen_methods.py``. Do not hand-edit that block changes
will be overwritten on the next regeneration. Add helpers and
overrides below the ``HAND-EDIT ONLY BELOW`` marker instead.
"""
def __init__(self, client: ISPConfigClient) -> None:
self._c = client
# ---- AUTO-GENERATED START (do not hand-edit above this line) ----
# Regenerate with: python3 tools/gen_methods.py
def sites_ftp_user_add(self, client_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_ftp_user_add``.
Source: ``sites.inc.php`` line 300.
PHP signature: ``sites_ftp_user_add($session_id, $client_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_ftp_user_add", ("client_id", client_id), ("params", params))
def sites_ftp_user_delete(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_ftp_user_delete``.
Source: ``sites.inc.php`` line 321.
PHP signature: ``sites_ftp_user_delete($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_ftp_user_delete", ("primary_id", primary_id))
def sites_ftp_user_get(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_ftp_user_get``.
Source: ``sites.inc.php`` line 286.
PHP signature: ``sites_ftp_user_get($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_ftp_user_get", ("primary_id", primary_id))
def sites_ftp_user_server_get(self, ftp_user: Any) -> Any:
"""
Auto-generated wrapper for ``sites_ftp_user_server_get``.
Source: ``sites.inc.php`` line 332.
PHP signature: ``sites_ftp_user_server_get($session_id, $ftp_user)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_ftp_user_server_get", ("ftp_user", ftp_user))
def sites_ftp_user_update(self, client_id: Any, primary_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_ftp_user_update``.
Source: ``sites.inc.php`` line 310.
PHP signature: ``sites_ftp_user_update($session_id, $client_id, $primary_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"sites_ftp_user_update", ("client_id", client_id), ("primary_id", primary_id), ("params", params)
)
# ---- AUTO-GENERATED END ----
# ---- HAND-EDIT ONLY BELOW ----

File diff suppressed because it is too large Load diff

81
src/ispconfig/misc.py Normal file
View file

@ -0,0 +1,81 @@
"""``misc.*`` — auto-generated ISPConfig remote-API wrappers.
This module is produced by ``tools/gen_methods.py`` from the
``tools/method_inventory.json`` catalog. Hand-edits go below the
``---- HAND-EDIT ONLY BELOW ----`` marker they survive regeneration.
"""
from __future__ import annotations
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from .client import ISPConfigClient
class MiscModule:
"""Auto-generated module: Misc.
All methods below the ``AUTO-GENERATED START`` marker are produced
by ``tools/gen_methods.py``. Do not hand-edit that block changes
will be overwritten on the next regeneration. Add helpers and
overrides below the ``HAND-EDIT ONLY BELOW`` marker instead.
"""
def __init__(self, client: ISPConfigClient) -> None:
self._c = client
# ---- AUTO-GENERATED START (do not hand-edit above this line) ----
# Regenerate with: python3 tools/gen_methods.py
def databasequota_get_by_user(self, client_id: Any) -> Any:
"""
Auto-generated wrapper for ``databasequota_get_by_user``.
Source: ``sites.inc.php`` line 1012.
PHP signature: ``databasequota_get_by_user($session_id, $client_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("databasequota_get_by_user", ("client_id", client_id))
def ftptrafficquota_data(self, client_id: Any, lastdays: Any = 0) -> Any:
"""
Auto-generated wrapper for ``ftptrafficquota_data``.
Source: ``sites.inc.php`` line 997.
PHP signature: ``ftptrafficquota_data($session_id, $client_id, $lastdays = 0)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("ftptrafficquota_data", ("client_id", client_id), ("lastdays", lastdays))
def quota_get_by_user(self, client_id: Any) -> Any:
"""
Auto-generated wrapper for ``quota_get_by_user``.
Source: ``sites.inc.php`` line 970.
PHP signature: ``quota_get_by_user($session_id, $client_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("quota_get_by_user", ("client_id", client_id))
def trafficquota_get_by_user(self, client_id: Any, lastdays: Any = 0) -> Any:
"""
Auto-generated wrapper for ``trafficquota_get_by_user``.
Source: ``sites.inc.php`` line 982.
PHP signature: ``trafficquota_get_by_user($session_id, $client_id, $lastdays = 0)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("trafficquota_get_by_user", ("client_id", client_id), ("lastdays", lastdays))
# ---- AUTO-GENERATED END ----
# ---- HAND-EDIT ONLY BELOW ----

45
src/ispconfig/monitor.py Normal file
View file

@ -0,0 +1,45 @@
"""``monitor.*`` — auto-generated ISPConfig remote-API wrappers.
This module is produced by ``tools/gen_methods.py`` from the
``tools/method_inventory.json`` catalog. Hand-edits go below the
``---- HAND-EDIT ONLY BELOW ----`` marker they survive regeneration.
"""
from __future__ import annotations
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from .client import ISPConfigClient
class MonitorModule:
"""Auto-generated module: Monitor.
All methods below the ``AUTO-GENERATED START`` marker are produced
by ``tools/gen_methods.py``. Do not hand-edit that block changes
will be overwritten on the next regeneration. Add helpers and
overrides below the ``HAND-EDIT ONLY BELOW`` marker instead.
"""
def __init__(self, client: ISPConfigClient) -> None:
self._c = client
# ---- AUTO-GENERATED START (do not hand-edit above this line) ----
# Regenerate with: python3 tools/gen_methods.py
def monitor_jobqueue_count(self, server_id: Any = 0) -> Any:
"""
Auto-generated wrapper for ``monitor_jobqueue_count``.
Source: ``monitor.inc.php`` line 36.
PHP signature: ``monitor_jobqueue_count($session_id, $server_id = 0)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("monitor_jobqueue_count", ("server_id", server_id))
# ---- AUTO-GENERATED END ----
# ---- HAND-EDIT ONLY BELOW ----

319
src/ispconfig/openvz.py Normal file
View file

@ -0,0 +1,319 @@
"""``openvz.*`` — auto-generated ISPConfig remote-API wrappers.
This module is produced by ``tools/gen_methods.py`` from the
``tools/method_inventory.json`` catalog. Hand-edits go below the
``---- HAND-EDIT ONLY BELOW ----`` marker they survive regeneration.
"""
from __future__ import annotations
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from .client import ISPConfigClient
class OpenvzModule:
"""Auto-generated module: Openvz.
All methods below the ``AUTO-GENERATED START`` marker are produced
by ``tools/gen_methods.py``. Do not hand-edit that block changes
will be overwritten on the next regeneration. Add helpers and
overrides below the ``HAND-EDIT ONLY BELOW`` marker instead.
"""
def __init__(self, client: ISPConfigClient) -> None:
self._c = client
# ---- AUTO-GENERATED START (do not hand-edit above this line) ----
# Regenerate with: python3 tools/gen_methods.py
def openvz_get_free_ip(self, server_id: Any = 0) -> Any:
"""
Auto-generated wrapper for ``openvz_get_free_ip``.
Source: ``openvz.inc.php`` line 151.
PHP signature: ``openvz_get_free_ip($session_id, $server_id = 0)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("openvz_get_free_ip", ("server_id", server_id))
def openvz_ip_add(self, client_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``openvz_ip_add``.
Source: ``openvz.inc.php`` line 175.
PHP signature: ``openvz_ip_add($session_id, $client_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("openvz_ip_add", ("client_id", client_id), ("params", params))
def openvz_ip_delete(self, ip_id: Any) -> Any:
"""
Auto-generated wrapper for ``openvz_ip_delete``.
Source: ``openvz.inc.php`` line 196.
PHP signature: ``openvz_ip_delete($session_id, $ip_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("openvz_ip_delete", ("ip_id", ip_id))
def openvz_ip_get(self, ip_id: Any) -> Any:
"""
Auto-generated wrapper for ``openvz_ip_get``.
Source: ``openvz.inc.php`` line 137.
PHP signature: ``openvz_ip_get($session_id, $ip_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("openvz_ip_get", ("ip_id", ip_id))
def openvz_ip_update(self, client_id: Any, ip_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``openvz_ip_update``.
Source: ``openvz.inc.php`` line 185.
PHP signature: ``openvz_ip_update($session_id, $client_id, $ip_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"openvz_ip_update", ("client_id", client_id), ("ip_id", ip_id), ("params", params)
)
def openvz_ostemplate_add(self, client_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``openvz_ostemplate_add``.
Source: ``openvz.inc.php`` line 59.
PHP signature: ``openvz_ostemplate_add($session_id, $client_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("openvz_ostemplate_add", ("client_id", client_id), ("params", params))
def openvz_ostemplate_delete(self, ostemplate_id: Any) -> Any:
"""
Auto-generated wrapper for ``openvz_ostemplate_delete``.
Source: ``openvz.inc.php`` line 80.
PHP signature: ``openvz_ostemplate_delete($session_id, $ostemplate_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("openvz_ostemplate_delete", ("ostemplate_id", ostemplate_id))
def openvz_ostemplate_get(self, ostemplate_id: Any) -> Any:
"""
Auto-generated wrapper for ``openvz_ostemplate_get``.
Source: ``openvz.inc.php`` line 45.
PHP signature: ``openvz_ostemplate_get($session_id, $ostemplate_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("openvz_ostemplate_get", ("ostemplate_id", ostemplate_id))
def openvz_ostemplate_update(self, client_id: Any, ostemplate_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``openvz_ostemplate_update``.
Source: ``openvz.inc.php`` line 69.
PHP signature: ``openvz_ostemplate_update($session_id, $client_id, $ostemplate_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"openvz_ostemplate_update",
("client_id", client_id),
("ostemplate_id", ostemplate_id),
("params", params),
)
def openvz_template_add(self, client_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``openvz_template_add``.
Source: ``openvz.inc.php`` line 105.
PHP signature: ``openvz_template_add($session_id, $client_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("openvz_template_add", ("client_id", client_id), ("params", params))
def openvz_template_delete(self, template_id: Any) -> Any:
"""
Auto-generated wrapper for ``openvz_template_delete``.
Source: ``openvz.inc.php`` line 126.
PHP signature: ``openvz_template_delete($session_id, $template_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("openvz_template_delete", ("template_id", template_id))
def openvz_template_get(self, template_id: Any) -> Any:
"""
Auto-generated wrapper for ``openvz_template_get``.
Source: ``openvz.inc.php`` line 91.
PHP signature: ``openvz_template_get($session_id, $template_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("openvz_template_get", ("template_id", template_id))
def openvz_template_update(self, client_id: Any, template_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``openvz_template_update``.
Source: ``openvz.inc.php`` line 115.
PHP signature: ``openvz_template_update($session_id, $client_id, $template_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"openvz_template_update",
("client_id", client_id),
("template_id", template_id),
("params", params),
)
def openvz_vm_add(self, client_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``openvz_vm_add``.
Source: ``openvz.inc.php`` line 241.
PHP signature: ``openvz_vm_add($session_id, $client_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("openvz_vm_add", ("client_id", client_id), ("params", params))
def openvz_vm_add_from_template(
self, client_id: Any, ostemplate_id: Any, template_id: Any, override_params: Any = None
) -> Any:
"""
Auto-generated wrapper for ``openvz_vm_add_from_template``.
Source: ``openvz.inc.php`` line 251.
PHP signature: ``openvz_vm_add_from_template($session_id, $client_id, $ostemplate_id, $template_id, $override_params = array())``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"openvz_vm_add_from_template",
("client_id", client_id),
("ostemplate_id", ostemplate_id),
("template_id", template_id),
("override_params", override_params),
)
def openvz_vm_delete(self, vm_id: Any) -> Any:
"""
Auto-generated wrapper for ``openvz_vm_delete``.
Source: ``openvz.inc.php`` line 342.
PHP signature: ``openvz_vm_delete($session_id, $vm_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("openvz_vm_delete", ("vm_id", vm_id))
def openvz_vm_get(self, vm_id: Any) -> Any:
"""
Auto-generated wrapper for ``openvz_vm_get``.
Source: ``openvz.inc.php`` line 207.
PHP signature: ``openvz_vm_get($session_id, $vm_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("openvz_vm_get", ("vm_id", vm_id))
def openvz_vm_get_by_client(self, client_id: Any) -> Any:
"""
Auto-generated wrapper for ``openvz_vm_get_by_client``.
Source: ``openvz.inc.php`` line 221.
PHP signature: ``openvz_vm_get_by_client($session_id, $client_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("openvz_vm_get_by_client", ("client_id", client_id))
def openvz_vm_restart(self, vm_id: Any) -> Any:
"""
Auto-generated wrapper for ``openvz_vm_restart``.
Source: ``openvz.inc.php`` line 437.
PHP signature: ``openvz_vm_restart($session_id, $vm_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("openvz_vm_restart", ("vm_id", vm_id))
def openvz_vm_start(self, vm_id: Any) -> Any:
"""
Auto-generated wrapper for ``openvz_vm_start``.
Source: ``openvz.inc.php`` line 353.
PHP signature: ``openvz_vm_start($session_id, $vm_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("openvz_vm_start", ("vm_id", vm_id))
def openvz_vm_stop(self, vm_id: Any) -> Any:
"""
Auto-generated wrapper for ``openvz_vm_stop``.
Source: ``openvz.inc.php`` line 395.
PHP signature: ``openvz_vm_stop($session_id, $vm_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("openvz_vm_stop", ("vm_id", vm_id))
def openvz_vm_update(self, client_id: Any, vm_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``openvz_vm_update``.
Source: ``openvz.inc.php`` line 331.
PHP signature: ``openvz_vm_update($session_id, $client_id, $vm_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"openvz_vm_update", ("client_id", client_id), ("vm_id", vm_id), ("params", params)
)
# ---- AUTO-GENERATED END ----
# ---- HAND-EDIT ONLY BELOW ----

215
src/ispconfig/server.py Normal file
View file

@ -0,0 +1,215 @@
"""``server.*`` — auto-generated ISPConfig remote-API wrappers.
This module is produced by ``tools/gen_methods.py`` from the
``tools/method_inventory.json`` catalog. Hand-edits go below the
``---- HAND-EDIT ONLY BELOW ----`` marker they survive regeneration.
"""
from __future__ import annotations
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from .client import ISPConfigClient
class ServerModule:
"""Auto-generated module: Server.
All methods below the ``AUTO-GENERATED START`` marker are produced
by ``tools/gen_methods.py``. Do not hand-edit that block changes
will be overwritten on the next regeneration. Add helpers and
overrides below the ``HAND-EDIT ONLY BELOW`` marker instead.
"""
def __init__(self, client: ISPConfigClient) -> None:
self._c = client
# ---- AUTO-GENERATED START (do not hand-edit above this line) ----
# Regenerate with: python3 tools/gen_methods.py
def server_config_set(self, server_id: Any, section: str, key: str, value: Any) -> Any:
"""
Set a value in the server configuration
Source: ``server.inc.php`` line 153.
PHP signature: ``server_config_set($session_id, $server_id, $section, $key, $value)``.
Params (from PHPDoc):
session (int): id
server (int): id
section (string): of the config field in the server table. Could be 'web', 'dns', 'mail', 'dns', 'cron', etc
key (string): of the option that you want to set
option (string): value that you want to set
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"server_config_set",
("server_id", server_id),
("section", section),
("key", key),
("value", value),
)
def server_get(self, server_id: Any = None, section: str = "") -> Any:
"""
Gets the server configuration
Source: ``server.inc.php`` line 116.
PHP signature: ``server_get($session_id, $server_id = null, $section ='')``.
Params (from PHPDoc):
session (int): id
server (int): id
section (string): of the config field in the server table. Could be 'web', 'dns', 'mail', 'dns', 'cron', etc
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("server_get", ("server_id", server_id), ("section", section))
def server_get_all(self) -> Any:
"""
Gets a list of all servers
Source: ``server.inc.php`` line 179.
Params (from PHPDoc):
server_name (int)
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("server_get_all")
def server_get_app_version(self, server_id: Any = 0) -> Any:
"""
Auto-generated wrapper for ``server_get_app_version``.
Source: ``server.inc.php`` line 238.
PHP signature: ``server_get_app_version($session_id, $server_id = 0)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("server_get_app_version", ("server_id", server_id))
def server_get_functions(self, server_id: int) -> Any:
"""
Gets the functions of a server by server_id
Source: ``server.inc.php`` line 223.
PHP signature: ``server_get_functions($session_id, $server_id)``.
Params (from PHPDoc):
server_id (int)
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("server_get_functions", ("server_id", server_id))
def server_get_php_versions(self, server_id: Any, php: Any, get_full_data: Any = False) -> Any:
"""
Auto-generated wrapper for ``server_get_php_versions``.
Source: ``server.inc.php`` line 259.
PHP signature: ``server_get_php_versions($session_id, $server_id, $php, $get_full_data = false)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"server_get_php_versions",
("server_id", server_id),
("php", php),
("get_full_data", get_full_data),
)
def server_get_serverid_by_ip(self, ipaddress: Any) -> Any:
"""
Gets the server configuration
Source: ``server.inc.php`` line 49.
PHP signature: ``server_get_serverid_by_ip($session_id, $ipaddress)``.
Params (from PHPDoc):
session (int): id
server (int): id
section (string): of the config field in the server table. Could be 'web', 'dns', 'mail', 'dns', 'cron', etc
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("server_get_serverid_by_ip", ("ipaddress", ipaddress))
def server_get_serverid_by_name(self, server_name: int) -> Any:
"""
Gets the server_id by server_name
Source: ``server.inc.php`` line 201.
PHP signature: ``server_get_serverid_by_name($session_id, $server_name)``.
Params (from PHPDoc):
server_name (int)
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("server_get_serverid_by_name", ("server_name", server_name))
def server_ip_add(self, client_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``server_ip_add``.
Source: ``server.inc.php`` line 78.
PHP signature: ``server_ip_add($session_id, $client_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("server_ip_add", ("client_id", client_id), ("params", params))
def server_ip_delete(self, ip_id: Any) -> Any:
"""
Auto-generated wrapper for ``server_ip_delete``.
Source: ``server.inc.php`` line 99.
PHP signature: ``server_ip_delete($session_id, $ip_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("server_ip_delete", ("ip_id", ip_id))
def server_ip_get(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``server_ip_get``.
Source: ``server.inc.php`` line 64.
PHP signature: ``server_ip_get($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("server_ip_get", ("primary_id", primary_id))
def server_ip_update(self, client_id: Any, ip_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``server_ip_update``.
Source: ``server.inc.php`` line 88.
PHP signature: ``server_ip_update($session_id, $client_id, $ip_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"server_ip_update", ("client_id", client_id), ("ip_id", ip_id), ("params", params)
)
# ---- AUTO-GENERATED END ----
# ---- HAND-EDIT ONLY BELOW ----

86
src/ispconfig/shell.py Normal file
View file

@ -0,0 +1,86 @@
"""``shell.*`` — auto-generated ISPConfig remote-API wrappers.
This module is produced by ``tools/gen_methods.py`` from the
``tools/method_inventory.json`` catalog. Hand-edits go below the
``---- HAND-EDIT ONLY BELOW ----`` marker they survive regeneration.
"""
from __future__ import annotations
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from .client import ISPConfigClient
class ShellModule:
"""Auto-generated module: Shell.
All methods below the ``AUTO-GENERATED START`` marker are produced
by ``tools/gen_methods.py``. Do not hand-edit that block changes
will be overwritten on the next regeneration. Add helpers and
overrides below the ``HAND-EDIT ONLY BELOW`` marker instead.
"""
def __init__(self, client: ISPConfigClient) -> None:
self._c = client
# ---- AUTO-GENERATED START (do not hand-edit above this line) ----
# Regenerate with: python3 tools/gen_methods.py
def sites_shell_user_add(self, client_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_shell_user_add``.
Source: ``sites.inc.php`` line 368.
PHP signature: ``sites_shell_user_add($session_id, $client_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_shell_user_add", ("client_id", client_id), ("params", params))
def sites_shell_user_delete(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_shell_user_delete``.
Source: ``sites.inc.php`` line 389.
PHP signature: ``sites_shell_user_delete($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_shell_user_delete", ("primary_id", primary_id))
def sites_shell_user_get(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_shell_user_get``.
Source: ``sites.inc.php`` line 354.
PHP signature: ``sites_shell_user_get($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_shell_user_get", ("primary_id", primary_id))
def sites_shell_user_update(self, client_id: Any, primary_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_shell_user_update``.
Source: ``sites.inc.php`` line 378.
PHP signature: ``sites_shell_user_update($session_id, $client_id, $primary_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"sites_shell_user_update",
("client_id", client_id),
("primary_id", primary_id),
("params", params),
)
# ---- AUTO-GENERATED END ----
# ---- HAND-EDIT ONLY BELOW ----

View file

@ -31,6 +31,409 @@ class SitesModule:
def __init__(self, client: ISPConfigClient) -> None:
self._c = client
# ---- AUTO-GENERATED START (do not hand-edit above this line) ----
# Regenerate with: python3 tools/gen_methods.py
def sites_web_aliasdomain_add(self, client_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_aliasdomain_add``.
Source: ``sites.inc.php`` line 642.
PHP signature: ``sites_web_aliasdomain_add($session_id, $client_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_web_aliasdomain_add", ("client_id", client_id), ("params", params))
def sites_web_aliasdomain_delete(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_aliasdomain_delete``.
Source: ``sites.inc.php`` line 663.
PHP signature: ``sites_web_aliasdomain_delete($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_web_aliasdomain_delete", ("primary_id", primary_id))
def sites_web_aliasdomain_get(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_aliasdomain_get``.
Source: ``sites.inc.php`` line 628.
PHP signature: ``sites_web_aliasdomain_get($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_web_aliasdomain_get", ("primary_id", primary_id))
def sites_web_aliasdomain_update(self, client_id: Any, primary_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_aliasdomain_update``.
Source: ``sites.inc.php`` line 652.
PHP signature: ``sites_web_aliasdomain_update($session_id, $client_id, $primary_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"sites_web_aliasdomain_update",
("client_id", client_id),
("primary_id", primary_id),
("params", params),
)
def sites_web_domain_add(self, client_id: Any, params: Any, readonly: Any = False) -> Any:
"""
Auto-generated wrapper for ``sites_web_domain_add``.
Source: ``sites.inc.php`` line 416.
PHP signature: ``sites_web_domain_add($session_id, $client_id, $params, $readonly = false)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"sites_web_domain_add", ("client_id", client_id), ("params", params), ("readonly", readonly)
)
def sites_web_domain_delete(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_domain_delete``.
Source: ``sites.inc.php`` line 471.
PHP signature: ``sites_web_domain_delete($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_web_domain_delete", ("primary_id", primary_id))
def sites_web_domain_get(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_domain_get``.
Source: ``sites.inc.php`` line 402.
PHP signature: ``sites_web_domain_get($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_web_domain_get", ("primary_id", primary_id))
def sites_web_domain_set_status(self, primary_id: Any, status: Any) -> Any:
"""
Change domains status
Source: ``sites.inc.php`` line 870.
PHP signature: ``sites_web_domain_set_status($session_id, $primary_id, $status)``.
Params (from PHPDoc):
session (int): id
site (int): id
active (string): or inactive string
Returns: mixed - false if error
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_web_domain_set_status", ("primary_id", primary_id), ("status", status))
def sites_web_domain_update(self, client_id: Any, primary_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_domain_update``.
Source: ``sites.inc.php`` line 451.
PHP signature: ``sites_web_domain_update($session_id, $client_id, $primary_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"sites_web_domain_update",
("client_id", client_id),
("primary_id", primary_id),
("params", params),
)
def sites_web_folder_add(self, client_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_folder_add``.
Source: ``sites.inc.php`` line 738.
PHP signature: ``sites_web_folder_add($session_id, $client_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_web_folder_add", ("client_id", client_id), ("params", params))
def sites_web_folder_delete(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_folder_delete``.
Source: ``sites.inc.php`` line 759.
PHP signature: ``sites_web_folder_delete($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_web_folder_delete", ("primary_id", primary_id))
def sites_web_folder_get(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_folder_get``.
Source: ``sites.inc.php`` line 724.
PHP signature: ``sites_web_folder_get($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_web_folder_get", ("primary_id", primary_id))
def sites_web_folder_update(self, client_id: Any, primary_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_folder_update``.
Source: ``sites.inc.php`` line 748.
PHP signature: ``sites_web_folder_update($session_id, $client_id, $primary_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"sites_web_folder_update",
("client_id", client_id),
("primary_id", primary_id),
("params", params),
)
def sites_web_folder_user_add(self, client_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_folder_user_add``.
Source: ``sites.inc.php`` line 796.
PHP signature: ``sites_web_folder_user_add($session_id, $client_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_web_folder_user_add", ("client_id", client_id), ("params", params))
def sites_web_folder_user_delete(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_folder_user_delete``.
Source: ``sites.inc.php`` line 817.
PHP signature: ``sites_web_folder_user_delete($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_web_folder_user_delete", ("primary_id", primary_id))
def sites_web_folder_user_get(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_folder_user_get``.
Source: ``sites.inc.php`` line 782.
PHP signature: ``sites_web_folder_user_get($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_web_folder_user_get", ("primary_id", primary_id))
def sites_web_folder_user_update(self, client_id: Any, primary_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_folder_user_update``.
Source: ``sites.inc.php`` line 806.
PHP signature: ``sites_web_folder_user_update($session_id, $client_id, $primary_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"sites_web_folder_user_update",
("client_id", client_id),
("primary_id", primary_id),
("params", params),
)
def sites_web_subdomain_add(self, client_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_subdomain_add``.
Source: ``sites.inc.php`` line 690.
PHP signature: ``sites_web_subdomain_add($session_id, $client_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_web_subdomain_add", ("client_id", client_id), ("params", params))
def sites_web_subdomain_delete(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_subdomain_delete``.
Source: ``sites.inc.php`` line 711.
PHP signature: ``sites_web_subdomain_delete($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_web_subdomain_delete", ("primary_id", primary_id))
def sites_web_subdomain_get(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_subdomain_get``.
Source: ``sites.inc.php`` line 676.
PHP signature: ``sites_web_subdomain_get($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_web_subdomain_get", ("primary_id", primary_id))
def sites_web_subdomain_update(self, client_id: Any, primary_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_subdomain_update``.
Source: ``sites.inc.php`` line 700.
PHP signature: ``sites_web_subdomain_update($session_id, $client_id, $primary_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"sites_web_subdomain_update",
("client_id", client_id),
("primary_id", primary_id),
("params", params),
)
def sites_web_vhost_aliasdomain_add(self, client_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_vhost_aliasdomain_add``.
Source: ``sites.inc.php`` line 498.
PHP signature: ``sites_web_vhost_aliasdomain_add($session_id, $client_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_web_vhost_aliasdomain_add", ("client_id", client_id), ("params", params))
def sites_web_vhost_aliasdomain_delete(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_vhost_aliasdomain_delete``.
Source: ``sites.inc.php`` line 543.
PHP signature: ``sites_web_vhost_aliasdomain_delete($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_web_vhost_aliasdomain_delete", ("primary_id", primary_id))
def sites_web_vhost_aliasdomain_get(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_vhost_aliasdomain_get``.
Source: ``sites.inc.php`` line 484.
PHP signature: ``sites_web_vhost_aliasdomain_get($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_web_vhost_aliasdomain_get", ("primary_id", primary_id))
def sites_web_vhost_aliasdomain_update(self, client_id: Any, primary_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_vhost_aliasdomain_update``.
Source: ``sites.inc.php`` line 523.
PHP signature: ``sites_web_vhost_aliasdomain_update($session_id, $client_id, $primary_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"sites_web_vhost_aliasdomain_update",
("client_id", client_id),
("primary_id", primary_id),
("params", params),
)
def sites_web_vhost_subdomain_add(self, client_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_vhost_subdomain_add``.
Source: ``sites.inc.php`` line 570.
PHP signature: ``sites_web_vhost_subdomain_add($session_id, $client_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_web_vhost_subdomain_add", ("client_id", client_id), ("params", params))
def sites_web_vhost_subdomain_delete(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_vhost_subdomain_delete``.
Source: ``sites.inc.php`` line 615.
PHP signature: ``sites_web_vhost_subdomain_delete($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_web_vhost_subdomain_delete", ("primary_id", primary_id))
def sites_web_vhost_subdomain_get(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_vhost_subdomain_get``.
Source: ``sites.inc.php`` line 556.
PHP signature: ``sites_web_vhost_subdomain_get($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_web_vhost_subdomain_get", ("primary_id", primary_id))
def sites_web_vhost_subdomain_update(self, client_id: Any, primary_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_web_vhost_subdomain_update``.
Source: ``sites.inc.php`` line 595.
PHP signature: ``sites_web_vhost_subdomain_update($session_id, $client_id, $primary_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"sites_web_vhost_subdomain_update",
("client_id", client_id),
("primary_id", primary_id),
("params", params),
)
# ---- AUTO-GENERATED END ----
# ---- HAND-EDIT ONLY BELOW ----
# ---- HAND-EDIT ONLY BELOW ----
# ---- HAND-EDIT ONLY BELOW ----
# ---- web domain ---------------------------------------------------
def web_domain_get(self, primary_id: int) -> WebDomain:
@ -42,12 +445,14 @@ class SitesModule:
``client_id=0`` creates an admin-owned site.
"""
return int(self._c._call(
"sites_web_domain_add",
("client_id", int(client_id)),
("params", dict(params)),
("read_only", bool(read_only)),
))
return int(
self._c._call(
"sites_web_domain_add",
("client_id", int(client_id)),
("params", dict(params)),
("read_only", bool(read_only)),
)
)
def web_domain_update(self, client_id: int, primary_id: int, params: Mapping[str, Any]) -> int:
"""Update a site.
@ -56,23 +461,27 @@ class SitesModule:
The second positional arg is ``client_id``, not ``primary_id``.
Pass 0 for admin-owned. See module docstring.
"""
return int(self._c._call(
"sites_web_domain_update",
("client_id", int(client_id)),
("primary_id", int(primary_id)),
("params", dict(params)),
))
return int(
self._c._call(
"sites_web_domain_update",
("client_id", int(client_id)),
("primary_id", int(primary_id)),
("params", dict(params)),
)
)
def web_domain_delete(self, primary_id: int) -> int:
return int(self._c._call("sites_web_domain_delete", ("primary_id", int(primary_id))))
def web_domain_set_status(self, primary_id: int, status: str) -> int:
"""``status`` is typically ``'active'`` or ``'inactive'``."""
return int(self._c._call(
"sites_web_domain_set_status",
("primary_id", int(primary_id)),
("status", status),
))
return int(
self._c._call(
"sites_web_domain_set_status",
("primary_id", int(primary_id)),
("status", status),
)
)
# ---- helpers ------------------------------------------------------
@ -129,11 +538,13 @@ class SitesModule:
return cast(Database, self._c._call("sites_database_get", ("primary_id", int(primary_id))))
def database_add(self, client_id: int, params: Mapping[str, Any]) -> int:
return int(self._c._call(
"sites_database_add",
("client_id", int(client_id)),
("params", dict(params)),
))
return int(
self._c._call(
"sites_database_add",
("client_id", int(client_id)),
("params", dict(params)),
)
)
def database_delete(self, primary_id: int) -> int:
return int(self._c._call("sites_database_delete", ("primary_id", int(primary_id))))
@ -142,16 +553,20 @@ class SitesModule:
return cast(DatabaseUser, self._c._call("sites_database_user_get", ("primary_id", int(primary_id))))
def database_user_add(self, client_id: int, params: Mapping[str, Any]) -> int:
return int(self._c._call(
"sites_database_user_add",
("client_id", int(client_id)),
("params", dict(params)),
))
return int(
self._c._call(
"sites_database_user_add",
("client_id", int(client_id)),
("params", dict(params)),
)
)
def database_user_update(self, client_id: int, primary_id: int, params: Mapping[str, Any]) -> int:
return int(self._c._call(
"sites_database_user_update",
("client_id", int(client_id)),
("primary_id", int(primary_id)),
("params", dict(params)),
))
return int(
self._c._call(
"sites_database_user_update",
("client_id", int(client_id)),
("primary_id", int(primary_id)),
("params", dict(params)),
)
)

86
src/ispconfig/webdav.py Normal file
View file

@ -0,0 +1,86 @@
"""``webdav.*`` — auto-generated ISPConfig remote-API wrappers.
This module is produced by ``tools/gen_methods.py`` from the
``tools/method_inventory.json`` catalog. Hand-edits go below the
``---- HAND-EDIT ONLY BELOW ----`` marker they survive regeneration.
"""
from __future__ import annotations
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from .client import ISPConfigClient
class WebdavModule:
"""Auto-generated module: Webdav.
All methods below the ``AUTO-GENERATED START`` marker are produced
by ``tools/gen_methods.py``. Do not hand-edit that block changes
will be overwritten on the next regeneration. Add helpers and
overrides below the ``HAND-EDIT ONLY BELOW`` marker instead.
"""
def __init__(self, client: ISPConfigClient) -> None:
self._c = client
# ---- AUTO-GENERATED START (do not hand-edit above this line) ----
# Regenerate with: python3 tools/gen_methods.py
def sites_webdav_user_add(self, client_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_webdav_user_add``.
Source: ``sites.inc.php`` line 1043.
PHP signature: ``sites_webdav_user_add($session_id, $client_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_webdav_user_add", ("client_id", client_id), ("params", params))
def sites_webdav_user_delete(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_webdav_user_delete``.
Source: ``sites.inc.php`` line 1064.
PHP signature: ``sites_webdav_user_delete($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_webdav_user_delete", ("primary_id", primary_id))
def sites_webdav_user_get(self, primary_id: Any) -> Any:
"""
Auto-generated wrapper for ``sites_webdav_user_get``.
Source: ``sites.inc.php`` line 1029.
PHP signature: ``sites_webdav_user_get($session_id, $primary_id)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call("sites_webdav_user_get", ("primary_id", primary_id))
def sites_webdav_user_update(self, client_id: Any, primary_id: Any, params: Any) -> Any:
"""
Auto-generated wrapper for ``sites_webdav_user_update``.
Source: ``sites.inc.php`` line 1053.
PHP signature: ``sites_webdav_user_update($session_id, $client_id, $primary_id, $params)``.
AUTO-GENERATED - param shapes may need verification against your
ISPConfig version. File issues at Sulkta-OSS/ispconfig-py.
"""
return self._c._call(
"sites_webdav_user_update",
("client_id", client_id),
("primary_id", primary_id),
("params", params),
)
# ---- AUTO-GENERATED END ----
# ---- HAND-EDIT ONLY BELOW ----