You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ni...@apache.org on 2014/03/18 04:00:12 UTC
[20/21] git commit: fixing
https://issues.apache.org/jira/browse/STRATOS-520 - adding Openstack-nova
module to dependencies
fixing https://issues.apache.org/jira/browse/STRATOS-520 - adding Openstack-nova module to dependencies
Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/d4243b7e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/d4243b7e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/d4243b7e
Branch: refs/heads/master
Commit: d4243b7e960e7f8067c81c07e3ec71290ba259a2
Parents: 517901a
Author: Jeffrey Nguyen <je...@cisco.com>
Authored: Tue Mar 18 08:20:54 2014 +0530
Committer: Nirmal Fernando <ni...@apache.org>
Committed: Tue Mar 18 08:26:53 2014 +0530
----------------------------------------------------------------------
.../org.apache.stratos.cloud.controller/pom.xml | 4 +-
.../openstack-nova/1.7.1-stratos/README.txt | 3 +
.../openstack-nova/1.7.1-stratos/pom.xml | 143 ++++
.../jclouds/openstack/nova/v2_0/NovaApi.java | 208 ++++++
.../openstack/nova/v2_0/NovaApiMetadata.java | 125 ++++
.../openstack/nova/v2_0/NovaAsyncApi.java | 214 ++++++
.../v2_0/binders/BindKeyPairToJsonPayload.java | 47 ++
.../v2_0/binders/BindMetadataToJsonPayload.java | 47 ++
.../BindSecurityGroupRuleToJsonPayload.java | 71 ++
.../nova/v2_0/compute/NovaComputeService.java | 183 +++++
.../v2_0/compute/NovaComputeServiceAdapter.java | 286 +++++++
.../config/NovaComputeServiceContextModule.java | 286 +++++++
.../compute/extensions/NovaImageExtension.java | 140 ++++
.../extensions/NovaSecurityGroupExtension.java | 373 ++++++++++
.../AllocateAndAddFloatingIpToNode.java | 112 +++
.../functions/CreateSecurityGroupIfNeeded.java | 93 +++
.../functions/FlavorInZoneToHardware.java | 60 ++
.../compute/functions/ImageInZoneToImage.java | 70 ++
.../functions/ImageToOperatingSystem.java | 128 ++++
.../NovaSecurityGroupInZoneToSecurityGroup.java | 75 ++
.../NovaSecurityGroupToSecurityGroup.java | 69 ++
.../functions/OrphanedGroupsByZoneId.java | 77 ++
.../RemoveFloatingIpFromNodeAndDeallocate.java | 74 ++
.../SecurityGroupRuleToIpPermission.java | 99 +++
.../functions/ServerInZoneToNodeMetadata.java | 199 +++++
.../compute/loaders/CreateUniqueKeyPair.java | 79 ++
.../loaders/FindSecurityGroupOrCreate.java | 86 +++
.../loaders/LoadFloatingIpsForInstance.java | 63 ++
.../compute/options/NovaTemplateOptions.java | 620 +++++++++++++++
.../predicates/AllNodesInGroupTerminated.java | 56 ++
...desWithGroupEncodedIntoNameThenAddToSet.java | 165 ++++
.../nova/v2_0/config/NovaParserModule.java | 159 ++++
.../nova/v2_0/config/NovaProperties.java | 43 ++
.../nova/v2_0/config/NovaRestClientModule.java | 191 +++++
.../openstack/nova/v2_0/domain/Address.java | 138 ++++
.../openstack/nova/v2_0/domain/BackupType.java | 41 +
.../openstack/nova/v2_0/domain/Flavor.java | 211 ++++++
.../openstack/nova/v2_0/domain/FloatingIP.java | 173 +++++
.../openstack/nova/v2_0/domain/Host.java | 127 ++++
.../nova/v2_0/domain/HostAggregate.java | 250 +++++++
.../nova/v2_0/domain/HostResourceUsage.java | 180 +++++
.../openstack/nova/v2_0/domain/Image.java | 303 ++++++++
.../openstack/nova/v2_0/domain/Ingress.java | 160 ++++
.../openstack/nova/v2_0/domain/KeyPair.java | 189 +++++
.../openstack/nova/v2_0/domain/Network.java | 173 +++++
.../openstack/nova/v2_0/domain/Quota.java | 356 +++++++++
.../openstack/nova/v2_0/domain/QuotaClass.java | 62 ++
.../openstack/nova/v2_0/domain/RebootType.java | 35 +
.../nova/v2_0/domain/SecurityGroup.java | 188 +++++
.../nova/v2_0/domain/SecurityGroupRule.java | 174 +++++
.../openstack/nova/v2_0/domain/Server.java | 476 ++++++++++++
.../nova/v2_0/domain/ServerCreated.java | 127 ++++
.../v2_0/domain/ServerExtendedAttributes.java | 156 ++++
.../nova/v2_0/domain/ServerExtendedStatus.java | 155 ++++
.../v2_0/domain/ServerWithSecurityGroups.java | 128 ++++
.../nova/v2_0/domain/SimpleServerUsage.java | 312 ++++++++
.../nova/v2_0/domain/SimpleTenantUsage.java | 245 ++++++
.../nova/v2_0/domain/TenantIdAndName.java | 127 ++++
.../nova/v2_0/domain/VirtualInterface.java | 128 ++++
.../openstack/nova/v2_0/domain/Volume.java | 346 +++++++++
.../nova/v2_0/domain/VolumeAttachment.java | 172 +++++
.../nova/v2_0/domain/VolumeSnapshot.java | 239 ++++++
.../openstack/nova/v2_0/domain/VolumeType.java | 192 +++++
.../domain/zonescoped/AvailabilityZone.java | 73 ++
.../v2_0/domain/zonescoped/FlavorInZone.java | 46 ++
.../v2_0/domain/zonescoped/ImageInZone.java | 46 ++
.../domain/zonescoped/SecurityGroupInZone.java | 46 ++
.../v2_0/domain/zonescoped/ServerInZone.java | 46 ++
.../nova/v2_0/domain/zonescoped/ZoneAndId.java | 86 +++
.../v2_0/domain/zonescoped/ZoneAndName.java | 111 +++
.../ZoneSecurityGroupNameAndPorts.java | 62 ++
.../nova/v2_0/domain/zonescoped/ZoneState.java | 61 ++
.../v2_0/extensions/AvailabilityZoneAPI.java | 40 +
.../extensions/AvailabilityZoneAsyncApi.java | 58 ++
.../v2_0/extensions/ExtensionNamespaces.java | 110 +++
.../v2_0/extensions/FlavorExtraSpecsApi.java | 77 ++
.../extensions/FlavorExtraSpecsAsyncApi.java | 118 +++
.../nova/v2_0/extensions/FloatingIPApi.java | 98 +++
.../v2_0/extensions/FloatingIPAsyncApi.java | 145 ++++
.../v2_0/extensions/HostAdministrationApi.java | 103 +++
.../extensions/HostAdministrationAsyncApi.java | 157 ++++
.../nova/v2_0/extensions/HostAggregateApi.java | 87 +++
.../v2_0/extensions/HostAggregateAsyncApi.java | 161 ++++
.../nova/v2_0/extensions/KeyPairApi.java | 65 ++
.../nova/v2_0/extensions/KeyPairAsyncApi.java | 101 +++
.../nova/v2_0/extensions/QuotaApi.java | 57 ++
.../nova/v2_0/extensions/QuotaAsyncApi.java | 89 +++
.../nova/v2_0/extensions/QuotaClassApi.java | 51 ++
.../v2_0/extensions/QuotaClassAsyncApi.java | 78 ++
.../nova/v2_0/extensions/SecurityGroupApi.java | 89 +++
.../v2_0/extensions/SecurityGroupAsyncApi.java | 152 ++++
.../nova/v2_0/extensions/ServerAdminApi.java | 120 +++
.../v2_0/extensions/ServerAdminAsyncApi.java | 175 +++++
.../extensions/ServerWithSecurityGroupsApi.java | 49 ++
.../ServerWithSecurityGroupsAsyncApi.java | 62 ++
.../v2_0/extensions/SimpleTenantUsageApi.java | 50 ++
.../extensions/SimpleTenantUsageAsyncApi.java | 77 ++
.../v2_0/extensions/VirtualInterfaceApi.java | 43 ++
.../extensions/VirtualInterfaceAsyncApi.java | 59 ++
.../nova/v2_0/extensions/VolumeApi.java | 147 ++++
.../nova/v2_0/extensions/VolumeAsyncApi.java | 254 +++++++
.../v2_0/extensions/VolumeAttachmentApi.java | 87 +++
.../extensions/VolumeAttachmentAsyncApi.java | 107 +++
.../nova/v2_0/extensions/VolumeTypeApi.java | 101 +++
.../v2_0/extensions/VolumeTypeAsyncApi.java | 161 ++++
.../openstack/nova/v2_0/features/FlavorApi.java | 78 ++
.../nova/v2_0/features/FlavorAsyncApi.java | 144 ++++
.../openstack/nova/v2_0/features/ImageApi.java | 142 ++++
.../nova/v2_0/features/ImageAsyncApi.java | 206 +++++
.../openstack/nova/v2_0/features/ServerApi.java | 276 +++++++
.../nova/v2_0/features/ServerAsyncApi.java | 356 +++++++++
.../functions/FieldValueResponseParsers.java | 105 +++
.../nova/v2_0/functions/OverLimitParser.java | 92 +++
.../ParseImageIdFromLocationHeader.java | 39 +
.../internal/OnlyMetadataValueOrNull.java | 63 ++
.../functions/internal/ParseDiagnostics.java | 47 ++
.../functions/internal/ParseFlavorDetails.java | 94 +++
.../v2_0/functions/internal/ParseFlavors.java | 96 +++
.../functions/internal/ParseImageDetails.java | 95 +++
.../v2_0/functions/internal/ParseImages.java | 96 +++
.../v2_0/functions/internal/ParseKeyPairs.java | 64 ++
.../functions/internal/ParseServerDetails.java | 94 +++
.../v2_0/functions/internal/ParseServers.java | 96 +++
.../nova/v2_0/handlers/NovaErrorHandler.java | 129 ++++
.../options/CreateBackupOfServerOptions.java | 105 +++
.../nova/v2_0/options/CreateServerOptions.java | 557 ++++++++++++++
.../nova/v2_0/options/CreateVolumeOptions.java | 220 ++++++
.../options/CreateVolumeSnapshotOptions.java | 138 ++++
.../v2_0/options/CreateVolumeTypeOptions.java | 101 +++
.../nova/v2_0/options/ListOptions.java | 107 +++
.../nova/v2_0/options/RebuildServerOptions.java | 142 ++++
.../FindSecurityGroupWithNameAndReturnTrue.java | 84 +++
.../nova/v2_0/predicates/ImagePredicates.java | 55 ++
.../nova/v2_0/predicates/KeyPairPredicates.java | 77 ++
.../predicates/SecurityGroupPredicates.java | 213 ++++++
.../services/org.jclouds.apis.ApiMetadata | 1 +
...tKeyAndTenantIdAuthenticationExpectTest.java | 75 ++
...antNamePropertyAuthenticationExpectTest.java | 75 ++
...KeyAndSecretKeyAuthenticationExpectTest.java | 69 ++
.../nova/v2_0/EndpointIdIsRandomExpectTest.java | 72 ++
.../nova/v2_0/NovaApiMetadataTest.java | 32 +
.../v2_0/PasswordAuthenticationExpectTest.java | 60 ++
...dAuthenticationWithTenantNameExpectTest.java | 69 ++
.../NovaComputeServiceAdapterExpectTest.java | 321 ++++++++
.../compute/NovaComputeServiceExpectTest.java | 382 ++++++++++
.../compute/NovaComputeServiceLiveTest.java | 96 +++
.../NovaImageExtensionExpectTest.java | 92 +++
.../extensions/NovaImageExtensionLiveTest.java | 43 ++
.../NovaSecurityGroupExtensionExpectTest.java | 433 +++++++++++
.../NovaSecurityGroupExtensionLiveTest.java | 35 +
...llocateAndAddFloatingIpToNodeExpectTest.java | 133 ++++
.../functions/FlavorInZoneToHardwareTest.java | 90 +++
.../functions/ImageInZoneToImageTest.java | 95 +++
.../functions/ImageToOperatingSystemTest.java | 192 +++++
...aSecurityGroupInZoneToSecurityGroupTest.java | 94 +++
.../NovaSecurityGroupToSecurityGroupTest.java | 155 ++++
.../functions/OrphanedGroupsByZoneIdTest.java | 96 +++
.../SecurityGroupRuleToIpPermissionTest.java | 81 ++
.../ServerInZoneToNodeMetadataTest.java | 311 ++++++++
.../loaders/CreateUniqueKeyPairTest.java | 111 +++
.../loaders/FindSecurityGroupOrCreateTest.java | 144 ++++
.../loaders/LoadFloatingIpsForInstanceTest.java | 108 +++
.../options/NovaTemplateOptionsTest.java | 263 +++++++
.../extensions/AdminActionsApiExpectTest.java | 350 +++++++++
.../extensions/AdminActionsApiLiveTest.java | 195 +++++
.../AvailabilityZoneApiExpectTest.java | 64 ++
.../AvailabilityZonesApiLiveTest.java | 45 ++
.../FlavorExtraSpecsApiExpectTest.java | 142 ++++
.../extensions/FlavorExtraSpecsApiLiveTest.java | 123 +++
.../extensions/FloatingIPApiExpectTest.java | 191 +++++
.../v2_0/extensions/FloatingIPApiLiveTest.java | 171 +++++
.../HostAdministrationApiExpectTest.java | 241 ++++++
.../HostAdministrationApiLiveTest.java | 116 +++
.../extensions/HostAggregateApiExpectTest.java | 179 +++++
.../extensions/HostAggregateApiLiveTest.java | 148 ++++
.../v2_0/extensions/KeyPairApiExpectTest.java | 142 ++++
.../v2_0/extensions/KeyPairApiLiveTest.java | 76 ++
.../v2_0/extensions/QuotaApiExpectTest.java | 125 ++++
.../nova/v2_0/extensions/QuotaApiLiveTest.java | 100 +++
.../extensions/QuotaClassApiExpectTest.java | 105 +++
.../v2_0/extensions/QuotaClassApiLiveTest.java | 73 ++
.../extensions/SecurityGroupApiExpectTest.java | 235 ++++++
.../extensions/SecurityGroupApiLiveTest.java | 100 +++
.../ServerWithSecurityGroupsApiExpectTest.java | 63 ++
.../ServerWithSecurityGroupsApiLiveTest.java | 80 ++
.../SimpleTenantUsageApiExpectTest.java | 99 +++
.../SimpleTenantUsageApiLiveTest.java | 51 ++
.../VirtualInterfaceApiExpectTest.java | 64 ++
.../extensions/VirtualInterfaceApiLiveTest.java | 68 ++
.../v2_0/extensions/VolumeApiExpectTest.java | 460 ++++++++++++
.../nova/v2_0/extensions/VolumeApiLiveTest.java | 274 +++++++
.../VolumeAttachmentApiExpectTest.java | 168 +++++
.../extensions/VolumeAttachmentApiLiveTest.java | 156 ++++
.../extensions/VolumeTypeApiExpectTest.java | 259 +++++++
.../v2_0/extensions/VolumeTypeApiLiveTest.java | 126 ++++
.../v2_0/features/ExtensionApiExpectTest.java | 115 +++
.../v2_0/features/ExtensionApiLiveTest.java | 84 +++
.../nova/v2_0/features/FlavorApiExpectTest.java | 164 ++++
.../nova/v2_0/features/FlavorApiLiveTest.java | 105 +++
.../nova/v2_0/features/ImageApiExpectTest.java | 377 ++++++++++
.../nova/v2_0/features/ImageApiLiveTest.java | 101 +++
.../nova/v2_0/features/ServerApiExpectTest.java | 746 +++++++++++++++++++
.../nova/v2_0/features/ServerApiLiveTest.java | 206 +++++
.../CreateSecurityGroupIfNeededTest.java | 168 +++++
...ityGroupWithNameAndReturnTrueExpectTest.java | 102 +++
.../v2_0/functions/InternalURLLiveTest.java | 64 ++
.../v2_0/handlers/NovaErrorHandlerTest.java | 225 ++++++
.../v2_0/internal/BaseNovaApiExpectTest.java | 28 +
.../nova/v2_0/internal/BaseNovaApiLiveTest.java | 120 +++
...BaseNovaComputeServiceContextExpectTest.java | 87 +++
.../BaseNovaComputeServiceExpectTest.java | 35 +
.../nova/v2_0/internal/BaseNovaExpectTest.java | 84 +++
...eComputeServiceTypicalSecurityGroupTest.java | 76 ++
.../nova/v2_0/parse/ParseCreateFlavorTest.java | 58 ++
.../nova/v2_0/parse/ParseCreatedServerTest.java | 80 ++
.../parse/ParseExtensionListNormalTest.java | 76 ++
.../nova/v2_0/parse/ParseExtensionListTest.java | 88 +++
.../nova/v2_0/parse/ParseExtensionTest.java | 71 ++
.../nova/v2_0/parse/ParseFlavorListTest.java | 85 +++
.../nova/v2_0/parse/ParseFlavorTest.java | 70 ++
.../v2_0/parse/ParseFloatingIPListTest.java | 59 ++
.../nova/v2_0/parse/ParseFloatingIPTest.java | 53 ++
.../nova/v2_0/parse/ParseImageListTest.java | 85 +++
.../nova/v2_0/parse/ParseImageTest.java | 98 +++
.../nova/v2_0/parse/ParseKeyPairListTest.java | 68 ++
.../nova/v2_0/parse/ParseKeyPairTest.java | 61 ++
.../nova/v2_0/parse/ParseMetadataItemTest.java | 58 ++
.../nova/v2_0/parse/ParseMetadataListTest.java | 63 ++
.../v2_0/parse/ParseMetadataUpdateTest.java | 64 ++
.../v2_0/parse/ParseSecurityGroupListTest.java | 72 ++
.../nova/v2_0/parse/ParseSecurityGroupTest.java | 69 ++
.../v2_0/parse/ParseServerDetailsEssexTest.java | 170 +++++
.../nova/v2_0/parse/ParseServerDiagnostics.java | 57 ++
.../nova/v2_0/parse/ParseServerListTest.java | 85 +++
.../nova/v2_0/parse/ParseServerTest.java | 117 +++
.../parse/ParseServerWithAllExtensionsTest.java | 104 +++
.../ParseServerWithInternetAddressesTest.java | 99 +++
...ublicIpsInPrivateAddressBlockExpectTest.java | 99 +++
.../v2_0/predicates/ImagePredicatesTest.java | 44 ++
.../predicates/SecurityGroupPredicatesTest.java | 129 ++++
.../src/test/resources/attachment_details.json | 1 +
.../src/test/resources/attachment_list.json | 1 +
.../src/test/resources/extension_details.json | 21 +
.../src/test/resources/extension_list.json | 42 ++
.../src/test/resources/extension_list_full.json | 281 +++++++
.../test/resources/extension_list_normal.json | 31 +
.../resources/extension_list_openstack.json | 115 +++
.../src/test/resources/flavor_details.json | 19 +
.../src/test/resources/flavor_list.json | 32 +
.../src/test/resources/flavor_list_detail.json | 1 +
.../resources/flavor_list_detail_openstack.json | 83 +++
.../src/test/resources/flavor_new.json | 10 +
.../src/test/resources/floatingip_details.json | 9 +
.../src/test/resources/floatingip_list.json | 16 +
.../1.7.1-stratos/src/test/resources/host.json | 1 +
.../test/resources/host_aggregate_details.json | 1 +
.../src/test/resources/host_aggregate_list.json | 1 +
.../host_aggregate_with_host_details.json | 1 +
.../src/test/resources/hosts_list.json | 1 +
.../src/test/resources/image_active.json | 41 +
.../src/test/resources/image_details.json | 41 +
.../src/test/resources/image_list.json | 32 +
.../src/test/resources/image_list_detail.json | 1 +
.../image_list_detail_imageextension.json | 121 +++
.../resources/image_list_detail_openstack.json | 81 ++
.../src/test/resources/keypair_created.json | 9 +
.../keypair_created_computeservice.json | 9 +
.../src/test/resources/keypair_list.json | 18 +
.../test/resources/listAvailabilityZones.json | 11 +
.../src/test/resources/metadata_item.json | 5 +
.../src/test/resources/metadata_list.json | 6 +
.../src/test/resources/metadata_updated.json | 7 +
.../src/test/resources/new_server.json | 41 +
.../resources/new_server_disk_config_auto.json | 42 ++
.../new_server_disk_config_manual.json | 42 ++
.../src/test/resources/new_server_in_zone.json | 41 +
.../resources/new_server_networks_response.json | 42 ++
.../test/resources/new_server_no_adminpass.json | 40 +
.../resources/new_server_nova_networks.json | 41 +
.../src/test/resources/quota_class.json | 15 +
.../src/test/resources/quotas.json | 15 +
.../test/resources/securitygroup_created.json | 9 +
.../test/resources/securitygroup_details.json | 34 +
...itygroup_details_computeservice_typical.json | 51 ++
.../securitygroup_details_extension.json | 34 +
...securitygroup_details_extension_norules.json | 10 +
.../resources/securitygroup_details_port22.json | 19 +
.../src/test/resources/securitygroup_list.json | 51 ++
...oup_list_details_computeservice_typical.json | 53 ++
.../resources/securitygroup_list_extension.json | 51 ++
.../resources/securitygrouprule_created.json | 12 +
.../securitygrouprule_created_cidr.json | 13 +
.../securitygrouprule_created_group.json | 14 +
.../src/test/resources/server_details.json | 86 +++
.../test/resources/server_details_devstack.json | 44 ++
.../resources/server_details_openstack.json | 46 ++
.../src/test/resources/server_diagnostics.json | 17 +
.../src/test/resources/server_list.json | 32 +
.../src/test/resources/server_list_details.json | 79 ++
.../resources/server_list_details_essex.json | 152 ++++
.../resources/server_public_ip_in_private.json | 51 ++
.../resources/server_with_security_groups.json | 1 +
.../server_with_security_groups_extension.json | 1 +
.../src/test/resources/simple_tenant_usage.json | 1 +
.../test/resources/simple_tenant_usages.json | 1 +
.../src/test/resources/snapshot_details.json | 1 +
.../src/test/resources/snapshot_list.json | 1 +
.../test/resources/snapshot_list_detail.json | 1 +
.../test/resources/virtual_interfaces_list.json | 1 +
.../src/test/resources/volume_details.json | 1 +
.../src/test/resources/volume_list.json | 1 +
.../src/test/resources/volume_list_detail.json | 1 +
.../src/test/resources/volume_type.json | 9 +
.../test/resources/volume_type_extra_specs.json | 1 +
.../src/test/resources/volume_type_list.json | 1 +
dependencies/pom.xml | 1 +
.../pom.xml | 8 +-
pom.xml | 2 +-
318 files changed, 34065 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/components/org.apache.stratos.cloud.controller/pom.xml
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cloud.controller/pom.xml b/components/org.apache.stratos.cloud.controller/pom.xml
index 73b67b4..c998706 100644
--- a/components/org.apache.stratos.cloud.controller/pom.xml
+++ b/components/org.apache.stratos.cloud.controller/pom.xml
@@ -196,7 +196,7 @@
<dependency>
<groupId>org.apache.jclouds.api</groupId>
<artifactId>openstack-nova</artifactId>
- <version>${jclouds.version}</version>
+ <version>${jclouds.stratos.version}</version>
</dependency>
<dependency>
<groupId>org.apache.jclouds.api</groupId>
@@ -211,7 +211,7 @@
<dependency>
<groupId>org.apache.jclouds.api</groupId>
<artifactId>vcloud</artifactId>
- <version>${jclouds.vcloud.version}</version>
+ <version>${jclouds.stratos.version}</version>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/README.txt
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/README.txt b/dependencies/jclouds/openstack-nova/1.7.1-stratos/README.txt
new file mode 100755
index 0000000..7162c0f
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/README.txt
@@ -0,0 +1,3 @@
+#
+# The jclouds API for OpenStack Nova
+#
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/pom.xml
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/pom.xml b/dependencies/jclouds/openstack-nova/1.7.1-stratos/pom.xml
new file mode 100644
index 0000000..e022595
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/pom.xml
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF 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.apache.jclouds</groupId>
+ <artifactId>jclouds-project</artifactId>
+ <version>1.7.1</version>
+ </parent>
+ <groupId>org.apache.jclouds.api</groupId>
+ <artifactId>openstack-nova</artifactId>
+ <version>1.7.1-stratos</version>
+ <name>jclouds openstack-nova api</name>
+ <description>jclouds components to access an implementation of OpenStack Nova</description>
+ <packaging>bundle</packaging>
+
+ <properties>
+ <jclouds.version>1.7.1</jclouds.version>
+ <!-- keystone endpoint -->
+ <test.openstack-nova.endpoint>http://localhost:5000/v2.0/</test.openstack-nova.endpoint>
+ <!-- keystone version -->
+ <test.openstack-nova.api-version>1.1</test.openstack-nova.api-version>
+ <test.openstack-nova.build-version />
+ <test.openstack-nova.identity>FIXME_IDENTITY</test.openstack-nova.identity>
+ <test.openstack-nova.credential>FIXME_CREDENTIALS</test.openstack-nova.credential>
+ <test.openstack-nova.template />
+ <test.jclouds.openstack-nova.auto-allocate-floating-ips>false</test.jclouds.openstack-nova.auto-allocate-floating-ips>
+ <test.jclouds.keystone.credential-type>passwordCredentials</test.jclouds.keystone.credential-type>
+
+ <jclouds.osgi.export>org.jclouds.openstack.nova.v2_0*;version="${project.version}"</jclouds.osgi.export>
+ <jclouds.osgi.import>
+ org.jclouds.compute.internal;version="${jclouds.version}",
+ org.jclouds.rest.internal;version="${jclouds.version}",
+ org.jclouds*;version="${jclouds.version}",
+ *
+ </jclouds.osgi.import>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.jclouds.api</groupId>
+ <artifactId>openstack-keystone</artifactId>
+ <version>${jclouds.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.jclouds</groupId>
+ <artifactId>jclouds-compute</artifactId>
+ <version>${jclouds.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.jclouds</groupId>
+ <artifactId>jclouds-core</artifactId>
+ <version>${jclouds.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.jclouds.api</groupId>
+ <artifactId>openstack-keystone</artifactId>
+ <version>${jclouds.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.jclouds</groupId>
+ <artifactId>jclouds-compute</artifactId>
+ <version>${jclouds.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.jclouds.driver</groupId>
+ <artifactId>jclouds-sshj</artifactId>
+ <version>${jclouds.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.jclouds.driver</groupId>
+ <artifactId>jclouds-slf4j</artifactId>
+ <version>${jclouds.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <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.endpoint>${test.openstack-nova.endpoint}</test.openstack-nova.endpoint>
+ <test.openstack-nova.api-version>${test.openstack-nova.api-version}</test.openstack-nova.api-version>
+ <test.openstack-nova.build-version>${test.openstack-nova.build-version}</test.openstack-nova.build-version>
+ <test.openstack-nova.identity>${test.openstack-nova.identity}</test.openstack-nova.identity>
+ <test.openstack-nova.credential>${test.openstack-nova.credential}</test.openstack-nova.credential>
+ <test.openstack-nova.template>${test.openstack-nova.template}</test.openstack-nova.template>
+ <test.jclouds.openstack-nova.auto-allocate-floating-ips>${test.jclouds.openstack-nova.auto-allocate-floating-ips}</test.jclouds.openstack-nova.auto-allocate-floating-ips>
+ <test.jclouds.keystone.credential-type>${test.jclouds.keystone.credential-type}</test.jclouds.keystone.credential-type>
+ </systemPropertyVariables>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApi.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApi.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApi.java
new file mode 100644
index 0000000..b03727e
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApi.java
@@ -0,0 +1,208 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.v2_0;
+
+import java.io.Closeable;
+import java.util.Set;
+import org.jclouds.javax.annotation.Nullable;
+import org.jclouds.location.Zone;
+import org.jclouds.location.functions.ZoneToEndpoint;
+import org.jclouds.openstack.nova.v2_0.extensions.AvailabilityZoneAPI;
+import org.jclouds.openstack.nova.v2_0.extensions.FlavorExtraSpecsApi;
+import org.jclouds.openstack.nova.v2_0.extensions.FloatingIPApi;
+import org.jclouds.openstack.nova.v2_0.extensions.HostAdministrationApi;
+import org.jclouds.openstack.nova.v2_0.extensions.HostAggregateApi;
+import org.jclouds.openstack.nova.v2_0.extensions.KeyPairApi;
+import org.jclouds.openstack.nova.v2_0.extensions.QuotaApi;
+import org.jclouds.openstack.nova.v2_0.extensions.QuotaClassApi;
+import org.jclouds.openstack.nova.v2_0.extensions.SecurityGroupApi;
+import org.jclouds.openstack.nova.v2_0.extensions.ServerAdminApi;
+import org.jclouds.openstack.nova.v2_0.extensions.ServerWithSecurityGroupsApi;
+import org.jclouds.openstack.nova.v2_0.extensions.SimpleTenantUsageApi;
+import org.jclouds.openstack.nova.v2_0.extensions.VirtualInterfaceApi;
+import org.jclouds.openstack.nova.v2_0.extensions.VolumeApi;
+import org.jclouds.openstack.nova.v2_0.extensions.VolumeAttachmentApi;
+import org.jclouds.openstack.nova.v2_0.extensions.VolumeTypeApi;
+import org.jclouds.openstack.nova.v2_0.features.FlavorApi;
+import org.jclouds.openstack.nova.v2_0.features.ImageApi;
+import org.jclouds.openstack.nova.v2_0.features.ServerApi;
+import org.jclouds.openstack.v2_0.features.ExtensionApi;
+import org.jclouds.rest.annotations.Delegate;
+import org.jclouds.rest.annotations.EndpointParam;
+
+import com.google.common.base.Optional;
+import com.google.inject.Provides;
+
+/**
+ * Provides synchronous access to Nova.
+ * <p/>
+ *
+ * @see NovaAsyncApi
+ * @see <a href="http://docs.openstack.org/api/openstack-compute/1.1/content/"
+ * />
+ * @author Adrian Cole
+ */
+public interface NovaApi extends Closeable {
+ /**
+ *
+ * @return the Zone codes configured
+ */
+ @Provides
+ @Zone
+ Set<String> getConfiguredZones();
+
+ /**
+ * Provides synchronous access to availability zone features
+ */
+ @Delegate
+ AvailabilityZoneAPI getAvailabilityZoneApi(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides synchronous access to Server features.
+ */
+ @Delegate
+ ServerApi getServerApiForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides synchronous access to Flavor features.
+ */
+ @Delegate
+ FlavorApi getFlavorApiForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides synchronous access to Extension features.
+ */
+ @Delegate
+ ExtensionApi getExtensionApiForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides synchronous access to Image features.
+ */
+ @Delegate
+ ImageApi getImageApiForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides synchronous access to Floating IP features.
+ */
+ @Delegate
+ Optional<? extends FloatingIPApi> getFloatingIPExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides synchronous access to Security Group features.
+ */
+ @Delegate
+ Optional<? extends SecurityGroupApi> getSecurityGroupExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides synchronous access to Key Pair features.
+ */
+ @Delegate
+ Optional<? extends KeyPairApi> getKeyPairExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides synchronous access to Host Administration features.
+ */
+ @Delegate
+ Optional<? extends HostAdministrationApi> getHostAdministrationExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides synchronous access to Simple Tenant Usage features.
+ */
+ @Delegate
+ Optional<? extends SimpleTenantUsageApi> getSimpleTenantUsageExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides synchronous access to Virtual Interface features.
+ */
+ @Delegate
+ Optional<? extends VirtualInterfaceApi> getVirtualInterfaceExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides synchronous access to Server Extra Data features.
+ */
+ @Delegate
+ Optional<? extends ServerWithSecurityGroupsApi> getServerWithSecurityGroupsExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides synchronous access to Server Admin Actions features.
+ */
+ @Delegate
+ Optional<? extends ServerAdminApi> getServerAdminExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides synchronous access to Aggregate features.
+ */
+ @Delegate
+ Optional<? extends HostAggregateApi> getHostAggregateExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides synchronous access to Flavor extra specs features.
+ */
+ @Delegate
+ Optional<? extends FlavorExtraSpecsApi> getFlavorExtraSpecsExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides synchronous access to Quota features.
+ */
+ @Delegate
+ Optional<? extends QuotaApi> getQuotaExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides synchronous access to Quota Classes features.
+ */
+ @Delegate
+ Optional<? extends QuotaClassApi> getQuotaClassExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides synchronous access to Volume features.
+ */
+ @Delegate
+ Optional<? extends VolumeApi> getVolumeExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides synchronous access to Volume Attachment features.
+ */
+ @Delegate
+ Optional<? extends VolumeAttachmentApi> getVolumeAttachmentExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides synchronous access to Volume Type features.
+ */
+ @Delegate
+ Optional<? extends VolumeTypeApi> getVolumeTypeExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApiMetadata.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApiMetadata.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApiMetadata.java
new file mode 100644
index 0000000..ff87858
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApiMetadata.java
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.v2_0;
+
+import static org.jclouds.Constants.PROPERTY_SESSION_INTERVAL;
+import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.CREDENTIAL_TYPE;
+import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.SERVICE_TYPE;
+import static org.jclouds.openstack.nova.v2_0.config.NovaProperties.AUTO_ALLOCATE_FLOATING_IPS;
+import static org.jclouds.openstack.nova.v2_0.config.NovaProperties.AUTO_GENERATE_KEYPAIRS;
+import static org.jclouds.openstack.nova.v2_0.config.NovaProperties.TIMEOUT_SECURITYGROUP_PRESENT;
+import static org.jclouds.reflect.Reflection2.typeToken;
+
+import java.net.URI;
+import java.util.Properties;
+
+import org.jclouds.compute.ComputeServiceContext;
+import org.jclouds.openstack.keystone.v2_0.config.CredentialTypes;
+import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule;
+import org.jclouds.openstack.keystone.v2_0.config.MappedAuthenticationApiModule;
+import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.ZoneModule;
+import org.jclouds.openstack.nova.v2_0.compute.config.NovaComputeServiceContextModule;
+import org.jclouds.openstack.nova.v2_0.config.NovaParserModule;
+import org.jclouds.openstack.nova.v2_0.config.NovaRestClientModule;
+import org.jclouds.openstack.v2_0.ServiceType;
+import org.jclouds.rest.internal.BaseRestApiMetadata;
+
+import com.google.common.collect.ImmutableSet;
+import com.google.common.reflect.TypeToken;
+import com.google.inject.Module;
+
+/**
+ * Implementation of {@link ApiMetadata} for Nova 2.0 API
+ *
+ * @author Adrian Cole
+ */
+public class NovaApiMetadata extends BaseRestApiMetadata {
+
+ /**
+ * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(NovaApi.class)} as
+ * {@link NovaAsyncApi} interface will be removed in jclouds 1.7.
+ */
+ @Deprecated
+ public static final TypeToken<org.jclouds.rest.RestContext<NovaApi, NovaAsyncApi>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<NovaApi, NovaAsyncApi>>() {
+ private static final long serialVersionUID = 1L;
+ };
+
+ @Override
+ public Builder toBuilder() {
+ return new Builder().fromApiMetadata(this);
+ }
+
+ public NovaApiMetadata() {
+ this(new Builder());
+ }
+
+ protected NovaApiMetadata(Builder builder) {
+ super(builder);
+ }
+
+ public static Properties defaultProperties() {
+ Properties properties = BaseRestApiMetadata.defaultProperties();
+ // auth fail can happen while cloud-init applies keypair updates
+ properties.setProperty("jclouds.ssh.max-retries", "7");
+ properties.setProperty("jclouds.ssh.retry-auth", "true");
+ properties.setProperty(SERVICE_TYPE, ServiceType.COMPUTE);
+ properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.PASSWORD_CREDENTIALS);
+ properties.setProperty(AUTO_ALLOCATE_FLOATING_IPS, "false");
+ properties.setProperty(AUTO_GENERATE_KEYPAIRS, "false");
+ properties.setProperty(TIMEOUT_SECURITYGROUP_PRESENT, "500");
+ // Keystone 1.1 expires tokens after 24 hours and allows renewal 1 hour
+ // before expiry by default. We choose a value less than the latter
+ // since the former persists between jclouds invocations.
+ properties.setProperty(PROPERTY_SESSION_INTERVAL, 30 * 60 + "");
+ return properties;
+ }
+
+ public static class Builder extends BaseRestApiMetadata.Builder<Builder> {
+
+ @SuppressWarnings("deprecation")
+ protected Builder() {
+ super(NovaApi.class, NovaAsyncApi.class);
+ id("openstack-nova")
+ .name("OpenStack Nova Diablo+ API")
+ .identityName("${tenantName}:${userName} or ${userName}, if your keystone supports a default tenant")
+ .credentialName("${password}")
+ .endpointName("KeyStone base url ending in /v2.0/")
+ .documentation(URI.create("http://api.openstack.org/"))
+ .version("1.1")
+ .defaultEndpoint("http://localhost:5000/v2.0/")
+ .defaultProperties(NovaApiMetadata.defaultProperties())
+ .view(typeToken(ComputeServiceContext.class))
+ .defaultModules(ImmutableSet.<Class<? extends Module>>builder()
+ .add(MappedAuthenticationApiModule.class)
+ .add(KeystoneAuthenticationModule.class)
+ .add(ZoneModule.class)
+ .add(NovaParserModule.class)
+ .add(NovaRestClientModule.class)
+ .add(NovaComputeServiceContextModule.class).build());
+ }
+
+ @Override
+ public NovaApiMetadata build() {
+ return new NovaApiMetadata(this);
+ }
+
+ @Override
+ protected Builder self() {
+ return this;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/NovaAsyncApi.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/NovaAsyncApi.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/NovaAsyncApi.java
new file mode 100644
index 0000000..9abea53
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/NovaAsyncApi.java
@@ -0,0 +1,214 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.v2_0;
+
+import java.io.Closeable;
+import java.util.Set;
+
+import org.jclouds.javax.annotation.Nullable;
+import org.jclouds.location.Zone;
+import org.jclouds.location.functions.ZoneToEndpoint;
+import org.jclouds.openstack.nova.v2_0.extensions.AvailabilityZoneAPI;
+import org.jclouds.openstack.nova.v2_0.extensions.FlavorExtraSpecsAsyncApi;
+import org.jclouds.openstack.nova.v2_0.extensions.FloatingIPAsyncApi;
+import org.jclouds.openstack.nova.v2_0.extensions.HostAdministrationAsyncApi;
+import org.jclouds.openstack.nova.v2_0.extensions.HostAggregateAsyncApi;
+import org.jclouds.openstack.nova.v2_0.extensions.KeyPairAsyncApi;
+import org.jclouds.openstack.nova.v2_0.extensions.QuotaAsyncApi;
+import org.jclouds.openstack.nova.v2_0.extensions.QuotaClassAsyncApi;
+import org.jclouds.openstack.nova.v2_0.extensions.SecurityGroupAsyncApi;
+import org.jclouds.openstack.nova.v2_0.extensions.ServerAdminAsyncApi;
+import org.jclouds.openstack.nova.v2_0.extensions.ServerWithSecurityGroupsAsyncApi;
+import org.jclouds.openstack.nova.v2_0.extensions.SimpleTenantUsageAsyncApi;
+import org.jclouds.openstack.nova.v2_0.extensions.VirtualInterfaceAsyncApi;
+import org.jclouds.openstack.nova.v2_0.extensions.VolumeAsyncApi;
+import org.jclouds.openstack.nova.v2_0.extensions.VolumeAttachmentAsyncApi;
+import org.jclouds.openstack.nova.v2_0.extensions.VolumeTypeAsyncApi;
+import org.jclouds.openstack.nova.v2_0.features.FlavorAsyncApi;
+import org.jclouds.openstack.nova.v2_0.features.ImageAsyncApi;
+import org.jclouds.openstack.nova.v2_0.features.ServerAsyncApi;
+import org.jclouds.openstack.v2_0.features.ExtensionAsyncApi;
+import org.jclouds.rest.annotations.Delegate;
+import org.jclouds.rest.annotations.EndpointParam;
+
+import com.google.common.base.Optional;
+import com.google.inject.Provides;
+
+/**
+ * Provides asynchronous access to Nova via their REST API.
+ * <p/>
+ *
+ * @see NovaApi
+ * @see <a href="http://docs.openstack.org/api/openstack-compute/1.1/content/"
+ * />
+ * @author Adrian Cole
+ * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(NovaApi.class)} as
+ * {@link NovaAsyncApi} interface will be removed in jclouds 1.7.
+ */
+@Deprecated
+public interface NovaAsyncApi extends Closeable {
+
+ /**
+ *
+ * @return the Zone codes configured
+ */
+ @Provides
+ @Zone
+ Set<String> getConfiguredZones();
+
+ /**
+ * Provides asynchronous access to availability zone features
+ */
+ @Delegate
+ AvailabilityZoneAPI getAvailabilityZoneApi(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides asynchronous access to Server features.
+ */
+ @Delegate
+ ServerAsyncApi getServerApiForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides asynchronous access to Flavor features.
+ */
+ @Delegate
+ FlavorAsyncApi getFlavorApiForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides asynchronous access to Extension features.
+ */
+ @Delegate
+ ExtensionAsyncApi getExtensionApiForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides asynchronous access to Image features.
+ */
+ @Delegate
+ ImageAsyncApi getImageApiForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides asynchronous access to Floating IP features.
+ */
+ @Delegate
+ Optional<? extends FloatingIPAsyncApi> getFloatingIPExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides asynchronous access to Security Group features.
+ */
+ @Delegate
+ Optional<? extends SecurityGroupAsyncApi> getSecurityGroupExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides asynchronous access to Key Pair features.
+ */
+ @Delegate
+ Optional<? extends KeyPairAsyncApi> getKeyPairExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides asynchronous access to Host Administration features.
+ */
+ @Delegate
+ Optional<? extends HostAdministrationAsyncApi> getHostAdministrationExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides asynchronous access to Simple Tenant Usage features.
+ */
+ @Delegate
+ Optional<? extends SimpleTenantUsageAsyncApi> getSimpleTenantUsageExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides asynchronous access to Virtual Interface features.
+ */
+ @Delegate
+ Optional<? extends VirtualInterfaceAsyncApi> getVirtualInterfaceExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+
+ /**
+ * Provides asynchronous access to Server Extra Data features.
+ */
+ @Delegate
+ Optional<? extends ServerWithSecurityGroupsAsyncApi> getServerWithSecurityGroupsExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides asynchronous access to Server Admin Actions features.
+ */
+ @Delegate
+ Optional<? extends ServerAdminAsyncApi> getServerAdminExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides asynchronous access to HostAggregate features.
+ */
+ @Delegate
+ Optional<? extends HostAggregateAsyncApi> getHostAggregateExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides asynchronous access to Flavor extra specs features.
+ */
+ @Delegate
+ Optional<? extends FlavorExtraSpecsAsyncApi> getFlavorExtraSpecsExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides asynchronous access to Quota features.
+ */
+ @Delegate
+ Optional<? extends QuotaAsyncApi> getQuotaExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides asynchronous access to Quota Classes features.
+ */
+ @Delegate
+ Optional<? extends QuotaClassAsyncApi> getQuotaClassExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides asynchronous access to Volume features.
+ */
+ @Delegate
+ Optional<? extends VolumeAsyncApi> getVolumeExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides asynchronous access to Volume features.
+ */
+ @Delegate
+ Optional<? extends VolumeAttachmentAsyncApi> getVolumeAttachmentExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+ /**
+ * Provides asynchronous access to Volume Type features.
+ */
+ @Delegate
+ Optional<? extends VolumeTypeAsyncApi> getVolumeTypeExtensionForZone(
+ @EndpointParam(parser = ZoneToEndpoint.class) @Nullable String zone);
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/binders/BindKeyPairToJsonPayload.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/binders/BindKeyPairToJsonPayload.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/binders/BindKeyPairToJsonPayload.java
new file mode 100644
index 0000000..882eac6
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/binders/BindKeyPairToJsonPayload.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.v2_0.binders;
+
+import java.util.Map;
+
+import javax.inject.Inject;
+import javax.inject.Singleton;
+
+import org.jclouds.http.HttpRequest;
+import org.jclouds.json.Json;
+import org.jclouds.rest.binders.BindToJsonPayload;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSortedMap;
+
+/**
+ *
+ * @author Adrian Cole
+ */
+@Singleton
+public class BindKeyPairToJsonPayload extends BindToJsonPayload {
+
+ @Inject
+ public BindKeyPairToJsonPayload(Json jsonBinder) {
+ super(jsonBinder);
+ }
+
+ @Override
+ public <R extends HttpRequest> R bindToRequest(R request, Map<String, Object> postParams) {
+ return bindToRequest(request, (Object) ImmutableMap.of("keypair", ImmutableSortedMap.copyOf(postParams)));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/binders/BindMetadataToJsonPayload.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/binders/BindMetadataToJsonPayload.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/binders/BindMetadataToJsonPayload.java
new file mode 100644
index 0000000..3cf29d7
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/binders/BindMetadataToJsonPayload.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.v2_0.binders;
+
+import java.util.Map;
+
+import javax.inject.Inject;
+import javax.inject.Singleton;
+
+import org.jclouds.http.HttpRequest;
+import org.jclouds.json.Json;
+import org.jclouds.rest.binders.BindToJsonPayload;
+
+import com.google.common.collect.ImmutableMap;
+
+/**
+ *
+ * @author Adrian Cole
+ */
+@Singleton
+public class BindMetadataToJsonPayload extends BindToJsonPayload {
+
+ @Inject
+ public BindMetadataToJsonPayload(Json jsonBinder) {
+ super(jsonBinder);
+ }
+
+ @Override
+ public <R extends HttpRequest> R bindToRequest(R request, Map<String, Object> postParams) {
+ return bindToRequest(request,
+ (Object) ImmutableMap.of("metadata", ImmutableMap.of(postParams.get("key"), postParams.get("value"))));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/binders/BindSecurityGroupRuleToJsonPayload.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/binders/BindSecurityGroupRuleToJsonPayload.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/binders/BindSecurityGroupRuleToJsonPayload.java
new file mode 100644
index 0000000..cdd3df5
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/binders/BindSecurityGroupRuleToJsonPayload.java
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.v2_0.binders;
+
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
+import static com.google.common.base.Predicates.instanceOf;
+import static com.google.common.collect.Iterables.find;
+
+import java.util.Map;
+
+import javax.inject.Inject;
+import javax.inject.Singleton;
+
+import org.jclouds.http.HttpRequest;
+import org.jclouds.json.Json;
+import org.jclouds.openstack.nova.v2_0.domain.Ingress;
+import org.jclouds.rest.MapBinder;
+import org.jclouds.rest.binders.BindToJsonPayload;
+import org.jclouds.rest.internal.GeneratedHttpRequest;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableMap.Builder;
+
+/**
+ *
+ * @author Adrian Cole
+ *
+ */
+@Singleton
+public class BindSecurityGroupRuleToJsonPayload extends BindToJsonPayload implements MapBinder {
+ @Inject
+ public BindSecurityGroupRuleToJsonPayload(Json jsonBinder) {
+ super(jsonBinder);
+ }
+
+ @Override
+ public <R extends HttpRequest> R bindToRequest(R request, Object toBind) {
+ throw new IllegalStateException("BindCredentialsToJsonPayload needs parameters");
+ }
+
+ @Override
+ public <R extends HttpRequest> R bindToRequest(R request, Map<String, Object> postParams) {
+ Builder<String, Object> payload = ImmutableMap.builder();
+ payload.putAll(postParams);
+ checkArgument(checkNotNull(request, "request") instanceof GeneratedHttpRequest,
+ "this binder is only valid for GeneratedHttpRequests!");
+ GeneratedHttpRequest gRequest = (GeneratedHttpRequest) request;
+
+ Ingress ingress = Ingress.class.cast(find(gRequest.getInvocation().getArgs(), instanceOf(Ingress.class)));
+ payload.put("ip_protocol", ingress.getIpProtocol().toString());
+ payload.put("from_port", ingress.getFromPort() + "");
+ payload.put("to_port", ingress.getToPort() + "");
+
+ return super.bindToRequest(request, ImmutableMap.of("security_group_rule", payload.build()));
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeService.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeService.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeService.java
new file mode 100644
index 0000000..7a10942
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeService.java
@@ -0,0 +1,183 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.v2_0.compute;
+import static com.google.common.base.Preconditions.checkNotNull;
+import static org.jclouds.compute.config.ComputeServiceProperties.TIMEOUT_NODE_RUNNING;
+import static org.jclouds.compute.config.ComputeServiceProperties.TIMEOUT_NODE_SUSPENDED;
+import static org.jclouds.compute.config.ComputeServiceProperties.TIMEOUT_NODE_TERMINATED;
+import static org.jclouds.openstack.nova.v2_0.predicates.KeyPairPredicates.nameMatches;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicReference;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import org.jclouds.Constants;
+import org.jclouds.collect.Memoized;
+import org.jclouds.compute.ComputeServiceContext;
+import org.jclouds.compute.callables.RunScriptOnNode;
+import org.jclouds.compute.domain.Hardware;
+import org.jclouds.compute.domain.Image;
+import org.jclouds.compute.domain.NodeMetadata;
+import org.jclouds.compute.domain.TemplateBuilder;
+import org.jclouds.compute.extensions.ImageExtension;
+import org.jclouds.compute.extensions.SecurityGroupExtension;
+import org.jclouds.compute.functions.GroupNamingConvention;
+import org.jclouds.compute.internal.BaseComputeService;
+import org.jclouds.compute.internal.PersistNodeCredentials;
+import org.jclouds.compute.options.TemplateOptions;
+import org.jclouds.compute.reference.ComputeServiceConstants.Timeouts;
+import org.jclouds.compute.strategy.CreateNodesInGroupThenAddToSet;
+import org.jclouds.compute.strategy.DestroyNodeStrategy;
+import org.jclouds.compute.strategy.GetImageStrategy;
+import org.jclouds.compute.strategy.GetNodeMetadataStrategy;
+import org.jclouds.compute.strategy.InitializeRunScriptOnNodeOrPlaceInBadMap;
+import org.jclouds.compute.strategy.ListNodesStrategy;
+import org.jclouds.compute.strategy.RebootNodeStrategy;
+import org.jclouds.compute.strategy.ResumeNodeStrategy;
+import org.jclouds.compute.strategy.SuspendNodeStrategy;
+import org.jclouds.domain.Credentials;
+import org.jclouds.domain.Location;
+import org.jclouds.openstack.nova.v2_0.NovaApi;
+import org.jclouds.openstack.nova.v2_0.compute.options.NovaTemplateOptions;
+import org.jclouds.openstack.nova.v2_0.domain.KeyPair;
+import org.jclouds.openstack.nova.v2_0.domain.SecurityGroup;
+import org.jclouds.openstack.nova.v2_0.domain.zonescoped.SecurityGroupInZone;
+import org.jclouds.openstack.nova.v2_0.domain.zonescoped.ZoneAndName;
+import org.jclouds.openstack.nova.v2_0.extensions.KeyPairApi;
+import org.jclouds.openstack.nova.v2_0.extensions.SecurityGroupApi;
+import org.jclouds.openstack.nova.v2_0.predicates.SecurityGroupPredicates;
+import org.jclouds.scriptbuilder.functions.InitAdminAccess;
+
+import com.google.common.base.Function;
+import com.google.common.base.Optional;
+import com.google.common.base.Predicate;
+import com.google.common.base.Supplier;
+import com.google.common.cache.LoadingCache;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Multimap;
+import com.google.common.util.concurrent.ListeningExecutorService;
+
+/**
+ * @author Adrian Cole
+ */
+@Singleton
+public class NovaComputeService extends BaseComputeService {
+ protected final NovaApi novaApi;
+ protected final LoadingCache<ZoneAndName, SecurityGroupInZone> securityGroupMap;
+ protected final LoadingCache<ZoneAndName, KeyPair> keyPairCache;
+ protected final Function<Set<? extends NodeMetadata>, Multimap<String, String>> orphanedGroupsByZoneId;
+ protected final GroupNamingConvention.Factory namingConvention;
+
+ @Inject
+ protected NovaComputeService(ComputeServiceContext context, Map<String, Credentials> credentialStore,
+ @Memoized Supplier<Set<? extends Image>> images, @Memoized Supplier<Set<? extends Hardware>> sizes,
+ @Memoized Supplier<Set<? extends Location>> locations, ListNodesStrategy listNodesStrategy,
+ GetImageStrategy getImageStrategy, GetNodeMetadataStrategy getNodeMetadataStrategy,
+ CreateNodesInGroupThenAddToSet runNodesAndAddToSetStrategy, RebootNodeStrategy rebootNodeStrategy,
+ DestroyNodeStrategy destroyNodeStrategy, ResumeNodeStrategy startNodeStrategy,
+ SuspendNodeStrategy stopNodeStrategy, Provider<TemplateBuilder> templateBuilderProvider,
+ @Named("DEFAULT") Provider<TemplateOptions> templateOptionsProvider,
+ @Named(TIMEOUT_NODE_RUNNING) Predicate<AtomicReference<NodeMetadata>> nodeRunning,
+ @Named(TIMEOUT_NODE_TERMINATED) Predicate<AtomicReference<NodeMetadata>> nodeTerminated,
+ @Named(TIMEOUT_NODE_SUSPENDED) Predicate<AtomicReference<NodeMetadata>> nodeSuspended,
+ InitializeRunScriptOnNodeOrPlaceInBadMap.Factory initScriptRunnerFactory,
+ RunScriptOnNode.Factory runScriptOnNodeFactory, InitAdminAccess initAdminAccess,
+ PersistNodeCredentials persistNodeCredentials, Timeouts timeouts,
+ @Named(Constants.PROPERTY_USER_THREADS) ListeningExecutorService userExecutor, NovaApi novaApi,
+ LoadingCache<ZoneAndName, SecurityGroupInZone> securityGroupMap,
+ LoadingCache<ZoneAndName, KeyPair> keyPairCache,
+ Function<Set<? extends NodeMetadata>, Multimap<String, String>> orphanedGroupsByZoneId,
+ GroupNamingConvention.Factory namingConvention, Optional<ImageExtension> imageExtension,
+ Optional<SecurityGroupExtension> securityGroupExtension) {
+ super(context, credentialStore, images, sizes, locations, listNodesStrategy, getImageStrategy,
+ getNodeMetadataStrategy, runNodesAndAddToSetStrategy, rebootNodeStrategy, destroyNodeStrategy,
+ startNodeStrategy, stopNodeStrategy, templateBuilderProvider, templateOptionsProvider, nodeRunning,
+ nodeTerminated, nodeSuspended, initScriptRunnerFactory, initAdminAccess, runScriptOnNodeFactory,
+ persistNodeCredentials, timeouts, userExecutor, imageExtension, securityGroupExtension);
+ this.novaApi = checkNotNull(novaApi, "novaApi");
+ this.securityGroupMap = checkNotNull(securityGroupMap, "securityGroupMap");
+ this.keyPairCache = checkNotNull(keyPairCache, "keyPairCache");
+ this.orphanedGroupsByZoneId = checkNotNull(orphanedGroupsByZoneId, "orphanedGroupsByZoneId");
+ this.namingConvention = checkNotNull(namingConvention, "namingConvention");
+ }
+
+ @Override
+ protected void cleanUpIncidentalResourcesOfDeadNodes(Set<? extends NodeMetadata> deadNodes) {
+ Multimap<String, String> zoneToZoneAndGroupNames = orphanedGroupsByZoneId.apply(deadNodes);
+ for (Map.Entry<String, Collection<String>> entry : zoneToZoneAndGroupNames.asMap().entrySet()) {
+ cleanOrphanedGroupsInZone(ImmutableSet.copyOf(entry.getValue()), entry.getKey());
+ }
+ }
+
+ protected void cleanOrphanedGroupsInZone(Set<String> groups, String zoneId) {
+ cleanupOrphanedSecurityGroupsInZone(groups, zoneId);
+ cleanupOrphanedKeyPairsInZone(groups, zoneId);
+ }
+
+ private void cleanupOrphanedSecurityGroupsInZone(Set<String> groups, String zoneId) {
+ Optional<? extends SecurityGroupApi> securityGroupApi = novaApi.getSecurityGroupExtensionForZone(zoneId);
+ if (securityGroupApi.isPresent()) {
+ for (String group : groups) {
+ for (SecurityGroup securityGroup : Iterables.filter(securityGroupApi.get().list(),
+ SecurityGroupPredicates.nameMatches(namingConvention.create().containsGroup(group)))) {
+ ZoneAndName zoneAndName = ZoneAndName.fromZoneAndName(zoneId, securityGroup.getName());
+ logger.debug(">> deleting securityGroup(%s)", zoneAndName);
+ securityGroupApi.get().delete(securityGroup.getId());
+ // TODO: test this clear happens
+ securityGroupMap.invalidate(zoneAndName);
+ logger.debug("<< deleted securityGroup(%s)", zoneAndName);
+ }
+ }
+ }
+ }
+
+ private void cleanupOrphanedKeyPairsInZone(Set<String> groups, String zoneId) {
+ Optional<? extends KeyPairApi> keyPairApi = novaApi.getKeyPairExtensionForZone(zoneId);
+ if (keyPairApi.isPresent()) {
+ for (String group : groups) {
+ for (KeyPair pair : keyPairApi.get().list().filter(nameMatches(namingConvention.create().containsGroup(group)))) {
+ ZoneAndName zoneAndName = ZoneAndName.fromZoneAndName(zoneId, pair.getName());
+ logger.debug(">> deleting keypair(%s)", zoneAndName);
+ keyPairApi.get().delete(pair.getName());
+ // TODO: test this clear happens
+ keyPairCache.invalidate(zoneAndName);
+ logger.debug("<< deleted keypair(%s)", zoneAndName);
+ }
+ keyPairCache.invalidate(ZoneAndName.fromZoneAndName(zoneId,
+ namingConvention.create().sharedNameForGroup(group)));
+ }
+ }
+ }
+
+ /**
+ * returns template options, except of type {@link NovaTemplateOptions}.
+ */
+ @Override
+ public NovaTemplateOptions templateOptions() {
+ return NovaTemplateOptions.class.cast(super.templateOptions());
+ }
+
+
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/d4243b7e/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeServiceAdapter.java
----------------------------------------------------------------------
diff --git a/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeServiceAdapter.java b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeServiceAdapter.java
new file mode 100644
index 0000000..e4ceade
--- /dev/null
+++ b/dependencies/jclouds/openstack-nova/1.7.1-stratos/src/main/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeServiceAdapter.java
@@ -0,0 +1,286 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF 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.v2_0.compute;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkState;
+import static com.google.common.collect.Iterables.contains;
+import static com.google.common.collect.Iterables.filter;
+import static com.google.common.collect.Iterables.transform;
+import static org.jclouds.compute.util.ComputeServiceUtils.metadataAndTagsAsCommaDelimitedValue;
+
+import java.util.Set;
+
+import javax.annotation.Resource;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import org.jclouds.compute.ComputeServiceAdapter;
+import org.jclouds.compute.domain.Template;
+import org.jclouds.compute.reference.ComputeServiceConstants;
+import org.jclouds.domain.Location;
+import org.jclouds.domain.LoginCredentials;
+import org.jclouds.location.Zone;
+import org.jclouds.logging.Logger;
+import org.jclouds.openstack.nova.v2_0.NovaApi;
+import org.jclouds.openstack.nova.v2_0.compute.functions.RemoveFloatingIpFromNodeAndDeallocate;
+import org.jclouds.openstack.nova.v2_0.compute.options.NovaTemplateOptions;
+import org.jclouds.openstack.nova.v2_0.domain.Flavor;
+import org.jclouds.openstack.nova.v2_0.domain.Image;
+import org.jclouds.openstack.nova.v2_0.domain.KeyPair;
+import org.jclouds.openstack.nova.v2_0.domain.RebootType;
+import org.jclouds.openstack.nova.v2_0.domain.Server;
+import org.jclouds.openstack.nova.v2_0.domain.ServerCreated;
+import org.jclouds.openstack.nova.v2_0.domain.zonescoped.FlavorInZone;
+import org.jclouds.openstack.nova.v2_0.domain.zonescoped.ImageInZone;
+import org.jclouds.openstack.nova.v2_0.domain.zonescoped.ServerInZone;
+import org.jclouds.openstack.nova.v2_0.domain.zonescoped.ZoneAndId;
+import org.jclouds.openstack.nova.v2_0.domain.zonescoped.ZoneAndName;
+import org.jclouds.openstack.nova.v2_0.options.CreateServerOptions;
+import org.jclouds.openstack.nova.v2_0.predicates.ImagePredicates;
+
+import com.google.common.base.Function;
+import com.google.common.base.Objects;
+import com.google.common.base.Optional;
+import com.google.common.base.Predicate;
+import com.google.common.base.Supplier;
+import com.google.common.cache.LoadingCache;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.ImmutableSet.Builder;
+
+/**
+ * The adapter used by the NovaComputeServiceContextModule to interface the nova-specific domain
+ * model to the computeService generic domain model.
+ *
+ * @author Matt Stephenson, Adrian Cole
+ */
+public class NovaComputeServiceAdapter implements
+ ComputeServiceAdapter<ServerInZone, FlavorInZone, ImageInZone, Location> {
+
+ @Resource
+ @Named(ComputeServiceConstants.COMPUTE_LOGGER)
+ protected Logger logger = Logger.NULL;
+
+ protected final NovaApi novaApi;
+ protected final Supplier<Set<String>> zoneIds;
+ protected final RemoveFloatingIpFromNodeAndDeallocate removeFloatingIpFromNodeAndDeallocate;
+ protected final LoadingCache<ZoneAndName, KeyPair> keyPairCache;
+
+ @Inject
+ public NovaComputeServiceAdapter(NovaApi novaApi, @Zone Supplier<Set<String>> zoneIds,
+ RemoveFloatingIpFromNodeAndDeallocate removeFloatingIpFromNodeAndDeallocate,
+ LoadingCache<ZoneAndName, KeyPair> keyPairCache) {
+ this.novaApi = checkNotNull(novaApi, "novaApi");
+ this.zoneIds = checkNotNull(zoneIds, "zoneIds");
+ this.removeFloatingIpFromNodeAndDeallocate = checkNotNull(removeFloatingIpFromNodeAndDeallocate,
+ "removeFloatingIpFromNodeAndDeallocate");
+ this.keyPairCache = checkNotNull(keyPairCache, "keyPairCache");
+ }
+
+ /**
+ * Note that we do not validate extensions here, on basis that
+ * {@link ApplyNovaTemplateOptionsCreateNodesWithGroupEncodedIntoNameThenAddToSet} has already
+ * done so.
+ */
+ @Override
+ public NodeAndInitialCredentials<ServerInZone> createNodeWithGroupEncodedIntoName(String group, String name,
+ Template template) {
+
+ LoginCredentials.Builder credentialsBuilder = LoginCredentials.builder();
+ NovaTemplateOptions templateOptions = template.getOptions().as(NovaTemplateOptions.class);
+
+ CreateServerOptions options = new CreateServerOptions();
+ options.metadata(metadataAndTagsAsCommaDelimitedValue(template.getOptions()));
+ if (templateOptions.getSecurityGroupNames().isPresent())
+ options.securityGroupNames(templateOptions.getSecurityGroupNames().get());
+ options.userData(templateOptions.getUserData());
+ options.diskConfig(templateOptions.getDiskConfig());
+ options.configDrive(templateOptions.getConfigDrive());
+ if (templateOptions.getNovaNetworks() != null) {
+ options.novaNetworks(templateOptions.getNovaNetworks());
+ }
+ if (templateOptions.getNetworks() != null) {
+ options.networks(templateOptions.getNetworks());
+ }
+
+ Optional<String> privateKey = Optional.absent();
+ if (templateOptions.getKeyPairName() != null) {
+ options.keyPairName(templateOptions.getKeyPairName());
+ KeyPair keyPair = keyPairCache.getIfPresent(ZoneAndName.fromZoneAndName(template.getLocation().getId(), templateOptions.getKeyPairName()));
+ if (keyPair != null && keyPair.getPrivateKey() != null) {
+ privateKey = Optional.of(keyPair.getPrivateKey());
+ credentialsBuilder.privateKey(privateKey.get());
+ }
+ }
+
+ String zoneId = template.getLocation().getId();
+ String imageId = template.getImage().getProviderId();
+ String flavorId = template.getHardware().getProviderId();
+
+ logger.debug(">> creating new server zone(%s) name(%s) image(%s) flavor(%s) options(%s)", zoneId, name, imageId, flavorId, options);
+ ServerCreated lightweightServer = novaApi.getServerApiForZone(zoneId).create(name, imageId, flavorId, options);
+ Server server = novaApi.getServerApiForZone(zoneId).get(lightweightServer.getId());
+
+ logger.trace("<< server(%s)", server.getId());
+
+ ServerInZone serverInZone = new ServerInZone(server, zoneId);
+ if (!privateKey.isPresent() && lightweightServer.getAdminPass().isPresent())
+ credentialsBuilder.password(lightweightServer.getAdminPass().get());
+ return new NodeAndInitialCredentials<ServerInZone>(serverInZone, serverInZone.slashEncode(), credentialsBuilder
+ .build());
+ }
+
+ @Override
+ public Iterable<FlavorInZone> listHardwareProfiles() {
+ Builder<FlavorInZone> builder = ImmutableSet.builder();
+ for (final String zoneId : zoneIds.get()) {
+ builder.addAll(transform(novaApi.getFlavorApiForZone(zoneId).listInDetail().concat(),
+ new Function<Flavor, FlavorInZone>() {
+
+ @Override
+ public FlavorInZone apply(Flavor arg0) {
+ return new FlavorInZone(arg0, zoneId);
+ }
+
+ }));
+ }
+ return builder.build();
+ }
+
+ @Override
+ public Iterable<ImageInZone> listImages() {
+ Builder<ImageInZone> builder = ImmutableSet.builder();
+ Set<String> zones = zoneIds.get();
+ checkState(zones.size() > 0, "no zones found in supplier %s", zoneIds);
+ for (final String zoneId : zones) {
+ Set<? extends Image> images = novaApi.getImageApiForZone(zoneId).listInDetail().concat().toSet();
+ if (images.size() == 0) {
+ logger.debug("no images found in zone %s", zoneId);
+ continue;
+ }
+ Iterable<? extends Image> active = filter(images, ImagePredicates.statusEquals(Image.Status.ACTIVE));
+ if (images.size() == 0) {
+ logger.debug("no images with status active in zone %s; non-active: %s", zoneId,
+ transform(active, new Function<Image, String>() {
+
+ @Override
+ public String apply(Image input) {
+ return Objects.toStringHelper("").add("id", input.getId()).add("status", input.getStatus())
+ .toString();
+ }
+
+ }));
+ continue;
+ }
+ builder.addAll(transform(active, new Function<Image, ImageInZone>() {
+
+ @Override
+ public ImageInZone apply(Image arg0) {
+ return new ImageInZone(arg0, zoneId);
+ }
+
+ }));
+ }
+ return builder.build();
+ }
+
+ @Override
+ public Iterable<ServerInZone> listNodes() {
+ Builder<ServerInZone> builder = ImmutableSet.builder();
+ for (final String zoneId : zoneIds.get()) {
+ builder.addAll(novaApi.getServerApiForZone(zoneId).listInDetail().concat()
+ .transform(new Function<Server, ServerInZone>() {
+
+ @Override
+ public ServerInZone apply(Server arg0) {
+ return new ServerInZone(arg0, zoneId);
+ }
+
+ }));
+ }
+ return builder.build();
+ }
+
+ @Override
+ public Iterable<ServerInZone> listNodesByIds(final Iterable<String> ids) {
+ return filter(listNodes(), new Predicate<ServerInZone>() {
+
+ @Override
+ public boolean apply(ServerInZone server) {
+ return contains(ids, server.slashEncode());
+ }
+ });
+ }
+
+ @Override
+ public Iterable<Location> listLocations() {
+ // locations provided by keystone
+ return ImmutableSet.of();
+ }
+
+ @Override
+ public ServerInZone getNode(String id) {
+ ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id);
+ Server server = novaApi.getServerApiForZone(zoneAndId.getZone()).get(zoneAndId.getId());
+ return server == null ? null : new ServerInZone(server, zoneAndId.getZone());
+ }
+
+ @Override
+ public ImageInZone getImage(String id) {
+ ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id);
+ Image image = novaApi.getImageApiForZone(zoneAndId.getZone()).get(zoneAndId.getId());
+ return image == null ? null : new ImageInZone(image, zoneAndId.getZone());
+ }
+
+ @Override
+ public void destroyNode(String id) {
+ ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id);
+ if (novaApi.getFloatingIPExtensionForZone(zoneAndId.getZone()).isPresent()) {
+ try {
+ removeFloatingIpFromNodeAndDeallocate.apply(zoneAndId);
+ } catch (RuntimeException e) {
+ logger.warn(e, "<< error removing and deallocating ip from node(%s): %s", id, e.getMessage());
+ }
+ }
+ novaApi.getServerApiForZone(zoneAndId.getZone()).delete(zoneAndId.getId());
+ }
+
+ @Override
+ public void rebootNode(String id) {
+ ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id);
+ novaApi.getServerApiForZone(zoneAndId.getZone()).reboot(zoneAndId.getId(), RebootType.HARD);
+ }
+
+ @Override
+ public void resumeNode(String id) {
+ ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id);
+ if (novaApi.getServerAdminExtensionForZone(zoneAndId.getZone()).isPresent()) {
+ novaApi.getServerAdminExtensionForZone(zoneAndId.getZone()).get().resume(zoneAndId.getId());
+ }
+ throw new UnsupportedOperationException("resume requires installation of the Admin Actions extension");
+ }
+
+ @Override
+ public void suspendNode(String id) {
+ ZoneAndId zoneAndId = ZoneAndId.fromSlashEncoded(id);
+ if (novaApi.getServerAdminExtensionForZone(zoneAndId.getZone()).isPresent()) {
+ novaApi.getServerAdminExtensionForZone(zoneAndId.getZone()).get().suspend(zoneAndId.getId());
+ }
+ throw new UnsupportedOperationException("suspend requires installation of the Admin Actions extension");
+ }
+
+}