~sebastian-scalr/openstack-platform-php/trunk

« back to all changes in this revision

Viewing changes to www/aws_vpc_gateways_view.php

  • Committer: DicsyDel
  • Date: 2010-01-14 09:49:24 UTC
  • Revision ID: svn-v4:ea022c65-b648-0410-8974-0d324702c27d:trunk:247
1.2.0 Stable Release
Events system improvements:
* Added new events: OnDNSZoneUpdated, OnEBSVolumeAttached

Scripting engine improvements:
* Added the %zone_name% variable for scripts executed on DNSZoneUpdate event
* Added the %new_ip_address% variable for scripts executed on IPAddressChanged event
* Added the %volume_id% and %mountpoint% variables for scripts executed on EBSVolumeMounted event
* The ability to execute scripts from the Scripts view page.

Snapshots manager improvements:
* Remove multiple snapshots in one time
* Share snapshots!

API improvements:
* Added methods: LaunchInstance, TerminateInstance, GetFarmDetails, GetScriptDetails, RebootInstance, GetEvents, GetLogs
* Added methods for working with DNS zones: ListDNSZones, ListDNSZoneRecords, AddDNSZoneRecord and RemoveDNSZoneRecord
* Improved the ExecuteScript method.
* Added LA for each instance to the GetFarmDetails method
* Added the ability to execute scripts with specified revision and parameters

Core improvements:
* Amazon RDS support
* Amazon Spot instances support.
* Amazon CloudWatch support (fine grained monitoring)
* Amazon VPC support (enterprise feature, deploy on non-shared servers)
* Rewrote the “Synchronize to all” feature. Cleaner and more reliable now.
* Same goes for AutoEBS and AutoEIP. Cleaner and more reliable.
* When you create a new AMI for a custom role, you can now switch over to it immediately.
* And the long awaited “Keep me logged in” checkbox on the login page!
* Filters for instances on the Servers view page.
* CloudFront distributions for domains not managed by Scalr.
* The ability to remove Elastic Load Balancers.
* Support for new region: us-west-1 (deploy on the west coast!)
* A new page with more details on the instance.
* Increased page load speed. Optimized js code. (faster, better interface!)
* An improved MySQL status page for your Farms
* The ability to set whether Scalr should terminate or reboot instances that fail to respond to SNMP calls.
* The ability to slowdown the scaling process
* Support for new instance types, the high memory instances (32 and 68GB of memory)
* The ability to add Google Apps MX records in the Zone Edit page in a single click.
* The ability to edit system DNS records. For advanced clients.
* The ability to set both size and snapshot for Role auto EBS (previously just one)
* Added ability to edit farm role specified security group
* Added Hide terminated instances checkbox on instances list.
* Added ability to view all instances (include non-scalr ones)
* Added ability to set system timezone for clients (Logs, Events, API logs)
* Fixed bug in garbage.php with “select all” checkbox
* Fixed bug with default SSH port (see thread)
* More than 200 bugs was fixed and tons of other internal improvements.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
 
 
3
        require("src/prepend.inc.php"); 
 
4
        
 
5
        if ($_SESSION["uid"] == 0)
 
6
        {
 
7
                $errmsg = "Requested page cannot be viewed from admin account";
 
8
                UI::Redirect("index.php");
 
9
        }       
 
10
        
 
11
        $display['load_extjs'] = true;  
 
12
        $Client = Client::Load($_SESSION['uid']);       
 
13
        $display["title"] = _("Tools&nbsp;&raquo;&nbsp;Amazon Web Services&nbsp;&raquo;&nbsp;Amazon VPC&nbsp;&raquo;&nbsp;Amazon VPC gateways list");
 
14
                
 
15
        if ($_POST)
 
