Merge branch 'master' of github.com:jclouds/jclouds into 1.5.x

* 'master' of github.com:jclouds/jclouds: (34 commits)
  Issue 899:NPE on cleanUpIncidentalResourcesOfDeadNodes
  openstack-nova-ec2 errors on authorizing security group to itself, and also needs to auto-allocate elastic ips
  updated error parser to work with Nova EC2 error message
  moved cacheloaders to the correct package
  default to allocate elastic ips on openstack-nova-ec
  more details when image doesn't match
  PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSetTest
  fix Accept header in delete
  fix (unused) createImage http body in 404 test.
  add tests for createImage, switch argument order.
  remove unused import statements.
  create an image from a nova vm instance.
  Issue 891: update to support lucid
  added openstack-nova-ec2 to allcompute
  Updated PlatformServices attribute name for RUN@cloud's TweetStore version
  Updated PlatformServices attribute name for OpenShift's TweetStore version
  ensure tests are tidy, consistent, and clean up after themselves
  refactor out test session to exist on the suite scope
  make adminContext more robust
  refactor out admin tests
  ...
This commit is contained in:
Adrian Cole 2012-04-08 22:39:13 -06:00
commit e686d26ada
356 changed files with 8771 additions and 5096 deletions

View File

@ -23,7 +23,7 @@ our compute api supports: aws-ec2, gogrid, cloudservers-us, stub (in-memory), de
openhosting-east1, serverlove-z1-man, skalicloud-sdg-my,
greenhousedata-element-vcloud, softlayer, cloudsigma (generic),
cloudstack (generic), ninefold-compute, openstack-nov (keystone),
hpcloud-compute, trystack-nova
hpcloud-compute, trystack-nova, openstack-nova-ec2
* note * the pom dependency org.jclouds/jclouds-allcompute gives you access to
to all of these providers

View File

@ -60,6 +60,11 @@
<artifactId>openstack-nova</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.api</groupId>
<artifactId>openstack-nova-ec2</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.api</groupId>
<artifactId>nova</artifactId>

View File

@ -0,0 +1,67 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.atmos;
import java.net.URI;
import org.jclouds.apis.ApiMetadata;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadata;
/**
* Implementation of {@link ApiMetadata} for EMC's Atmos API.
*
* @author Adrian Cole
*/
public class AtmosApiMetadata extends BaseApiMetadata {
public AtmosApiMetadata() {
this(builder()
.id("atmos")
.type(ApiType.BLOBSTORE)
.name("EMC's Atmos API")
.identityName("Subtenant ID (UID)")
.credentialName("Shared Secret")
.documentation(URI.create("https://community.emc.com/docs/DOC-10508")));
}
// below are so that we can reuse builders, toString, hashCode, etc.
// we have to set concrete classes here, as our base class cannot be
// concrete due to serviceLoader
protected AtmosApiMetadata(Builder<?> builder) {
super(builder);
}
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
@Override
public AtmosApiMetadata build() {
return new AtmosApiMetadata(this);
}
}
public static ConcreteBuilder builder() {
return new ConcreteBuilder();
}
@Override
public ConcreteBuilder toBuilder() {
return builder().fromApiMetadata(this);
}
}

View File

@ -0,0 +1 @@
org.jclouds.atmos.AtmosApiMetadata

View File

@ -0,0 +1,35 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.atmos;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadataTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "unit", testName = "AtmosApiMetadataTest")
public class AtmosApiMetadataTest extends BaseApiMetadataTest {
public AtmosApiMetadataTest() {
super(new AtmosApiMetadata(), ApiType.BLOBSTORE);
}
}

View File

@ -0,0 +1,67 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.byon;
import java.net.URI;
import org.jclouds.apis.ApiMetadata;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadata;
/**
* Implementation of {@link ApiMetadata} for jclouds BYON API
*
* @author Adrian Cole
*/
public class BYONApiMetadata extends BaseApiMetadata {
public BYONApiMetadata() {
this(builder()
.id("byon")
.type(ApiType.COMPUTE)
.name("Bring Your Own Node (BYON) API")
.identityName("Unused")
.documentation(URI.create("https://github.com/jclouds/jclouds/tree/master/apis/byon")));
}
// below are so that we can reuse builders, toString, hashCode, etc.
// we have to set concrete classes here, as our base class cannot be
// concrete due to serviceLoader
protected BYONApiMetadata(Builder<?> builder) {
super(builder);
}
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
@Override
public BYONApiMetadata build() {
return new BYONApiMetadata(this);
}
}
public static ConcreteBuilder builder() {
return new ConcreteBuilder();
}
@Override
public ConcreteBuilder toBuilder() {
return builder().fromApiMetadata(this);
}
}

View File

@ -0,0 +1 @@
org.jclouds.byon.BYONApiMetadata

View File

@ -0,0 +1,35 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.byon;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadataTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "unit", testName = "BYONApiMetadataTest")
public class BYONApiMetadataTest extends BaseApiMetadataTest {
public BYONApiMetadataTest() {
super(new BYONApiMetadata(), ApiType.COMPUTE);
}
}

View File

@ -0,0 +1,68 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.cloudfiles;
import java.net.URI;
import org.jclouds.apis.ApiMetadata;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadata;
/**
* Implementation of {@link ApiMetadata} for Rackspace Cloud Files API
*
* @author Dan Lo Bianco
*/
public class CloudFilesApiMetadata extends BaseApiMetadata {
public CloudFilesApiMetadata() {
this(builder()
.id("cloudfiles")
.type(ApiType.BLOBSTORE)
.name("Rackspace Cloud Files API")
.identityName("Username")
.credentialName("API Key")
.documentation(URI.create("http://docs.rackspacecloud.com/files/api/v1/cfdevguide_d5/content/ch01.html")));
}
// below are so that we can reuse builders, toString, hashCode, etc.
// we have to set concrete classes here, as our base class cannot be
// concrete due to serviceLoader
protected CloudFilesApiMetadata(Builder<?> builder) {
super(builder);
}
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
@Override
public CloudFilesApiMetadata build() {
return new CloudFilesApiMetadata(this);
}
}
public static ConcreteBuilder builder() {
return new ConcreteBuilder();
}
@Override
public ConcreteBuilder toBuilder() {
return builder().fromApiMetadata(this);
}
}

View File

@ -1,69 +0,0 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.cloudfiles;
import java.net.URI;
import org.jclouds.providers.BaseProviderMetadata;
import org.jclouds.providers.ProviderMetadata;
/**
* Common implementation of {@link org.jclouds.types.ProviderMetadata} for Rackspace Cloud Files
*
* @author Dan Lo Bianco
*/
public abstract class CloudFilesProviderMetadata extends BaseProviderMetadata {
public CloudFilesProviderMetadata() {
super();
}
/**
* {@inheritDoc}
*/
@Override
public String getType() {
return ProviderMetadata.BLOBSTORE_TYPE;
}
/**
* {@inheritDoc}
*/
@Override
public String getIdentityName() {
return "Username";
}
/**
* {@inheritDoc}
*/
@Override
public String getCredentialName() {
return "API Key";
}
/**
* {@inheritDoc}
*/
@Override
public URI getApiDocumentation() {
return URI.create("http://docs.rackspacecloud.com/files/api/v1/cfdevguide_d5/content/ch01.html");
}
}

View File

@ -0,0 +1 @@
org.jclouds.cloudfiles.CloudFilesApiMetadata

View File

@ -0,0 +1,35 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.cloudfiles;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadataTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "unit", testName = "CloudFilesApiMetadataTest")
public class CloudFilesApiMetadataTest extends BaseApiMetadataTest {
public CloudFilesApiMetadataTest() {
super(new CloudFilesApiMetadata(), ApiType.BLOBSTORE);
}
}

View File

@ -0,0 +1,68 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.cloudloadbalancers;
import java.net.URI;
import org.jclouds.apis.ApiMetadata;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadata;
/**
* Implementation of {@link ApiMetadata} for Rackspace Cloud Load Balancers API
*
* @author Dan Lo Bianco
*/
public class CloudLoadBalancersApiMetadata extends BaseApiMetadata {
public CloudLoadBalancersApiMetadata() {
this(builder()
.id("cloudloadbalancers")
.type(ApiType.LOADBALANCER)
.name("Rackspace Cloud Load Balancers API")
.identityName("Username")
.credentialName("API Key")
.documentation(URI.create("http://docs.rackspacecloud.com/loadbalancers/api/v1.0/clb-devguide/content/ch01.html")));
}
// below are so that we can reuse builders, toString, hashCode, etc.
// we have to set concrete classes here, as our base class cannot be
// concrete due to serviceLoader
protected CloudLoadBalancersApiMetadata(Builder<?> builder) {
super(builder);
}
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
@Override
public CloudLoadBalancersApiMetadata build() {
return new CloudLoadBalancersApiMetadata(this);
}
}
public static ConcreteBuilder builder() {
return new ConcreteBuilder();
}
@Override
public ConcreteBuilder toBuilder() {
return builder().fromApiMetadata(this);
}
}

View File

@ -1,69 +0,0 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.cloudloadbalancers;
import java.net.URI;
import org.jclouds.providers.BaseProviderMetadata;
import org.jclouds.providers.ProviderMetadata;
/**
* Common implementation of {@link org.jclouds.types.ProviderMetadata} for Rackspace Cloud LoadBalancers.
*
* @author Dan Lo Bianco
*/
public abstract class CloudLoadBalancersProviderMetadata extends BaseProviderMetadata {
public CloudLoadBalancersProviderMetadata() {
super();
}
/**
* {@inheritDoc}
*/
@Override
public String getType() {
return ProviderMetadata.LOADBALANCER_TYPE;
}
/**
* {@inheritDoc}
*/
@Override
public String getIdentityName() {
return "Username";
}
/**
* {@inheritDoc}
*/
@Override
public String getCredentialName() {
return "API Key";
}
/**
* {@inheritDoc}
*/
@Override
public URI getApiDocumentation() {
return URI.create("http://docs.rackspacecloud.com/loadbalancers/api/v1.0/clb-devguide/content/ch01.html");
}
}

View File

@ -0,0 +1 @@
org.jclouds.cloudloadbalancers.CloudLoadBalancersApiMetadata

View File

@ -0,0 +1,35 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.cloudloadbalancers;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadataTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "unit", testName = "CloudLoadBalancersApiMetadataTest")
public class CloudLoadBalancersApiMetadataTest extends BaseApiMetadataTest {
public CloudLoadBalancersApiMetadataTest() {
super(new CloudLoadBalancersApiMetadata(), ApiType.LOADBALANCER);
}
}

View File

@ -0,0 +1,68 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.cloudservers;
import java.net.URI;
import org.jclouds.apis.ApiMetadata;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadata;
/**
* Implementation of {@link ApiMetadata} for Rackspace Cloud Servers API
*
* @author Adrian Cole
*/
public class CloudServersApiMetadata extends BaseApiMetadata {
public CloudServersApiMetadata() {
this(builder()
.id("cloudservers")
.type(ApiType.COMPUTE)
.name("Rackspace Cloud Servers API")
.identityName("Username")
.credentialName("API Key")
.documentation(URI.create("http://docs.rackspacecloud.com/servers/api/v1.0/cs-devguide/content/ch01.html")));
}
// below are so that we can reuse builders, toString, hashCode, etc.
// we have to set concrete classes here, as our base class cannot be
// concrete due to serviceLoader
protected CloudServersApiMetadata(Builder<?> builder) {
super(builder);
}
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
@Override
public CloudServersApiMetadata build() {
return new CloudServersApiMetadata(this);
}
}
public static ConcreteBuilder builder() {
return new ConcreteBuilder();
}
@Override
public ConcreteBuilder toBuilder() {
return builder().fromApiMetadata(this);
}
}

View File

@ -1,69 +0,0 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.cloudservers;
import java.net.URI;
import org.jclouds.providers.BaseProviderMetadata;
import org.jclouds.providers.ProviderMetadata;
/**
* Common implementation of {@link org.jclouds.types.ProviderMetadata} for Rackspace Cloud Servers.
*
* @author Dan Lo Bianco
*/
public abstract class CloudServersProviderMetadata extends BaseProviderMetadata {
public CloudServersProviderMetadata() {
super();
}
/**
* {@inheritDoc}
*/
@Override
public String getType() {
return ProviderMetadata.COMPUTE_TYPE;
}
/**
* {@inheritDoc}
*/
@Override
public String getIdentityName() {
return "Username";
}
/**
* {@inheritDoc}
*/
@Override
public String getCredentialName() {
return "API Key";
}
/**
* {@inheritDoc}
*/
@Override
public URI getApiDocumentation() {
return URI.create("http://docs.rackspacecloud.com/servers/api/v1.0/cs-devguide/content/ch01.html");
}
}

View File

@ -0,0 +1 @@
org.jclouds.cloudservers.CloudServersApiMetadata

View File

@ -16,25 +16,20 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.aws.simpledb;
package org.jclouds.cloudservers;
import org.jclouds.rest.Providers;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadataTest;
import org.testng.annotations.Test;
import com.google.common.collect.Iterables;
/**
*
* @author Adrian Cole
*
*/
@Test(groups = "unit")
public class ProvidersInPropertiesTest {
@Test
public void testSupportedProviders() {
Iterable<String> providers = Providers.getSupportedProviders();
assert Iterables.contains(providers, "aws-simpledb") : providers;
}
@Test(groups = "unit", testName = "CloudServersApiMetadataTest")
public class CloudServersApiMetadataTest extends BaseApiMetadataTest {
public CloudServersApiMetadataTest() {
super(new CloudServersApiMetadata(), ApiType.COMPUTE);
}
}

View File

@ -0,0 +1,68 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.cloudsigma;
import java.net.URI;
import org.jclouds.apis.ApiMetadata;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadata;
/**
* Implementation of {@link ApiMetadata} for the Cloud Sigma API
*
* @author Adrian Cole
*/
public class CloudSigmaApiMetadata extends BaseApiMetadata {
public CloudSigmaApiMetadata() {
this(builder()
.id("cloudsigma")
.type(ApiType.COMPUTE)
.name("CloudSigma API")
.identityName("Email")
.credentialName("Password")
.documentation(URI.create("http://cloudsigma.com/en/platform-details/the-api")));
}
// below are so that we can reuse builders, toString, hashCode, etc.
// we have to set concrete classes here, as our base class cannot be
// concrete due to serviceLoader
protected CloudSigmaApiMetadata(Builder<?> builder) {
super(builder);
}
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
@Override
public CloudSigmaApiMetadata build() {
return new CloudSigmaApiMetadata(this);
}
}
public static ConcreteBuilder builder() {
return new ConcreteBuilder();
}
@Override
public ConcreteBuilder toBuilder() {
return builder().fromApiMetadata(this);
}
}

View File

@ -0,0 +1 @@
org.jclouds.cloudsigma.CloudSigmaApiMetadata

View File

@ -0,0 +1,35 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.cloudsigma;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadataTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "unit", testName = "CloudSigmaApiMetadataTest")
public class CloudSigmaApiMetadataTest extends BaseApiMetadataTest {
public CloudSigmaApiMetadataTest() {
super(new CloudSigmaApiMetadata(), ApiType.COMPUTE);
}
}

View File

