|
|
@@ -55,7 +55,7 @@ class ApiClient {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Initially deploy the placeholder site and config for the customer
|
|
|
+ * 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
|
|
|
@@ -127,30 +127,7 @@ class ApiClient {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Migrate dev site to prod site
|
|
|
- *
|
|
|
- * @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
|
|
|
- *
|
|
|
- * @return a json with ['status' => $httpCode,'response' => ['success' => 'Text']];
|
|
|
- * or a json with ['status' => $httpCode,'response' => ['error' => 'Error-Description']];
|
|
|
- *
|
|
|
- * Attention: The given parameters adminName and adminPassword must be stored locally for the
|
|
|
- * Single Sign on from whcms plugin
|
|
|
- */
|
|
|
- public function migrate($username, $domain, $adminName, $adminPassword) {
|
|
|
- $url = "$this->apiUrl/migrate/$username/$domain";
|
|
|
- $data = [
|
|
|
- 'admin_name' => $adminName,
|
|
|
- 'admin_password' => $adminPassword
|
|
|
- ];
|
|
|
- return $this->sendRequest('POST', $url, $data);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * Disables the prod webpage
|
|
|
+ * Disables the webpage
|
|
|
*
|
|
|
* @param username: The username under which the domain is deployed
|
|
|
* @param domain: The Domain to migrate
|
|
|
@@ -164,7 +141,7 @@ class ApiClient {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Creates a user and placeholder webpage
|
|
|
+ * Creates a user and base configuration
|
|
|
*
|
|
|
* @param username: The username under which the domain is deployed
|
|
|
* @param domain: The Domain to create
|
|
|
@@ -269,52 +246,7 @@ class ApiClient {
|
|
|
return $this->sendRequest('GET', $url);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * Lists the Prod Backups for the prod webpage
|
|
|
- *
|
|
|
- * @param username: The username under which the domain is deployed
|
|
|
- * @param domain: The Domain to migrate
|
|
|
- *
|
|
|
- * @return a json with ['status' => $httpCode,'response' => [
|
|
|
- * 'backups' =>
|
|
|
- * [
|
|
|
- * ['backup_date' => 'ISO Backup Datum',
|
|
|
- * 'swiss_date' => 'Datum im Schweizer Format',
|
|
|
- * 'size_mb' => 'Grösse in Megabyte',
|
|
|
- * 'filename' => 'Dateiname des tar.gz's'
|
|
|
- * ]
|
|
|
- * ];
|
|
|
- *
|
|
|
- */
|
|
|
- public function listbackups($username, $domain) {
|
|
|
- $url = "$this->apiUrl/listbackups/$username/$domain";
|
|
|
- return $this->sendRequest('GET', $url);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * Restores a Backup with the given ISO Date
|
|
|
- *
|
|
|
- * @param username: The username under which the domain is deployed
|
|
|
- * @param domain: The Domain to migrate
|
|
|
- * @param backupDate: The ISO-Date of the backup (backup_date from listBackups) to restore
|
|
|
- *
|
|
|
- * @return a json with ['status' => $httpCode,'response' => ['success' => 'Text']];
|
|
|
- * or a json with ['status' => $httpCode,'response' => ['error' => 'Error-Description']];
|
|
|
- */
|
|
|
- public function restorebackup($username, $domain, $backupDate) {
|
|
|
- $url = "$this->apiUrl/restorebackup/$username/$domain";
|
|
|
- $data = [
|
|
|
- 'backup_date' => $backupDate
|
|
|
- ];
|
|
|
- return $this->sendRequest('POST', $url, $data);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ // send request
|
|
|
private function sendRequest($method, $url, $data = []) {
|
|
|
$ch = curl_init();
|
|
|
|