CS-15031. ec2-describe-instances, provide support for group-id filter.

This commit is contained in:
Likitha Shetty 2012-05-22 10:59:57 +05:30
parent 99a546191f
commit ff72492c01
1 changed files with 8 additions and 0 deletions

View File

@ -46,6 +46,7 @@ public class EC2InstanceFilterSet {
filterTypes.put( "owner-id", "string" );
filterTypes.put( "root-device-name", "string" );
filterTypes.put( "private-ip-address", "string" );
filterTypes.put( "group-id", "string" );
}
@ -154,6 +155,13 @@ public class EC2InstanceFilterSet {
{
return containsDevice( vm.getRootDeviceId(), valueSet );
}
else if (filterName.equalsIgnoreCase( "group-id"))
{
String[] groupSet = vm.getGroupSet();
for (String group : groupSet)
if (containsString(group, valueSet)) return true;
return false;
}
else return false;
}