@ -0,0 +1,68 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.cloudstack;
import java.net.URI;
import org.jclouds.apis.ApiMetadata;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadata;
/**
* Implementation of {@link ApiMetadata} for Citrix CloudStack API
*
* @author Adrian Cole
*/
public class CloudStackApiMetadata extends BaseApiMetadata {
public CloudStackApiMetadata() {
this(builder()
.id("cloudstack")
.type(ApiType.COMPUTE)
.name("Citrix CloudStack API")
.identityName("API Key")
.credentialName("Secret Key")
.documentation(URI.create("http://download.cloud.com/releases/2.2.0/api_2.2.12/TOC_User.html")));
}
// below are so that we can reuse builders, toString, hashCode, etc.
// we have to set concrete classes here, as our base class cannot be
// concrete due to serviceLoader
protected CloudStackApiMetadata(Builder<?> builder) {
super(builder);
}
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
@Override
public CloudStackApiMetadata build() {
return new CloudStackApiMetadata(this);
}
}
public static ConcreteBuilder builder() {
return new ConcreteBuilder();
}
@Override
public ConcreteBuilder toBuilder() {
return builder().fromApiMetadata(this);
}
}

View File

@ -0,0 +1 @@
org.jclouds.cloudstack.CloudStackApiMetadata

View File

@ -0,0 +1,35 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.cloudstack;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadataTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "unit", testName = "CloudStackApiMetadataTest")
public class CloudStackApiMetadataTest extends BaseApiMetadataTest {
public CloudStackApiMetadataTest() {
super(new CloudStackApiMetadata(), ApiType.COMPUTE);
}
}

View File

@ -0,0 +1,67 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.cloudwatch;
import java.net.URI;
import org.jclouds.apis.ApiMetadata;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadata;
/**
* Implementation of {@link ApiMetadata} for Amazon's CloudWatch api.
*
* @author Adrian Cole
*/
public class CloudWatchApiMetadata extends BaseApiMetadata {
public CloudWatchApiMetadata() {
this(builder()
.id("cloudwatch")
.type(ApiType.MONITOR)
.name("Amazon CloudWatch Api")
.identityName("Access Key ID")
.credentialName("Secret Access Key")
.documentation(URI.create("http://docs.amazonwebservices.com/AmazonCloudWatch/latest/APIReference/")));
}
// below are so that we can reuse builders, toString, hashCode, etc.
// we have to set concrete classes here, as our base class cannot be
// concrete due to serviceLoader
protected CloudWatchApiMetadata(Builder<?> builder) {
super(builder);
}
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
@Override
public CloudWatchApiMetadata build() {
return new CloudWatchApiMetadata(this);
}
}
public static ConcreteBuilder builder() {
return new ConcreteBuilder();
}
@Override
public ConcreteBuilder toBuilder() {
return builder().fromApiMetadata(this);
}
}

View File

@ -52,7 +52,6 @@ import com.google.common.util.concurrent.ListenableFuture;
* @author Adrian Cole
*/
@RequestFilters(FormSigner.class)
@FormParams(keys = "Version", values = CloudWatchAsyncClient.VERSION)
@VirtualHost
public interface CloudWatchAsyncClient {
public static final String VERSION = "2010-08-01";

View File

@ -0,0 +1 @@
org.jclouds.cloudwatch.CloudWatchApiMetadata

View File

@ -0,0 +1,35 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.cloudwatch;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadataTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "unit", testName = "CloudWatchApiMetadataTest")
public class CloudWatchApiMetadataTest extends BaseApiMetadataTest {
public CloudWatchApiMetadataTest() {
super(new CloudWatchApiMetadata(), ApiType.MONITOR);
}
}

View File

@ -77,7 +77,7 @@ public class CloudWatchAsyncClientTest extends RestClientTest<CloudWatchAsyncCli
assertNonPayloadHeadersEqual(request, "Host: monitoring.us-east-1.amazonaws.com\n");
assertPayloadEquals(
request,
"Version=2010-08-01&Action=GetMetricStatistics&Statistics.member.1=Average&Period=60&Namespace=AWS%2FEC2&MetricName=CPUUtilization&StartTime=1970-01-01T02%3A46%3A40Z&EndTime=1970-01-01T02%3A46%3A40Z&Dimensions.member.1.Name=InstanceId&Dimensions.member.1.Value=i-12312313",
"Action=GetMetricStatistics&Statistics.member.1=Average&Period=60&Namespace=AWS%2FEC2&MetricName=CPUUtilization&StartTime=1970-01-01T02%3A46%3A40Z&EndTime=1970-01-01T02%3A46%3A40Z&Dimensions.member.1.Name=InstanceId&Dimensions.member.1.Value=i-12312313",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);

View File

@ -0,0 +1,68 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.deltacloud;
import java.net.URI;
import org.jclouds.apis.ApiMetadata;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadata;
/**
* Implementation of {@link ApiMetadata} for Apache Deltacloud API
*
* @author Adrian Cole
*/
public class DeltacloudApiMetadata extends BaseApiMetadata {
public DeltacloudApiMetadata() {
this(builder()
.id("deltacloud")
.type(ApiType.COMPUTE)
.name("Apache Deltacloud API")
.identityName("Username")
.credentialName("Password")
.documentation(URI.create("http://deltacloud.apache.org/api.html")));
}
// below are so that we can reuse builders, toString, hashCode, etc.
// we have to set concrete classes here, as our base class cannot be
// concrete due to serviceLoader
protected DeltacloudApiMetadata(Builder<?> builder) {
super(builder);
}
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
@Override
public DeltacloudApiMetadata build() {
return new DeltacloudApiMetadata(this);
}
}
public static ConcreteBuilder builder() {
return new ConcreteBuilder();
}
@Override
public ConcreteBuilder toBuilder() {
return builder().fromApiMetadata(this);
}
}

View File

@ -0,0 +1 @@
org.jclouds.deltacloud.DeltacloudApiMetadata

View File

@ -0,0 +1,35 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.deltacloud;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadataTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "unit", testName = "DeltacloudApiMetadataTest")
public class DeltacloudApiMetadataTest extends BaseApiMetadataTest {
public DeltacloudApiMetadataTest() {
super(new DeltacloudApiMetadata(), ApiType.COMPUTE);
}
}

View File

@ -0,0 +1,75 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.ec2;
import java.net.URI;
import org.jclouds.apis.ApiMetadata;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadata;
/**
* Implementation of {@link ApiMetadata} for Amazon's EC2 api.
*
* @author Adrian Cole
*/
public class EC2ApiMetadata extends BaseApiMetadata {
public EC2ApiMetadata() {
this(builder()
.id("ec2")
.type(ApiType.COMPUTE)
.name("Amazon Elastic Compute Cloud (EC2) API")
.identityName("Access Key ID")
.credentialName("Secret Access Key")
.documentation(URI.create("http://docs.amazonwebservices.com/AWSEC2/latest/APIReference")));
}
// below are so that we can reuse builders, toString, hashCode, etc.
// we have to set concrete classes here, as our base class cannot be
// concrete due to serviceLoader
protected EC2ApiMetadata(EC2ApiMetadataBuilder<?> builder) {
super(builder);
}
public static class EC2ApiMetadataBuilder<B extends EC2ApiMetadataBuilder<B>> extends Builder<B> {
@Override
public EC2ApiMetadata build() {
return new EC2ApiMetadata(this);
}
}
private static class EC2ConcreteBuilder extends EC2ApiMetadataBuilder<EC2ConcreteBuilder> {
@Override
public EC2ApiMetadata build() {
return new EC2ApiMetadata(this);
}
}
private static EC2ConcreteBuilder builder() {
return new EC2ConcreteBuilder();
}
@Override
public EC2ApiMetadataBuilder<?> toBuilder() {
return builder().fromApiMetadata(this);
}
}

View File

@ -21,6 +21,7 @@ package org.jclouds.ec2;
import static org.jclouds.Constants.PROPERTY_API_VERSION;
import static org.jclouds.aws.reference.AWSConstants.PROPERTY_AUTH_TAG;
import static org.jclouds.aws.reference.AWSConstants.PROPERTY_HEADER_TAG;
import static org.jclouds.compute.config.ComputeServiceProperties.RESOURCENAME_DELIMITER;
import static org.jclouds.ec2.reference.EC2Constants.PROPERTY_EC2_AMI_OWNERS;
import static org.jclouds.ec2.reference.EC2Constants.PROPERTY_EC2_AUTO_ALLOCATE_ELASTIC_IPS;
import static org.jclouds.ec2.reference.EC2Constants.PROPERTY_EC2_TIMEOUT_SECURITYGROUP_PRESENT;
@ -44,6 +45,7 @@ public class EC2PropertiesBuilder extends PropertiesBuilder {
properties.setProperty(PROPERTY_EC2_AMI_OWNERS, "*");
properties.setProperty(PROPERTY_EC2_TIMEOUT_SECURITYGROUP_PRESENT, "500");
properties.setProperty(PROPERTY_EC2_AUTO_ALLOCATE_ELASTIC_IPS, "false");
properties.setProperty(RESOURCENAME_DELIMITER, "#");
return properties;
}

View File