16
        {
 
17
                $i = 0;
 
18
                if($post_action_customer == 'delete' )
 
19
                {                       
 
20
                        $AmazonVPCClient = AmazonVPC::GetInstance(AWSRegions::GetAPIURL($_SESSION['aws_region']));
 
21
                        $AmazonVPCClient->SetAuthKeys($Client->AWSPrivateKey, $Client->AWSCertificate); 
 
22
                        foreach ($post_customer_id as $id)
 
23
                        {
 
24
                                try
 
25
                                {                               
 
26
                                        $AmazonVPCClient->DeleteCustomerGateway($id);
 
27
                                        $i++;                           
 
28
                                }
 
29
                                catch(Exception $e)
 
30
                                {
 
31
                                        $err[] = $e->getMessage(); //Cannot delete Gateways %s: %s
 
32
                                        UI::Redirect("aws_vpc_gateways_view.php");
 
33
                                }
 
34
                        }       
 
35
                        
 
36
                        if ($i > 0)
 
37
                                $okmsg = sprintf(_("%s Customer gateways(s) successfully removed"), $i);
 
38
                        
 
39
                        UI::Redirect("aws_vpc_gateways_view.php");
 
40
                }
 
41
                
 
42
                if($post_action_vpn == 'delete')
 
43
                {
 
44
                        $AmazonVPCClient = AmazonVPC::GetInstance(AWSRegions::GetAPIURL($_SESSION['aws_region']));
 
45
                        $AmazonVPCClient->SetAuthKeys($Client->AWSPrivateKey, $Client->AWSCertificate); 
 
46
                        foreach ($post_vpn_id as $id)
 
47
                        {
 
48
                                try
 
49
                                {                               
 
50
                                        $AmazonVPCClient->DeleteVpnGateway($id);
 
51
                                        $i++;                           
 
52
                                }
 
53
                                catch(Exception $e)
 
54
                                {
 
55
                                        $err[] = $e->getMessage(); //Cannot delete Gateways %s: %s
 
56
                                        UI::Redirect("aws_vpc_gateways_view.php");
 
57
                                }
 
58
                        }       
 
59
                        if ($i > 0)
 
60
                                $okmsg = sprintf(_("%s VPN gateways(s) successfully removed"), $i);
 
61
                        
 
62
                        UI::Redirect("aws_vpc_gateways_view.php");
 
63
                }
 
64
                
 
65
                if($post_action_conn == 'delete')
 
66
                {
 
67
                
 
68
                        $AmazonVPCClient = AmazonVPC::GetInstance(AWSRegions::GetAPIURL($_SESSION['aws_region']));
 
69
                        $AmazonVPCClient->SetAuthKeys($Client->AWSPrivateKey, $Client->AWSCertificate);
 
70
                        
 
71
                        foreach ($post_conn_id as $id)
 
72
                        {
 
73
                                try
 
74
                                {                               
 
75
                                        $AmazonVPCClient->DeleteVpnConnection($id);
 
76
                                        $i++;                           
 
77
                                }
 
78
                                catch(Exception $e)
 
79
                                {
 
80
                                        $err[] = $e->getMessage(); //Cannot delete connection(s) %s: %s
 
81
                                        UI::Redirect("aws_vpc_gateways_view.php");
 
82
                                }
 
83
                        }
 
84
                        if ($i > 0)
 
85
                                $okmsg = sprintf(_("%s VPN connection(s) successfully removed"), $i);
 
86
                        
 
87
                        UI::Redirect("aws_vpc_gateways_view.php");                      
 
88
                }       
 
89
 
 
90
        }
 
91
        
 
92
        if($_GET)
 
93
        {       
 
94
                // detaching selected item                      
 
95
                if($req_action === 'detach')    
 
96
                {                                       
 
97
                        try
 
98
                                {               
 
99
                                        $AmazonVPCClient = AmazonVPC::GetInstance(AWSRegions::GetAPIURL($_SESSION['aws_region']));
 
100
                                        $AmazonVPCClient->SetAuthKeys($Client->AWSPrivateKey, $Client->AWSCertificate); 
 
101
                                                
 
102
                                        if (!$req_vpcId)
 
103
                                        {
 
104
                                                $errmsg = "VPC ID not found. Please select atteched VPN";
 
105
                                                UI::Redirect("/aws_vpc_gateways_view.php");
 
106
                                        }
 
107
                                        if (!$req_vpnId)
 
108
                                        {
 
109
                                                $errmsg = "VPN ID not found. Please select atteched VPN";
 
110
                                                UI::Redirect("/aws_vpc_gateways_view.php");
 
111
                                        }       
 
112
                                                                                
 
113
                                        $AmazonVPCClient->DetachVpnGateway(new DetachVpnGateway($req_vpcId,$req_vpnId));
 
114
                                        $okmsg = "Vpn gateway deteched successfully";   
 
115
                                        UI::Redirect("/aws_vpc_gateways_view.php");                                     
 
116
                                }
 
117
                                catch(Exception $e)
 
118
                                {                                       
 
119
                                        $err[] = $e->getMessage(); //"Cannot detach VPN gateway %s from VPC %s : %s
 
120
                                        UI::Redirect("/aws_vpc_gateways_view.php");
 
121
                                }
 
122
                }
 
123
                else
 
124
                {
 
125
                        $err[] = sprintf(_("The incorrect action with VPN %s"),$req_vpnId);
 
126
                        UI::Redirect("/aws_vpc_gateways_view.php");     
 
127
                }
 
128
                
 
129
        }
 
130
 
 
131
        require("src/append.inc.php");  
 
132
 
 
133
?>