diff --git a/CHANGELOG b/CHANGELOG index 9bf3208..3c7c9c9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +TRANSIP API V5.18 +NEW +- Added functionality to convert vps backups to snapshots. + TRANSIP API V5.17 NEW - Added functionality to get default DNS Entries and Nameservers by domain name. diff --git a/Transip/ColocationService.php b/Transip/ColocationService.php index 655fdd6..efc4bdb 100644 --- a/Transip/ColocationService.php +++ b/Transip/ColocationService.php @@ -16,7 +16,7 @@ class Transip_ColocationService /** The SOAP service that corresponds with this class. */ const SERVICE = 'ColocationService'; /** The API version. */ - const API_VERSION = '5.17'; + const API_VERSION = '5.18'; /** @var SoapClient The SoapClient used to perform the SOAP calls. */ protected static $_soapClient = null; diff --git a/Transip/DnsService.php b/Transip/DnsService.php index 5511a1a..37bea19 100644 --- a/Transip/DnsService.php +++ b/Transip/DnsService.php @@ -17,7 +17,7 @@ class Transip_DnsService /** The SOAP service that corresponds with this class. */ const SERVICE = 'DnsService'; /** The API version. */ - const API_VERSION = '5.17'; + const API_VERSION = '5.18'; /** @var SoapClient The SoapClient used to perform the SOAP calls. */ protected static $_soapClient = null; @@ -225,6 +225,7 @@ public static function getDnsSecEntries($domainName) * * @param string $domainName * @param Transip_DnsSecEntry[] $dnssecKeyEntrySet + * @throws ApiException * @example examples/DnsService-setDnsSecEntries.php */ public static function setDnsSecEntries($domainName, $dnssecKeyEntrySet) diff --git a/Transip/DomainService.php b/Transip/DomainService.php index 1a435d7..1dbdb2e 100644 --- a/Transip/DomainService.php +++ b/Transip/DomainService.php @@ -23,7 +23,7 @@ class Transip_DomainService /** The SOAP service that corresponds with this class. */ const SERVICE = 'DomainService'; /** The API version. */ - const API_VERSION = '5.17'; + const API_VERSION = '5.18'; /** @var SoapClient The SoapClient used to perform the SOAP calls. */ protected static $_soapClient = null; diff --git a/Transip/ForwardService.php b/Transip/ForwardService.php index 3c0179d..700e765 100644 --- a/Transip/ForwardService.php +++ b/Transip/ForwardService.php @@ -16,7 +16,7 @@ class Transip_ForwardService /** The SOAP service that corresponds with this class. */ const SERVICE = 'ForwardService'; /** The API version. */ - const API_VERSION = '5.17'; + const API_VERSION = '5.18'; /** @var SoapClient The SoapClient used to perform the SOAP calls. */ protected static $_soapClient = null; diff --git a/Transip/HaipService.php b/Transip/HaipService.php index 6505698..1c8fb2b 100644 --- a/Transip/HaipService.php +++ b/Transip/HaipService.php @@ -17,7 +17,7 @@ class Transip_HaipService /** The SOAP service that corresponds with this class. */ const SERVICE = 'HaipService'; /** The API version. */ - const API_VERSION = '5.17'; + const API_VERSION = '5.18'; /** @var SoapClient The SoapClient used to perform the SOAP calls. */ protected static $_soapClient = null; diff --git a/Transip/PropositionService.php b/Transip/PropositionService.php index 6a4647c..8a5784a 100644 --- a/Transip/PropositionService.php +++ b/Transip/PropositionService.php @@ -15,7 +15,7 @@ class Transip_PropositionService /** The SOAP service that corresponds with this class. */ const SERVICE = 'PropositionService'; /** The API version. */ - const API_VERSION = '5.17'; + const API_VERSION = '5.18'; /** @var SoapClient The SoapClient used to perform the SOAP calls. */ protected static $_soapClient = null; diff --git a/Transip/VpsService.php b/Transip/VpsService.php index da5d227..6021f4f 100644 --- a/Transip/VpsService.php +++ b/Transip/VpsService.php @@ -22,7 +22,7 @@ class Transip_VpsService /** The SOAP service that corresponds with this class. */ const SERVICE = 'VpsService'; /** The API version. */ - const API_VERSION = '5.17'; + const API_VERSION = '5.18'; /** @var SoapClient The SoapClient used to perform the SOAP calls. */ protected static $_soapClient = null; @@ -697,6 +697,19 @@ public static function getAvailableAvailabilityZones() { return self::_getSoapClient(array_merge(array(), array('__method' => 'getAvailableAvailabilityZones')))->getAvailableAvailabilityZones(); } + + /** + * Convert a backup to a Snapshot + * + * @param string $vpsName The vps name + * @param string $description The snapshot description + * @param int $diskBackupId The selected backup id + * @throws ApiException on error + */ + public static function convertVpsBackupToSnapshot($vpsName, $description, $diskBackupId) + { + return self::_getSoapClient(array_merge(array($vpsName, $description, $diskBackupId), array('__method' => 'convertVpsBackupToSnapshot')))->convertVpsBackupToSnapshot($vpsName, $description, $diskBackupId); + } } ?> diff --git a/Transip/WebhostingService.php b/Transip/WebhostingService.php index 95a7f7d..c5b478d 100644 --- a/Transip/WebhostingService.php +++ b/Transip/WebhostingService.php @@ -22,7 +22,7 @@ class Transip_WebhostingService /** The SOAP service that corresponds with this class. */ const SERVICE = 'WebhostingService'; /** The API version. */ - const API_VERSION = '5.17'; + const API_VERSION = '5.18'; /** @var SoapClient The SoapClient used to perform the SOAP calls. */ protected static $_soapClient = null; diff --git a/examples/VpsService-convertBackupToSnapshot.php b/examples/VpsService-convertBackupToSnapshot.php new file mode 100644 index 0000000..6bf343d --- /dev/null +++ b/examples/VpsService-convertBackupToSnapshot.php @@ -0,0 +1,29 @@ + + */ + +// Include vpsservice +require_once('Transip/VpsService.php'); + +try { + $vpsName = 'example-vps'; + $snapshotDescription = 'My new snapshot'; + + // Get disk backups for given vps + $diskBackups = Transip_VpsService::getVpsBackupsByVps($vpsName); + // print_r($vpsBackups); + $vpsDiskBackupId = $diskBackups[0]->id; + + // Convert vps backup to a snapshot + Transip_VpsService::convertVpsBackupToSnapshot($vpsName, $snapshotDescription, $vpsDiskBackupId); + echo 'Starting backup to snapshot conversion'; +} catch (SoapFault $f) { + // It is possible that an error occurs when connecting to the TransIP Soap API, + // those errors will be thrown as a SoapFault exception. + echo 'An error occurred: ' . $f->getMessage(), PHP_EOL; +}