mirror of https://github.com/apache/jclouds.git
Issue 36: combined Attribute parameters
git-svn-id: http://jclouds.googlecode.com/svn/trunk@1418 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
parent
cb5c918918
commit
e0b68edf7d
|
@ -233,6 +233,31 @@ sub build_contents {
|
||||||
}
|
}
|
||||||
push @params, \%param;
|
push @params, \%param;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Attribute query parameters come in as separate parameters, so
|
||||||
|
# we coallate them into one
|
||||||
|
my %attribute;
|
||||||
|
for ( 0 .. $#params ) {
|
||||||
|
my $param = $params[$_];
|
||||||
|
if ( $param->{name} =~ /Attribute=/ ) {
|
||||||
|
delete $params[$_];
|
||||||
|
if ( !defined %attribute ) {
|
||||||
|
$attribute{name} = "Attribute";
|
||||||
|
$attribute{type} = "String";
|
||||||
|
$attribute{optional} = "true";
|
||||||
|
$attribute{defaultValue} = "true";
|
||||||
|
}
|
||||||
|
my $enum = $attribute{valueMap};
|
||||||
|
$_ = $param->{name};
|
||||||
|
s/Attribute=//;
|
||||||
|
$enum->{$_} = $param->{desc};
|
||||||
|
$attribute{valueMap} = $enum;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( defined %attribute ) {
|
||||||
|
push @params, \%attribute;
|
||||||
|
}
|
||||||
|
|
||||||
return \@params;
|
return \@params;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,6 +289,7 @@ sub build_item {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
unless ( $class =~ /Response/ ) {
|
unless ( $class =~ /Response/ ) {
|
||||||
|
|
||||||
#$tree->dump;
|
#$tree->dump;
|
||||||
my ${descriptionDiv} =
|
my ${descriptionDiv} =
|
||||||
$tree->look_down( '_tag', 'h2', 'id',
|
$tree->look_down( '_tag', 'h2', 'id',
|
||||||
|
|
|
@ -223,10 +223,8 @@ public class AmazonEC2QueryAPIExpectations {
|
||||||
"DeregisterImage", ImmutableSet.of("ImageId")).put(
|
"DeregisterImage", ImmutableSet.of("ImageId")).put(
|
||||||
"ModifyImageAttribute",
|
"ModifyImageAttribute",
|
||||||
ImmutableSet.of("Group.n", "UserId.n", "ImageId", "ProductCode.n", "Group.n",
|
ImmutableSet.of("Group.n", "UserId.n", "ImageId", "ProductCode.n", "Group.n",
|
||||||
"UserId.n")).put(
|
"UserId.n")).put("DescribeImageAttribute",
|
||||||
"DescribeImageAttribute",
|
ImmutableSet.of("Attribute", "ImageId")).put("DescribeImages",
|
||||||
ImmutableSet.of("Attribute=productCodes", "ImageId", "Attribute=platform", "Attribute=blockDeviceMapping",
|
|
||||||
"Attribute=launchPermission", "Attribute=ramdisk", "Attribute=kernel")).put("DescribeImages",
|
|
||||||
ImmutableSet.of("explicit", "public", "implicit")).put(
|
ImmutableSet.of("explicit", "public", "implicit")).put(
|
||||||
"DescribeAvailabilityZones", ImmutableSet.of("ZoneName")).put(
|
"DescribeAvailabilityZones", ImmutableSet.of("ZoneName")).put(
|
||||||
"DescribeRegions", ImmutableSet.of("RegionName.n")).put("DeleteVolume",
|
"DescribeRegions", ImmutableSet.of("RegionName.n")).put("DeleteVolume",
|
||||||
|
|
|
@ -298,46 +298,18 @@
|
||||||
"defaultValue" : "None"
|
"defaultValue" : "None"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"desc" : "Describes the launch permissions of the AMI.",
|
"name" : "Attribute",
|
||||||
"name" : "Attribute=launchPermission",
|
|
||||||
"type" : "String",
|
"type" : "String",
|
||||||
"optional" : "true",
|
"optional" : "true",
|
||||||
"defaultValue" : "None"
|
"defaultValue" : "true",
|
||||||
},
|
"valueMap" : {
|
||||||
{
|
"productCodes" : "Describes the product code associated with the AMI.",
|
||||||
"desc" : "Describes the product code associated with the AMI.",
|
"ramdisk" : "Describes the ID of the RAM disk associated with the AMI.",
|
||||||
"name" : "Attribute=productCodes",
|
"kernel" : "Describes the ID of the kernel associated with the AMI.",
|
||||||
"type" : "String",
|
"launchPermission" : "Describes the launch permissions of the AMI.",
|
||||||
"optional" : "true",
|
"platform" : "Describes the operating system platform.",
|
||||||
"defaultValue" : "None"
|
"blockDeviceMapping" : "Describes the mapping that defines native device names to use when exposing virtual devices."
|
||||||
},
|
}
|
||||||
{
|
|
||||||
"desc" : "Describes the ID of the kernel associated with the AMI.",
|
|
||||||
"name" : "Attribute=kernel",
|
|
||||||
"type" : "String",
|
|
||||||
"optional" : "true",
|
|
||||||
"defaultValue" : "None"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Describes the ID of the RAM disk associated with the AMI.",
|
|
||||||
"name" : "Attribute=ramdisk",
|
|
||||||
"type" : "String",
|
|
||||||
"optional" : "true",
|
|
||||||
"defaultValue" : "None"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Describes the mapping that defines native device names to use when exposing virtual devices.",
|
|
||||||
"name" : "Attribute=blockDeviceMapping",
|
|
||||||
"type" : "String",
|
|
||||||
"optional" : "true",
|
|
||||||
"defaultValue" : "None"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"desc" : "Describes the operating system platform.",
|
|
||||||
"name" : "Attribute=platform",
|
|
||||||
"type" : "String",
|
|
||||||
"optional" : "true",
|
|
||||||
"defaultValue" : "None"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type" : "DescribeImageAttribute",
|
"type" : "DescribeImageAttribute",
|
||||||
|
@ -716,8 +688,8 @@
|
||||||
"name" : "Availability Zones and Regions",
|
"name" : "Availability Zones and Regions",
|
||||||
"queries" : {
|
"queries" : {
|
||||||
"DescribeAvailabilityZones" : {
|
"DescribeAvailabilityZones" : {
|
||||||
"exampleCode" : "https://ec2.amazonaws.com/?Action=DescribeAvailabilityZones&ZoneName.0=us-east-1a&ZoneName.1=us-east-1b&ZoneName.1=us-east-1c&AuthParams",
|
"exampleCode" : "https://ec2.amazonaws.com/?Action=DescribeAvailabilityZones&ZoneName.0=us-east-1a&ZoneName.1=us-east-1b&ZoneName.2=us-east-1c&ZoneName.3=us-east-1d&AuthParams",
|
||||||
"exampleHTML" : "<div class=\"section\" lang=\"en\"><div class=\"titlepage\"><div><div><h3 class=\"title\" id=\"ApiReference-query-DescribeAvailabilityZones-Example-Request-1\">Example Request</h3></div></div></div><p>This example displays information about Availability Zones that are available to the account.<pre class=\"programlisting\">https://ec2.amazonaws.com/?Action=DescribeAvailabilityZones&ZoneName.0=us-east-1a&ZoneName.1=us-east-1b&ZoneName.1=us-east-1c&AuthParams</pre></div>\n",
|
"exampleHTML" : "<div class=\"section\" lang=\"en\"><div class=\"titlepage\"><div><div><h3 class=\"title\" id=\"ApiReference-query-DescribeAvailabilityZones-Example-Request-1\">Example Request</h3></div></div></div><p>This example displays information about Availability Zones that are available to the account.<pre class=\"programlisting\">https://ec2.amazonaws.com/?Action=DescribeAvailabilityZones&ZoneName.0=us-east-1a&ZoneName.1=us-east-1b&ZoneName.2=us-east-1c&ZoneName.3=us-east-1d&AuthParams</pre></div>\n",
|
||||||
"contents" : [
|
"contents" : [
|
||||||
{
|
{
|
||||||
"desc" : "Availability Zone name.",
|
"desc" : "Availability Zone name.",
|
||||||
|
@ -2927,8 +2899,8 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"DescribeAvailabilityZonesResponse" : {
|
"DescribeAvailabilityZonesResponse" : {
|
||||||
"exampleCode" : "<DescribeAvailabilityZonesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\n <availabilityZoneInfo>\n <item>\n <zoneName>us-east-1a</zoneName>\n <zoneState>available</zoneState>\n </item>\n <item>\n <zoneName>us-east-1b</zoneName>\n <zoneState>available</zoneState>\n </item>\n <item>\n <zoneName>us-east-1c</zoneName>\n <zoneState>available</zoneState>\n </item>\n </availabilityZoneInfo>\n</DescribeAvailabilityZonesResponse>",
|
"exampleCode" : "<DescribeAvailabilityZonesResponse xmlns=\"http://ec2.amazonaws.com/doc/2009-04-04/\">\n <availabilityZoneInfo>\n <item>\n <zoneName>us-east-1a</zoneName>\n <zoneState>available</zoneState>\n </item>\n <item>\n <zoneName>us-east-1b</zoneName>\n <zoneState>available</zoneState>\n </item>\n <item>\n <zoneName>us-east-1c</zoneName>\n <zoneState>available</zoneState>\n </item>\n <item>\n <zoneName>us-east-1d</zoneName>\n <zoneState>available</zoneState>\n </item>\n </availabilityZoneInfo>\n</DescribeAvailabilityZonesResponse>",
|
||||||
"exampleHTML" : "<div class=\"section\" lang=\"en\"><div class=\"titlepage\"><div><div><h3 class=\"title\" id=\"ApiReference-query-DescribeAvailabilityZones-Example-Response-1\">Example Response</h3></div></div></div><pre class=\"programlisting\"><DescribeAvailabilityZonesResponse xmlns="http://ec2.amazonaws.com/doc/2009-04-04/">\n <availabilityZoneInfo>\n <item>\n <zoneName>us-east-1a</zoneName>\n <zoneState>available</zoneState>\n </item>\n <item>\n <zoneName>us-east-1b</zoneName>\n <zoneState>available</zoneState>\n </item>\n <item>\n <zoneName>us-east-1c</zoneName>\n <zoneState>available</zoneState>\n </item>\n </availabilityZoneInfo>\n</DescribeAvailabilityZonesResponse></pre></div>\n",
|
"exampleHTML" : "<div class=\"section\" lang=\"en\"><div class=\"titlepage\"><div><div><h3 class=\"title\" id=\"ApiReference-query-DescribeAvailabilityZones-Example-Response-1\">Example Response</h3></div></div></div><pre class=\"programlisting\"><DescribeAvailabilityZonesResponse xmlns="http://ec2.amazonaws.com/doc/2009-04-04/">\n <availabilityZoneInfo>\n <item>\n <zoneName>us-east-1a</zoneName>\n <zoneState>available</zoneState>\n </item>\n <item>\n <zoneName>us-east-1b</zoneName>\n <zoneState>available</zoneState>\n </item>\n <item>\n <zoneName>us-east-1c</zoneName>\n <zoneState>available</zoneState>\n </item>\n <item>\n <zoneName>us-east-1d</zoneName>\n <zoneState>available</zoneState>\n </item>\n </availabilityZoneInfo>\n</DescribeAvailabilityZonesResponse></pre></div>\n",
|
||||||
"contents" : [
|
"contents" : [
|
||||||
{
|
{
|
||||||
"desc" : "Availability Zone information.",
|
"desc" : "Availability Zone information.",
|
||||||
|
|
|
@ -38,7 +38,7 @@ import org.testng.annotations.Test;
|
||||||
*
|
*
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
@Test(testName = "ec2.AmazonEC2QueryAPIParser")
|
@Test(testName = "ec2.AmazonEC2QueryAPIParserTest")
|
||||||
public class AmazonEC2QueryAPIParserTest extends AmazonEC2QueryAPIValidator {
|
public class AmazonEC2QueryAPIParserTest extends AmazonEC2QueryAPIValidator {
|
||||||
@BeforeTest
|
@BeforeTest
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
|
|
Loading…
Reference in New Issue