forked from hasinhayder/openshift-php-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.php
66 lines (44 loc) · 2.43 KB
/
example.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/*
* OpenShift PHP Rest Client Library Example
* @author Hasin Hayder | [email protected] | www.hasin.me
* @author Abu Ashraf Masnun | [email protected] | www.masnun.me
* @license MIT License
* @link https://github.com/hasinhayder/openshift-php-client
*/
// The following assumes you have the library installed with composer.
use \Roomify\OpenShift\Client as OpenShift;
$username = "[email protected]"; // your account, most likely your email address
$password = "mySuperCryptikPa55W0rD!"; // your password
$openshift = new OpenShift($username, $password);
echo "<pre>";
// Create a New Domain
// $data = $openshift->getDomainManager()->createDomain("osphp");
// List Domains
// $data = $openshift->getDomainManager()->getDomains();
// Rename the Domain
// $data = $openshift->getDomainManager()->getDomain("osphp")->updateName("masnun") ;
// Create a Zend 5.6 App Container
// $data = $openshift->getDomainManager()->getDomain("masnun")->createApplication("restclient","zend-5.6");
// Get all Applications
// $data = $openshift->getDomainManager()->getDomain("masnun")->getApplications();
// Get Application Details
// $data = $openshift->getDomainManager()->getDomain("masnun")->getApplication("restclient")->getDetails();
// Stop an Application
// $data = $openshift->getDomainManager()->getDomain("masnun")->getApplication("restclient")->stop();
// Start an Application
// $data = $openshift->getDomainManager()->getDomain("masnun")->getApplication("restclient")->start();
// Restart an Application
// $data = $openshift->getDomainManager()->getDomain("masnun")->getApplication("restclient")->restart();
// Reload an Application
// $data = $openshift->getDomainManager()->getDomain("masnun")->getApplication("restclient")->reload();
// Add an Alias
// $data = $openshift->getDomainManager()->getDomain("masnun")->getApplication("restclient")->addAlias("mydomain.com");
// Remove an Alias
// $data = $openshift->getDomainManager()->getDomain("masnun")->getApplication("restclient")->removeAlias("mydomain.com");
// Add a Cartridge
// $data = $openshift->getDomainManager()->getDomain("masnun")->getApplication("restclient")->addCartridge("mysql-5.1");
// Delete a Cartridge
// $data = $openshift->getDomainManager()->getDomain("masnun")->getApplication("restclient")->getCartridge("mysql-5.1")->delete();
// There are many other methods supported by applications, domains and the cartridges. For details, check their source code.
//print_r($data);