The DescribeInstances operation returns information about instances that you own.
If you specify one or more instance IDs, Amazon EC2 returns information for those instances. If you do not specify instance IDs, Amazon EC2 returns information for all relevant instances. If you specify an invalid instance ID, a fault is returned. If you specify an instance that you do not own, it will not be included in the returned results.
Recently terminated instances might appear in the returned results. This interval is usually less than one hour.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Optional |
An associative array of parameters that can have the following keys:
|
Returns
Type |
Description |
---|---|
A |
Examples
Describe all instances.
$ec2 = new AmazonEC2(); $response = $ec2->describe_instances(); var_dump($response->isOK());Result:
bool(true)
Filter instances.
$ec2 = new AmazonEC2(); $response = $ec2->describe_instances(array( 'Filter' => array( array('Name' => 'architecture', 'Value' => 'x86_64'), array('Name' => 'root-device-type', 'Value' => 'ebs'), array('Name' => 'virtualization-type', 'Value' => 'paravirtual'), ) )); var_dump($response->isOK());Result:
bool(true)
Related Methods
Source
Method defined in services/ec2.class.php | Toggle source view (24 lines) | View on GitHub