delete_gateway ( $opt )

This operation deletes a gateway. To specify which gateway to delete, use the Amazon Resource Name (ARN) of the gateway in your request. The operation deletes the gateway; however, it does not delete the gateway virtual machine (VM) from your host computer.

After you delete a gateway, you cannot reactivate it. Completed snapshots of the gateway volumes are not deleted upon deleting the gateway, however, pending snapshots will not complete. After you delete a gateway, your next step is to remove it from your environment.

You no longer pay software charges after the gateway is deleted; however, your existing Amazon EBS snapshots persist and you will continue to be billed for these snapshots. You can choose to remove all remaining Amazon EBS snapshots by canceling your Amazon EC2 subscription.  If you prefer not to cancel your Amazon EC2 subscription, you can delete your snapshots using the Amazon EC2 console. For more information, see the AWS Storage Gateway Detail Page.

Access

public

Parameters

Parameter

Type

Required

Description

$opt

array

Optional

An associative array of parameters that can have the following keys:

  • GatewayARN - string - Required - The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation to return a list of gateways for your account and region.
  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
  • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.

Returns

Type

Description

CFResponse

A CFResponse object containing a parsed HTTP response.

Examples

Teardown a Storage Gateway

$ec2 = new AmazonEC2();
$sg = new AmazonStorageGateway();

// Delete the gateway
$response = $sg->delete_gateway(array('GatewayARN' => $gateway_arn));
var_dump($response->isOK());

sleep(20);

// Detach EBS volume
$response = $ec2->detach_volume($volume_id, array(
	'InstanceId' => $instance_id,
	'Device'     => '/dev/sdk',
));
var_dump($response->isOK());

sleep(20);

// Delete EBS volume
$response = $ec2->delete_volume($volume_id);
var_dump($response->isOK());

sleep(20);

// Terminate EC2 instance
$response = $ec2->terminate_instances($instance_id);
var_dump($response->isOK());
Result:
bool(true)
bool(true)
bool(true)
bool(true)

Source

Method defined in services/storagegateway.class.php | Toggle source view (6 lines) | View on GitHub

public function delete_gateway($opt = null)
{
    if (!$opt) $opt = array();
    
    return $this->authenticate('DeleteGateway', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback