Skip to content
This repository was archived by the owner on Jul 22, 2021. It is now read-only.

Commit 3d05924

Browse files
committed
Added support for the CancelUpdateStack operation in the CloudFormation client
1 parent a1af686 commit 3d05924

File tree

1 file changed

+36
-16
lines changed

1 file changed

+36
-16
lines changed

services/cloudformation.class.php

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* information about a specific AWS product, you can find the product's technical documentation at
3434
* <a href="http://aws.amazon.com/documentation/">http://aws.amazon.com/documentation/</a>.
3535
*
36-
* @version 2013.01.14
36+
* @version 2013.02.27
3737
* @license See the included NOTICE.md file for complete information.
3838
* @copyright See the included NOTICE.md file for complete information.
3939
* @link http://aws.amazon.com/cloudformation/ AWS CloudFormation
@@ -176,6 +176,28 @@ public function set_region($region)
176176
/*%******************************************************************************************%*/
177177
// SERVICE METHODS
178178

179+
/**
180+
* Cancels an update on the specified stack. If the call completes successfully, the stack will
181+
* roll back the update and revert to the previous stack configuration.
182+
*
183+
* <p class="note">
184+
* Only stacks that are in the UPDATE_IN_PROGRESS state can be canceled.
185+
* </p>
186+
*
187+
* @param string $stack_name (Required) The name or the unique identifier associated with the stack.
188+
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
189+
* <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
190+
* <li><code>returnCurlHandle</code> - <code>boolean</code> - 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.</li></ul>
191+
* @return CFResponse A <CFResponse> object containing a parsed HTTP response.
192+
*/
193+
public function cancel_update_stack($stack_name, $opt = null)
194+
{
195+
if (!$opt) $opt = array();
196+
$opt['StackName'] = $stack_name;
197+
198+
return $this->authenticate('CancelUpdateStack', $opt);
199+
}
200+
179201
/**
180202
* Creates a stack as specified in the template. After the call completes successfully, the stack
181203
* creation starts. You can check the status of the stack via the <code>DescribeStacks</code> API.
@@ -187,7 +209,7 @@ public function set_region($region)
187209
* @param string $stack_name (Required) The name associated with the stack. The name must be unique within your AWS account. <p class="note">Must contain only alphanumeric characters (case sensitive) and start with an alpha character. Maximum length of the name is 255 characters.</p>
188210
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
189211
* <li><code>TemplateBody</code> - <code>string</code> - Optional - Structure containing the template body. (For more information, go to the <a href="http://docs.amazonwebservices.com/AWSCloudFormation/latest/UserGuide">AWS CloudFormation User Guide</a>.) Conditional: You must pass <code>TemplateBody</code> or <code>TemplateURL</code>. If both are passed, only <code>TemplateBody</code> is used.</li>
190-
* <li><code>TemplateURL</code> - <code>string</code> - Optional - Location of file containing the template body. The URL must point to a template located in an S3 bucket in the same region as the stack. For more information, go to the <a href="http://docs.amazonwebservices.com/AWSCloudFormation/latest/UserGuide">AWS CloudFormation User Guide</a>. Conditional: You must pass <code>TemplateURL</code> or <code>TemplateBody</code>. If both are passed, only <code>TemplateBody</code> is used.</li>
212+
* <li><code>TemplateURL</code> - <code>string</code> - Optional - Location of file containing the template body. The URL must point to a template (max size: 307,200 bytes) located in an S3 bucket in the same region as the stack. For more information, go to the <a href="http://docs.amazonwebservices.com/AWSCloudFormation/latest/UserGuide">AWS CloudFormation User Guide</a>. Conditional: You must pass <code>TemplateURL</code> or <code>TemplateBody</code>. If both are passed, only <code>TemplateBody</code> is used.</li>
191213
* <li><code>Parameters</code> - <code>array</code> - Optional - A list of <code>Parameter</code> structures that specify input parameters for the stack. <ul>
192214
* <li><code>x</code> - <code>array</code> - Optional - This represents a simple array index. <ul>
193215
* <li><code>ParameterKey</code> - <code>string</code> - Optional - The key associated with the parameter.</li>
@@ -323,23 +345,21 @@ public function describe_stack_resource($stack_name, $logical_resource_id, $opt
323345
/**
324346
* Returns AWS resource descriptions for running and deleted stacks. If <code>StackName</code> is
325347
* specified, all the associated resources that are part of the stack are returned. If
326-
* <code>PhysicalResourceId</code> is specified, all the associated resources of the stack the
348+
* <code>PhysicalResourceId</code> is specified, the associated resources of the stack that the
327349
* resource belongs to are returned.
328-
*
329-
* For deleted stacks, DescribeStackResources returns resource information for up to 90 days after
330-
* the stack has been deleted.
331-
*
332-
* If you do not provide either a stack or resource id, information for all stacks and resources
333-
* will be returned, up to a limit of 100 records.
334350
*
335-
* <p class="note"></p>
336-
* To list more than 100 resources use <code>ListStackResources</code> instead.
351+
* <p class="note">
352+
* Only the first 100 resources will be returned. If your stack has more resources than this, you
353+
* should use <code>ListStackResources</code> instead.
354+
* </p>
355+
* For deleted stacks, <code>DescribeStackResources</code> returns resource information for up to
356+
* 90 days after the stack has been deleted.
337357
*
338-
* You can specify either <code>StackName</code> or <code>PhysicalResourceId.</code>, but not
358+
* You must specify either <code>StackName</code> or <code>PhysicalResourceId</code>, but not
339359
* both. In addition, you can specify <code>LogicalResourceId</code> to filter the returned
340360
* result. For more information about resources, the <code>LogicalResourceId</code> and
341361
* <code>PhysicalResourceId</code>, go to the <a href=
342-
* "http://docs.amazonwebservices.com/AWSCloudFormation/latest/UserGuide">AWS CloudFormation User
362+
* "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide">AWS CloudFormation User
343363
* Guide</a>.
344364
*
345365
* <p class="note">
@@ -348,9 +368,9 @@ public function describe_stack_resource($stack_name, $logical_resource_id, $opt
348368
* </p>
349369
*
350370
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
351-
* <li><code>StackName</code> - <code>string</code> - Optional - The name or the unique identifier associated with the stack. Default: There is no default value.</li>
371+
* <li><code>StackName</code> - <code>string</code> - Optional - The name or the unique identifier associated with the stack. Required: Conditional. If you do not specify <code>StackName</code>, you must specify <code>PhysicalResourceId</code>. Default: There is no default value.</li>
352372
* <li><code>LogicalResourceId</code> - <code>string</code> - Optional - The logical name of the resource as specified in the template. Default: There is no default value.</li>
353-
* <li><code>PhysicalResourceId</code> - <code>string</code> - Optional - The name or unique identifier that corresponds to a physical instance ID of a resource supported by AWS CloudFormation. For example, for an Amazon Elastic Compute Cloud (EC2) instance, <code>PhysicalResourceId</code> corresponds to the <code>InstanceId</code>. You can pass the EC2 <code>InstanceId</code> to <code>DescribeStackResources</code> to find which stack the instance belongs to and what other resources are part of the stack. Default: There is no default value.</li>
373+
* <li><code>PhysicalResourceId</code> - <code>string</code> - Optional - The name or unique identifier that corresponds to a physical instance ID of a resource supported by AWS CloudFormation. For example, for an Amazon Elastic Compute Cloud (EC2) instance, <code>PhysicalResourceId</code> corresponds to the <code>InstanceId</code>. You can pass the EC2 <code>InstanceId</code> to <code>DescribeStackResources</code> to find which stack the instance belongs to and what other resources are part of the stack. Required: Conditional. If you do not specify <code>PhysicalResourceId</code>, you must specify <code>StackName</code>. Default: There is no default value.</li>
354374
* <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
355375
* <li><code>returnCurlHandle</code> - <code>boolean</code> - 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.</li></ul>
356376
* @return CFResponse A <CFResponse> object containing a parsed HTTP response.
@@ -550,7 +570,7 @@ public function update_stack($stack_name, $opt = null)
550570
*
551571
* @param array $opt (Optional) An associative array of parameters that can have the following keys: <ul>
552572
* <li><code>TemplateBody</code> - <code>string</code> - Optional - String containing the template body. (For more information, go to the <a href="http://docs.amazonwebservices.com/AWSCloudFormation/latest/UserGuide">AWS CloudFormation User Guide</a>.) Conditional: You must pass <code>TemplateURL</code> or <code>TemplateBody</code>. If both are passed, only <code>TemplateBody</code> is used.</li>
553-
* <li><code>TemplateURL</code> - <code>string</code> - Optional - Location of file containing the template body. The URL must point to a template located in an S3 bucket in the same region as the stack. For more information, go to the <a href="http://docs.amazonwebservices.com/AWSCloudFormation/latest/UserGuide">AWS CloudFormation User Guide</a>. Conditional: You must pass <code>TemplateURL</code> or <code>TemplateBody</code>. If both are passed, only <code>TemplateBody</code> is used.</li>
573+
* <li><code>TemplateURL</code> - <code>string</code> - Optional - Location of file containing the template body. The URL must point to a template (max size: 307,200 bytes) located in an S3 bucket in the same region as the stack. For more information, go to the <a href="http://docs.amazonwebservices.com/AWSCloudFormation/latest/UserGuide">AWS CloudFormation User Guide</a>. Conditional: You must pass <code>TemplateURL</code> or <code>TemplateBody</code>. If both are passed, only <code>TemplateBody</code> is used.</li>
554574
* <li><code>curlopts</code> - <code>array</code> - Optional - A set of values to pass directly into <code>curl_setopt()</code>, where the key is a pre-defined <code>CURLOPT_*</code> constant.</li>
555575
* <li><code>returnCurlHandle</code> - <code>boolean</code> - 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.</li></ul>
556576
* @return CFResponse A <CFResponse> object containing a parsed HTTP response.

0 commit comments

Comments
 (0)