andre 7 mesi fa
parent
commit
822f540985
1 ha cambiato i file con 69 aggiunte e 59 eliminazioni
  1. 69 59
      api/sitebuilder.php

+ 69 - 59
api/sitebuilder.php

@@ -12,8 +12,8 @@ class ApiClient {
     /**
      * Check accessibility to the Server
      *
-     * @param adminName:       The Super-Admin User of the CRM System (usually the e-mail of the customer
-     * @param adminPassword:   A self randomly generated password
+     * @param string $adminName      The Super-Admin User of the CRM System (usually the e-mail of the customer
+     * @param string $adminPassword  A self randomly generated password
      *
      * @return string          'pong' on success
      *
@@ -31,15 +31,15 @@ class ApiClient {
     }
   
     /**
-     * Initially deploy the development site for the customer
+     * Deploy the website to customers webspace
      *
-     * @param username:        The username under which the domain is deployed
-     * @param domain:          The Domain to migrate
-     * @param adminName:       The Super-Admin User of the CRM System (usually the e-mail of the customer
-     * @param adminPassword:   A self randomly generated password
+     * @param string $username The username
+     * @param string $domain   The site to deploy
+     * @param string $adminName      The Super-Admin User of the CRM System (usually the e-mail of the customer
+     * @param string $adminPassword  A self randomly generated password
      *
-     * @return                  a json with ['status' => $httpCode,'response' => ['success' => 'Text']];
-     *                          or a json with ['status' => $httpCode,'response' => ['error' => 'Error-Description']];
+     * @return array with ['status' => $httpCode,'response' => $response'];
+     * 
      *
      * Attention: The given parameters username, adminName and adminPassword must be
      *            stored locally for the Single Sign on from whcms plugin
@@ -57,13 +57,13 @@ class ApiClient {
     /**
      * Initially deploy the placeholder site and config for the new website
      *
-     * @param username:        The username under which the domain is deployed
-     * @param domain:          The Domain to migrate
-     * @param adminName:       The Super-Admin User of the CRM System (usually the e-mail of the customer
-     * @param adminPassword:   A self randomly generated password
+     * @param string $username The username
+     * @param string $domain   The site to init
+     * @param string $adminName      The Super-Admin User of the CRM System (usually the e-mail of the customer
+     * @param string $adminPassword  A self randomly generated password
      *
-     * @return                  a json with ['status' => $httpCode,'response' => ['success' => 'Text']];
-     *                          or a json with ['status' => $httpCode,'response' => ['error' => 'Error-Description']];
+     * @return array with ['status' => $httpCode,'response' => $response'];
+     * 
      *
      * Attention: The given parameters username, adminName and adminPassword must be
      *            stored locally for the Single Sign on from whcms plugin
@@ -79,15 +79,15 @@ class ApiClient {
     }
   
     /**
-     * Revert the development site for the customer
+     * Re-init the site for the customer
      *
-     * @param username:        The username under which the domain is deployed
-     * @param domain:          The Domain to migrate
-     * @param adminName:       The Super-Admin User of the CRM System (usually the e-mail of the customer
-     * @param adminPassword:   A self randomly generated password
+     * @param string $username The username
+     * @param string $domain   The site to revert
+     * @param string $adminName      The Super-Admin User of the CRM System (usually the e-mail of the customer
+     * @param string $adminPassword  A self randomly generated password
      *
-     * @return                  a json with ['status' => $httpCode,'response' => ['success' => 'Text']];
-     *                          or a json with ['status' => $httpCode,'response' => ['error' => 'Error-Description']];
+     * @return array with ['status' => $httpCode,'response' => $response'];
+     * 
      *
      * Attention: The given parameters username, adminName and adminPassword must be
      *            stored locally for the Single Sign on from whcms plugin
@@ -103,15 +103,15 @@ class ApiClient {
     }
  
     /**
-     * Removes the productive site for the customer
+     * Removes the site for the customer
      *
-     * @param username:        The username under which the domain is deployed
-     * @param domain:          The Domain to migrate
-     * @param adminName:       The Super-Admin User of the CRM System (usually the e-mail of the customer
-     * @param adminPassword:   A self randomly generated password
+     * @param string $username      The username
+     * @param string $domain        The site to remove
+     * @param string $adminName     The Super-Admin User of the CRM System (usually the e-mail of the customer
+     * @param string $adminPassword A self randomly generated password
      *
-     * @return                  a json with ['status' => $httpCode,'response' => ['success' => 'Text']];
-     *                          or a json with ['status' => $httpCode,'response' => ['error' => 'Error-Description']];
+     * @return array with ['status' => $httpCode,'response' => $response'];
+     * 
      *
      * Attention: The given parameters username, adminName and adminPassword must be
      *            stored locally for the Single Sign on from whcms plugin
@@ -129,11 +129,11 @@ class ApiClient {
     /**
      * Disables the webpage
      *
-     * @param username:        The username under which the domain is deployed
-     * @param domain:          The Domain to migrate
+     * @param string $username The username
+     * @param string $domain   The site to disable
      *
-     * @return                  a json with ['status' => $httpCode,'response' => ['success' => 'Text']];
-     *                          or a json with ['status' => $httpCode,'response' => ['error' => 'Error-Description']];
+     * @return array with ['status' => $httpCode,'response' => $response'];
+     * 
      */
     public function disable($username, $domain) {
         $url = "$this->apiUrl/disable/$username/$domain";
@@ -143,11 +143,11 @@ class ApiClient {
     /**
      * Creates a user and base configuration
      *
-     * @param username:        The username under which the domain is deployed
-     * @param domain:          The Domain to create
+     * @param string $username The username
+     * @param string $domain   The site to create
      *
-     * @return                  a json with ['status' => $httpCode,'response' => ['success' => 'Text']];
-     *                          or a json with ['status' => $httpCode,'response' => ['error' => 'Error-Description']];
+     * @return array with ['status' => $httpCode,'response' => $response'];
+     * 
      */
     public function create($username, $domain, $adminName, $adminPassword) {
         $url = "$this->apiUrl/create/$username/$domain";
@@ -159,13 +159,13 @@ class ApiClient {
     }
   
     /**
-     * Removes a user and placeholder webpage
+     * Removes a user and user configuration
      *
-     * @param username:        The username under which the domain is deployed
-     * @param domain:          The Domain to delete
+     * @param string $username The username
+     * @param string $domain   The base domain of the service
      *
-     * @return                  a json with ['status' => $httpCode,'response' => ['success' => 'Text']];
-     *                          or a json with ['status' => $httpCode,'response' => ['error' => 'Error-Description']];
+     * @return array with ['status' => $httpCode,'response' => $response'];
+     * 
      */
     public function terminate($username, $domain) {
         $url = "$this->apiUrl/terminate/$username/$domain";
@@ -173,13 +173,13 @@ class ApiClient {
     }
   
     /**
-     * Enables the prod webpage
+     * Enables the webpage
      *
-     * @param username:        The username under which the domain is deployed
-     * @param domain:          The Domain to migrate
+     * @param string $username The username
+     * @param string $domain   The site to enable
      *
-     * @return                  a json with ['status' => $httpCode,'response' => ['isenabled' => 'YES']];
-     *                          or a json with ['status' => $httpCode,'response' => ['isenabled' => 'NO']];
+     * @return array with ['status' => $httpCode,'response' => $response'];
+     * 
      */
     public function enable($username, $domain) {
         $url = "$this->apiUrl/enable/$username/$domain";
@@ -188,13 +188,13 @@ class ApiClient {
   
   
     /**
-     * Disables the prod webpage
+     * Check a webpage for enabled state
      *
-     * @param username:        The username under which the domain is deployed
-     * @param domain:          The Domain to migrate
+     * @param string $username The username
+     * @param string $domain   The site to check about
      *
-     * @return                  a json with ['status' => $httpCode,'response' => ['success' => 'Text']];
-     *                          or a json with ['status' => $httpCode,'response' => ['error' => 'Error-Description']];
+     * @return array with ['status' => $httpCode,'response' => $response'];
+     * 
      */
     public function isenabled($username, $domain) {
         $url = "$this->apiUrl/isenabled/$username/$domain";
@@ -204,15 +204,25 @@ class ApiClient {
     /**
      * Return users quota
      *
-     * @param username:        The username under which the domain is deployed
+     * @param string $username The username
      *
-     * @return                  a json with ['status' => $httpCode,'response' => $response'];
+     * @return array with ['status' => $httpCode,'response' => $response'];
      */
     public function getQuota($username) {
         $url = "$this->apiUrl/getquota/$username";
         return $this->sendRequest('GET', $url);
     }
      
+    /**
+     * Set users quota
+     *
+     * @param string $username The username
+     * @param string $quota Quota in MegaBytes (MB)
+     * @param string $adminName Admin user
+     * @param string $adminPassword Admin password
+     *
+     * @return array with ['status' => $httpCode,'response' => $response'];
+     */
     public function setQuota($username, $quota, $adminName, $adminPassword) {
         $url = "$this->apiUrl/setquota/$username";
         $data = [
@@ -226,7 +236,7 @@ class ApiClient {
     /**
      * Return users quota
      *
-     * @return                  a json with ['status' => $httpCode,'response' => $response'];
+     * @return array with ['status' => $httpCode,'response' => $response'];
      */
     public function getStats() {
         $url = "$this->apiUrl/getstats";
@@ -234,12 +244,12 @@ class ApiClient {
     }
      
     /**
-     * Disables the prod webpage
+     * Return SSL informations
      *
-     * @param username:        The username under which the domain is deployed
-     * @param domain:          The Domain to migrate
+     * @param string $username The username
+     * @param string $domain   The site to gater informations about
      *
-     * @return                  a json with ['status' => $httpCode,'response' => ['ssl_expiry' => 'Datum des Ablaufs des Zertifikats', 'ssl_remaining' => 'Anzahl der Tage bis zum Ablauf des Zertifikats']];
+     * @return array with ['status' => $httpCode,'response' => $response'];
      */
     public function getSSLDays($username, $domain) {
         $url = "$this->apiUrl/getssldays/$username/$domain";