Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C2DEVEL-15441: Add RamMonitoring Instance attribute #160

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading