Overview

Packages

  • PHP
  • Transip

Classes

  • Transip_ApiSettings
  • Transip_AvailabilityZone
  • Transip_ColocationService
  • Transip_Cronjob
  • Transip_DataCenterVisitor
  • Transip_Db
  • Transip_DnsEntry
  • Transip_DnsService
  • Transip_Domain
  • Transip_DomainAction
  • Transip_DomainBranding
  • Transip_DomainCheckResult
  • Transip_DomainService
  • Transip_ExtraContactField
  • Transip_Forward
  • Transip_ForwardService
  • Transip_Haip
  • Transip_HaipService
  • Transip_MailBox
  • Transip_MailForward
  • Transip_Nameserver
  • Transip_OperatingSystem
  • Transip_PrivateNetwork
  • Transip_Product
  • Transip_PropositionService
  • Transip_Snapshot
  • Transip_SubDomain
  • Transip_Tld
  • Transip_Vps
  • Transip_VpsBackup
  • Transip_VpsService
  • Transip_WebHost
  • Transip_WebhostingPackage
  • Transip_WebhostingService
  • Transip_WhoisContact
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: 
  3: require_once('ApiSettings.php');
  4: require_once('Product.php');
  5: require_once('PrivateNetwork.php');
  6: require_once('Vps.php');
  7: require_once('Snapshot.php');
  8: require_once('VpsBackup.php');
  9: require_once('OperatingSystem.php');
 10: require_once('AvailabilityZone.php');
 11: 
 12: /**
 13:  * This is the API endpoint for the VpsService
 14:  *
 15:  * @package Transip
 16:  * @class VpsService
 17:  * @author TransIP (support@transip.nl)
 18:  */
 19: class Transip_VpsService
 20: {
 21:     // These fields are SOAP related
 22:     /** The SOAP service that corresponds with this class. */
 23:     const SERVICE = 'VpsService';
 24:     /** The API version. */
 25:     const API_VERSION = '5.23';
 26:     /** @var SoapClient  The SoapClient used to perform the SOAP calls. */
 27:     protected static $_soapClient = null;
 28: 
 29:     /**
 30:      * Gets the singleton SoapClient which is used to connect to the TransIP Api.
 31:      *
 32:      * @param  mixed       $parameters  Parameters.
 33:      * @return SoapClient               The SoapClient object to which we can connect to the TransIP API
 34:      */
 35:     public static function _getSoapClient($parameters = array())
 36:     {
 37:         $endpoint = Transip_ApiSettings::$endpoint;
 38: 
 39:         if(self::$_soapClient === null)
 40:         {
 41:             $extensions = get_loaded_extensions();
 42:             $errors     = array();
 43:             if(!class_exists('SoapClient') || !in_array('soap', $extensions))
 44:             {
 45:                 $errors[] = 'The PHP SOAP extension doesn\'t seem to be installed. You need to install the PHP SOAP extension. (See: http://www.php.net/manual/en/book.soap.php)';
 46:             }
 47:             if(!in_array('openssl', $extensions))
 48:             {
 49:                 $errors[] = 'The PHP OpenSSL extension doesn\'t seem to be installed. You need to install PHP with the OpenSSL extension. (See: http://www.php.net/manual/en/book.openssl.php)';
 50:             }
 51:             if(!empty($errors)) die('<p>' . implode("</p>\n<p>", $errors) . '</p>');
 52: 
 53:             $classMap = array(
 54:                 'Product' => 'Transip_Product',
 55:                 'PrivateNetwork' => 'Transip_PrivateNetwork',
 56:                 'Vps' => 'Transip_Vps',
 57:                 'Snapshot' => 'Transip_Snapshot',
 58:                 'VpsBackup' => 'Transip_VpsBackup',
 59:                 'OperatingSystem' => 'Transip_OperatingSystem',
 60:                 'AvailabilityZone' => 'Transip_AvailabilityZone',
 61:             );
 62: 
 63:             $options = array(
 64:                 'classmap' => $classMap,
 65:                 'encoding' => 'utf-8', // lets support unicode
 66:                 'features' => SOAP_SINGLE_ELEMENT_ARRAYS, // see http://bugs.php.net/bug.php?id=43338
 67:                 'trace'    => false, // can be used for debugging
 68:             );
 69: 
 70:             $wsdlUri  = "https://{$endpoint}/wsdl/?service=" . self::SERVICE;
 71:             try
 72:             {
 73:                 self::$_soapClient = new SoapClient($wsdlUri, $options);
 74:             }
 75:             catch(SoapFault $sf)
 76:             {
 77:                 throw new Exception("Unable to connect to endpoint '{$endpoint}'");
 78:             }
 79:             self::$_soapClient->__setCookie('login', Transip_ApiSettings::$login);
 80:             self::$_soapClient->__setCookie('mode', Transip_ApiSettings::$mode);
 81:         }
 82: 
 83:         $timestamp = time();
 84:         $nonce     = uniqid('', true);
 85: 
 86:         self::$_soapClient->__setCookie('timestamp', $timestamp);
 87:         self::$_soapClient->__setCookie('nonce', $nonce);
 88:         self::$_soapClient->__setCookie('clientVersion', self::API_VERSION);
 89:         self::$_soapClient->__setCookie('signature', self::_urlencode(self::_sign(array_merge($parameters, array(
 90:             '__service'   => self::SERVICE,
 91:             '__hostname'  => $endpoint,
 92:             '__timestamp' => $timestamp,
 93:             '__nonce'     => $nonce
 94:         )))));
 95: 
 96:         return self::$_soapClient;
 97:     }
 98: 
 99:     /**
100:      * Calculates the hash to sign our request with based on the given parameters.
101:      *
102:      * @param  mixed   $parameters  The parameters to sign.
103:      * @return string               Base64 encoded signing hash.
104:      */
105:     protected static function _sign($parameters)
106:     {
107:         // Fixup our private key, copy-pasting the key might lead to whitespace faults
108:         if(!preg_match('/-----BEGIN (RSA )?PRIVATE KEY-----(.*)-----END (RSA )?PRIVATE KEY-----/si', Transip_ApiSettings::$privateKey, $matches))
109:             die('<p>Could not find your private key, please supply your private key in the ApiSettings file. You can request a new private key in your TransIP Controlpanel.</p>');
110: 
111:         $key = $matches[2];
112:         $key = preg_replace('/\s*/s', '', $key);
113:         $key = chunk_split($key, 64, "\n");
114: 
115:         $key = "-----BEGIN PRIVATE KEY-----\n" . $key . "-----END PRIVATE KEY-----";
116: 
117:         $digest = self::_sha512Asn1(self::_encodeParameters($parameters));
118:         if(!@openssl_private_encrypt($digest, $signature, $key))
119:             die('<p>Could not sign your request, please supply your private key in the ApiSettings file. You can request a new private key in your TransIP Controlpanel.</p>');
120: 
121:         return base64_encode($signature);
122:     }
123: 
124:     /**
125:      * Creates a digest of the given data, with an asn1 header.
126:      *
127:      * @param  string  $data  The data to create a digest of.
128:      * @return string         The digest of the data, with asn1 header.
129:      */
130:     protected static function _sha512Asn1($data)
131:     {
132:         $digest = hash('sha512', $data, true);
133: 
134:         // this ASN1 header is sha512 specific
135:         $asn1  = chr(0x30).chr(0x51);
136:         $asn1 .= chr(0x30).chr(0x0d);
137:         $asn1 .= chr(0x06).chr(0x09);
138:         $asn1 .= chr(0x60).chr(0x86).chr(0x48).chr(0x01).chr(0x65);
139:         $asn1 .= chr(0x03).chr(0x04);
140:         $asn1 .= chr(0x02).chr(0x03);
141:         $asn1 .= chr(0x05).chr(0x00);
142:         $asn1 .= chr(0x04).chr(0x40);
143:         $asn1 .= $digest;
144: 
145:         return $asn1;
146:     }
147: 
148:     /**
149:      * Encodes the given paramaters into a url encoded string based upon RFC 3986.
150:      *
151:      * @param  mixed   $parameters  The parameters to encode.
152:      * @param  string  $keyPrefix   Key prefix.
153:      * @return string               The given parameters encoded according to RFC 3986.
154:      */
155:     protected static function _encodeParameters($parameters, $keyPrefix = null)
156:     {
157:         if(!is_array($parameters) && !is_object($parameters))
158:             return self::_urlencode($parameters);
159: 
160:         $encodedData = array();
161: 
162:         foreach($parameters as $key => $value)
163:         {
164:             $encodedKey = is_null($keyPrefix)
165:                 ? self::_urlencode($key)
166:                 : $keyPrefix . '[' . self::_urlencode($key) . ']';
167: 
168:             if(is_array($value) || is_object($value))
169:             {
170:                 $encodedData[] = self::_encodeParameters($value, $encodedKey);
171:             }
172:             else
173:             {
174:                 $encodedData[] = $encodedKey . '=' . self::_urlencode($value);
175:             }
176:         }
177: 
178:         return implode('&', $encodedData);
179:     }
180: 
181:     /**
182:      * Our own function to encode a string according to RFC 3986 since.
183:      * PHP < 5.3.0 encodes the ~ character which is not allowed.
184:      *
185:      * @param string $string The string to encode.
186:      * @return string The encoded string according to RFC 3986.
187:      */
188:     protected static function _urlencode($string)
189:     {
190:         $string = trim($string);
191:         $string = rawurlencode($string);
192:         return str_replace('%7E', '~', $string);
193:     }
194: 
195:     const CANCELLATIONTIME_END = 'end';
196:     const CANCELLATIONTIME_IMMEDIATELY = 'immediately';
197:     const TRACK_ENDPOINT_NAME = 'VPS';
198: 
199:     /**
200:      * Get available VPS products
201:      *
202:      * @return Transip_Product[] List of available VPS Products
203:      */
204:     public static function getAvailableProducts()
205:     {
206:         return self::_getSoapClient(array_merge(array(), array('__method' => 'getAvailableProducts')))->getAvailableProducts();
207:     }
208: 
209:     /**
210:      * Get available VPS addons
211:      *
212:      * @return Transip_Product[] List of available VPS Products
213:      */
214:     public static function getAvailableAddons()
215:     {
216:         return self::_getSoapClient(array_merge(array(), array('__method' => 'getAvailableAddons')))->getAvailableAddons();
217:     }
218: 
219:     /**
220:      * Get all the Active Addons for Vps
221:      *
222:      * @param string $vpsName The name of the VPS
223:      * @return Transip_Product[] List of available VPS Products
224:      */
225:     public static function getActiveAddonsForVps($vpsName)
226:     {
227:         return self::_getSoapClient(array_merge(array($vpsName), array('__method' => 'getActiveAddonsForVps')))->getActiveAddonsForVps($vpsName);
228:     }
229: 
230:     /**
231:      * Get available VPS upgrades for a specific Vps
232:      *
233:      * @param string $vpsName The name of the VPS
234:      * @return Transip_Product[] List of available VPS Products
235:      */
236:     public static function getAvailableUpgrades($vpsName)
237:     {
238:         return self::_getSoapClient(array_merge(array($vpsName), array('__method' => 'getAvailableUpgrades')))->getAvailableUpgrades($vpsName);
239:     }
240: 
241:     /**
242:      * Get available Addons for Vps
243:      *
244:      * @param string $vpsName The name of the VPS
245:      * @return Transip_Product[] List of available VPS Products
246:      */
247:     public static function getAvailableAddonsForVps($vpsName)
248:     {
249:         return self::_getSoapClient(array_merge(array($vpsName), array('__method' => 'getAvailableAddonsForVps')))->getAvailableAddonsForVps($vpsName);
250:     }
251: 
252:     /**
253:      * Get cancellable addons for specific Vps
254:      *
255:      * @param string $vpsName The name of the Vps
256:      * @return Transip_Product[] List of cancellable addons for this Vps
257:      */
258:     public static function getCancellableAddonsForVps($vpsName)
259:     {
260:         return self::_getSoapClient(array_merge(array($vpsName), array('__method' => 'getCancellableAddonsForVps')))->getCancellableAddonsForVps($vpsName);
261:     }
262: 
263:     /**
264:      * Order a VPS with optional Addons
265:      *
266:      * @param string $productName Name of the product
267:      * @param string[] $addons array with additional addons
268:      * @param string $operatingSystemName The name of the operatingSystem to install
269:      * @param string $hostname The name for the host
270:      * @throws Exception
271:      */
272:     public static function orderVps($productName, $addons, $operatingSystemName, $hostname)
273:     {
274:         return self::_getSoapClient(array_merge(array($productName, $addons, $operatingSystemName, $hostname), array('__method' => 'orderVps')))->orderVps($productName, $addons, $operatingSystemName, $hostname);
275:     }
276: 
277:     /**
278:      * Order a VPS with optional Addons
279:      *
280:      * @param string $productName Name of the product
281:      * @param string[] $addons array with additional addons
282:      * @param string $operatingSystemName The name of the operatingSystem to install
283:      * @param string $hostname The name for the host
284:      * @param string $availabilityZone The availability zone the vps should be created in
285:      * @throws Exception
286:      */
287:     public static function orderVpsInAvailabilityZone($productName, $addons, $operatingSystemName, $hostname, $availabilityZone)
288:     {
289:         return self::_getSoapClient(array_merge(array($productName, $addons, $operatingSystemName, $hostname, $availabilityZone), array('__method' => 'orderVpsInAvailabilityZone')))->orderVpsInAvailabilityZone($productName, $addons, $operatingSystemName, $hostname, $availabilityZone);
290:     }
291: 
292:     /**
293:      * Clone a VPS
294:      *
295:      * @param string $vpsName The vps name
296:      * @throws Exception
297:      */
298:     public static function cloneVps($vpsName)
299:     {
300:         return self::_getSoapClient(array_merge(array($vpsName), array('__method' => 'cloneVps')))->cloneVps($vpsName);
301:     }
302: 
303:     /**
304:      * Clone a VPS
305:      *
306:      * @param string $vpsName The vps name
307:      * @param string $availabilityZone The availability zone the clone should be created in.
308:      * @throws Exception
309:      */
310:     public static function cloneVpsToAvailabilityZone($vpsName, $availabilityZone)
311:     {
312:         return self::_getSoapClient(array_merge(array($vpsName, $availabilityZone), array('__method' => 'cloneVpsToAvailabilityZone')))->cloneVpsToAvailabilityZone($vpsName, $availabilityZone);
313:     }
314: 
315:     /**
316:      * Order addons to a VPS
317:      *
318:      * @param string $vpsName The name of the VPS
319:      * @param string[] $addons Array with Addons
320:      * @throws ApiException on error
321:      */
322:     public static function orderAddon($vpsName, $addons)
323:     {
324:         return self::_getSoapClient(array_merge(array($vpsName, $addons), array('__method' => 'orderAddon')))->orderAddon($vpsName, $addons);
325:     }
326: 
327:     /**
328:      * Order a private Network
329:      *
330:      * @throws ApiException on error
331:      */
332:     public static function orderPrivateNetwork()
333:     {
334:         return self::_getSoapClient(array_merge(array(), array('__method' => 'orderPrivateNetwork')))->orderPrivateNetwork();
335:     }
336: 
337:     /**
338:      * upgrade a Vps
339:      *
340:      * @param string $vpsName The name of the VPS
341:      * @param string $upgradeToProductName The name of the product to upgrade to
342:      * @throws ApiException on error
343:      */
344:     public static function upgradeVps($vpsName, $upgradeToProductName)
345:     {
346:         return self::_getSoapClient(array_merge(array($vpsName, $upgradeToProductName), array('__method' => 'upgradeVps')))->upgradeVps($vpsName, $upgradeToProductName);
347:     }
348: 
349:     /**
350:      * Cancel a Vps
351:      *
352:      * @param string $vpsName The vps to cancel
353:      * @param string $endTime The time to cancel the vps (VpsService::CANCELLATIONTIME_END (end of contract)
354:      * @throws ApiException on error
355:      */
356:     public static function cancelVps($vpsName, $endTime)
357:     {
358:         return self::_getSoapClient(array_merge(array($vpsName, $endTime), array('__method' => 'cancelVps')))->cancelVps($vpsName, $endTime);
359:     }
360: 
361:     /**
362:      * Cancel a Vps Addon
363:      *
364:      * @param string $vpsName The vps to cancel
365:      * @param string $addonName name of the addon
366:      * @throws ApiException on error
367:      */
368:     public static function cancelAddon($vpsName, $addonName)
369:     {
370:         return self::_getSoapClient(array_merge(array($vpsName, $addonName), array('__method' => 'cancelAddon')))->cancelAddon($vpsName, $addonName);
371:     }
372: 
373:     /**
374:      * Cancel a PrivateNetwork
375:      *
376:      * @param string $privateNetworkName the name of the private network to cancel
377:      * @param string $endTime The time to cancel the vps (VpsService::CANCELLATIONTIME_END (end of contract)
378:      * @throws ApiException on error
379:      */
380:     public static function cancelPrivateNetwork($privateNetworkName, $endTime)
381:     {
382:         return self::_getSoapClient(array_merge(array($privateNetworkName, $endTime), array('__method' => 'cancelPrivateNetwork')))->cancelPrivateNetwork($privateNetworkName, $endTime);
383:     }
384: 
385:     /**
386:      * Get Private networks for a specific vps
387:      *
388:      * @param string $vpsName The name of the VPS
389:      * @return Transip_PrivateNetwork[] $privateNetworks Array of PrivateNetwork objects
390:      */
391:     public static function getPrivateNetworksByVps($vpsName)
392:     {
393:         return self::_getSoapClient(array_merge(array($vpsName), array('__method' => 'getPrivateNetworksByVps')))->getPrivateNetworksByVps($vpsName);
394:     }
395: 
396:     /**
397:      * Get all Private networks in your account
398:      *
399:      * @return Transip_PrivateNetwork[] $privateNetworks Array of PrivateNetwork objects
400:      */
401:     public static function getAllPrivateNetworks()
402:     {
403:         return self::_getSoapClient(array_merge(array(), array('__method' => 'getAllPrivateNetworks')))->getAllPrivateNetworks();
404:     }
405: 
406:     /**
407:      * Add VPS to a private Network
408:      *
409:      * @param string $vpsName The name of the VPS
410:      * @param string $privateNetworkName The name of the privateNetwork to add to
411:      */
412:     public static function addVpsToPrivateNetwork($vpsName, $privateNetworkName)
413:     {
414:         return self::_getSoapClient(array_merge(array($vpsName, $privateNetworkName), array('__method' => 'addVpsToPrivateNetwork')))->addVpsToPrivateNetwork($vpsName, $privateNetworkName);
415:     }
416: 
417:     /**
418:      * Remove VPS from a private Network
419:      *
420:      * @param string $vpsName The name of the VPS
421:      * @param string $privateNetworkName The name of the private Network
422:      */
423:     public static function removeVpsFromPrivateNetwork($vpsName, $privateNetworkName)
424:     {
425:         return self::_getSoapClient(array_merge(array($vpsName, $privateNetworkName), array('__method' => 'removeVpsFromPrivateNetwork')))->removeVpsFromPrivateNetwork($vpsName, $privateNetworkName);
426:     }
427: 
428:     /**
429:      * Get Traffic information by vpsName for this contractPeriod
430:      *
431:      * @param string $vpsName The name of the VPS
432:      * @throws ApiException on error
433:      * @return array The traffic information for this VPS
434:      */
435:     public static function getTrafficInformationForVps($vpsName)
436:     {
437:         return self::_getSoapClient(array_merge(array($vpsName), array('__method' => 'getTrafficInformationForVps')))->getTrafficInformationForVps($vpsName);
438:     }
439: 
440:     /**
441:      * Get PooledTraffic information for the account
442:      *
443:      * @return array 
444:      */
445:     public static function getPooledTrafficInformation()
446:     {
447:         return self::_getSoapClient(array_merge(array(), array('__method' => 'getPooledTrafficInformation')))->getPooledTrafficInformation();
448:     }
449: 
450:     /**
451:      * Start a Vps
452:      *
453:      * @param string $vpsName The vps name
454:      * @throws ApiException on error
455:      */
456:     public static function start($vpsName)
457:     {
458:         return self::_getSoapClient(array_merge(array($vpsName), array('__method' => 'start')))->start($vpsName);
459:     }
460: 
461:     /**
462:      * Stop a Vps
463:      *
464:      * @param string $vpsName The vps name
465:      * @throws ApiException on error
466:      */
467:     public static function stop($vpsName)
468:     {
469:         return self::_getSoapClient(array_merge(array($vpsName), array('__method' => 'stop')))->stop($vpsName);
470:     }
471: 
472:     /**
473:      * Reset a Vps
474:      *
475:      * @param string $vpsName The vps name
476:      * @throws ApiException on error
477:      */
478:     public static function reset($vpsName)
479:     {
480:         return self::_getSoapClient(array_merge(array($vpsName), array('__method' => 'reset')))->reset($vpsName);
481:     }
482: 
483:     /**
484:      * Create a snapshot
485:      *
486:      * @param string $vpsName The vps name
487:      * @param string $description The snapshot description
488:      * @throws ApiException on error
489:      */
490:     public static function createSnapshot($vpsName, $description)
491:     {
492:         return self::_getSoapClient(array_merge(array($vpsName, $description), array('__method' => 'createSnapshot')))->createSnapshot($vpsName, $description);
493:     }
494: 
495:     /**
496:      * Revert a snapshot
497:      *
498:      * @param string $vpsName The vps name
499:      * @param string $snapshotName The snapshot name
500:      * @throws ApiException on error
501:      */
502:     public static function revertSnapshot($vpsName, $snapshotName)
503:     {
504:         return self::_getSoapClient(array_merge(array($vpsName, $snapshotName), array('__method' => 'revertSnapshot')))->revertSnapshot($vpsName, $snapshotName);
505:     }
506: 
507:     /**
508:      * Revert a snapshot to another VPS
509:      *
510:      * @param string $sourceVpsName The name of the VPS where the snapshot is made
511:      * @param string $snapshotName The snapshot name
512:      * @param string $destinationVpsName The name of the VPS where the snapshot should be reverted to
513:      * @throws ApiException on error
514:      */
515:     public static function revertSnapshotToOtherVps($sourceVpsName, $snapshotName, $destinationVpsName)
516:     {
517:         return self::_getSoapClient(array_merge(array($sourceVpsName, $snapshotName, $destinationVpsName), array('__method' => 'revertSnapshotToOtherVps')))->revertSnapshotToOtherVps($sourceVpsName, $snapshotName, $destinationVpsName);
518:     }
519: 
520:     /**
521:      * Remove a snapshot
522:      *
523:      * @param string $vpsName The vps name
524:      * @param string $snapshotName The snapshot name
525:      * @throws ApiException on error
526:      */
527:     public static function removeSnapshot($vpsName, $snapshotName)
528:     {
529:         return self::_getSoapClient(array_merge(array($vpsName, $snapshotName), array('__method' => 'removeSnapshot')))->removeSnapshot($vpsName, $snapshotName);
530:     }
531: 
532:     /**
533:      * Revert a vps backup
534:      *
535:      * @param string $vpsName The vps name
536:      * @param int $vpsBackupId The backup id
537:      * @throws ApiException on error
538:      */
539:     public static function revertVpsBackup($vpsName, $vpsBackupId)
540:     {
541:         return self::_getSoapClient(array_merge(array($vpsName, $vpsBackupId), array('__method' => 'revertVpsBackup')))->revertVpsBackup($vpsName, $vpsBackupId);
542:     }
543: 
544:     /**
545:      * Get a Vps by name
546:      *
547:      * @param string $vpsName The vps name
548:      * @return Transip_Vps $vps    The vps objects
549:      */
550:     public static function getVps($vpsName)
551:     {
552:         return self::_getSoapClient(array_merge(array($vpsName), array('__method' => 'getVps')))->getVps($vpsName);
553:     }
554: 
555:     /**
556:      * Get all Vpss
557:      *
558:      * @return Transip_Vps[] Array of Vps objects
559:      */
560:     public static function getVpses()
561:     {
562:         return self::_getSoapClient(array_merge(array(), array('__method' => 'getVpses')))->getVpses();
563:     }
564: 
565:     /**
566:      * Get all Snapshots for a vps
567:      *
568:      * @param string $vpsName The name of the VPS
569:      * @return Transip_Snapshot[] $snapshotArray Array of snapshot objects
570:      */
571:     public static function getSnapshotsByVps($vpsName)
572:     {
573:         return self::_getSoapClient(array_merge(array($vpsName), array('__method' => 'getSnapshotsByVps')))->getSnapshotsByVps($vpsName);
574:     }
575: 
576:     /**
577:      * Get all VpsBackups for a vps
578:      *
579:      * @param string $vpsName The name of the VPS
580:      * @return Transip_VpsBackup[] $vpsBackupArray Array of snapshot objects
581:      */
582:     public static function getVpsBackupsByVps($vpsName)
583:     {
584:         return self::_getSoapClient(array_merge(array($vpsName), array('__method' => 'getVpsBackupsByVps')))->getVpsBackupsByVps($vpsName);
585:     }
586: 
587:     /**
588:      * Get all operating systems
589:      *
590:      * @return Transip_OperatingSystem[] Array of OperatingSystem objects
591:      */
592:     public static function getOperatingSystems()
593:     {
594:         return self::_getSoapClient(array_merge(array(), array('__method' => 'getOperatingSystems')))->getOperatingSystems();
595:     }
596: 
597:     /**
598:      * Install an operating system on a vps
599:      *
600:      * @param string $vpsName The name of the VPS
601:      * @param string $operatingSystemName The name of the operating to install
602:      * @param string $hostname preinstallable Only
603:      */
604:     public static function installOperatingSystem($vpsName, $operatingSystemName, $hostname)
605:     {
606:         return self::_getSoapClient(array_merge(array($vpsName, $operatingSystemName, $hostname), array('__method' => 'installOperatingSystem')))->installOperatingSystem($vpsName, $operatingSystemName, $hostname);
607:     }
608: 
609:     /**
610:      * Install an operating system on a vps with a unattended installfile
611:      *
612:      * @param string $vpsName The name of the VPS
613:      * @param string $operatingSystemName The name of the operating to install
614:      * @param string $base64InstallText base64_encoded preseed/kickstart text
615:      * @throws ApiException
616:      */
617:     public static function installOperatingSystemUnattended($vpsName, $operatingSystemName, $base64InstallText)
618:     {
619:         return self::_getSoapClient(array_merge(array($vpsName, $operatingSystemName, $base64InstallText), array('__method' => 'installOperatingSystemUnattended')))->installOperatingSystemUnattended($vpsName, $operatingSystemName, $base64InstallText);
620:     }
621: 
622:     /**
623:      * Get Ips for a specific Vps
624:      *
625:      * @param string $vpsName The name of the Vps
626:      * @return string[] $ipAddresses Array of ipAddresses
627:      */
628:     public static function getIpsForVps($vpsName)
629:     {
630:         return self::_getSoapClient(array_merge(array($vpsName), array('__method' => 'getIpsForVps')))->getIpsForVps($vpsName);
631:     }
632: 
633:     /**
634:      * Get All ips
635:      *
636:      * @return string[] $ipAddresses Array of ipAddresses
637:      */
638:     public static function getAllIps()
639:     {
640:         return self::_getSoapClient(array_merge(array(), array('__method' => 'getAllIps')))->getAllIps();
641:     }
642: 
643:     /**
644:      * Add Ipv6 Address to Vps
645:      *
646:      * @param string $vpsName The name of the VPS
647:      * @param string $ipv6Address The Ipv6 Address from your range
648:      * @throws ApiException on error
649:      */
650:     public static function addIpv6ToVps($vpsName, $ipv6Address)
651:     {
652:         return self::_getSoapClient(array_merge(array($vpsName, $ipv6Address), array('__method' => 'addIpv6ToVps')))->addIpv6ToVps($vpsName, $ipv6Address);
653:     }
654: 
655:     /**
656:      * Update PTR record (reverse DNS) for an ipAddress
657:      *
658:      * @param string $ipAddress The IP Address to update (ipv4 or ipv6)
659:      * @param string $ptrRecord The PTR Record to update to
660:      * @throws ApiException on error
661:      */
662:     public static function updatePtrRecord($ipAddress, $ptrRecord)
663:     {
664:         return self::_getSoapClient(array_merge(array($ipAddress, $ptrRecord), array('__method' => 'updatePtrRecord')))->updatePtrRecord($ipAddress, $ptrRecord);
665:     }
666: 
667:     /**
668:      * Enable or Disable a Customer Lock for a Vps
669:      *
670:      * @param string $vpsName The name of the Vps
671:      * @param boolean $enabled Enable (true) or Disable (false) the lock
672:      * @throws ApiException on error
673:      */
674:     public static function setCustomerLock($vpsName, $enabled)
675:     {
676:         return self::_getSoapClient(array_merge(array($vpsName, $enabled), array('__method' => 'setCustomerLock')))->setCustomerLock($vpsName, $enabled);
677:     }
678: 
679:     /**
680:      * Handover a VPS to another TransIP User
681:      *
682:      * @param string $vpsName The name of the Vps
683:      * @param string $targetAccountname the target account name
684:      * @throws ApiException on error
685:      */
686:     public static function handoverVps($vpsName, $targetAccountname)
687:     {
688:         return self::_getSoapClient(array_merge(array($vpsName, $targetAccountname), array('__method' => 'handoverVps')))->handoverVps($vpsName, $targetAccountname);
689:     }
690: 
691:     /**
692:      * Returns an array of available AvailabilityZones
693:      *
694:      * @return Transip_AvailabilityZone[] an array of AvailabilityZones
695:      */
696:     public static function getAvailableAvailabilityZones()
697:     {
698:         return self::_getSoapClient(array_merge(array(), array('__method' => 'getAvailableAvailabilityZones')))->getAvailableAvailabilityZones();
699:     }
700: 
701:     /**
702:      * Convert a backup to a Snapshot
703:      *
704:      * @param string $vpsName The vps name
705:      * @param string $description The snapshot description
706:      * @param int $vpsBackupId The selected backup id
707:      * @throws ApiException on error
708:      */
709:     public static function convertVpsBackupToSnapshot($vpsName, $description, $vpsBackupId)
710:     {
711:         return self::_getSoapClient(array_merge(array($vpsName, $description, $vpsBackupId), array('__method' => 'convertVpsBackupToSnapshot')))->convertVpsBackupToSnapshot($vpsName, $description, $vpsBackupId);
712:     }
713: }
714: 
715: ?>
716: 
API documentation generated by ApiGen 2.8.0