MCPcopy Create free account
hub / github.com/agenticsorg/edge-agents / stop_instance

Method stop_instance

scripts/agents/devops/src/aws/ec2.py:214–236  ·  view source on GitHub ↗

Stop a running EC2 instance. Args: instance_id: The ID of the instance to stop. force: Whether to force stop the instance. wait: Whether to wait for the instance to be stopped. Returns: Updated instance de

(
        self, 
        instance_id: str, 
        force: bool = False, 
        wait: bool = True
    )

Source from the content-addressed store, hash-verified

212
213 @aws_operation("stop_instance")
214 def stop_instance(
215 self,
216 instance_id: str,
217 force: bool = False,
218 wait: bool = True
219 ) -> Dict[str, Any]:
220 """
221 Stop a running EC2 instance.
222
223 Args:
224 instance_id: The ID of the instance to stop.
225 force: Whether to force stop the instance.
226 wait: Whether to wait for the instance to be stopped.
227
228 Returns:
229 Updated instance details.
230 """
231 self.client.stop_instances(InstanceIds=[instance_id], Force=force)
232
233 if wait:
234 self.wait_for('instance_stopped', {'InstanceIds': [instance_id]})
235
236 return self.get_instance(instance_id)
237
238 @aws_operation("terminate_instance")
239 def terminate_instance(self, instance_id: str, wait: bool = True) -> Dict[str, Any]:

Callers 3

handle_ec2_commandFunction · 0.95
resize_instanceMethod · 0.95
test_instance_lifecycleFunction · 0.80

Calls 2

get_instanceMethod · 0.95
wait_forMethod · 0.80

Tested by 1

test_instance_lifecycleFunction · 0.64