@ -21,16 +21,16 @@ package org.jclouds.ec2.compute;
import static com.google.common.collect.Iterables.concat;
import static com.google.common.collect.Iterables.filter;
import static com.google.common.collect.Iterables.transform;
import static org.jclouds.compute.config.ComputeServiceProperties.RESOURCENAME_DELIMITER;
import static org.jclouds.util.Preconditions2.checkNotEmpty;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.atomic.AtomicReference;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Provider;
import javax.inject.Singleton;
@ -73,8 +73,9 @@ import com.google.common.base.Predicate;
import com.google.common.base.Supplier;
import com.google.common.cache.LoadingCache;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.ImmutableMultimap.Builder;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableMultimap.Builder;
import com.google.inject.Inject;
/**
* @author Adrian Cole
@ -111,6 +112,10 @@ public class EC2ComputeService extends BaseComputeService {
this.securityGroupMap = securityGroupMap;
}
@Inject(optional = true)
@Named(RESOURCENAME_DELIMITER)
char delimiter = '#';
/**
* @throws IllegalStateException If the security group was in use
*/
@ -118,7 +123,7 @@ public class EC2ComputeService extends BaseComputeService {
void deleteSecurityGroup(String region, String group) {
checkNotEmpty(region, "region");
checkNotEmpty(group, "group");
String groupName = String.format("jclouds#%s#%s", group, region);
String groupName = String.format("jclouds#%s#%s", group, region).replace('#', delimiter);
if (ec2Client.getSecurityGroupServices().describeSecurityGroupsInRegion(region, groupName).size() > 0) {
logger.debug(">> deleting securityGroup(%s)", groupName);
ec2Client.getSecurityGroupServices().deleteSecurityGroupInRegion(region, groupName);
@ -133,11 +138,11 @@ public class EC2ComputeService extends BaseComputeService {
for (KeyPair keyPair : ec2Client.getKeyPairServices().describeKeyPairsInRegion(region)) {
if (
// when the keypair is unique per group
keyPair.getKeyName().equals("jclouds#" + group)
|| keyPair.getKeyName().matches(String.format("jclouds#%s#%s", group, "[0-9a-f]+"))
keyPair.getKeyName().equals("jclouds"+ delimiter + group)
|| keyPair.getKeyName().matches(String.format("jclouds#%s#%s", group, "[0-9a-f]+").replace('#', delimiter))
// old keypair pattern too verbose as it has an unnecessary
// region qualifier
|| keyPair.getKeyName().matches(String.format("jclouds#%s#%s#%s", group, region, "[0-9a-f]+"))) {
|| keyPair.getKeyName().matches(String.format("jclouds#%s#%s#%s", group, region, "[0-9a-f]+").replace('#', delimiter))) {
Set<String> instancesUsingKeyPair = extractIdsFromInstances(filter(concat(ec2Client.getInstanceServices()
.describeInstancesInRegion(region)), usingKeyPairAndNotDead(keyPair)));
if (instancesUsingKeyPair.size() > 0) {

View File

@ -35,7 +35,7 @@ import org.jclouds.compute.domain.Image;
import org.jclouds.concurrent.RetryOnTimeOutExceptionSupplier;
import org.jclouds.ec2.compute.EC2ComputeService;
import org.jclouds.ec2.compute.domain.RegionAndName;
import org.jclouds.ec2.compute.functions.RegionAndIdToImage;
import org.jclouds.ec2.compute.loaders.RegionAndIdToImage;
import org.jclouds.ec2.compute.suppliers.RegionAndNameToImageSupplier;
import org.jclouds.rest.AuthorizationException;
import org.jclouds.rest.suppliers.SetAndThrowAuthorizationExceptionSupplier;

View File

@ -42,14 +42,14 @@ import org.jclouds.ec2.EC2Client;
import org.jclouds.ec2.compute.EC2ComputeService;
import org.jclouds.ec2.compute.domain.RegionAndName;
import org.jclouds.ec2.compute.functions.AddElasticIpsToNodemetadata;
import org.jclouds.ec2.compute.functions.CreateSecurityGroupIfNeeded;
import org.jclouds.ec2.compute.functions.CreateUniqueKeyPair;
import org.jclouds.ec2.compute.functions.CredentialsForInstance;
import org.jclouds.ec2.compute.functions.LoadPublicIpForInstanceOrNull;
import org.jclouds.ec2.compute.functions.RegionAndIdToImage;
import org.jclouds.ec2.compute.functions.RunningInstanceToNodeMetadata;
import org.jclouds.ec2.compute.functions.WindowsLoginCredentialsFromEncryptedData;
import org.jclouds.ec2.compute.internal.EC2TemplateBuilderImpl;
import org.jclouds.ec2.compute.loaders.CreateSecurityGroupIfNeeded;
import org.jclouds.ec2.compute.loaders.LoadPublicIpForInstanceOrNull;
import org.jclouds.ec2.compute.loaders.RegionAndIdToImage;
import org.jclouds.ec2.compute.options.EC2TemplateOptions;
import org.jclouds.ec2.compute.predicates.SecurityGroupPresent;
import org.jclouds.ec2.domain.InstanceState;

View File

@ -19,9 +19,9 @@
package org.jclouds.ec2.compute.functions;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.jclouds.compute.config.ComputeServiceProperties.RESOURCENAME_DELIMITER;
import javax.annotation.Resource;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
@ -34,6 +34,7 @@ import org.jclouds.logging.Logger;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Function;
import com.google.common.base.Supplier;
import com.google.inject.Inject;
/**
*
@ -74,8 +75,12 @@ public class CreateUniqueKeyPair implements Function<RegionAndName, KeyPair> {
}
return keyPair;
}
@Inject(optional=true)
@Named(RESOURCENAME_DELIMITER)
char delimiter = '#';
private String getNextName(String region, String group) {
return String.format("jclouds#%s#%s#%s", group, region, randomSuffix.get());
return String.format("jclouds#%s#%s#%s", group, region, randomSuffix.get()).replace('#', delimiter);
}
}

View File

@ -21,15 +21,16 @@ package org.jclouds.ec2.compute.functions;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Predicates.not;
import static com.google.common.collect.Iterables.filter;
import static org.jclouds.compute.config.ComputeServiceProperties.RESOURCENAME_DELIMITER;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.Map.Entry;
import javax.annotation.Resource;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import org.jclouds.collect.Memoized;
@ -60,11 +61,12 @@ import com.google.common.base.Supplier;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSet.Builder;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.common.collect.ImmutableSet.Builder;
import com.google.common.util.concurrent.UncheckedExecutionException;
import com.google.inject.Inject;
/**
* @author Adrian Cole
@ -195,6 +197,10 @@ public class RunningInstanceToNodeMetadata implements Function<RunningInstance,
return group;
}
@Inject(optional = true)
@Named(RESOURCENAME_DELIMITER)
char delimiter = '#';
private String parseGroupFrom(final RunningInstance instance, final Set<String> data) {
String group = null;
try {
@ -202,13 +208,13 @@ public class RunningInstanceToNodeMetadata implements Function<RunningInstance,
@Override
public boolean apply(String input) {
return input.startsWith("jclouds#") && input.contains("#" + instance.getRegion());
return input.startsWith("jclouds" + delimiter) && input.contains(delimiter + instance.getRegion());
}
})).split("#")[1];
})).split(delimiter + "")[1];
} catch (NoSuchElementException e) {
logger.debug("no group parsed from %s's data: %s", instance.getId(), data);
} catch (IllegalArgumentException e) {
logger.debug("too many groups match %s; %s's data: %s", "jclouds#", instance.getId(), data);
logger.debug("too many groups match %s%s; %s's data: %s", "jclouds", delimiter, instance.getId(), data);
}
return group;
}

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.ec2.compute.functions;
package org.jclouds.ec2.compute.loaders;
import static com.google.common.base.Preconditions.checkNotNull;
@ -92,13 +92,13 @@ public class CreateSecurityGroupIfNeeded extends CacheLoader<RegionAndName, Stri
}
}
private void createIngressRuleForTCPPort(String region, String name, int port) {
protected void createIngressRuleForTCPPort(String region, String name, int port) {
logger.debug(">> authorizing securityGroup region(%s) name(%s) port(%s)", region, name, port);
securityClient.authorizeSecurityGroupIngressInRegion(region, name, IpProtocol.TCP, port, port, "0.0.0.0/0");
logger.debug("<< authorized securityGroup(%s)", name);
}
private void authorizeGroupToItself(String region, String name) {
protected void authorizeGroupToItself(String region, String name) {
logger.debug(">> authorizing securityGroup region(%s) name(%s) permission to itself", region, name);
String myOwnerId = Iterables.get(securityClient.describeSecurityGroupsInRegion(region, name), 0).getOwnerId();
securityClient.authorizeSecurityGroupIngressInRegion(region, name, new UserIdGroupPair(myOwnerId, name));

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.ec2.compute.functions;
package org.jclouds.ec2.compute.loaders;
import java.util.NoSuchElementException;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.ec2.compute.functions;
package org.jclouds.ec2.compute.loaders;
import static org.jclouds.ec2.options.DescribeImagesOptions.Builder.imageIds;
@ -29,6 +29,7 @@ import javax.inject.Singleton;
import org.jclouds.compute.domain.Image;
import org.jclouds.ec2.EC2Client;
import org.jclouds.ec2.compute.domain.RegionAndName;
import org.jclouds.ec2.compute.functions.EC2ImageParser;
import org.jclouds.logging.Logger;
import com.google.common.cache.CacheLoader;

View File

@ -21,13 +21,13 @@ package org.jclouds.ec2.compute.strategy;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
import static org.jclouds.compute.config.ComputeServiceProperties.RESOURCENAME_DELIMITER;
import static org.jclouds.crypto.SshKeys.fingerprintPrivateKey;
import static org.jclouds.crypto.SshKeys.sha1PrivateKey;
import java.util.Set;
import java.util.concurrent.ConcurrentMap;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Provider;
import javax.inject.Singleton;
@ -47,6 +47,7 @@ import com.google.common.base.Function;
import com.google.common.cache.LoadingCache;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSet.Builder;
import com.google.inject.Inject;
/**
*
@ -159,12 +160,16 @@ public class CreateKeyPairAndSecurityGroupsAsNeededAndReturnRunOptions {
return keyPair.getKeyName();
}
@Inject(optional = true)
@Named(RESOURCENAME_DELIMITER)
char delimiter = '#';
@VisibleForTesting
public Set<String> getSecurityGroupsForTagAndOptions(String region, @Nullable String group, TemplateOptions options) {
Builder<String> groups = ImmutableSet.<String> builder();
if (group != null) {
String markerGroup = String.format("jclouds#%s#%s", group, region);
String markerGroup = String.format("jclouds#%s#%s", group, region).replace('#', delimiter);
groups.add(markerGroup);
RegionNameAndIngressRules regionNameAndIngessRulesForMarkerGroup;

View File

@ -19,7 +19,6 @@
package org.jclouds.ec2.services;
import static org.jclouds.aws.reference.FormParameters.ACTION;
import static org.jclouds.aws.reference.FormParameters.VERSION;
import java.util.Map;
import java.util.Set;
@ -29,12 +28,11 @@ import javax.ws.rs.POST;
import javax.ws.rs.Path;
import org.jclouds.aws.filters.FormSigner;
import org.jclouds.ec2.EC2AsyncClient;
import org.jclouds.ec2.binders.BindUserGroupsToIndexedFormParams;
import org.jclouds.ec2.binders.BindUserIdsToIndexedFormParams;
import org.jclouds.ec2.domain.Image;
import org.jclouds.ec2.domain.Image.EbsBlockDevice;
import org.jclouds.ec2.domain.Permission;
import org.jclouds.ec2.domain.Image.EbsBlockDevice;
import org.jclouds.ec2.options.CreateImageOptions;
import org.jclouds.ec2.options.DescribeImagesOptions;
import org.jclouds.ec2.options.RegisterImageBackedByEbsOptions;
@ -63,7 +61,6 @@ import com.google.common.util.concurrent.ListenableFuture;
* @author Adrian Cole
*/
@RequestFilters(FormSigner.class)
@FormParams(keys = VERSION, values = EC2AsyncClient.VERSION)
@VirtualHost
public interface AMIAsyncClient {

View File

@ -19,7 +19,6 @@
package org.jclouds.ec2.services;
import static org.jclouds.aws.reference.FormParameters.ACTION;
import static org.jclouds.aws.reference.FormParameters.VERSION;
import java.net.URI;
import java.util.Map;
@ -29,7 +28,6 @@ import javax.ws.rs.POST;
import javax.ws.rs.Path;
import org.jclouds.aws.filters.FormSigner;
import org.jclouds.ec2.EC2AsyncClient;
import org.jclouds.ec2.domain.AvailabilityZoneInfo;
import org.jclouds.ec2.options.DescribeAvailabilityZonesOptions;
import org.jclouds.ec2.options.DescribeRegionsOptions;
@ -54,7 +52,6 @@ import com.google.common.util.concurrent.ListenableFuture;
* @author Adrian Cole
*/
@RequestFilters(FormSigner.class)
@FormParams(keys = VERSION, values = EC2AsyncClient.VERSION)
@VirtualHost
public interface AvailabilityZoneAndRegionAsyncClient {

View File

@ -19,7 +19,6 @@
package org.jclouds.ec2.services;
import static org.jclouds.aws.reference.FormParameters.ACTION;
import static org.jclouds.aws.reference.FormParameters.VERSION;
import java.util.Set;
@ -28,7 +27,6 @@ import javax.ws.rs.POST;
import javax.ws.rs.Path;
import org.jclouds.aws.filters.FormSigner;
import org.jclouds.ec2.EC2AsyncClient;
import org.jclouds.ec2.binders.BindUserGroupsToIndexedFormParams;
import org.jclouds.ec2.binders.BindUserIdsToIndexedFormParams;
import org.jclouds.ec2.binders.BindVolumeIdsToIndexedFormParams;
@ -67,7 +65,6 @@ import com.google.common.util.concurrent.ListenableFuture;
* @author Adrian Cole
*/
@RequestFilters(FormSigner.class)
@FormParams(keys = VERSION, values = EC2AsyncClient.VERSION)
@VirtualHost
public interface ElasticBlockStoreAsyncClient {

View File

@ -19,7 +19,6 @@
package org.jclouds.ec2.services;
import static org.jclouds.aws.reference.FormParameters.ACTION;
import static org.jclouds.aws.reference.FormParameters.VERSION;
import java.util.Set;
@ -28,7 +27,6 @@ import javax.ws.rs.POST;
import javax.ws.rs.Path;
import org.jclouds.aws.filters.FormSigner;
import org.jclouds.ec2.EC2AsyncClient;
import org.jclouds.ec2.binders.BindPublicIpsToIndexedFormParams;
import org.jclouds.ec2.domain.PublicIpInstanceIdPair;
import org.jclouds.ec2.xml.AllocateAddressResponseHandler;
@ -53,7 +51,6 @@ import com.google.common.util.concurrent.ListenableFuture;
* @author Adrian Cole
*/
@RequestFilters(FormSigner.class)
@FormParams(keys = VERSION, values = EC2AsyncClient.VERSION)
@VirtualHost
public interface ElasticIPAddressAsyncClient {

View File

@ -19,7 +19,6 @@
package org.jclouds.ec2.services;
import static org.jclouds.aws.reference.FormParameters.ACTION;
import static org.jclouds.aws.reference.FormParameters.VERSION;
import java.util.Map;
import java.util.Set;
@ -29,7 +28,6 @@ import javax.ws.rs.POST;
import javax.ws.rs.Path;
import org.jclouds.aws.filters.FormSigner;
import org.jclouds.ec2.EC2AsyncClient;
import org.jclouds.ec2.binders.BindBlockDeviceMappingToIndexedFormParams;
import org.jclouds.ec2.binders.BindInstanceIdsToIndexedFormParams;
import org.jclouds.ec2.binders.IfNotNullBindAvailabilityZoneToFormParam;
@ -70,7 +68,6 @@ import com.google.common.util.concurrent.ListenableFuture;
* @author Adrian Cole
*/
@RequestFilters(FormSigner.class)
@FormParams(keys = VERSION, values = EC2AsyncClient.VERSION)
@VirtualHost
public interface InstanceAsyncClient {

View File

@ -19,7 +19,6 @@
package org.jclouds.ec2.services;
import static org.jclouds.aws.reference.FormParameters.ACTION;
import static org.jclouds.aws.reference.FormParameters.VERSION;
import java.util.Set;
@ -28,7 +27,6 @@ import javax.ws.rs.POST;
import javax.ws.rs.Path;
import org.jclouds.aws.filters.FormSigner;
import org.jclouds.ec2.EC2AsyncClient;
import org.jclouds.ec2.binders.BindKeyNamesToIndexedFormParams;
import org.jclouds.ec2.domain.KeyPair;
import org.jclouds.ec2.xml.DescribeKeyPairsResponseHandler;
@ -53,7 +51,6 @@ import com.google.common.util.concurrent.ListenableFuture;
* @author Adrian Cole
*/
@RequestFilters(FormSigner.class)
@FormParams(keys = VERSION, values = EC2AsyncClient.VERSION)
@VirtualHost
public interface KeyPairAsyncClient {

View File

@ -19,7 +19,6 @@
package org.jclouds.ec2.services;
import static org.jclouds.aws.reference.FormParameters.ACTION;
import static org.jclouds.aws.reference.FormParameters.VERSION;
import java.util.Set;
@ -28,7 +27,6 @@ import javax.ws.rs.POST;
import javax.ws.rs.Path;
import org.jclouds.aws.filters.FormSigner;
import org.jclouds.ec2.EC2AsyncClient;
import org.jclouds.ec2.binders.BindGroupNamesToIndexedFormParams;
import org.jclouds.ec2.binders.BindUserIdGroupPairToSourceSecurityGroupFormParams;
import org.jclouds.ec2.domain.IpProtocol;
@ -56,7 +54,6 @@ import com.google.common.util.concurrent.ListenableFuture;
* @author Adrian Cole
*/
@RequestFilters(FormSigner.class)
@FormParams(keys = VERSION, values = EC2AsyncClient.VERSION)
@VirtualHost
public interface SecurityGroupAsyncClient {

View File

@ -19,7 +19,6 @@
package org.jclouds.ec2.services;
import static org.jclouds.aws.reference.FormParameters.ACTION;
import static org.jclouds.aws.reference.FormParameters.VERSION;
import java.util.Set;
@ -28,7 +27,6 @@ import javax.ws.rs.POST;
import javax.ws.rs.Path;
import org.jclouds.aws.filters.FormSigner;
import org.jclouds.ec2.EC2AsyncClient;
import org.jclouds.ec2.binders.BindBundleIdsToIndexedFormParams;
import org.jclouds.ec2.binders.BindS3UploadPolicyAndSignature;
import org.jclouds.ec2.domain.BundleTask;
@ -57,7 +55,6 @@ import com.google.common.util.concurrent.ListenableFuture;
* @author Adrian Cole
*/
@RequestFilters(FormSigner.class)
@FormParams(keys = VERSION, values = EC2AsyncClient.VERSION)
@VirtualHost
public interface WindowsAsyncClient {

View File

@ -110,7 +110,8 @@ public class DescribeImagesResponseHandler extends ParseSax.HandlerForGeneratedR
public void endElement(String uri, String name, String qName) {
if (qName.equals("architecture")) {
architecture = Architecture.fromValue(currentText.toString().trim());
} else if (qName.equals("name")) {
// Nova Diablo uses the wrong name for this field
} else if (qName.equals("name") || qName.equals("displayName")) {
this.name = currentText.toString().trim();
} else if (qName.equals("description")) {
description = currentText.toString().trim();

View File

@ -0,0 +1 @@
org.jclouds.ec2.EC2ApiMetadata

View File

@ -0,0 +1,35 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.ec2;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadataTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "unit", testName = "EC2ApiMetadataTest")
public class EC2ApiMetadataTest extends BaseApiMetadataTest {
public EC2ApiMetadataTest() {
super(new EC2ApiMetadata(), ApiType.COMPUTE);
}
}

View File

@ -25,7 +25,7 @@ import static org.testng.Assert.fail;
import org.jclouds.compute.domain.Image;
import org.jclouds.ec2.compute.domain.RegionAndName;
import org.jclouds.ec2.compute.functions.RegionAndIdToImage;
import org.jclouds.ec2.compute.loaders.RegionAndIdToImage;
import org.jclouds.rest.AuthorizationException;
import org.testng.annotations.Test;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.ec2.compute.functions;
package org.jclouds.ec2.compute.loaders;
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.createNiceMock;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.ec2.compute.functions;
package org.jclouds.ec2.compute.loaders;
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.expect;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.ec2.compute.functions;
package org.jclouds.ec2.compute.loaders;
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.createNiceMock;
@ -33,6 +33,7 @@ import java.util.concurrent.ExecutionException;
import org.jclouds.compute.domain.Image;
import org.jclouds.ec2.EC2Client;
import org.jclouds.ec2.compute.domain.RegionAndName;
import org.jclouds.ec2.compute.functions.EC2ImageParser;
import org.jclouds.ec2.services.AMIClient;
import org.jclouds.rest.ResourceNotFoundException;
import org.testng.annotations.Test;

View File

@ -58,7 +58,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=CreateImage&InstanceId=instanceId&Name=name",
assertPayloadEquals(request, "Action=CreateImage&InstanceId=instanceId&Name=name",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
assertSaxResponseParserClassEquals(method, ImageIdHandler.class);
@ -77,7 +77,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(
request,
"Version=2010-06-15&Action=CreateImage&InstanceId=instanceId&Name=name&Description=description&NoReboot=true",
"Action=CreateImage&InstanceId=instanceId&Name=name&Description=description&NoReboot=true",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -94,7 +94,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=DescribeImages", "application/x-www-form-urlencoded",
assertPayloadEquals(request, "Action=DescribeImages", "application/x-www-form-urlencoded",
false);
filter.filter(request);
assertPayloadEquals(
@ -119,7 +119,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(
request,
"Version=2010-06-15&Action=DescribeImages&ExecutableBy=me&Owner.1=fred&Owner.2=nancy&ImageId.1=1&ImageId.2=2",
"Action=DescribeImages&ExecutableBy=me&Owner.1=fred&Owner.2=nancy&ImageId.1=1&ImageId.2=2",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -135,7 +135,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=DeregisterImage&ImageId=imageId",
assertPayloadEquals(request, "Action=DeregisterImage&ImageId=imageId",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@ -152,7 +152,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=RegisterImage&ImageLocation=pathToManifest&Name=name",
assertPayloadEquals(request, "Action=RegisterImage&ImageLocation=pathToManifest&Name=name",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
assertSaxResponseParserClassEquals(method, ImageIdHandler.class);
@ -171,7 +171,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(
request,
"Version=2010-06-15&Action=RegisterImage&ImageLocation=pathToManifest&Name=name&Description=description",
"Action=RegisterImage&ImageLocation=pathToManifest&Name=name&Description=description",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -190,7 +190,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(
request,
"Version=2010-06-15&Action=RegisterImage&RootDeviceName=%2Fdev%2Fsda1&BlockDeviceMapping.0.DeviceName=%2Fdev%2Fsda1&BlockDeviceMapping.0.Ebs.SnapshotId=snapshotId&Name=imageName",
"Action=RegisterImage&RootDeviceName=%2Fdev%2Fsda1&BlockDeviceMapping.0.DeviceName=%2Fdev%2Fsda1&BlockDeviceMapping.0.Ebs.SnapshotId=snapshotId&Name=imageName",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
assertSaxResponseParserClassEquals(method, ImageIdHandler.class);
@ -210,7 +210,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(
request,
"Version=2010-06-15&Action=RegisterImage&RootDeviceName=%2Fdev%2Fsda1&BlockDeviceMapping.0.DeviceName=%2Fdev%2Fsda1&BlockDeviceMapping.0.Ebs.SnapshotId=snapshotId&Name=imageName&Description=description&BlockDeviceMapping.1.Ebs.DeleteOnTermination=false&BlockDeviceMapping.1.DeviceName=%2Fdev%2Fdevice&BlockDeviceMapping.1.Ebs.SnapshotId=snapshot&BlockDeviceMapping.2.Ebs.DeleteOnTermination=false&BlockDeviceMapping.2.DeviceName=%2Fdev%2Fnewdevice&BlockDeviceMapping.2.VirtualName=newblock&BlockDeviceMapping.2.Ebs.VolumeSize=100",
"Action=RegisterImage&RootDeviceName=%2Fdev%2Fsda1&BlockDeviceMapping.0.DeviceName=%2Fdev%2Fsda1&BlockDeviceMapping.0.Ebs.SnapshotId=snapshotId&Name=imageName&Description=description&BlockDeviceMapping.1.Ebs.DeleteOnTermination=false&BlockDeviceMapping.1.DeviceName=%2Fdev%2Fdevice&BlockDeviceMapping.1.Ebs.SnapshotId=snapshot&BlockDeviceMapping.2.Ebs.DeleteOnTermination=false&BlockDeviceMapping.2.DeviceName=%2Fdev%2Fnewdevice&BlockDeviceMapping.2.VirtualName=newblock&BlockDeviceMapping.2.Ebs.VolumeSize=100",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -228,7 +228,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request,
"Version=2010-06-15&Action=DescribeImageAttribute&Attribute=blockDeviceMapping&ImageId=imageId",
"Action=DescribeImageAttribute&Attribute=blockDeviceMapping&ImageId=imageId",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -245,7 +245,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request,
"Version=2010-06-15&Action=DescribeImageAttribute&Attribute=launchPermission&ImageId=imageId",
"Action=DescribeImageAttribute&Attribute=launchPermission&ImageId=imageId",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -265,7 +265,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(
request,
"Version=2010-06-15&Action=ModifyImageAttribute&OperationType=add&Attribute=launchPermission&ImageId=imageId&UserGroup.1=all&UserId.1=bob&UserId.2=sue",
"Action=ModifyImageAttribute&OperationType=add&Attribute=launchPermission&ImageId=imageId&UserGroup.1=all&UserId.1=bob&UserId.2=sue",
"application/x-www-form-urlencoded", false);
filter.filter(request);
assertPayloadEquals(
@ -290,7 +290,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(
request,
"Version=2010-06-15&Action=ModifyImageAttribute&OperationType=remove&Attribute=launchPermission&ImageId=imageId&UserGroup.1=all&UserId.1=bob&UserId.2=sue",
"Action=ModifyImageAttribute&OperationType=remove&Attribute=launchPermission&ImageId=imageId&UserGroup.1=all&UserId.1=bob&UserId.2=sue",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
assertSaxResponseParserClassEquals(method, null);
@ -307,7 +307,7 @@ public class AMIAsyncClientTest extends BaseEC2AsyncClientTest<AMIAsyncClient> {
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request,
"Version=2010-06-15&Action=ResetImageAttribute&Attribute=launchPermission&ImageId=imageId",
"Action=ResetImageAttribute&Attribute=launchPermission&ImageId=imageId",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
assertSaxResponseParserClassEquals(method, null);

View File

@ -55,7 +55,7 @@ public class AvailabilityZoneAndRegionAsyncClientTest extends
assertRequestLineEquals(request, "POST https://ec2.us-west-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-west-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=DescribeAvailabilityZones",
assertPayloadEquals(request, "Action=DescribeAvailabilityZones",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -73,7 +73,7 @@ public class AvailabilityZoneAndRegionAsyncClientTest extends
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request,
"Version=2010-06-15&Action=DescribeAvailabilityZones&ZoneName.1=us-east-1a&ZoneName.2=us-east-1b",
"Action=DescribeAvailabilityZones&ZoneName.1=us-east-1a&ZoneName.2=us-east-1b",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -90,7 +90,7 @@ public class AvailabilityZoneAndRegionAsyncClientTest extends
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=DescribeRegions", "application/x-www-form-urlencoded",
assertPayloadEquals(request, "Action=DescribeRegions", "application/x-www-form-urlencoded",
false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -108,7 +108,7 @@ public class AvailabilityZoneAndRegionAsyncClientTest extends
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request,
"Version=2010-06-15&Action=DescribeRegions&RegionName.1=us-east-1&RegionName.2=us-west-1",
"Action=DescribeRegions&RegionName.1=us-east-1&RegionName.2=us-west-1",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);

View File

@ -61,7 +61,7 @@ public class ElasticBlockStoreAsyncClientTest extends BaseEC2AsyncClientTest<Ela
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=CreateVolume&AvailabilityZone=us-east-1a&Size=20",
assertPayloadEquals(request, "Action=CreateVolume&AvailabilityZone=us-east-1a&Size=20",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -79,7 +79,7 @@ public class ElasticBlockStoreAsyncClientTest extends BaseEC2AsyncClientTest<Ela
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request,
"Version=2010-06-15&Action=CreateVolume&AvailabilityZone=us-east-1a&SnapshotId=snapshotId",
"Action=CreateVolume&AvailabilityZone=us-east-1a&SnapshotId=snapshotId",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -97,7 +97,7 @@ public class ElasticBlockStoreAsyncClientTest extends BaseEC2AsyncClientTest<Ela
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request,
"Version=2010-06-15&Action=CreateVolume&AvailabilityZone=us-east-1a&SnapshotId=snapshotId&Size=15",
"Action=CreateVolume&AvailabilityZone=us-east-1a&SnapshotId=snapshotId&Size=15",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -113,7 +113,7 @@ public class ElasticBlockStoreAsyncClientTest extends BaseEC2AsyncClientTest<Ela
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=DeleteVolume&VolumeId=id",
assertPayloadEquals(request, "Action=DeleteVolume&VolumeId=id",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@ -130,7 +130,7 @@ public class ElasticBlockStoreAsyncClientTest extends BaseEC2AsyncClientTest<Ela
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=DescribeVolumes", "application/x-www-form-urlencoded",
assertPayloadEquals(request, "Action=DescribeVolumes", "application/x-www-form-urlencoded",
false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -147,7 +147,7 @@ public class ElasticBlockStoreAsyncClientTest extends BaseEC2AsyncClientTest<Ela
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=DescribeVolumes&VolumeId.1=1&VolumeId.2=2",
assertPayloadEquals(request, "Action=DescribeVolumes&VolumeId.1=1&VolumeId.2=2",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -165,7 +165,7 @@ public class ElasticBlockStoreAsyncClientTest extends BaseEC2AsyncClientTest<Ela
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request,
"Version=2010-06-15&Action=AttachVolume&InstanceId=instanceId&VolumeId=id&Device=%2Fdevice",
"Action=AttachVolume&InstanceId=instanceId&VolumeId=id&Device=%2Fdevice",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -182,7 +182,7 @@ public class ElasticBlockStoreAsyncClientTest extends BaseEC2AsyncClientTest<Ela
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=DetachVolume&Force=false&VolumeId=id",
assertPayloadEquals(request, "Action=DetachVolume&Force=false&VolumeId=id",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@ -201,7 +201,7 @@ public class ElasticBlockStoreAsyncClientTest extends BaseEC2AsyncClientTest<Ela
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request,
"Version=2010-06-15&Action=DetachVolume&Force=true&VolumeId=id&InstanceId=instanceId&Device=%2Fdevice",
"Action=DetachVolume&Force=true&VolumeId=id&InstanceId=instanceId&Device=%2Fdevice",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@ -218,7 +218,7 @@ public class ElasticBlockStoreAsyncClientTest extends BaseEC2AsyncClientTest<Ela
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=CreateSnapshot&VolumeId=volumeId",
assertPayloadEquals(request, "Action=CreateSnapshot&VolumeId=volumeId",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -237,7 +237,7 @@ public class ElasticBlockStoreAsyncClientTest extends BaseEC2AsyncClientTest<Ela
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request,
"Version=2010-06-15&Action=CreateSnapshot&VolumeId=volumeId&Description=description",
"Action=CreateSnapshot&VolumeId=volumeId&Description=description",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -254,7 +254,7 @@ public class ElasticBlockStoreAsyncClientTest extends BaseEC2AsyncClientTest<Ela
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=DescribeSnapshots", "application/x-www-form-urlencoded",
assertPayloadEquals(request, "Action=DescribeSnapshots", "application/x-www-form-urlencoded",
false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -274,7 +274,7 @@ public class ElasticBlockStoreAsyncClientTest extends BaseEC2AsyncClientTest<Ela
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(
request,
"Version=2010-06-15&Action=DescribeSnapshots&Owner.1=o1&Owner.2=o2&RestorableBy.1=r1&RestorableBy.2=r2&SnapshotId.1=s1&SnapshotId.2=s2",
"Action=DescribeSnapshots&Owner.1=o1&Owner.2=o2&RestorableBy.1=r1&RestorableBy.2=r2&SnapshotId.1=s1&SnapshotId.2=s2",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -293,7 +293,7 @@ public class ElasticBlockStoreAsyncClientTest extends BaseEC2AsyncClientTest<Ela
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(
request,
"Version=2010-06-15&Action=DescribeSnapshotAttribute&Attribute=createVolumePermission&SnapshotId=snapshotId",
"Action=DescribeSnapshotAttribute&Attribute=createVolumePermission&SnapshotId=snapshotId",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -313,7 +313,7 @@ public class ElasticBlockStoreAsyncClientTest extends BaseEC2AsyncClientTest<Ela
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(
request,
"Version=2010-06-15&Action=ModifySnapshotAttribute&OperationType=add&Attribute=createVolumePermission&SnapshotId=snapshotId&UserGroup.1=all&UserId.1=bob&UserId.2=sue",
"Action=ModifySnapshotAttribute&OperationType=add&Attribute=createVolumePermission&SnapshotId=snapshotId&UserGroup.1=all&UserId.1=bob&UserId.2=sue",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@ -334,7 +334,7 @@ public class ElasticBlockStoreAsyncClientTest extends BaseEC2AsyncClientTest<Ela
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(
request,
"Version=2010-06-15&Action=ModifySnapshotAttribute&OperationType=remove&Attribute=createVolumePermission&SnapshotId=snapshotId&UserGroup.1=all&UserId.1=bob&UserId.2=sue",
"Action=ModifySnapshotAttribute&OperationType=remove&Attribute=createVolumePermission&SnapshotId=snapshotId&UserGroup.1=all&UserId.1=bob&UserId.2=sue",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
assertSaxResponseParserClassEquals(method, null);
@ -353,7 +353,7 @@ public class ElasticBlockStoreAsyncClientTest extends BaseEC2AsyncClientTest<Ela
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(
request,
"Version=2010-06-15&Action=ResetSnapshotAttribute&Attribute=createVolumePermission&SnapshotId=snapshotId",
"Action=ResetSnapshotAttribute&Attribute=createVolumePermission&SnapshotId=snapshotId",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
assertSaxResponseParserClassEquals(method, null);

View File

@ -49,7 +49,7 @@ public class ElasticIPAddressAsyncClientTest extends BaseEC2AsyncClientTest<Elas
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=DisassociateAddress&PublicIp=127.0.0.1",
assertPayloadEquals(request, "Action=DisassociateAddress&PublicIp=127.0.0.1",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@ -66,7 +66,7 @@ public class ElasticIPAddressAsyncClientTest extends BaseEC2AsyncClientTest<Elas
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=AssociateAddress&InstanceId=me&PublicIp=127.0.0.1",
assertPayloadEquals(request, "Action=AssociateAddress&InstanceId=me&PublicIp=127.0.0.1",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@ -82,7 +82,7 @@ public class ElasticIPAddressAsyncClientTest extends BaseEC2AsyncClientTest<Elas
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=ReleaseAddress&PublicIp=127.0.0.1",
assertPayloadEquals(request, "Action=ReleaseAddress&PublicIp=127.0.0.1",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@ -99,7 +99,7 @@ public class ElasticIPAddressAsyncClientTest extends BaseEC2AsyncClientTest<Elas
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=DescribeAddresses&PublicIp.1=127.0.0.1",
assertPayloadEquals(request, "Action=DescribeAddresses&PublicIp.1=127.0.0.1",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -115,7 +115,7 @@ public class ElasticIPAddressAsyncClientTest extends BaseEC2AsyncClientTest<Elas
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=AllocateAddress", "application/x-www-form-urlencoded",
assertPayloadEquals(request, "Action=AllocateAddress", "application/x-www-form-urlencoded",
false);
assertResponseParserClassEquals(method, request, ParseSax.class);

View File

@ -60,7 +60,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=DescribeInstances", "application/x-www-form-urlencoded",
assertPayloadEquals(request, "Action=DescribeInstances", "application/x-www-form-urlencoded",
false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -76,7 +76,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=DescribeInstances&InstanceId.1=1&InstanceId.2=2",
assertPayloadEquals(request, "Action=DescribeInstances&InstanceId.1=1&InstanceId.2=2",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -93,7 +93,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=TerminateInstances&InstanceId.1=1&InstanceId.2=2",
assertPayloadEquals(request, "Action=TerminateInstances&InstanceId.1=1&InstanceId.2=2",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -111,11 +111,11 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
try {
assertPayloadEquals(request, "Version=2010-06-15&Action=RunInstances&ImageId=ami-voo&MinCount=1&MaxCount=1",
assertPayloadEquals(request, "Action=RunInstances&ImageId=ami-voo&MinCount=1&MaxCount=1",
"application/x-www-form-urlencoded", false);
} catch (AssertionError e) {
// mvn 3.0 osx 10.6.5 somehow sorts differently
assertPayloadEquals(request, "Version=2010-06-15&Action=RunInstances&ImageId=ami-voo&MaxCount=1&MinCount=1",
assertPayloadEquals(request, "Action=RunInstances&ImageId=ami-voo&MaxCount=1&MinCount=1",
"application/x-www-form-urlencoded", false);
}
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -136,13 +136,13 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
try {
assertPayloadEquals(
request,
"Version=2010-06-15&Action=RunInstances&ImageId=ami-voo&MinCount=1&MaxCount=5&KernelId=kernelId&SecurityGroup.1=group1&SecurityGroup.2=group2&Placement.AvailabilityZone=eu-west-1a",
"Action=RunInstances&ImageId=ami-voo&MinCount=1&MaxCount=5&KernelId=kernelId&SecurityGroup.1=group1&SecurityGroup.2=group2&Placement.AvailabilityZone=eu-west-1a",
"application/x-www-form-urlencoded", false);
} catch (AssertionError e) {
// mvn 3.0 osx 10.6.5 somehow sorts differently
assertPayloadEquals(
request,
"Version=2010-06-15&Action=RunInstances&ImageId=ami-voo&MaxCount=5&MinCount=1&KernelId=kernelId&SecurityGroup.1=group1&SecurityGroup.2=group2&Placement.AvailabilityZone=eu-west-1a",
"Action=RunInstances&ImageId=ami-voo&MaxCount=5&MinCount=1&KernelId=kernelId&SecurityGroup.1=group1&SecurityGroup.2=group2&Placement.AvailabilityZone=eu-west-1a",
"application/x-www-form-urlencoded", false);
}
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -159,7 +159,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=StopInstances&Force=true&InstanceId.1=1&InstanceId.2=2",
assertPayloadEquals(request, "Action=StopInstances&Force=true&InstanceId.1=1&InstanceId.2=2",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -176,7 +176,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=RebootInstances&InstanceId.1=1&InstanceId.2=2",
assertPayloadEquals(request, "Action=RebootInstances&InstanceId.1=1&InstanceId.2=2",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@ -193,7 +193,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=StartInstances&InstanceId.1=1&InstanceId.2=2",
assertPayloadEquals(request, "Action=StartInstances&InstanceId.1=1&InstanceId.2=2",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -210,7 +210,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request,
"Version=2010-06-15&Action=DescribeInstanceAttribute&Attribute=userData&InstanceId=1",
"Action=DescribeInstanceAttribute&Attribute=userData&InstanceId=1",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -228,7 +228,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request,
"Version=2010-06-15&Action=DescribeInstanceAttribute&Attribute=rootDeviceName&InstanceId=1",
"Action=DescribeInstanceAttribute&Attribute=rootDeviceName&InstanceId=1",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -245,7 +245,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request,
"Version=2010-06-15&Action=DescribeInstanceAttribute&Attribute=ramdisk&InstanceId=1",
"Action=DescribeInstanceAttribute&Attribute=ramdisk&InstanceId=1",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -264,7 +264,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request,
"Version=2010-06-15&Action=DescribeInstanceAttribute&Attribute=disableApiTermination&InstanceId=1",
"Action=DescribeInstanceAttribute&Attribute=disableApiTermination&InstanceId=1",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -280,7 +280,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=DescribeInstanceAttribute&Attribute=kernel&InstanceId=1",
assertPayloadEquals(request, "Action=DescribeInstanceAttribute&Attribute=kernel&InstanceId=1",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -298,7 +298,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request,
"Version=2010-06-15&Action=DescribeInstanceAttribute&Attribute=instanceType&InstanceId=1",
"Action=DescribeInstanceAttribute&Attribute=instanceType&InstanceId=1",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -318,7 +318,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(
request,
"Version=2010-06-15&Action=DescribeInstanceAttribute&Attribute=instanceInitiatedShutdownBehavior&InstanceId=1",
"Action=DescribeInstanceAttribute&Attribute=instanceInitiatedShutdownBehavior&InstanceId=1",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -337,7 +337,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request,
"Version=2010-06-15&Action=DescribeInstanceAttribute&Attribute=blockDeviceMapping&InstanceId=1",
"Action=DescribeInstanceAttribute&Attribute=blockDeviceMapping&InstanceId=1",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -355,7 +355,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request,
"Version=2010-06-15&Action=ModifyInstanceAttribute&Attribute=userData&Value=dGVzdA%3D%3D&InstanceId=1",
"Action=ModifyInstanceAttribute&Attribute=userData&Value=dGVzdA%3D%3D&InstanceId=1",
"application/x-www-form-urlencoded", false);
filter.filter(request);// ensure encoding worked properly
assertPayloadEquals(
@ -377,7 +377,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request,
"Version=2010-06-15&Action=ModifyInstanceAttribute&Attribute=ramdisk&Value=test&InstanceId=1",
"Action=ModifyInstanceAttribute&Attribute=ramdisk&Value=test&InstanceId=1",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
assertSaxResponseParserClassEquals(method, null);
@ -394,7 +394,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request,
"Version=2010-06-15&Action=ModifyInstanceAttribute&Attribute=kernel&Value=test&InstanceId=1",
"Action=ModifyInstanceAttribute&Attribute=kernel&Value=test&InstanceId=1",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
assertSaxResponseParserClassEquals(method, null);
@ -413,7 +413,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(
request,
"Version=2010-06-15&Action=ModifyInstanceAttribute&Attribute=disableApiTermination&Value=true&InstanceId=1",
"Action=ModifyInstanceAttribute&Attribute=disableApiTermination&Value=true&InstanceId=1",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@ -431,7 +431,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request,
"Version=2010-06-15&Action=ModifyInstanceAttribute&Attribute=instanceType&Value=c1.medium&InstanceId=1",
"Action=ModifyInstanceAttribute&Attribute=instanceType&Value=c1.medium&InstanceId=1",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@ -451,7 +451,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(
request,
"Version=2010-06-15&Action=ModifyInstanceAttribute&Attribute=instanceInitiatedShutdownBehavior&Value=terminate&InstanceId=1",
"Action=ModifyInstanceAttribute&Attribute=instanceInitiatedShutdownBehavior&Value=terminate&InstanceId=1",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@ -474,7 +474,7 @@ public class InstanceAsyncClientTest extends BaseEC2AsyncClientTest<InstanceAsyn
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(
request,
"Version=2010-06-15&Action=ModifyInstanceAttribute&InstanceId=1&BlockDeviceMapping.1.Ebs.VolumeId=vol-test1&BlockDeviceMapping.1.DeviceName=%2Fdev%2Fsda1&BlockDeviceMapping.1.Ebs.DeleteOnTermination=true",
"Action=ModifyInstanceAttribute&InstanceId=1&BlockDeviceMapping.1.Ebs.VolumeId=vol-test1&BlockDeviceMapping.1.DeviceName=%2Fdev%2Fsda1&BlockDeviceMapping.1.Ebs.DeleteOnTermination=true",
"application/x-www-form-urlencoded", false);
filter.filter(request);// ensure encoding worked properly
assertPayloadEquals(

View File

@ -47,7 +47,7 @@ public class KeyPairAsyncClientTest extends BaseEC2AsyncClientTest<KeyPairAsyncC
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=DeleteKeyPair&KeyName=mykey",
assertPayloadEquals(request, "Action=DeleteKeyPair&KeyName=mykey",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@ -64,7 +64,7 @@ public class KeyPairAsyncClientTest extends BaseEC2AsyncClientTest<KeyPairAsyncC
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=DescribeKeyPairs", "application/x-www-form-urlencoded",
assertPayloadEquals(request, "Action=DescribeKeyPairs", "application/x-www-form-urlencoded",
false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -81,7 +81,7 @@ public class KeyPairAsyncClientTest extends BaseEC2AsyncClientTest<KeyPairAsyncC
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=DescribeKeyPairs&KeyName.1=1&KeyName.2=2",
assertPayloadEquals(request, "Action=DescribeKeyPairs&KeyName.1=1&KeyName.2=2",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);

View File

@ -51,7 +51,7 @@ public class SecurityGroupAsyncClientTest extends BaseEC2AsyncClientTest<Securit
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=DeleteSecurityGroup&GroupName=name",
assertPayloadEquals(request, "Action=DeleteSecurityGroup&GroupName=name",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@ -69,7 +69,7 @@ public class SecurityGroupAsyncClientTest extends BaseEC2AsyncClientTest<Securit
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request,
"Version=2010-06-15&Action=CreateSecurityGroup&GroupDescription=description&GroupName=name",
"Action=CreateSecurityGroup&GroupDescription=description&GroupName=name",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@ -86,7 +86,7 @@ public class SecurityGroupAsyncClientTest extends BaseEC2AsyncClientTest<Securit
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=DescribeSecurityGroups",
assertPayloadEquals(request, "Action=DescribeSecurityGroups",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -103,7 +103,7 @@ public class SecurityGroupAsyncClientTest extends BaseEC2AsyncClientTest<Securit
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=DescribeSecurityGroups&GroupName.1=1&GroupName.2=2",
assertPayloadEquals(request, "Action=DescribeSecurityGroups&GroupName.1=1&GroupName.2=2",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -123,7 +123,7 @@ public class SecurityGroupAsyncClientTest extends BaseEC2AsyncClientTest<Securit
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(
request,
"Version=2010-06-15&Action=AuthorizeSecurityGroupIngress&GroupName=group&SourceSecurityGroupOwnerId=sourceUser&SourceSecurityGroupName=sourceGroup",
"Action=AuthorizeSecurityGroupIngress&GroupName=group&SourceSecurityGroupOwnerId=sourceUser&SourceSecurityGroupName=sourceGroup",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@ -143,13 +143,13 @@ public class SecurityGroupAsyncClientTest extends BaseEC2AsyncClientTest<Securit
try {
assertPayloadEquals(
request,
"Version=2010-06-15&Action=AuthorizeSecurityGroupIngress&CidrIp=0.0.0.0%2F0&IpProtocol=tcp&GroupName=group&FromPort=6000&ToPort=7000",
"Action=AuthorizeSecurityGroupIngress&CidrIp=0.0.0.0%2F0&IpProtocol=tcp&GroupName=group&FromPort=6000&ToPort=7000",
"application/x-www-form-urlencoded", false);
} catch (AssertionError e) {
// mvn 3.0 osx 10.6.5 somehow sorts differently
assertPayloadEquals(
request,
"Version=2010-06-15&Action=AuthorizeSecurityGroupIngress&CidrIp=0.0.0.0%2F0&IpProtocol=tcp&GroupName=group&ToPort=7000&FromPort=6000",
"Action=AuthorizeSecurityGroupIngress&CidrIp=0.0.0.0%2F0&IpProtocol=tcp&GroupName=group&ToPort=7000&FromPort=6000",
"application/x-www-form-urlencoded", false);
}
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@ -169,7 +169,7 @@ public class SecurityGroupAsyncClientTest extends BaseEC2AsyncClientTest<Securit
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(
request,
"Version=2010-06-15&Action=RevokeSecurityGroupIngress&GroupName=group&SourceSecurityGroupOwnerId=sourceUser&SourceSecurityGroupName=sourceGroup",
"Action=RevokeSecurityGroupIngress&GroupName=group&SourceSecurityGroupOwnerId=sourceUser&SourceSecurityGroupName=sourceGroup",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@ -189,13 +189,13 @@ public class SecurityGroupAsyncClientTest extends BaseEC2AsyncClientTest<Securit
try {
assertPayloadEquals(
request,
"Version=2010-06-15&Action=RevokeSecurityGroupIngress&CidrIp=0.0.0.0%2F0&IpProtocol=tcp&GroupName=group&FromPort=6000&ToPort=7000",
"Action=RevokeSecurityGroupIngress&CidrIp=0.0.0.0%2F0&IpProtocol=tcp&GroupName=group&FromPort=6000&ToPort=7000",
"application/x-www-form-urlencoded", false);
} catch (AssertionError e) {
// mvn 3.0 osx 10.6.5 somehow sorts differently
assertPayloadEquals(
request,
"Version=2010-06-15&Action=RevokeSecurityGroupIngress&CidrIp=0.0.0.0%2F0&IpProtocol=tcp&GroupName=group&ToPort=7000&FromPort=6000",
"Action=RevokeSecurityGroupIngress&CidrIp=0.0.0.0%2F0&IpProtocol=tcp&GroupName=group&ToPort=7000&FromPort=6000",
"application/x-www-form-urlencoded", false);
}
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);

View File

@ -53,7 +53,7 @@ public class WindowsAsyncClientTest extends BaseEC2AsyncClientTest<WindowsAsyncC
"my-bucket",
"{\"expiration\": \"2008-08-30T08:49:09Z\",\"conditions\": [{\"bucket\": \"my-bucket\"},[\"starts-with\", \"$key\", \"my-new-image\"]]}");
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
String payload = "Version=2010-06-15&Action=BundleInstance&Storage.S3.Prefix=winami&InstanceId=i-e468cd8d&Storage.S3.Bucket=my-bucket&Storage.S3.UploadPolicy=eyJleHBpcmF0aW9uIjogIjIwMDgtMDgtMzBUMDg6NDk6MDlaIiwiY29uZGl0aW9ucyI6IFt7ImJ1Y2tldCI6ICJteS1idWNrZXQifSxbInN0YXJ0cy13aXRoIiwgIiRrZXkiLCAibXktbmV3LWltYWdlIl1dfQ%3D%3D&Storage.S3.UploadPolicySignature=ih%2FiohGe0A7y4QVRbKaq6BZShzUsmBEJEa9AdFbxM6Y%3D";
String payload = "Action=BundleInstance&Storage.S3.Prefix=winami&InstanceId=i-e468cd8d&Storage.S3.Bucket=my-bucket&Storage.S3.UploadPolicy=eyJleHBpcmF0aW9uIjogIjIwMDgtMDgtMzBUMDg6NDk6MDlaIiwiY29uZGl0aW9ucyI6IFt7ImJ1Y2tldCI6ICJteS1idWNrZXQifSxbInN0YXJ0cy13aXRoIiwgIiRrZXkiLCAibXktbmV3LWltYWdlIl1dfQ%3D%3D&Storage.S3.UploadPolicySignature=ih%2FiohGe0A7y4QVRbKaq6BZShzUsmBEJEa9AdFbxM6Y%3D";
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, payload, "application/x-www-form-urlencoded", false);
@ -77,7 +77,7 @@ public class WindowsAsyncClientTest extends BaseEC2AsyncClientTest<WindowsAsyncC
"{\"expiration\": \"2008-08-30T08:49:09Z\",\"conditions\": [{\"bucket\": \"my-bucket\"},[\"starts-with\", \"$key\", \"my-new-image\"]]}",
BundleInstanceS3StorageOptions.Builder.bucketOwnedBy("10QMXFEV71ZS32XQFTR2"));
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
String payload = "Version=2010-06-15&Action=BundleInstance&Storage.S3.Prefix=winami&InstanceId=i-e468cd8d&Storage.S3.Bucket=my-bucket&Storage.S3.AWSAccessKeyId=10QMXFEV71ZS32XQFTR2&Storage.S3.UploadPolicy=eyJleHBpcmF0aW9uIjogIjIwMDgtMDgtMzBUMDg6NDk6MDlaIiwiY29uZGl0aW9ucyI6IFt7ImJ1Y2tldCI6ICJteS1idWNrZXQifSxbInN0YXJ0cy13aXRoIiwgIiRrZXkiLCAibXktbmV3LWltYWdlIl1dfQ%3D%3D&Storage.S3.UploadPolicySignature=ih%2FiohGe0A7y4QVRbKaq6BZShzUsmBEJEa9AdFbxM6Y%3D";
String payload = "Action=BundleInstance&Storage.S3.Prefix=winami&InstanceId=i-e468cd8d&Storage.S3.Bucket=my-bucket&Storage.S3.AWSAccessKeyId=10QMXFEV71ZS32XQFTR2&Storage.S3.UploadPolicy=eyJleHBpcmF0aW9uIjogIjIwMDgtMDgtMzBUMDg6NDk6MDlaIiwiY29uZGl0aW9ucyI6IFt7ImJ1Y2tldCI6ICJteS1idWNrZXQifSxbInN0YXJ0cy13aXRoIiwgIiRrZXkiLCAibXktbmV3LWltYWdlIl1dfQ%3D%3D&Storage.S3.UploadPolicySignature=ih%2FiohGe0A7y4QVRbKaq6BZShzUsmBEJEa9AdFbxM6Y%3D";
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, payload, "application/x-www-form-urlencoded", false);
@ -94,7 +94,7 @@ public class WindowsAsyncClientTest extends BaseEC2AsyncClientTest<WindowsAsyncC
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=DescribeBundleTasks",
assertPayloadEquals(request, "Action=DescribeBundleTasks",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@ -110,7 +110,7 @@ public class WindowsAsyncClientTest extends BaseEC2AsyncClientTest<WindowsAsyncC
assertRequestLineEquals(request, "POST https://ec2.us-east-1.amazonaws.com/ HTTP/1.1");
assertNonPayloadHeadersEqual(request, "Host: ec2.us-east-1.amazonaws.com\n");
assertPayloadEquals(request, "Version=2010-06-15&Action=DescribeBundleTasks&BundleId.1=1&BundleId.2=2",
assertPayloadEquals(request, "Action=DescribeBundleTasks&BundleId.1=1&BundleId.2=2",
"application/x-www-form-urlencoded", false);
assertResponseParserClassEquals(method, request, ParseSax.class);

View File

@ -92,6 +92,18 @@ public class DescribeImagesResponseHandlerTest {
assertEquals(result, contents);
}
public void testDiabloWithIncorrectDisplayNameField() {
Set<Image> contents = ImmutableSet.of(new Image("us-east-1", Architecture.X86_64, "CentOS 6.2 Server 64-bit 20120125", "", "ami-0000054e",
"local (CentOS 6.2 Server 64-bit 20120125)", "", ImageState.AVAILABLE,
ImageType.MACHINE, true, Sets.<String> newHashSet(), "aki-0000054c", null, "ari-0000054d",
RootDeviceType.INSTANCE_STORE, "/dev/sda1", ImmutableMap.<String, EbsBlockDevice> of(),
VirtualizationType.PARAVIRTUAL, Hypervisor.XEN));
Set<Image> result = parseImages("/describe_images_nova.xml");
assertEquals(result.toString(), contents.toString());
}
static ParseSax<Set<Image>> createParser() {
Injector injector = Guice.createInjector(new SaxParserModule(), new AbstractModule() {

View File

@ -0,0 +1,21 @@
<?xml version="1.0" ?>
<DescribeImagesResponse xmlns="http://ec2.amazonaws.com/doc/2009-04-04/">
<requestId>f3daebdd-c435-4af4-86fc-d467e4530e57</requestId>
<imagesSet>
<item>
<displayName>CentOS 6.2 Server 64-bit 20120125</displayName>
<description />
<imageOwnerId />
<isPublic>true</isPublic>
<imageId>ami-0000054e</imageId>
<imageState>available</imageState>
<rootDeviceType>instance-store</rootDeviceType>
<architecture>x86_64</architecture>
<imageLocation>local (CentOS 6.2 Server 64-bit 20120125)</imageLocation>
<kernelId>aki-0000054c</kernelId>
<ramdiskId>ari-0000054d</ramdiskId>
<rootDeviceName>/dev/sda1</rootDeviceName>
<imageType>machine</imageType>
</item>
</imagesSet>
</DescribeImagesResponse>

View File

@ -0,0 +1,68 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.elasticstack;
import java.net.URI;
import org.jclouds.apis.ApiMetadata;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadata;
/**
* Implementation of {@link ApiMetadata} for the ElasticStack API
*
* @author Adrian Cole
*/
public class ElasticStackApiMetadata extends BaseApiMetadata {
public ElasticStackApiMetadata() {
this(builder()
.id("elasticstack")
.type(ApiType.COMPUTE)
.name("ElasticStack API")
.identityName("UUID")
.credentialName("Secret API key")
.documentation(URI.create("http://www.elasticstack.com/cloud-platform/api")));
}
// below are so that we can reuse builders, toString, hashCode, etc.
// we have to set concrete classes here, as our base class cannot be
// concrete due to serviceLoader
protected ElasticStackApiMetadata(ConcreteBuilder builder) {
super(builder);
}
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
@Override
public ElasticStackApiMetadata build() {
return new ElasticStackApiMetadata(this);
}
}
public static ConcreteBuilder builder() {
return new ConcreteBuilder();
}
@Override
public ConcreteBuilder toBuilder() {
return builder().fromApiMetadata(this);
}
}

View File

@ -0,0 +1 @@
org.jclouds.elasticstack.ElasticStackApiMetadata

View File

@ -16,25 +16,20 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.cloudonestorage;
package org.jclouds.elasticstack;
import org.jclouds.rest.Providers;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadataTest;
import org.testng.annotations.Test;
import com.google.common.collect.Iterables;
/**
*
* @author Adrian Cole
*
*/
@Test(groups = "unit")
public class ProvidersInPropertiesTest {
@Test
public void testSupportedProviders() {
Iterable<String> providers = Providers.getSupportedProviders();
assert Iterables.contains(providers, "cloudonestorage") : providers;
}
@Test(groups = "unit", testName = "ElasticStackApiMetadataTest")
public class ElasticStackApiMetadataTest extends BaseApiMetadataTest {
public ElasticStackApiMetadataTest() {
super(new ElasticStackApiMetadata(), ApiType.COMPUTE);
}
}

View File

@ -1,53 +0,0 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.elasticstack;
import org.jclouds.compute.util.ComputeServiceUtils;
import org.jclouds.rest.Providers;
import org.testng.annotations.Test;
import com.google.common.collect.Iterables;
/**
*
* @author Adrian Cole
*
*/
@Test(groups = "unit")
public class ProvidersInPropertiesTest {
@Test
public void testSupportedProviders() {
Iterable<String> providers = Providers.getSupportedProviders();
assert Iterables.contains(providers, "elasticstack") : providers;
assert Iterables.contains(providers, "elastichosts-lon-p") : providers;
assert Iterables.contains(providers, "elastichosts-lon-b") : providers;
assert Iterables.contains(providers, "elastichosts-sat-p") : providers;
}
@Test
public void testSupportedComputeServiceProviders() {
Iterable<String> providers = ComputeServiceUtils.getSupportedProviders();
assert Iterables.contains(providers, "elasticstack") : providers;
assert Iterables.contains(providers, "elastichosts-lon-p") : providers;
assert Iterables.contains(providers, "elastichosts-lon-b") : providers;
assert Iterables.contains(providers, "elastichosts-sat-p") : providers;
}
}

View File

@ -0,0 +1,60 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.eucalyptus;
import org.jclouds.apis.ApiMetadata;
import org.jclouds.ec2.EC2ApiMetadata;
/**
* Implementation of {@link ApiMetadata} for the Eucalyptus (EC2 clone) api.
*
* @author Adrian Cole
*/
public class EucalyptusApiMetadata extends EC2ApiMetadata {
public EucalyptusApiMetadata() {
this(builder().fromApiMetadata(new EC2ApiMetadata())
.id("eucalyptus")
.name("Eucalyptus (EC2 clone) API"));
}
// below are so that we can reuse builders, toString, hashCode, etc.
// we have to set concrete classes here, as our base class cannot be
// concrete due to serviceLoader
protected EucalyptusApiMetadata(ConcreteBuilder builder) {
super(builder);
}
private static class ConcreteBuilder extends EC2ApiMetadataBuilder<ConcreteBuilder> {
@Override
public EucalyptusApiMetadata build() {
return new EucalyptusApiMetadata(this);
}
}
private static ConcreteBuilder builder() {
return new ConcreteBuilder();
}
@Override
public ConcreteBuilder toBuilder() {
return builder().fromApiMetadata(this);
}
}

View File

@ -0,0 +1 @@
org.jclouds.eucalyptus.EucalyptusApiMetadata

View File

@ -0,0 +1,35 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.eucalyptus;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadataTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "unit", testName = "EucalyptusApiMetadataTest")
public class EucalyptusApiMetadataTest extends BaseApiMetadataTest {
public EucalyptusApiMetadataTest() {
super(new EucalyptusApiMetadata(), ApiType.COMPUTE);
}
}

View File

@ -0,0 +1,67 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.filesystem;
import java.net.URI;
import org.jclouds.apis.ApiMetadata;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadata;
/**
* Implementation of {@link ApiMetadata} for jclouds Filesystem-based BlobStore
*
* @author Adrian Cole
*/
public class FilesystemApiMetadata extends BaseApiMetadata {
public FilesystemApiMetadata() {
this(builder()
.id("filesystem")
.type(ApiType.BLOBSTORE)
.name("Filesystem-based BlobStore")
.identityName("Unused")
.documentation(URI.create("http://www.jclouds.org/documentation/userguide/blobstore-guide")));
}
// below are so that we can reuse builders, toString, hashCode, etc.
// we have to set concrete classes here, as our base class cannot be
// concrete due to serviceLoader
protected FilesystemApiMetadata(ConcreteBuilder builder) {
super(builder);
}
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
@Override
public FilesystemApiMetadata build() {
return new FilesystemApiMetadata(this);
}
}
public static ConcreteBuilder builder() {
return new ConcreteBuilder();
}
@Override
public ConcreteBuilder toBuilder() {
return builder().fromApiMetadata(this);
}
}

View File

@ -0,0 +1 @@
org.jclouds.filesystem.FilesystemApiMetadata

View File

@ -0,0 +1,35 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.filesystem;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadataTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "unit", testName = "FilesystemApiMetadataTest")
public class FilesystemApiMetadataTest extends BaseApiMetadataTest {
public FilesystemApiMetadataTest() {
super(new FilesystemApiMetadata(), ApiType.BLOBSTORE);
}
}

View File

@ -0,0 +1,67 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.openstack.nova;
import java.net.URI;
import org.jclouds.apis.ApiMetadata;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadata;
/**
* Implementation of {@link ApiMetadata} for OpenStack Nova Pre-Diablo
*
* @author Adrian Cole
*/
public class NovaApiMetadata extends BaseApiMetadata {
public NovaApiMetadata() {
this(builder()
.id("nova")
.type(ApiType.COMPUTE)
.name("OpenStack Nova Pre-Diablo API")
.identityName("accessKey")
.credentialName("secretKey")
.documentation(URI.create("http://api.openstack.org/")));
}
// below are so that we can reuse builders, toString, hashCode, etc.
// we have to set concrete classes here, as our base class cannot be
// concrete due to serviceLoader
protected NovaApiMetadata(ConcreteBuilder builder) {
super(builder);
}
private static class ConcreteBuilder extends Builder<ConcreteBuilder> {
@Override
public NovaApiMetadata build() {
return new NovaApiMetadata(this);
}
}
public static ConcreteBuilder builder() {
return new ConcreteBuilder();
}
@Override
public ConcreteBuilder toBuilder() {
return builder().fromApiMetadata(this);
}
}

View File

@ -0,0 +1 @@
org.jclouds.openstack.nova.NovaApiMetadata

View File

@ -0,0 +1,35 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.openstack.nova;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadataTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "unit", testName = "NovaApiMetadataTest")
public class NovaApiMetadataTest extends BaseApiMetadataTest {
public NovaApiMetadataTest() {
super(new NovaApiMetadata(), ApiType.COMPUTE);
}
}

View File

@ -0,0 +1,150 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to jclouds, Inc. (jclouds) under one or more
contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. jclouds licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-project</artifactId>
<version>1.5.0-SNAPSHOT</version>
<relativePath>../../project/pom.xml</relativePath>
</parent>
<groupId>org.jclouds.api</groupId>
<artifactId>openstack-nova-ec2</artifactId>
<name>jclouds Eucalyptus api</name>
<description>EC2 implementation based on Eucalyptus</description>
<packaging>bundle</packaging>
<properties>
<test.openstack-nova-ec2.endpoint>http://localhost:8773/services/Cloud</test.openstack-nova-ec2.endpoint>
<test.openstack-nova-ec2.api-version>2010-06-15</test.openstack-nova-ec2.api-version>
<test.openstack-nova-ec2.build-version></test.openstack-nova-ec2.build-version>
<test.openstack-nova-ec2.identity>FIXME_IDENTITY</test.openstack-nova-ec2.identity>
<test.openstack-nova-ec2.credential>FIXME_CREDENTIAL</test.openstack-nova-ec2.credential>
<test.openstack-nova-ec2.image-id></test.openstack-nova-ec2.image-id>
<test.openstack-nova-ec2.image.login-user></test.openstack-nova-ec2.image.login-user>
<test.openstack-nova-ec2.image.authenticate-sudo></test.openstack-nova-ec2.image.authenticate-sudo>
</properties>
<dependencies>
<dependency>
<groupId>org.jclouds.api</groupId>
<artifactId>openstack-nova</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.api</groupId>
<artifactId>ec2</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jclouds.api</groupId>
<artifactId>ec2</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-core</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-compute</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds.driver</groupId>
<artifactId>jclouds-slf4j</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jclouds.driver</groupId>
<artifactId>jclouds-sshj</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>live</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>integration</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<systemPropertyVariables>
<test.openstack-nova-ec2.endpoint>${test.openstack-nova-ec2.endpoint}</test.openstack-nova-ec2.endpoint>
<test.openstack-nova-ec2.api-version>${test.openstack-nova-ec2.api-version}</test.openstack-nova-ec2.api-version>
<test.openstack-nova-ec2.build-version>${test.openstack-nova-ec2.build-version}</test.openstack-nova-ec2.build-version>
<test.openstack-nova-ec2.identity>${test.openstack-nova-ec2.identity}</test.openstack-nova-ec2.identity>
<test.openstack-nova-ec2.credential>${test.openstack-nova-ec2.credential}</test.openstack-nova-ec2.credential>
<test.openstack-nova-ec2.image-id>${test.openstack-nova-ec2.image-id}</test.openstack-nova-ec2.image-id>
<test.openstack-nova-ec2.image.login-user>${test.openstack-nova-ec2.image.login-user}</test.openstack-nova-ec2.image.login-user>
<test.openstack-nova-ec2.image.authenticate-sudo>${test.openstack-nova-ec2.image.authenticate-sudo}</test.openstack-nova-ec2.image.authenticate-sudo>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Export-Package>org.jclouds.openstack.nova.ec2*;version="${project.version}"</Export-Package>
<Import-Package>
org.jclouds.compute.internal;version="${project.version}",
org.jclouds.rest.internal;version="${project.version}",
org.jclouds*;version="${project.version}",
*
</Import-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,60 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.openstack.nova.ec2;
import org.jclouds.apis.ApiMetadata;
import org.jclouds.ec2.EC2ApiMetadata;
/**
* Implementation of {@link ApiMetadata} for Nova's EC2-clone API
*
* @author Adrian Cole
*/
public class NovaEC2ApiMetadata extends EC2ApiMetadata {
public NovaEC2ApiMetadata() {
this(builder().fromApiMetadata(new EC2ApiMetadata())
.id("openstack-nova-ec2")
.name("Nova's EC2-clone API"));
}
// below are so that we can reuse builders, toString, hashCode, etc.
// we have to set concrete classes here, as our base class cannot be
// concrete due to serviceLoader
protected NovaEC2ApiMetadata(ConcreteBuilder builder) {
super(builder);
}
private static class ConcreteBuilder extends EC2ApiMetadataBuilder<ConcreteBuilder> {
@Override
public NovaEC2ApiMetadata build() {
return new NovaEC2ApiMetadata(this);
}
}
private static ConcreteBuilder builder() {
return new ConcreteBuilder();
}
@Override
public ConcreteBuilder toBuilder() {
return builder().fromApiMetadata(this);
}
}

View File

@ -16,32 +16,36 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.rimuhosting.miro;
package org.jclouds.openstack.nova.ec2;
import org.jclouds.compute.util.ComputeServiceUtils;
import org.jclouds.rest.Providers;
import org.testng.annotations.Test;
import java.util.List;
import java.util.Properties;
import com.google.common.collect.Iterables;
import org.jclouds.ec2.EC2ContextBuilder;
import org.jclouds.openstack.nova.ec2.config.NovaEC2ComputeServiceContextModule;
import org.jclouds.openstack.nova.ec2.config.NovaEC2RestClientModule;
import com.google.inject.Module;
/**
*
* @author Adrian Cole
*
*/
@Test(groups = "unit")
public class ProvidersInPropertiesTest {
public class NovaEC2ContextBuilder extends EC2ContextBuilder {
@Test
public void testSupportedProviders() {
Iterable<String> providers = Providers.getSupportedProviders();
assert Iterables.contains(providers, "rimuhosting") : providers;
public NovaEC2ContextBuilder(Properties props) {
super(props);
}
@Test
public void testSupportedComputeServiceProviders() {
Iterable<String> providers = ComputeServiceUtils.getSupportedProviders();
assert Iterables.contains(providers, "rimuhosting") : providers;
@Override
protected void addClientModule(List<Module> modules) {
modules.add(new NovaEC2RestClientModule());
}
@Override
protected void addContextModule(List<Module> modules) {
modules.add(new NovaEC2ComputeServiceContextModule());
}
}

View File

@ -0,0 +1,64 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.openstack.nova.ec2;
import static org.jclouds.Constants.PROPERTY_API_VERSION;
import static org.jclouds.Constants.PROPERTY_ENDPOINT;
import static org.jclouds.Constants.PROPERTY_RELAX_HOSTNAME;
import static org.jclouds.Constants.PROPERTY_TRUST_ALL_CERTS;
import static org.jclouds.compute.config.ComputeServiceProperties.RESOURCENAME_DELIMITER;
import static org.jclouds.ec2.reference.EC2Constants.PROPERTY_EC2_AMI_OWNERS;
import static org.jclouds.ec2.reference.EC2Constants.PROPERTY_EC2_AUTO_ALLOCATE_ELASTIC_IPS;
import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGIONS;
import java.util.Properties;
import org.jclouds.ec2.EC2PropertiesBuilder;
/**
* Builds properties used in NovaEC2 Clients
*
* @author Adrian Cole
*/
public class NovaEC2PropertiesBuilder extends EC2PropertiesBuilder {
@Override
protected Properties defaultProperties() {
Properties properties = super.defaultProperties();
properties.setProperty(PROPERTY_API_VERSION, "2009-04-04");
properties.setProperty(PROPERTY_ENDPOINT, "http://localhost:8773/services/Cloud");
properties.setProperty(PROPERTY_REGIONS, "nova");
properties.setProperty(PROPERTY_EC2_AMI_OWNERS, "admin");
// hash characters are banned
properties.setProperty(RESOURCENAME_DELIMITER, "-");
// often, we are dealing with IP addresses, not hostnames
properties.setProperty(PROPERTY_RELAX_HOSTNAME, "true");
properties.setProperty(PROPERTY_TRUST_ALL_CERTS, "true");
properties.setProperty(PROPERTY_EC2_AUTO_ALLOCATE_ELASTIC_IPS, "true");
// auth fail sometimes happens in EC2, as the rc.local script that injects the
// authorized key executes after ssh has started.
properties.setProperty("jclouds.ssh.max-retries", "7");
properties.setProperty("jclouds.ssh.retry-auth", "true");
return properties;
}
public NovaEC2PropertiesBuilder(Properties properties) {
super(properties);
}
}

View File

@ -0,0 +1,47 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.openstack.nova.ec2.config;
import org.jclouds.compute.domain.OperatingSystem;
import org.jclouds.ec2.compute.config.EC2ComputeServiceContextModule;
import org.jclouds.ec2.compute.loaders.CreateSecurityGroupIfNeeded;
import org.jclouds.ec2.compute.strategy.ReviseParsedImage;
import org.jclouds.openstack.nova.ec2.loaders.NovaCreateSecurityGroupIfNeeded;
import org.jclouds.openstack.nova.ec2.strategy.NovaReviseParsedImage;
import org.jclouds.openstack.nova.v1_1.compute.functions.ImageToOperatingSystem;
import com.google.common.base.Function;
import com.google.inject.TypeLiteral;
/**
*
* @author Adrian Cole
*/
public class NovaEC2ComputeServiceContextModule extends EC2ComputeServiceContextModule {
@Override
protected void configure() {
super.configure();
bind(new TypeLiteral<Function<org.jclouds.openstack.nova.v1_1.domain.Image, OperatingSystem>>() {
}).to(ImageToOperatingSystem.class);
bind(ReviseParsedImage.class).to(NovaReviseParsedImage.class);
bind(CreateSecurityGroupIfNeeded.class).to(NovaCreateSecurityGroupIfNeeded.class);
}
}

View File

@ -0,0 +1,53 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.openstack.nova.ec2.config;
import org.jclouds.ec2.EC2AsyncClient;
import org.jclouds.ec2.EC2Client;
import org.jclouds.ec2.config.EC2RestClientModule;
import org.jclouds.ec2.suppliers.DescribeAvailabilityZonesInRegion;
import org.jclouds.http.RequiresHttp;
import org.jclouds.location.config.LocationModule;
import org.jclouds.location.suppliers.RegionIdToZoneIdsSupplier;
import org.jclouds.location.suppliers.ZoneIdsSupplier;
import org.jclouds.location.suppliers.derived.ZoneIdsFromRegionIdToZoneIdsValues;
import org.jclouds.rest.ConfiguresRestClient;
import com.google.inject.Scopes;
/**
*
* @author Adrian Cole
*/
@RequiresHttp
@ConfiguresRestClient
public class NovaEC2RestClientModule extends EC2RestClientModule<EC2Client, EC2AsyncClient> {
public NovaEC2RestClientModule() {
super(EC2Client.class, EC2AsyncClient.class, DELEGATE_MAP);
}
@Override
protected void installLocations() {
install(new LocationModule());
bind(RegionIdToZoneIdsSupplier.class).to(DescribeAvailabilityZonesInRegion.class).in(Scopes.SINGLETON);
// there is only one region, and its endpoint is the same as the provider
bind(ZoneIdsSupplier.class).to(ZoneIdsFromRegionIdToZoneIdsValues.class).in(Scopes.SINGLETON);
}
}

View File

@ -0,0 +1,55 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.openstack.nova.ec2.loaders;
import static com.google.common.base.Preconditions.checkNotNull;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import org.jclouds.aws.AWSResponseException;
import org.jclouds.ec2.EC2Client;
import org.jclouds.ec2.compute.domain.RegionAndName;
import org.jclouds.ec2.compute.loaders.CreateSecurityGroupIfNeeded;
import com.google.common.base.Predicate;
/**
*
* @author Adrian Cole
*/
@Singleton
public class NovaCreateSecurityGroupIfNeeded extends CreateSecurityGroupIfNeeded {
@Inject
public NovaCreateSecurityGroupIfNeeded(EC2Client ec2Client,
@Named("SECURITY") Predicate<RegionAndName> securityGroupEventualConsistencyDelay) {
super(checkNotNull(ec2Client, "ec2Client").getSecurityGroupServices(), securityGroupEventualConsistencyDelay);
}
protected void authorizeGroupToItself(String region, String name) {
try {
super.authorizeGroupToItself(region, name);
} catch (AWSResponseException e) {
logger.warn(e, "<< error authorizing securityGroup(%s)", name);
}
}
}

View File

@ -0,0 +1,59 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.openstack.nova.ec2.strategy;
import static com.google.common.base.Preconditions.checkNotNull;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.jclouds.compute.domain.ImageBuilder;
import org.jclouds.compute.domain.OperatingSystem;
import org.jclouds.compute.domain.OsFamily;
import org.jclouds.ec2.compute.strategy.ReviseParsedImage;
import org.jclouds.openstack.nova.v1_1.domain.Image;
import com.google.common.base.Function;
/**
* @author Adrian Cole
*/
@Singleton
public class NovaReviseParsedImage implements ReviseParsedImage {
private final Function<Image, OperatingSystem> imageToOs;
@Inject
public NovaReviseParsedImage(Function<Image, OperatingSystem> imageToOs) {
this.imageToOs = checkNotNull(imageToOs, "imageToOs");
}
@Override
public void reviseParsedImage(org.jclouds.ec2.domain.Image from, ImageBuilder builder, OsFamily family,
OperatingSystem.Builder osBuilder) {
Image image = Image.builder().id(from.getId()).name(from.getName()).build();
OperatingSystem os = imageToOs.apply(image);
osBuilder.description(os.getDescription());
osBuilder.family(os.getFamily());
osBuilder.name(os.getName());
osBuilder.is64Bit(os.is64Bit());
osBuilder.version(os.getVersion());
// arch is accurate already
}
}

View File

@ -0,0 +1 @@
org.jclouds.openstack.nova.ec2.NovaEC2ApiMetadata

View File

@ -0,0 +1,35 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.openstack.nova.ec2;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadataTest;
import org.testng.annotations.Test;
/**
*
* @author Adrian Cole
*/
@Test(groups = "unit", testName = "NovaEC2ApiMetadataTest")
public class NovaEC2ApiMetadataTest extends BaseApiMetadataTest {
public NovaEC2ApiMetadataTest() {
super(new NovaEC2ApiMetadata(), ApiType.COMPUTE);
}
}

View File

@ -16,32 +16,26 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.atmos;
package org.jclouds.openstack.nova.ec2.compute;
import org.jclouds.blobstore.util.BlobStoreUtils;
import org.jclouds.rest.Providers;
import org.jclouds.compute.domain.ExecResponse;
import org.jclouds.compute.domain.NodeMetadata;
import org.jclouds.ec2.compute.EC2ComputeServiceLiveTest;
import org.testng.annotations.Test;
import com.google.common.collect.Iterables;
/**
*
* @author Adrian Cole
*
*/
@Test(groups = "unit")
public class ProvidersInPropertiesTest {
@Test(groups = "live", singleThreaded = true, testName = "NovaEC2ComputeServiceLiveTest")
public class NovaEC2ComputeServiceLiveTest extends EC2ComputeServiceLiveTest {
@Test
public void testSupportedProviders() {
Iterable<String> providers = Providers.getSupportedProviders();
assert Iterables.contains(providers, "atmos") : providers;
public NovaEC2ComputeServiceLiveTest() {
provider = "openstack-nova-ec2";
}
@Test
public void testSupportedBlobStoreProviders() {
Iterable<String> providers = BlobStoreUtils.getSupportedProviders();
assert Iterables.contains(providers, "atmos") : providers;
protected void checkResponseEqualsHostname(ExecResponse execResponse, NodeMetadata node1) {
// hostname is not predictable based on node metadata
assert execResponse.getOutput().trim().equals("ubuntu");
}
}

View File

@ -0,0 +1,98 @@
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.jclouds.openstack.nova.ec2.strategy;
import static org.testng.Assert.assertEquals;
import java.util.Map;
import java.util.Set;
import org.jclouds.compute.config.BaseComputeServiceContextModule;
import org.jclouds.compute.domain.ImageBuilder;
import org.jclouds.compute.domain.OperatingSystem;
import org.jclouds.compute.domain.OsFamily;
import org.jclouds.compute.reference.ComputeServiceConstants;
import org.jclouds.domain.Location;
import org.jclouds.domain.LocationBuilder;
import org.jclouds.domain.LocationScope;
import org.jclouds.domain.LoginCredentials;
import org.jclouds.ec2.compute.functions.EC2ImageParser;
import org.jclouds.ec2.compute.strategy.EC2PopulateDefaultLoginCredentialsForImageStrategy;
import org.jclouds.ec2.domain.Image;
import org.jclouds.ec2.xml.DescribeImagesResponseHandlerTest;
import org.jclouds.json.Json;
import org.jclouds.json.config.GsonModule;
import org.jclouds.openstack.nova.v1_1.compute.functions.ImageToOperatingSystem;
import org.testng.annotations.Test;
import com.google.common.base.Predicates;
import com.google.common.base.Suppliers;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.Sets;
import com.google.inject.Guice;
/**
* @author Adrian Cole
*/
@Test(groups = "unit", testName = "NovaReviseParsedImageTest")
public class NovaReviseParsedImageTest {
public void test() {
Set<org.jclouds.compute.domain.Image> result = convertImages("/nova_ec2_images.xml");
assertEquals(result.size(), 7);
assertEquals(
Iterables.get(result, 4).toString(),
new ImageBuilder()
.operatingSystem(
OperatingSystem.builder().family(OsFamily.UBUNTU).arch("paravirtual").version("10.10")
.name("Ubuntu Maverick 10.10 Server 64-bit 20111212")
.description("Ubuntu Maverick 10.10 Server 64-bit 20111212").is64Bit(true)
.build())
.name("Ubuntu Maverick 10.10 Server 64-bit 20111212")
.description("")
.defaultCredentials(new LoginCredentials("root", false))
.id("us-east-1/ami-000004d6")
.providerId("ami-000004d6")
.location(defaultLocation)
.userMetadata(
ImmutableMap.of("owner", "", "rootDeviceType", "instance-store", "virtualizationType",
"paravirtual", "hypervisor", "xen")).build().toString());
}
static Location defaultLocation = new LocationBuilder().scope(LocationScope.REGION).id("us-east-1").description(
"us-east-1").build();
public static Set<org.jclouds.compute.domain.Image> convertImages(String resource) {
Map<OsFamily, Map<String, String>> map = new BaseComputeServiceContextModule() {
}.provideOsVersionMap(new ComputeServiceConstants.ReferenceData(), Guice.createInjector(new GsonModule())
.getInstance(Json.class));
Set<Image> result = DescribeImagesResponseHandlerTest.parseImages(resource);
EC2ImageParser parser = new EC2ImageParser(new EC2PopulateDefaultLoginCredentialsForImageStrategy(), map,
Suppliers.<Set<? extends Location>> ofInstance(ImmutableSet.<Location> of(defaultLocation)), Suppliers
.ofInstance(defaultLocation), new NovaReviseParsedImage(new ImageToOperatingSystem(map)));
return Sets.newLinkedHashSet(Iterables.filter(Iterables.transform(result, parser), Predicates.notNull()));
}
}

View File

@ -0,0 +1,259 @@
<?xml version="1.0" ?>
<DescribeImagesResponse xmlns="http://ec2.amazonaws.com/doc/2009-04-04/">
<requestId>b5ad23de-f77d-
4b66-bfc2-ab01ceccb97b</requestId>
<imagesSet>
<item>
<displayName>Debian Squeeze 6.0.3 Server 64-bit 20120123</displayName>
<description />
<imageOwnerId />
<isPublic>true</isPublic>
<imageId>ami-00000551</imageId>
<imageState>available</imageState>
<rootDeviceType>instance-store</rootDeviceType>
<architecture>amd64</architecture>
<imageLocation>local (Debian Squeeze 6.0.3 Server 64-bit
20120123)</imageLocation>
<kernelId>aki-0000054f</kernelId>
<ramdiskId>ari-00000550</ramdiskId>
<rootDeviceName>/dev/sda1</rootDeviceName>
<imageType>machine</imageType>
</item>
<item>
<displayName>Debian Squeeze 6.0.3 Server 64-bit 20120123
(Ramdisk)</displayName>
<description />
<imageOwnerId />
<isPublic>true</isPublic>
<imageId>ari-00000550</imageId>
<imageState>available</imageState>
<architecture>amd64</architecture>
<imageLocation>local (Debian Squeeze 6.0.3 Server 64-bit
20120123 (Ramdisk))</imageLocation>
<rootDeviceType>instance-store</rootDeviceType>
<rootDeviceName>/dev/sda1</rootDeviceName>
<imageType>ramdisk</imageType>
</item>
<item>
<displayName>Debian Squeeze 6.0.3 Server 64-bit 20120123
(Kernel)</displayName>
<description />
<imageOwnerId />
<isPublic>true</isPublic>
<imageId>aki-0000054f</imageId>
<imageState>available</imageState>
<architecture>amd64</architecture>
<imageLocation>local (Debian Squeeze 6.0.3 Server 64-bit
20120123 (Kernel))</imageLocation>
<rootDeviceType>instance-store</rootDeviceType>
<rootDeviceName>/dev/sda1</rootDeviceName>
<imageType>kernel</imageType>
</item>
<item>
<displayName>CentOS 6.2 Server 64-bit 20120125</displayName>
<description />
<imageOwnerId />
<isPublic>true</isPublic>
<imageId>ami-0000054e</imageId>
<imageState>available</imageState>
<rootDeviceType>instance-store</rootDeviceType>
<architecture>x86_64</architecture>
<imageLocation>local (CentOS 6.2 Server 64-bit 20120125)</imageLocation>
<kernelId>aki-0000054c</kernelId>
<ramdiskId>ari-0000054d</ramdiskId>
<rootDeviceName>/dev/sda1</rootDeviceName>
<imageType>machine</imageType>
</item>
<item>
<displayName>CentOS 6.2 Server 64-bit 20120125 (Ramdisk)</displayName>
<description />
<imageOwnerId />
<isPublic>true</isPublic>
<imageId>ari-0000054d</imageId>
<imageState>available</imageState>
<architecture>x86_64</architecture>
<imageLocation>local (CentOS 6.2 Server 64-bit 20120125
(Ramdisk))</imageLocation>
<rootDeviceType>instance-store</rootDeviceType>
<rootDeviceName>/dev/sda1</rootDeviceName>
<imageType>ramdisk</imageType>
</item>
<item>
<displayName>CentOS 6.2 Server 64-bit 20120125 (Kernel)</displayName>
<description />
<imageOwnerId />
<isPublic>true</isPublic>
<imageId>aki-0000054c</imageId>
<imageState>available</imageState>
<architecture>x86_64</architecture>
<imageLocation>local (CentOS 6.2 Server 64-bit 20120125
(Kernel))</imageLocation>
<rootDeviceType>instance-store</rootDeviceType>
<rootDeviceName>/dev/sda1</rootDeviceName>
<imageType>kernel</imageType>
</item>
<item>
<displayName>Ubuntu Oneiric 11.10 Server 64-bit 20111212</displayName>
<description />
<imageOwnerId />
<isPublic>true</isPublic>
<imageId>ami-000004da</imageId>
<imageState>available</imageState>
<rootDeviceType>instance-store</rootDeviceType>
<architecture>amd64</architecture>
<imageLocation>local (Ubuntu Oneiric 11.10 Server 64-bit
20111212)</imageLocation>
<kernelId>aki-000004d9</kernelId>
<rootDeviceName>/dev/sda1</rootDeviceName>
<imageType>machine</imageType>
</item>
<item>
<displayName>Ubuntu Oneiric 11.10 Server 64-bit 20111212
(Kernel)</displayName>
<description />
<imageOwnerId />
<isPublic>true</isPublic>
<imageId>aki-000004d9</imageId>
<imageState>available</imageState>
<architecture>amd64</architecture>
<imageLocation>local (Ubuntu Oneiric 11.10 Server 64-bit
20111212 (Kernel))</imageLocation>
<rootDeviceType>instance-store</rootDeviceType>
<rootDeviceName>/dev/sda1</rootDeviceName>
<imageType>kernel</imageType>
</item>
<item>
<displayName>Ubuntu Natty 11.04 Server 64-bit 20111212</displayName>
<description />
<imageOwnerId />
<isPublic>true</isPublic>
<imageId>ami-000004d8</imageId>
<imageState>available</imageState>
<rootDeviceType>instance-store</rootDeviceType>
<architecture>amd64</architecture>
<imageLocation>local (Ubuntu Natty 11.04 Server 64-bit
20111212)</imageLocation>
<kernelId>aki-000004d7</kernelId>
<rootDeviceName>/dev/sda1</rootDeviceName>
<imageType>machine</imageType>
</item>
<item>
<displayName>Ubuntu Natty 11.04 Server 64-bit 20111212
(Kernel)</displayName>
<description />
<imageOwnerId />
<isPublic>true</isPublic>
<imageId>aki-000004d7</imageId>
<imageState>available</imageState>
<architecture>amd64</architecture>
<imageLocation>local (Ubuntu Natty 11.04 Server 64-bit
20111212 (Kernel))</imageLocation>
<rootDeviceType>instance-store</rootDeviceType>
<rootDeviceName>/dev/sda1</rootDeviceName>
<imageType>kernel</imageType>
</item>
<item>
<displayName>Ubuntu Maverick 10.10 Server 64-bit 20111212</displayName>
<description />
<imageOwnerId />
<isPublic>true</isPublic>
<imageId>ami-000004d6</imageId>
<imageState>available</imageState>
<rootDeviceType>instance-store</rootDeviceType>
<architecture>amd64</architecture>
<imageLocation>local (Ubuntu Maverick 10.10 Server 64-bit
20111212)</imageLocation>
<kernelId>aki-000004d5</kernelId>
<rootDeviceName>/dev/sda1</rootDeviceName>
<imageType>machine</imageType>
</item>
<item>
<displayName>Ubuntu Maverick 10.10 Server 64-bit 20111212
(Kernel)</displayName>
<description />
<imageOwnerId />
<isPublic>true</isPublic>
<imageId>aki-000004d5</imageId>
<imageState>available</imageState>
<architecture>amd64</architecture>
<imageLocation>local (Ubuntu Maverick 10.10 Server 64-bit
20111212 (Kernel))</imageLocation>
<rootDeviceType>instance-store</rootDeviceType>
<rootDeviceName>/dev/sda1</rootDeviceName>
<imageType>kernel</imageType>
</item>
<item>
<displayName>Ubuntu Lucid 10.04 LTS Server 64-bit 20111212</displayName>
<description />
<imageOwnerId />
<isPublic>true</isPublic>
<imageId>ami-000004d4</imageId>
<imageState>available</imageState>
<rootDeviceType>instance-store</rootDeviceType>
<architecture>amd64</architecture>
<imageLocation>local (Ubuntu Lucid 10.04 LTS Server 64-bit
20111212)</imageLocation>
<kernelId>aki-000004d3</kernelId>
<rootDeviceName>/dev/sda1</rootDeviceName>
<imageType>machine</imageType>
</item>
<item>
<displayName>Ubuntu Lucid 10.04 LTS Server 64-bit 20111212
(Kernel)</displayName>
<description />
<imageOwnerId />
<isPublic>true</isPublic>
<imageId>aki-000004d3</imageId>
<imageState>available</imageState>
<architecture>amd64</architecture>
<imageLocation>local (Ubuntu Lucid 10.04 LTS Server 64-bit
20111212 (Kernel))</imageLocation>
<rootDeviceType>instance-store</rootDeviceType>
<rootDeviceName>/dev/sda1</rootDeviceName>
<imageType>kernel</imageType>
</item>
<item>
<displayName>CentOS 5.6 Server 64-bit 20111207</displayName>
<description />
<imageOwnerId />
<isPublic>true</isPublic>
<imageId>ami-000004d2</imageId>
<imageState>available</imageState>
<rootDeviceType>instance-store</rootDeviceType>
<architecture>x86_64</architecture>
<imageLocation>local (CentOS 5.6 Server 64-bit 20111207)</imageLocation>
<kernelId>aki-000004d0</kernelId>
<ramdiskId>ari-000004d1</ramdiskId>
<rootDeviceName>/dev/sda1</rootDeviceName>
<imageType>machine</imageType>
</item>
<item>
<displayName>CentOS 5.6 Server 64-bit 20111207 (Ramdisk)</displayName>
<description />
<imageOwnerId />
<isPublic>true</isPublic>
<imageId>ari-000004d1</imageId>
<imageState>available</imageState>
<architecture>x86_64</architecture>
<imageLocation>local (CentOS 5.6 Server 64-bit 20111207
(Ramdisk))</imageLocation>
<rootDeviceType>instance-store</rootDeviceType>
<rootDeviceName>/dev/sda1</rootDeviceName>
<imageType>ramdisk</imageType>
</item>
<item>
<displayName>CentOS 5.6 Server 64-bit 20111207 (Kernel)</displayName>
<description />
<imageOwnerId />
<isPublic>true</isPublic>
<imageId>aki-000004d0</imageId>
<imageState>available</imageState>
<architecture>x86_64</architecture>
<imageLocation>local (CentOS 5.6 Server 64-bit 20111207
(Kernel))</imageLocation>
<rootDeviceType>instance-store</rootDeviceType>
<rootDeviceName>/dev/sda1</rootDeviceName>
<imageType>kernel</imageType>
</item>
</imagesSet>
</DescribeImagesResponse>

View File

@ -0,0 +1,58 @@
package org.jclouds.openstack.nova.v1_1;
import java.net.URI;
import org.jclouds.apis.ApiMetadata;
import org.jclouds.apis.ApiType;
import org.jclouds.apis.BaseApiMetadata;
/**
* Implementation of {@link ApiMetadata} for OpenStack Nova Diablo+
*
* @author Adrian Cole
*/
public class NovaApiMetadata extends BaseApiMetadata {
public NovaApiMetadata() {
this(builder()
.id("openstack-nova")
.type(ApiType.COMPUTE)
.name("OpenStack Nova Diablo+ API")
.identityName("tenantId:user")
.credentialName("password")
.documentation(URI.create("http://api.openstack.org/")));
}
// below are so that we can reuse builders, toString, hashCode, etc.
// we have to set concrete classes here, as our base class cannot be
// concrete due to serviceLoader
protected NovaApiMetadata(NovaApiMetadataBuilder<?> builder) {
super(builder);
}
public static class NovaApiMetadataBuilder<B extends NovaApiMetadataBuilder<B>> extends Builder<B> {
@Override
public NovaApiMetadata build() {
return new NovaApiMetadata(this);
}
}
private static class NovaConcreteBuilder extends NovaApiMetadataBuilder<NovaConcreteBuilder> {
@Override
public NovaApiMetadata build() {
return new NovaApiMetadata(this);
}
}
private static NovaConcreteBuilder builder() {
return new NovaConcreteBuilder();
}
@Override
public NovaApiMetadataBuilder<?> toBuilder() {
return builder().fromApiMetadata(this);
}
}

View File

@ -106,7 +106,7 @@ public class ImageToOperatingSystem implements Function<Image, OperatingSystem>
osFamily = OsFamily.UBUNTU;
osVersion = ubuntuVersion;
} else {
logger.trace("could not parse operating system family for image(%s): %s", imageNameParts);
logger.trace("could not parse operating system family for image(%s): %s", from.getId(), imageNameParts);
osFamily = OsFamily.UNRECOGNIZED;
}
}

View File

@ -104,7 +104,7 @@ public interface SecurityGroupAsyncClient {
@DELETE
@Path("/os-security-groups/{id}")
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
@Consumes
@Consumes(MediaType.APPLICATION_JSON)
ListenableFuture<Boolean> deleteSecurityGroup(@PathParam("id") String id);
/**

View File

@ -34,6 +34,7 @@ import org.jclouds.openstack.domain.Resource;
import org.jclouds.openstack.filters.AuthenticateRequest;
import org.jclouds.openstack.nova.v1_1.domain.RebootType;
import org.jclouds.openstack.nova.v1_1.domain.Server;
import org.jclouds.openstack.nova.v1_1.functions.ParseImageIdFromLocationHeader;
import org.jclouds.openstack.nova.v1_1.options.CreateServerOptions;
import org.jclouds.openstack.nova.v1_1.options.RebuildServerOptions;
import org.jclouds.rest.annotations.ExceptionParser;
@ -41,9 +42,11 @@ import org.jclouds.rest.annotations.MapBinder;
import org.jclouds.rest.annotations.Payload;
import org.jclouds.rest.annotations.PayloadParam;
import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.annotations.ResponseParser;
import org.jclouds.rest.annotations.SelectJson;
import org.jclouds.rest.annotations.SkipEncoding;
import org.jclouds.rest.annotations.Unwrap;
import org.jclouds.rest.functions.MapHttp4xxCodesToExceptions;
import org.jclouds.rest.functions.ReturnEmptySetOnNotFoundOr404;
import org.jclouds.rest.functions.ReturnFalseOnNotFoundOr404;
import org.jclouds.rest.functions.ReturnNullOnNotFoundOr404;
@ -182,4 +185,17 @@ public interface ServerAsyncClient {
@Produces(MediaType.APPLICATION_JSON)
@Payload("%7B\"server\":%7B\"name\":\"{name}\"%7D%7D")
ListenableFuture<Void> renameServer(@PathParam("id") String id, @PayloadParam("name") String newName);
/**
* @see ServerClient#createImageFromServer
*/
@POST
@Path("/servers/{id}/action")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Payload("%7B\"createImage\":%7B\"name\":\"{name}\", \"metadata\": %7B%7D%7D%7D")
@ExceptionParser(MapHttp4xxCodesToExceptions.class)
@ResponseParser(ParseImageIdFromLocationHeader.class)
ListenableFuture<String> createImageFromServer(@PayloadParam("name") String name, @PathParam("id") String id);
}

Some files were not shown because too many files have changed in this diff Show More