Repository: boto/boto

Issue:
Update get_all_instance_status to handle include_all_instances parameter
AWS DescribeInstanceStatus supports an IncludeAllInstances boolean parameter which is not supported by boto's corresponding 'get_all_instance_status' method.

**AWS DescribeInstanceStatus:**
http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeInstanceStatus.html

**IncludeAllInstances**
_When true, includes the health status for all instances. When false, includes the health status for running instances only._

Type: Boolean
Default: false
Required: No

The 'get_all_instance_status' method in "boto/ec2/connection.py" needs to be updated to include a new 'include_all_instances=False' kwarg, with associated :type and :param comments, and a check to set params['IncludeAllInstances'] = 'true' when this kwarg is True.



Discussion:
```
In [1]: import boto, boto.ec2

In [2]: conn = boto.ec2.connect_to_region("us-west-2");

In [3]: conn.get_all_instance_status(include_all_instances=True)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-3-40a477ccad70> in <module>()
----> 1 conn.get_all_instance_status(include_all_instances=True)

TypeError: get_all_instance_status() got an unexpected keyword argument 'include_all_instances'
```


Resolving patch:
diff --git a/boto/ec2/connection.py b/boto/ec2/connection.py
--- a/boto/ec2/connection.py
+++ b/boto/ec2/connection.py
@@ -684,7 +684,8 @@ def get_all_reservations(self, instance_ids=None, filters=None,
 
     def get_all_instance_status(self, instance_ids=None,
                                 max_results=None, next_token=None,
-                                filters=None, dry_run=False):
+                                filters=None, dry_run=False,
+                                include_all_instances=False):
         """
         Retrieve all the instances in your account scheduled for maintenance.
 
@@ -712,6 +713,11 @@ def get_all_instance_status(self, instance_ids=None,
         :type dry_run: bool
         :param dry_run: Set to True if the operation should not actually run.
 
+        :type include_all_instances: bool
+        :param include_all_instances: Set to True if all
+            instances should be returned. (Only running
+            instances are included by default.)
+
         :rtype: list
         :return: A list of instances that have maintenance scheduled.
         """
@@ -726,6 +732,8 @@ def get_all_instance_status(self, instance_ids=None,
             self.build_filter_params(params, filters)
         if dry_run:
             params['DryRun'] = 'true'
+        if include_all_instances:
+            params['IncludeAllInstances'] = 'true'
         return self.get_object('DescribeInstanceStatus', params,
                                InstanceStatusSet, verb='POST')
 


Test patch:
diff --git a/tests/unit/ec2/test_instancestatus.py b/tests/unit/ec2/test_instancestatus.py
--- a/tests/unit/ec2/test_instancestatus.py
+++ b/tests/unit/ec2/test_instancestatus.py
@@ -25,6 +25,20 @@ def test_next_token(self):
         mock_response.status = 200
         ec2.make_request = mock.Mock(return_value=mock_response)
         all_statuses = ec2.get_all_instance_status()
+        self.assertNotIn('IncludeAllInstances', ec2.make_request.call_args[0][1])
+        self.assertEqual(all_statuses.next_token, 'page-2')
+
+
+    def test_include_all_instances(self):
+        ec2 = EC2Connection(aws_access_key_id='aws_access_key_id',
+                            aws_secret_access_key='aws_secret_access_key')
+        mock_response = mock.Mock()
+        mock_response.read.return_value = INSTANCE_STATUS_RESPONSE
+        mock_response.status = 200
+        ec2.make_request = mock.Mock(return_value=mock_response)
+        all_statuses = ec2.get_all_instance_status(include_all_instances=True)
+        self.assertIn('IncludeAllInstances', ec2.make_request.call_args[0][1])
+        self.assertEqual('true', ec2.make_request.call_args[0][1]['IncludeAllInstances'])
         self.assertEqual(all_statuses.next_token, 'page-2')