Skip to content

comp-it-aut/DirectAdminAPI

Repository files navigation

DirectAdminAPI

Swagger API for DirectAdmin server

Installation & Usage

Requirements

PHP 8.1 and later.

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/comp-it-aut/DirectAdminAPI.git"
    }
  ],
  "require": {
    "comp-it-aut/DirectAdminAPI": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/DirectAdminAPI/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');



// Configure HTTP basic authorization: DaBasicAuth
$config = COMPITAUT\DirectAdminAPI\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');


$apiInstance = new COMPITAUT\DirectAdminAPI\Api\AdminApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->apiAdminUsageGet();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AdminApi->apiAdminUsageGet: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
AdminApi apiAdminUsageGet GET /api/admin-usage Get admin's usage
ClamAVApi apiClamavGet GET /api/clamav Get clamAV processes
ClamAVApi apiClamavPidDelete DELETE /api/clamav/{pid} Cancel the clamAV process by PID
ClamAVApi apiClamavPost POST /api/clamav Scan directories in the specified path
CpanelApi apiCpanelImportCheckRemotePost POST /api/cpanel-import/check-remote Checks SSH connection to remote cPanel server and returns list of remote users
CpanelApi apiCpanelImportTasksGet GET /api/cpanel-import/tasks List all cPanel import tasks
CpanelApi apiCpanelImportTasksIdDelete DELETE /api/cpanel-import/tasks/{id} Delete single pending cPanel import task
CpanelApi apiCpanelImportTasksIdGet GET /api/cpanel-import/tasks/{id} Get single cPanel import task
CpanelApi apiCpanelImportTasksIdLogGet GET /api/cpanel-import/tasks/{id}/log Retrieve single import task log
CpanelApi apiCpanelImportTasksIdLogSseGet GET /api/cpanel-import/tasks/{id}/log-sse Stream import task log
CpanelApi apiCpanelImportTasksStartPost POST /api/cpanel-import/tasks/start Starts remote cPanel account import to local DirectAdmin server
CustombuildApi apiCustombuildActionsGet GET /api/custombuild/actions Get available custombuild actions
CustombuildApi apiCustombuildCompileScriptsAppGet GET /api/custombuild/compile-scripts/{app} Get custombuild's app's default compile script
CustombuildApi apiCustombuildCompileScriptsCustomAppDelete DELETE /api/custombuild/compile-scripts-custom/{app} Delete custombuild's app's custom compile script (reset to default)
CustombuildApi apiCustombuildCompileScriptsCustomAppGet GET /api/custombuild/compile-scripts-custom/{app} Get custombuild's app's customized compile script
CustombuildApi apiCustombuildCompileScriptsCustomAppPut PUT /api/custombuild/compile-scripts-custom/{app} Set custombuild's app's custom compile script
CustombuildApi apiCustombuildCompileScriptsGet GET /api/custombuild/compile-scripts Get all custombuild's apps' compile scripts metadata
CustombuildApi apiCustombuildKillPost POST /api/custombuild/kill Kill custombuild
CustombuildApi apiCustombuildLogsGet GET /api/custombuild/logs Get all custombuild log files metadata
CustombuildApi apiCustombuildLogsLognameDelete DELETE /api/custombuild/logs/{logname} Delete custombuild log
CustombuildApi apiCustombuildLogsLognameSseGet GET /api/custombuild/logs/{logname}/sse Stream custombuild log file
CustombuildApi apiCustombuildOptionsGet GET /api/custombuild/options Get custombuild options
CustombuildApi apiCustombuildOptionsPatch PATCH /api/custombuild/options Patch custombuild options
CustombuildApi apiCustombuildOptionsV2Get GET /api/custombuild/options-v2 Get custombuild options
CustombuildApi apiCustombuildOptionsV2Patch PATCH /api/custombuild/options-v2 Patch custombuild options
CustombuildApi apiCustombuildOptionsValidateGet GET /api/custombuild/options/validate Get custombuild options validation message
CustombuildApi apiCustombuildRemovalsGet GET /api/custombuild/removals List of custombuild commands to remove no longer needed software
CustombuildApi apiCustombuildRunPost POST /api/custombuild/run Run Custombuild
CustombuildApi apiCustombuildSoftwareGet GET /api/custombuild/software Get available custombuild software
CustombuildApi apiCustombuildStateGet GET /api/custombuild/state Get custombuild state
CustombuildApi apiCustombuildStateSseGet GET /api/custombuild/state/sse Get custombuild state stream
CustombuildApi apiCustombuildUpdatesGet GET /api/custombuild/updates Get available custombuild updates
CustombuildApi apiCustombuildVersionsCustomAppDelete DELETE /api/custombuild/versions-custom/{app} Delete custombuild's app's custom version
CustombuildApi apiCustombuildVersionsCustomAppPut PUT /api/custombuild/versions-custom/{app} Set custombuild's app's custom version
CustombuildApi apiCustombuildVersionsCustomGet GET /api/custombuild/versions-custom Get all custombuild's apps custom versions
CustombuildApi apiCustombuildVersionsGet GET /api/custombuild/versions Get all custombuild's apps default versions
DatabaseApi apiDbManageCloneDbPost POST /api/db-manage/clone-db Clone database
DatabaseApi apiDbManageCreateDbPost POST /api/db-manage/create-db Create empty database
DatabaseApi apiDbManageCreateDbWithUserPost POST /api/db-manage/create-db-with-user Create database with user
DatabaseApi apiDbManageCreateUserPost POST /api/db-manage/create-user Create database user
DatabaseApi apiDbManageDatabasesDatabaseCheckPost POST /api/db-manage/databases/{database}/check Check database
DatabaseApi apiDbManageDatabasesDatabaseDelete DELETE /api/db-manage/databases/{database} Delete database
DatabaseApi apiDbManageDatabasesDatabaseExportGet GET /api/db-manage/databases/{database}/export Export database
DatabaseApi apiDbManageDatabasesDatabaseFixDefinersPost POST /api/db-manage/databases/{database}/fix-definers Fix broken database definers
DatabaseApi apiDbManageDatabasesDatabaseImportPost POST /api/db-manage/databases/{database}/import Import database backup
DatabaseApi apiDbManageDatabasesDatabaseOptimizePost POST /api/db-manage/databases/{database}/optimize Optimize database
DatabaseApi apiDbManageDatabasesDatabaseRepairPost POST /api/db-manage/databases/{database}/repair Repair database
DatabaseApi apiDbManageUsersDbuserChangeHostsPost POST /api/db-manage/users/{dbuser}/change-hosts Change database user hosts
DatabaseApi apiDbManageUsersDbuserChangePasswordPost POST /api/db-manage/users/{dbuser}/change-password Change database user password
DatabaseApi apiDbManageUsersDbuserDatabasesDatabaseChangePrivsPut PUT /api/db-manage/users/{dbuser}/databases/{database}/change-privs Set database privileges for dbuser
DatabaseApi apiDbManageUsersDbuserDelete DELETE /api/db-manage/users/{dbuser} Delete database user
DatabaseApi apiDbShowDatabasesDatabaseGet GET /api/db-show/databases/{database} Get Database metadata
DatabaseApi apiDbShowDatabasesDatabaseUsersGet GET /api/db-show/databases/{database}/users Get Database info
DatabaseApi apiDbShowDatabasesGet GET /api/db-show/databases Get Databases list
DatabaseApi apiDbShowInfoGet GET /api/db-show/info Database server info
DatabaseApi apiDbShowUsersDbuserDatabasesGet GET /api/db-show/users/{dbuser}/databases Get user databases
DatabaseApi apiDbShowUsersDbuserGet GET /api/db-show/users/{dbuser} Get User
DatabaseApi apiDbShowUsersGet GET /api/db-show/users Get Users
DatabaseApi apiPhpmyadminSsoAccountAccessPost POST /api/phpmyadmin-sso/account-access Create PhpMyAdmin single sign-on URL for user account access.
DatabaseApi apiPhpmyadminSsoDatabaseAccessDatabasePost POST /api/phpmyadmin-sso/database-access/{database} Create PhpMyAdmin single sign-on URL for single DB access.
DatabaseMonitorApi apiDbMonitorProcessesGet GET /api/db-monitor/processes Get database processes list
DatabaseMonitorApi apiDbMonitorProcessesIdKillPost POST /api/db-monitor/processes/{id}/kill Kill database thread
EmailApi apiEmailConfigMobileconfigGet GET /api/email-config/mobileconfig Download Apple Mail Configuration Profile
EmailApi apiEmailLogsGet GET /api/email-logs Get email logs
EmailApi apiEmailLogsSummaryGet GET /api/email-logs-summary Get emails log summary
ExecApi apiExecutePost POST /api/execute Executes command with options under user privileges
FilemanagerApi apiFilemanagerDiskUsageGet GET /api/filemanager/disk-usage Disk usage.
FilemanagerApi apiFilemanagerDownloadGet GET /api/filemanager/download Download file.
FilemanagerApi apiFilemanagerListGet GET /api/filemanager/list List directory contents.
FilemanagerApi apiFilemanagerMetadataGet GET /api/filemanager/metadata File metadata.
FilemanagerApi apiFilemanagerTreeGet GET /api/filemanager/tree Directories tree.
FilemanagerApi apiFilemanagerUploadPost POST /api/filemanager/upload Upload file.
GitApi apiGitDomainDomainGet GET /api/git/domain/{domain} Returns information about all the repositories under the user's domain
GitApi apiGitDomainDomainPost POST /api/git/domain/{domain} Initializes a repository or clones a remote one
GitApi apiGitUserUsernameUuidUuidWebhookPost POST /api/git/user/{username}/uuid/{uuid}/webhook fetches and deploys repository
GitApi apiGitUuidUuidBranchBranchGet GET /api/git/uuid/{uuid}/branch/{branch} Returns repository's branch log history
GitApi apiGitUuidUuidCommitCommitGet GET /api/git/uuid/{uuid}/commit/{commit} Returns commit information
GitApi apiGitUuidUuidDelete DELETE /api/git/uuid/{uuid} Removes repository
GitApi apiGitUuidUuidDeployPost POST /api/git/uuid/{uuid}/deploy Deploys bare repository to a working tree
GitApi apiGitUuidUuidFetchPost POST /api/git/uuid/{uuid}/fetch Fetches latest repository changes from the remote
GitApi apiGitUuidUuidGet GET /api/git/uuid/{uuid} Returns information about one repository under user domain
GitApi apiGitUuidUuidPut PUT /api/git/uuid/{uuid} Updates repository settings
ImapsyncApi apiImapsyncExportPost POST /api/imapsync/export Export emails over IMAP from DirecTadmin server to external server
ImapsyncApi apiImapsyncImportPost POST /api/imapsync/import Import emails over IMAP from external server to DirectAdmin server
ImapsyncApi apiImapsyncMigrationsGet GET /api/imapsync/migrations List all running imapsync migrations
ImapsyncApi apiImapsyncMigrationsIdDelete DELETE /api/imapsync/migrations/{id} Cancel imapsync migration
InfoApi apiInfoGet GET /api/info Get basic server info
InfoApi apiSystemInfoCpuGet GET /api/system-info/cpu Get system CPU
InfoApi apiSystemInfoFsGet GET /api/system-info/fs Get file system space usage
InfoApi apiSystemInfoLoadGet GET /api/system-info/load Get system load
InfoApi apiSystemInfoMemoryGet GET /api/system-info/memory Get system memory
InfoApi apiSystemInfoServicesGet GET /api/system-info/services Get system services
InfoApi apiSystemInfoUptimeGet GET /api/system-info/uptime Get system uptime
LicensingApi apiLicenseGet GET /api/license Get license info
LicensingApi apiLicenseProofGet GET /api/license/proof Get license session proof
LicensingApi apiLicenseUpdateKeyPost POST /api/license/update-key Change license key
LoginKeysApi apiLoginKeysCommandsGet GET /api/login-keys/commands Get all commands available for login keys
LoginKeysApi apiLoginKeysKeysGet GET /api/login-keys/keys Get all login keys
LoginKeysApi apiLoginKeysKeysIdDelete DELETE /api/login-keys/keys/{id} Delete login key
LoginKeysApi apiLoginKeysKeysIdGet GET /api/login-keys/keys/{id} Get login key
LoginKeysApi apiLoginKeysKeysIdHistoryGet GET /api/login-keys/keys/{id}/history Get login key history
LoginKeysApi apiLoginKeysKeysIdPatch PATCH /api/login-keys/keys/{id} Update login key
LoginKeysApi apiLoginKeysKeysPost POST /api/login-keys/keys Create login key
LoginKeysApi apiLoginKeysUrlsGet GET /api/login-keys/urls Get all login URLs
LoginKeysApi apiLoginKeysUrlsIdDelete DELETE /api/login-keys/urls/{id} Delete login URL
LoginKeysApi apiLoginKeysUrlsPost POST /api/login-keys/urls Create login URL
MaintenanceApi apiMaintenanceGet GET /api/maintenance List maintenance tasks
MaintenanceApi apiMaintenanceTaskCheckPost POST /api/maintenance/{task}/check run task checks
MaintenanceApi apiMaintenanceTaskFixPost POST /api/maintenance/{task}/fix run task automatic fix action
MessagesApi apiMessagesGet GET /api/messages Get messages list
MigrateApi apiChangeUserCreatorPost POST /api/change-user-creator Change user creator (move user between resellers)
MigrateApi apiConvertResellerToUserPost POST /api/convert-reseller-to-user Change reseller to user type.
MigrateApi apiConvertUserToResellerPost POST /api/convert-user-to-reseller Change user to reseller type.
MiscApi apiRestartPost POST /api/restart Restart Directadmin
ModsecurityApi apiModsecurityAuditLogEntryGet GET /api/modsecurity-audit-log/entry get unparsed log entry with the given refence
ModsecurityApi apiModsecurityAuditLogSummaryGet GET /api/modsecurity-audit-log/summary Read and parse modsecurity audit log
PasswordApi apiChangePasswordPost POST /api/change-password Change password
RedisApi apiRedisDisablePost POST /api/redis/disable Disable/Stop Redis
RedisApi apiRedisEnablePost POST /api/redis/enable Enable/Start Redis
RedisApi apiRedisStatusGet GET /api/redis/status Get Redis status
ResellersApi apiResellersUsernameConfigGet GET /api/resellers/{username}/config Get reseller config
ResellersApi apiResellersUsernameUsageGet GET /api/resellers/{username}/usage Get reseller and his users usage
SecurityTxtApi apiSecurityTxtStatusGet GET /api/security-txt/status Check security.txt
SessionControlApi apiLoginPost POST /api/login Create Login session
SessionControlApi apiLoginUrlGet GET /api/login/url Create Login session using OTP
SessionControlApi apiLogoutPost POST /api/logout Create Login session
SessionControlApi apiSessionLoginAsReturnPost POST /api/session/login-as/return Drop out of Login-as session
SessionControlApi apiSessionLoginAsSwitchPost POST /api/session/login-as/switch Swich to a new session that impersonating another account
SessionsApi apiSessionGet GET /api/session Get current session info
SessionsApi apiSessionResellerConfigGet GET /api/session/reseller-config Get reseller config
SessionsApi apiSessionStateGet GET /api/session/state Get server state
SessionsApi apiSessionSwitchActiveDomainPost POST /api/session/switch-active-domain Switch active domain for current session
SessionsApi apiSessionUserConfigGet GET /api/session/user-config Current user config
SessionsApi apiSessionUserUsageGet GET /api/session/user-usage Get user's usage
SessionsApi apiSessionsDestroyAllOtherPost POST /api/sessions/destroy-all-other Destroy all active sessions except current
SessionsApi apiSessionsDestroyPublicIdPost POST /api/sessions/destroy/{public_id} Destroy an active session
SessionsApi apiSessionsGet GET /api/sessions List active user sessions
SkinCustomizationApi apiSessionSkinCustomizationSkinFilenameGet GET /api/session/skin-customization/{skin}/{filename} Download active skin customization file
SkinCustomizationApi apiSessionSkinCustomizationSkinGet GET /api/session/skin-customization/{skin} Get list of active skin customizations
SkinCustomizationApi apiSkinCustomizationSkinCreatorFilenameGet GET /api/skin-customization/{skin}/creator/{filename} Download creator's skin customization file
SkinCustomizationApi apiSkinCustomizationSkinCreatorGet GET /api/skin-customization/{skin}/creator Get list of creator's skin customizations
SkinCustomizationApi apiSkinCustomizationSkinLocalDelete DELETE /api/skin-customization/{skin}/local Delete all skin customization files
SkinCustomizationApi apiSkinCustomizationSkinLocalFilenameDelete DELETE /api/skin-customization/{skin}/local/{filename} Delete skin customization file
SkinCustomizationApi apiSkinCustomizationSkinLocalFilenameGet GET /api/skin-customization/{skin}/local/{filename} Download my skin customization file
SkinCustomizationApi apiSkinCustomizationSkinLocalFilenamePut PUT /api/skin-customization/{skin}/local/{filename} Upload skin customization file (overwrites if exists)
SkinCustomizationApi apiSkinCustomizationSkinLocalGet GET /api/skin-customization/{skin}/local Get list of my skin customizations
SkinCustomizationApi apiSkinCustomizationSkinLocalPost POST /api/skin-customization/{skin}/local Upload skin customization file (overwrites if exists)
SkinOptionsApi apiSkinGlobalOptionsSkinDelete DELETE /api/skin-global-options/{skin} Delete skin global options
SkinOptionsApi apiSkinGlobalOptionsSkinGet GET /api/skin-global-options/{skin} Get skin global options
SkinOptionsApi apiSkinGlobalOptionsSkinPatch PATCH /api/skin-global-options/{skin} Patch skin global options
SkinOptionsApi apiSkinGlobalOptionsSkinPut PUT /api/skin-global-options/{skin} Update skin global options
SkinOptionsApi apiSkinOptionsSkinDelete DELETE /api/skin-options/{skin} Delete skin user options
SkinOptionsApi apiSkinOptionsSkinGet GET /api/skin-options/{skin} Get skin user options
SkinOptionsApi apiSkinOptionsSkinPatch PATCH /api/skin-options/{skin} Patch skin user options
SkinOptionsApi apiSkinOptionsSkinPut PUT /api/skin-options/{skin} Update skin user options
SkinTranslationsApi apiSkinTranslationSkinLangGet GET /api/skin-translation/{skin}/{lang} Skin translations by a language code
TLSApi apiServerTlsAcmeConfigGet GET /api/server-tls/acme-config Get main server's TLS ACME configuration
TLSApi apiServerTlsAcmeConfigPut PUT /api/server-tls/acme-config Set main server's TLS ACME configuration
TLSApi apiServerTlsCertificateGet GET /api/server-tls/certificate Get main server's TLS certificate
TLSApi apiServerTlsEnablePost POST /api/server-tls/enable Enable SSL for main server
TLSApi apiServerTlsFilesGet GET /api/server-tls/files Retrieve server TLS certificates
TLSApi apiServerTlsFilesPut PUT /api/server-tls/files Replace server TLS certificates
TLSApi apiServerTlsObtainPost POST /api/server-tls/obtain Queues action to force obtain TLS certificate for main server
TLSApi apiServerTlsStatusGet GET /api/server-tls/status Get main server's TLS certificate status
TicketsApi apiTicketRequestsGet GET /api/ticket-requests Get ticket requests list
TicketsApi apiTicketsGet GET /api/tickets Get received tickets list
UserSearchApi apiSessionLoginAsUserListGet GET /api/session/login-as/user-list Search for users when in login-as session
UsersApi apiLoginHistoryGet GET /api/login-history Get login history
UsersApi apiUsersUsernameConfigGet GET /api/users/{username}/config Get user config
UsersApi apiUsersUsernameLoginHistoryGet GET /api/users/{username}/login-history Get user's login history
UsersApi apiUsersUsernameUsageGet GET /api/users/{username}/usage Get user's usage
VacationApi apiEmailvacationDomainGet GET /api/emailvacation/{domain} List vacation schedules for all mail users in domain
VacationApi apiEmailvacationDomainUserDelete DELETE /api/emailvacation/{domain}/{user} delete vacation configuration for user.
VacationApi apiEmailvacationDomainUserGet GET /api/emailvacation/{domain}/{user} List detailed vacation configuration for user.
VacationApi apiEmailvacationDomainUserPut PUT /api/emailvacation/{domain}/{user} create or modify vacation configuration for user.
VersioningApi apiVersionGet GET /api/version Get versions info
VersioningApi apiVersionPatch PATCH /api/version Change update channel
VersioningApi apiVersionUpdatePost POST /api/version/update Update Directadmin
WordPressApi apiWordpressInstallPost POST /api/wordpress/install Performs new wordpress installation in a given location
WordPressApi apiWordpressInstallQuickPost POST /api/wordpress/install-quick Performs quick new wordpress installation in a given location
WordPressApi apiWordpressLocationsGet GET /api/wordpress/locations Returns list of known wordpress installations and potential installation locations.
WordPressApi apiWordpressLocationsLocationIdConfigAutoUpdatePut PUT /api/wordpress/locations/{location_id}/config/auto-update Change wordpress core auto update state.
WordPressApi apiWordpressLocationsLocationIdConfigGet GET /api/wordpress/locations/{location_id}/config Retrieve wordpress database configuration for a single installation.
WordPressApi apiWordpressLocationsLocationIdConfigPut PUT /api/wordpress/locations/{location_id}/config Change wordpress database configuration for a single installation.
WordPressApi apiWordpressLocationsLocationIdDelete DELETE /api/wordpress/locations/{location_id} Remove wordpress installation.
WordPressApi apiWordpressLocationsLocationIdOptionsGet GET /api/wordpress/locations/{location_id}/options Retrieve all wordpress options for a single installation.
WordPressApi apiWordpressLocationsLocationIdOptionsPatch PATCH /api/wordpress/locations/{location_id}/options Change wordpress options for a given installation.
WordPressApi apiWordpressLocationsLocationIdUsersGet GET /api/wordpress/locations/{location_id}/users Retrieve all wordpress user accounts
WordPressApi apiWordpressLocationsLocationIdUsersUserIdChangePasswordPost POST /api/wordpress/locations/{location_id}/users/{user_id}/change-password Change wordpress user account password
WordPressApi apiWordpressLocationsLocationIdUsersUserIdSsoLoginPost POST /api/wordpress/locations/{location_id}/users/{user_id}/sso-login Create magic login URL.
WordPressApi apiWordpressLocationsLocationIdWordpressGet GET /api/wordpress/locations/{location_id}/wordpress Retrieve information about a single WordPress installation
XtermApi apiTerminalGet GET /api/terminal WebSocket endpoint to start new web terminal session

Models

Authorization

Authentication schemes defined for the API:

DaBasicAuth

  • Type: HTTP basic authentication

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

support@directadmin.com

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0
    • Generator version: 7.14.0-SNAPSHOT
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen

About

DirectAdmin API Client for PHP generated with openapigenerator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages