-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelete.php
25 lines (19 loc) · 856 Bytes
/
delete.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
<?php
require "functions.php";
function remove($xauthtoken, $region, $accountid, $id) {
$headers = array("X-Auth-Token" => "$xauthtoken", "Content-Type" => "application/json", "Accept" => "application/json");
$url = lbaas_url($region, $accountid);
if ( $url == -1 ) return error("Invalid Region: $region");
$url .= "/loadbalancers/$id";
$api_response = http_parse_message(http_request(HTTP_METH_DELETE, $url,'',array("headers"=>$headers),$info));
// $info will give request data, $api_response for response info
print "<pre>";
print_r( $info );
print_r( $api_response );
print "</pre>";
if (ereg("20(.)",$api_response->responseCode,$regs)) {
return array( "status" => "success", "message" => "Deleting Load Balancer ID: $id");
} else
return error($api_response->responseStatus);
}
?>