Skip to content

Commit

Permalink
Merge pull request #160 from No-Rib/ram-monitoring
Browse files Browse the repository at this point in the history
C2DEVEL-15441: Add RamMonitoring Instance attribute
  • Loading branch information
vamping111 authored Jul 23, 2024
2 parents dac51b6 + 43a6961 commit e9c3440
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion boto/ec2/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,8 @@ def run_instances(self, image_id, min_count=1, max_count=1,
user_data=None, addressing_type=None,
instance_type='m1.small', placement=None,
kernel_id=None, ramdisk_id=None,
monitoring_enabled=False, subnet_id=None,
monitoring_enabled=False, ram_monitoring=False,
subnet_id=None,
block_device_map=None,
disable_api_termination=False,
instance_initiated_shutdown_behavior=None,
Expand Down Expand Up @@ -864,6 +865,10 @@ def run_instances(self, image_id, min_count=1, max_count=1,
:param monitoring_enabled: Enable detailed CloudWatch monitoring on
the instance.
:type ram_monitoring: bool
:param ram_monitoring: Enable RAM CloudWatch monitoring on
the instance.
:type subnet_id: string
:param subnet_id: The subnet ID within which to launch the instances
for VPC.
Expand Down Expand Up @@ -1002,6 +1007,8 @@ def run_instances(self, image_id, min_count=1, max_count=1,
params['RamdiskId'] = ramdisk_id
if monitoring_enabled:
params['Monitoring.Enabled'] = 'true'
if ram_monitoring:
params['RamMonitoring'] = 'true'
if subnet_id:
params['SubnetId'] = subnet_id
if private_ip_address:
Expand Down
3 changes: 3 additions & 0 deletions boto/ec2/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ def __init__(self, connection=None):
self.ami_launch_index = None
self.monitored = False
self.monitoring_state = None
self.ram_monitoring = None
self.spot_instance_request_id = None
self.subnet_id = None
self.vpc_id = None
Expand Down Expand Up @@ -373,6 +374,8 @@ def endElement(self, name, value, connection):
if value == 'enabled':
self.monitored = True
self._in_monitoring_element = False
elif name == 'ramMonitoring':
self.ram_monitoring = value
elif name == 'spotInstanceRequestId':
self.spot_instance_request_id = value
elif name == 'subnetId':
Expand Down

0 comments on commit e9c3440

Please sign in to comment.