summaryrefslogtreecommitdiffstats
path: root/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main
diff options
context:
space:
mode:
authorRY303T <RY303T@att.com>2017-10-11 02:16:18 -0400
committerRY303T <RY303T@att.com>2017-10-11 11:58:16 -0400
commit8d8251478f7242d3898b7c2760ddfc230bd94c7e (patch)
tree25423e02bb62a28822e484b609f46c93e40b01ae /appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main
parentf7824831d63aeb5be44077de7bf51fa05a4e5010 (diff)
Add support for OpenStack V3 Identity Service
replaced ServiceCatalog with a factory to select correct version ServiceCatalogV2 contains code previously found in ServiceCatalog add ServiceCatalogV3 implementation of V3 connector Issue-ID: APPC-259 Change-Id: Iba7d98cfc9e50914b8063be0b35494a9d0fea793 Signed-off-by: RY303T <RY303T@att.com>
Diffstat (limited to 'appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main')
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/AppcProviderAdapterActivator.java29
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/ProviderAdapter.java86
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/IdentityURL.java11
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ProviderAdapterImpl.java67
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ProviderCache.java50
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/RequestContext.java12
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/RequestFailedException.java83
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ServiceCatalog.java321
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ServiceCatalogFactory.java57
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ServiceCatalogV2.java380
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ServiceCatalogV3.java402
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/TenantCache.java91
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/VMURL.java9
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/api/IProviderOperation.java14
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/api/ProviderOperationFactory.java4
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/common/constants/Property.java1
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/common/enums/Operation.java28
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/common/enums/Outcome.java4
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/CreateSnapshot.java21
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/EvacuateServer.java72
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/LookupServer.java26
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/MigrateServer.java12
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/RebuildServer.java56
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/RestartServer.java40
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/RestoreStack.java32
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/SnapshotStack.java20
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/StartServer.java45
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/StopServer.java52
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/TerminateServer.java47
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/TerminateStack.java10
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/VmStatuschecker.java11
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/base/ProviderOperation.java103
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/base/ProviderServerOperation.java329
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/base/ProviderStackOperation.java28
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/SnapshotResource.java10
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/StackResource.java1
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/CreateSnapshotParams.java10
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Data.java67
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Environment.java17
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Properties.java10
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/ResourceData.java10
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/ResourceRegistry.java10
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Resources_.java10
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Resources__.java10
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Snapshot.java45
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/SnapshotDetails.java10
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/SnapshotRestoreResponse.java24
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Template.java17
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Volume.java17
-rw-r--r--appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Volume_.java52
50 files changed, 1661 insertions, 1212 deletions
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/AppcProviderAdapterActivator.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/AppcProviderAdapterActivator.java
index 75dadae58..f17584e2a 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/AppcProviderAdapterActivator.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/AppcProviderAdapterActivator.java
@@ -32,7 +32,6 @@ import org.openecomp.appc.i18n.Msg;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
-
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
@@ -83,12 +82,10 @@ public class AppcProviderAdapterActivator implements BundleActivator {
* This method must complete and return to its caller in a timely manner.
* </p>
*
- * @param context
- * The execution context of the bundle being started.
- * @throws java.lang.Exception
- * If this method throws an exception, this bundle is marked as stopped and the Framework will remove
- * this bundle's listeners, unregister all services registered by this bundle, and release all services
- * used by this bundle.
+ * @param context The execution context of the bundle being started.
+ * @throws java.lang.Exception If this method throws an exception, this bundle is marked as stopped and the
+ * Framework will remove this bundle's listeners, unregister all services registered by this bundle, and
+ * release all services used by this bundle.
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/
@Override
@@ -100,14 +97,14 @@ public class AppcProviderAdapterActivator implements BundleActivator {
logger.info(Msg.COMPONENT_INITIALIZING, appName, "IAAS adapter");
try {
adapter = new ProviderAdapterImpl(configuration.getProperties());
- } catch(Exception e){
- logger.error("Error initializing APPC IAAS ProviderAdapterImpl",e);
+ } catch (Exception e) {
+ logger.error("Error initializing APPC IAAS ProviderAdapterImpl", e);
throw e;
}
-
+
if (registration == null) {
logger.info(Msg.REGISTERING_SERVICE, appName, adapter.getAdapterName(),
- ProviderAdapter.class.getSimpleName());
+ ProviderAdapter.class.getSimpleName());
registration = context.registerService(ProviderAdapter.class, adapter, null);
}
@@ -123,12 +120,10 @@ public class AppcProviderAdapterActivator implements BundleActivator {
* This method must complete and return to its caller in a timely manner.
* </p>
*
- * @param context
- * The execution context of the bundle being stopped.
- * @throws java.lang.Exception
- * If this method throws an exception, the bundle is still marked as stopped, and the Framework will
- * remove the bundle's listeners, unregister all services registered by the bundle, and release all
- * services used by the bundle. *
+ * @param context The execution context of the bundle being stopped.
+ * @throws java.lang.Exception If this method throws an exception, the bundle is still marked as stopped, and the
+ * Framework will remove the bundle's listeners, unregister all services registered by the bundle, and
+ * release all services used by the bundle. *
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
*/
@Override
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/ProviderAdapter.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/ProviderAdapter.java
index 513524370..06a190cf3 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/ProviderAdapter.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/ProviderAdapter.java
@@ -25,7 +25,6 @@
package org.openecomp.appc.adapter.iaas;
import java.util.Map;
-
import org.openecomp.appc.exceptions.APPCException;
import org.openecomp.appc.exceptions.UnknownProviderException;
import com.att.cdp.zones.model.Image;
@@ -68,17 +67,17 @@ public interface ProviderAdapter extends SvcLogicJavaPlugin {
* The fully-qualified URL of the instance to be manipulated as it is known to the provider.
*/
static final String PROPERTY_IDENTITY_URL = "org.openecomp.appc.identity.url";
-
+
/**
* The Rebuild VM flag is an optional payload parameter for the Evacuate API.
*/
static final String PROPERTY_REBUILD_VM = "org.openecomp.appc.rebuildvm";
-
+
/**
* The target host id is an optional payload parameter for the Evacuate API.
*/
static final String PROPERTY_TARGETHOST_ID = "org.openecomp.appc.targethost.id";
-
+
/**
* heat stack id to perform operation on stack
*/
@@ -89,7 +88,7 @@ public interface ProviderAdapter extends SvcLogicJavaPlugin {
static final String PROPERTY_INPUT_SNAPSHOT_ID = "org.openecomp.appc.snapshot.id";
static final String DG_OUTPUT_PARAM_NAMESPACE = "output.";
-
+
static final String SKIP_HYPERVISOR_CHECK = "org.openecomp.appc.skiphypervisorcheck";
/**
@@ -109,16 +108,13 @@ public interface ProviderAdapter extends SvcLogicJavaPlugin {
* </dl>
* </p>
*
- * @param properties
- * A map of name-value pairs that supply the parameters needed by this method. The properties needed are
- * defined above.
- * @param context
- * The service logic context of the graph being executed.
+ * @param properties A map of name-value pairs that supply the parameters needed by this method. The properties
+ * needed are defined above.
+ * @param context The service logic context of the graph being executed.
* @return The <code>Server</code> object that represents the VM being restarted. The returned server object can be
* inspected for the final state of the server once the restart has been completed. The method does not
* return until the restart has either completed or has failed.
- * @throws APPCException
- * If the server cannot be restarted for some reason
+ * @throws APPCException If the server cannot be restarted for some reason
*/
Server restartServer(Map<String, String> properties, SvcLogicContext context) throws APPCException;
@@ -139,16 +135,13 @@ public interface ProviderAdapter extends SvcLogicJavaPlugin {
* </dl>
* </p>
*
- * @param properties
- * A map of name-value pairs that supply the parameters needed by this method. The properties needed are
- * defined above.
- * @param context
- * The service logic context of the graph being executed.
+ * @param properties A map of name-value pairs that supply the parameters needed by this method. The properties
+ * needed are defined above.
+ * @param context The service logic context of the graph being executed.
* @return The <code>Server</code> object that represents the VM being stopped. The returned server object can be
* inspected for the final state of the server once the stop has been completed. The method does not return
* until the stop has either completed or has failed.
- * @throws APPCException
- * If the server cannot be stopped for some reason
+ * @throws APPCException If the server cannot be stopped for some reason
*/
Server stopServer(Map<String, String> properties, SvcLogicContext context) throws APPCException;
@@ -169,16 +162,13 @@ public interface ProviderAdapter extends SvcLogicJavaPlugin {
* </dl>
* </p>
*
- * @param properties
- * A map of name-value pairs that supply the parameters needed by this method. The properties needed are
- * defined above.
- * @param context
- * The service logic context of the graph being executed.
+ * @param properties A map of name-value pairs that supply the parameters needed by this method. The properties
+ * needed are defined above.
+ * @param context The service logic context of the graph being executed.
* @return The <code>Server</code> object that represents the VM being started. The returned server object can be
* inspected for the final state of the server once the start has been completed. The method does not return
* until the start has either completed or has failed.
- * @throws APPCException
- * If the server cannot be started for some reason
+ * @throws APPCException If the server cannot be started for some reason
*/
Server startServer(Map<String, String> properties, SvcLogicContext context) throws APPCException;
@@ -199,16 +189,13 @@ public interface ProviderAdapter extends SvcLogicJavaPlugin {
* </dl>
* </p>
*
- * @param properties
- * A map of name-value pairs that supply the parameters needed by this method. The properties needed are
- * defined above.
- * @param context
- * The service logic context of the graph being executed.
+ * @param properties A map of name-value pairs that supply the parameters needed by this method. The properties
+ * needed are defined above.
+ * @param context The service logic context of the graph being executed.
* @return The <code>Server</code> object that represents the VM being rebuilt. The returned server object can be
* inspected for the final state of the server once the rebuild has been completed. The method does not
* return until the rebuild has either completed or has failed.
- * @throws APPCException
- * If the server cannot be rebuilt for some reason
+ * @throws APPCException If the server cannot be rebuilt for some reason
*/
Server rebuildServer(Map<String, String> properties, SvcLogicContext context) throws APPCException;
@@ -229,16 +216,13 @@ public interface ProviderAdapter extends SvcLogicJavaPlugin {
* </dl>
* </p>
*
- * @param properties
- * A map of name-value pairs that supply the parameters needed by this method. The properties needed are
- * defined above.
- * @param context
- * The service logic context of the graph being executed.
+ * @param properties A map of name-value pairs that supply the parameters needed by this method. The properties
+ * needed are defined above.
+ * @param context The service logic context of the graph being executed.
* @return The <code>Server</code> object that represents the VM being rebuilt. The returned server object can be
* inspected for the final state of the server once the rebuild has been completed. The method does not
* return until the rebuild has either completed or has failed.
- * @throws APPCException
- * If the server cannot be terminate for some reason
+ * @throws APPCException If the server cannot be terminate for some reason
*/
Server terminateServer(Map<String, String> properties, SvcLogicContext context) throws APPCException;
@@ -278,32 +262,26 @@ public interface ProviderAdapter extends SvcLogicJavaPlugin {
* </dl>
* </p>
*
- * @param properties
- * A map of name-value pairs that supply the parameters needed by this method. The properties needed are
- * defined above.
- * @param context
- * The service logic context of the graph being executed.
+ * @param properties A map of name-value pairs that supply the parameters needed by this method. The properties
+ * needed are defined above.
+ * @param context The service logic context of the graph being executed.
* @return The <code>Server</code> object that represents the VM being rebuilt. The returned server object can be
* inspected for the final state of the server once the rebuild has been completed. The method does not
* return until the rebuild has either completed or has failed.
- * @throws APPCException
- * If the server cannot be found for some reason
+ * @throws APPCException If the server cannot be found for some reason
*/
Server lookupServer(Map<String, String> properties, SvcLogicContext context) throws APPCException;
/**
* The
*
- * @param params
- * A map of name-value pairs that supply the parameters needed by this method. The properties needed are
- * defined above.
- * @param ctx
- * The service logic context of the graph being executed.
+ * @param params A map of name-value pairs that supply the parameters needed by this method. The properties needed
+ * are defined above.
+ * @param ctx The service logic context of the graph being executed.
* @return The <code>Image</code> object that represents the VM being restarted. The returned server object can be
* inspected for the final state of the server once the restart has been completed. The method does not
* return until the restart has either completed or has failed.
- * @throws APPCException
- * If the server cannot be restarted for some reason
+ * @throws APPCException If the server cannot be restarted for some reason
*/
Image createSnapshot(Map<String, String> params, SvcLogicContext ctx) throws APPCException;
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/IdentityURL.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/IdentityURL.java
index 327191af2..038b8de84 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/IdentityURL.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/IdentityURL.java
@@ -75,15 +75,14 @@ public class IdentityURL {
* This static method is used to parse the provided server URL string and return a parse results object (VMURL)
* which represents the state of the parse.
*
- * @param serverUrl
- * The server URL to be parsed
+ * @param serverUrl The server URL to be parsed
* @return The VMURL parse results object, or null if the URL was not valid or null.
*/
- public static IdentityURL parseURL(String serverUrl) {
+ public static IdentityURL parseURL(String identUrl) {
IdentityURL obj = null;
- if (serverUrl != null) {
- Matcher matcher = pattern.matcher(serverUrl.trim());
- if (matcher.matches()) {
+ if (identUrl != null) {
+ Matcher matcher = pattern.matcher(identUrl.trim()); // http://msb.onap.org:80/api/multicloud/v0/cloudowner_region/identity/v3
+ if (matcher.matches()) { // (\\p{Alnum}+)://([^/:]+)(?::([0-9]+))?(/.*)?/(v[0-9\\.]+)/?"
obj = new IdentityURL();
obj.scheme = matcher.group(1);
obj.host = matcher.group(2);
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ProviderAdapterImpl.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ProviderAdapterImpl.java
index 37ff3d767..95e8e27f4 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ProviderAdapterImpl.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ProviderAdapterImpl.java
@@ -43,7 +43,6 @@ import com.att.cdp.zones.model.Stack;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
-
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -58,6 +57,10 @@ import java.util.Properties;
*/
@SuppressWarnings("javadoc")
public class ProviderAdapterImpl implements ProviderAdapter {
+ /**
+ * The default domain name for authentication
+ */
+ public static final String DEFAULT_DOMAIN_NAME = "Default";
/**
* The logger to be used
@@ -79,10 +82,11 @@ public class ProviderAdapterImpl implements ProviderAdapter {
private Map<String /* provider name */, ProviderCache> providerCache;
/**
- * The username and password to use for dynamically created connections
+ * The username, password, and domain to use for dynamically created connections
*/
private static String DEFAULT_USER;
private static String DEFAULT_PASS;
+ private static String DEFAULT_DOMAIN;
/**
@@ -98,8 +102,7 @@ public class ProviderAdapterImpl implements ProviderAdapter {
* This constructor is used primarily in the test cases to bypass initialization of the adapter for isolated,
* disconnected testing
*
- * @param initialize
- * True if the adapter is to be initialized, can false if not
+ * @param initialize True if the adapter is to be initialized, can false if not
*/
@SuppressWarnings("all")
public ProviderAdapterImpl(boolean initialize) {
@@ -110,8 +113,7 @@ public class ProviderAdapterImpl implements ProviderAdapter {
}
/**
- * @param props
- * not used
+ * @param props not used
*/
public ProviderAdapterImpl(@SuppressWarnings("unused") Properties props) {
initialize();
@@ -125,6 +127,7 @@ public class ProviderAdapterImpl implements ProviderAdapter {
op.setProviderCache(this.providerCache);
op.setDefaultPass(DEFAULT_PASS);
op.setDefaultUser(DEFAULT_USER);
+ op.setDefaultDomain(DEFAULT_DOMAIN);
return (Server) op.doOperation(params, context);
}
@@ -135,6 +138,7 @@ public class ProviderAdapterImpl implements ProviderAdapter {
op.setProviderCache(this.providerCache);
op.setDefaultPass(DEFAULT_PASS);
op.setDefaultUser(DEFAULT_USER);
+ op.setDefaultDomain(DEFAULT_DOMAIN);
return (Server) op.doOperation(params, context);
}
@@ -145,6 +149,7 @@ public class ProviderAdapterImpl implements ProviderAdapter {
op.setProviderCache(this.providerCache);
op.setDefaultPass(DEFAULT_PASS);
op.setDefaultUser(DEFAULT_USER);
+ op.setDefaultDomain(DEFAULT_DOMAIN);
return (Server) op.doOperation(params, context);
}
@@ -155,6 +160,7 @@ public class ProviderAdapterImpl implements ProviderAdapter {
op.setProviderCache(this.providerCache);
op.setDefaultPass(DEFAULT_PASS);
op.setDefaultUser(DEFAULT_USER);
+ op.setDefaultDomain(DEFAULT_DOMAIN);
return (Server) op.doOperation(params, context);
}
@@ -165,6 +171,7 @@ public class ProviderAdapterImpl implements ProviderAdapter {
op.setProviderCache(this.providerCache);
op.setDefaultPass(DEFAULT_PASS);
op.setDefaultUser(DEFAULT_USER);
+ op.setDefaultDomain(DEFAULT_DOMAIN);
return (Server) op.doOperation(params, context);
}
@@ -175,6 +182,7 @@ public class ProviderAdapterImpl implements ProviderAdapter {
op.setProviderCache(this.providerCache);
op.setDefaultPass(DEFAULT_PASS);
op.setDefaultUser(DEFAULT_USER);
+ op.setDefaultDomain(DEFAULT_DOMAIN);
// pass this object's reference to EvacuateServer to allow rebuild after evacuate
((EvacuateServer) op).setProvideAdapterRef(this);
return (Server) op.doOperation(params, context);
@@ -187,6 +195,7 @@ public class ProviderAdapterImpl implements ProviderAdapter {
op.setProviderCache(this.providerCache);
op.setDefaultPass(DEFAULT_PASS);
op.setDefaultUser(DEFAULT_USER);
+ op.setDefaultDomain(DEFAULT_DOMAIN);
return (Server) op.doOperation(params, context);
}
@@ -197,6 +206,7 @@ public class ProviderAdapterImpl implements ProviderAdapter {
op.setProviderCache(this.providerCache);
op.setDefaultPass(DEFAULT_PASS);
op.setDefaultUser(DEFAULT_USER);
+ op.setDefaultDomain(DEFAULT_DOMAIN);
return (Server) op.doOperation(params, context);
}
@@ -207,6 +217,7 @@ public class ProviderAdapterImpl implements ProviderAdapter {
op.setProviderCache(this.providerCache);
op.setDefaultPass(DEFAULT_PASS);
op.setDefaultUser(DEFAULT_USER);
+ op.setDefaultDomain(DEFAULT_DOMAIN);
return (Stack) op.doOperation(params, context);
}
@@ -217,6 +228,7 @@ public class ProviderAdapterImpl implements ProviderAdapter {
op.setProviderCache(this.providerCache);
op.setDefaultPass(DEFAULT_PASS);
op.setDefaultUser(DEFAULT_USER);
+ op.setDefaultDomain(DEFAULT_DOMAIN);
return (Stack) op.doOperation(params, context);
}
@@ -227,6 +239,7 @@ public class ProviderAdapterImpl implements ProviderAdapter {
op.setProviderCache(this.providerCache);
op.setDefaultPass(DEFAULT_PASS);
op.setDefaultUser(DEFAULT_USER);
+ op.setDefaultDomain(DEFAULT_DOMAIN);
return (Stack) op.doOperation(params, context);
}
@@ -237,6 +250,7 @@ public class ProviderAdapterImpl implements ProviderAdapter {
op.setProviderCache(this.providerCache);
op.setDefaultPass(DEFAULT_PASS);
op.setDefaultUser(DEFAULT_USER);
+ op.setDefaultDomain(DEFAULT_DOMAIN);
return (Server) op.doOperation(params, context);
}
@@ -247,6 +261,7 @@ public class ProviderAdapterImpl implements ProviderAdapter {
op.setProviderCache(this.providerCache);
op.setDefaultPass(DEFAULT_PASS);
op.setDefaultUser(DEFAULT_USER);
+ op.setDefaultDomain(DEFAULT_DOMAIN);
return (Image) op.doOperation(params, context);
}
@@ -273,27 +288,15 @@ public class ProviderAdapterImpl implements ProviderAdapter {
* property set, where the names form a hierarchical name space (dotted notation, such as one.two.three). Each
* name in the name space can also be serialized by appending a sequence number. All nodes at the same level
* with the same serial number are grouped together in the namespace hierarchy. This allows a hierarchical
- * multi-valued property to be defined, which can then be used to setup the provider and tenant caches.
- * <p>
- * For example, the following definitions show how the namespace hierarchy is defined for two providers, with
- * two tenants on the first provider and a single tenant for the second provider. <pre>
- * provider1.type=OpenStackProvider
- * provider1.name=ILAB
- * provider1.identity=http://provider1:5000/v2.0
- * provider1.tenant1.name=CDP-ONAP-APPC
- * provider1.tenant1.userid=testUser
- * provider1.tenant1.password=testPassword
- * provider1.tenant2.name=TEST-TENANT
- * provider1.tenant2.userid=testUser
- * provider1.tenant2.password=testPassword
- * provider2.type=OpenStackProvider
- * provider2.name=PDK1
- * provider2.identity=http://provider2:5000/v2.0
- * provider2.tenant1.name=someName
- * provider2.tenant1.userid=someUser
- * provider2.tenant1.password=somePassword
- * </pre>
- * </p>
+ * multi-valued property to be defined, which can then be used to setup the provider and tenant caches. <p> For
+ * example, the following definitions show how the namespace hierarchy is defined for two providers, with two
+ * tenants on the first provider and a single tenant for the second provider. <pre>
+ * provider1.type=OpenStackProvider provider1.name=ILAB provider1.identity=http://provider1:5000/v2.0
+ * provider1.tenant1.name=CDP-ONAP-APPC provider1.tenant1.userid=testUser
+ * provider1.tenant1.password=testPassword provider1.tenant2.name=TEST-TENANT provider1.tenant2.userid=testUser
+ * provider1.tenant2.password=testPassword provider2.type=OpenStackProvider provider2.name=PDK1
+ * provider2.identity=http://provider2:5000/v2.0 provider2.tenant1.name=someName
+ * provider2.tenant1.userid=someUser provider2.tenant1.password=somePassword </pre> </p>
*/
providerCache = new HashMap<>();
Properties properties = configuration.getProperties();
@@ -312,6 +315,8 @@ public class ProviderAdapterImpl implements ProviderAdapter {
String tenantName = null;
String userId = null;
String password = null;
+ // domain is not required so set a default
+ String domain = DEFAULT_DOMAIN_NAME;
for (Node node2 : node.getChildren()) {
switch (node2.getName()) {
case Property.PROVIDER_TENANT_NAME:
@@ -325,10 +330,14 @@ public class ProviderAdapterImpl implements ProviderAdapter {
password = node2.getValue();
DEFAULT_PASS = node2.getValue();
break;
+ case Property.PROVIDER_TENANT_DOMAIN:
+ domain = node2.getValue();
+ DEFAULT_DOMAIN = node2.getValue();
+ break;
}
}
-
- cache.addTenant(null, tenantName, userId, password);
+
+ cache.addTenant(null, tenantName, userId, password, domain);
}
}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ProviderCache.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ProviderCache.java
index ffbdaf0a0..bbf85a71a 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ProviderCache.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ProviderCache.java
@@ -72,14 +72,13 @@ public class ProviderCache {
* discover all of the regions supported on the provider, and load all of the service catalogs for each provider.
*/
public void initialize() {
- for (Map.Entry<String, TenantCache> entry: tenants.entrySet()) {
- entry.getValue().initialize();
+ for (Map.Entry<String, TenantCache> entry : tenants.entrySet()) {
+ entry.getValue().initialize();
}
}
/**
- * @param providerType
- * the value for providerType
+ * @param providerType the value for providerType
*/
public void setProviderType(String providerType) {
this.providerType = providerType;
@@ -93,8 +92,7 @@ public class ProviderCache {
}
/**
- * @param identityURL
- * the value for identityURL
+ * @param identityURL the value for identityURL
*/
public void setIdentityURL(String identityURL) {
this.identityURL = identityURL;
@@ -108,8 +106,7 @@ public class ProviderCache {
}
/**
- * @param providerName
- * the value for providerName
+ * @param providerName the value for providerName
*/
public void setProviderName(String providerName) {
this.providerName = providerName;
@@ -121,42 +118,43 @@ public class ProviderCache {
public Map<String, TenantCache> getTenants() {
return tenants;
}
-
+
/**
* This method is a helper to return a specific TenantCache
*
- * @param tenantId
- * @return
+ * @param tenantId
+ * @return
*/
- public TenantCache getTenant(String tenantId){
- return tenants.get(tenantId);
+ public TenantCache getTenant(String tenantId) {
+ return tenants.get(tenantId);
}
-
+
// Previously there was no way to add additional tenants to the tenant cache
/**
* This method is used to add a tenant to the provider cache
*
- * @param tenantId
- * @param UserId
- * @param password
- * @return the new initialized TenantCache or null if unsuccessful
- */
- public TenantCache addTenant(String tenantId, String tenantName, String userId, String password){
- if(tenantId != null || tenantName != null && userId != null && password != null){
+ * @param tenantId
+ * @param UserId
+ * @param password
+ * @return the new initialized TenantCache or null if unsuccessful
+ */
+ public TenantCache addTenant(String tenantId, String tenantName, String userId, String password, String domain) {
+ if (tenantId != null || tenantName != null && userId != null && password != null) {
TenantCache tenant = new TenantCache(this);
- if(tenantId != null){
+ if (tenantId != null) {
tenant.setTenantId(tenantId);
}
- if(tenantName != null){
+ if (tenantName != null) {
tenant.setTenantName(tenantName);
}
tenant.setUserid(userId);
tenant.setPassword(password);
-
- if(identityURL != null){
+ tenant.setDomain(domain);
+
+ if (identityURL != null) {
tenant.initialize();
}
-
+
if (tenant.isInitialized()) {
tenants.put(tenant.getTenantId(), tenant);
return tenant;
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/RequestContext.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/RequestContext.java
index f96002f89..cec09266a 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/RequestContext.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/RequestContext.java
@@ -91,8 +91,7 @@ public class RequestContext {
/**
* Creates the request context
*
- * @param context
- * The service logic (SLI) context associated with the current DG
+ * @param context The service logic (SLI) context associated with the current DG
*/
public RequestContext(SvcLogicContext context) {
setSvcLogicContext(context);
@@ -219,8 +218,7 @@ public class RequestContext {
/**
* Sets the time to live to the value, expressed in seconds
*
- * @param time
- * The time to live, in seconds
+ * @param time The time to live, in seconds
*/
public void setTimeToLiveSeconds(int time) {
setTimeToLiveMS(time * 1000L);
@@ -229,8 +227,7 @@ public class RequestContext {
/**
* Sets the time to live to the value, expressed in milliseconds
*
- * @param time
- * The time to live, in milliseconds
+ * @param time The time to live, in milliseconds
*/
public void setTimeToLiveMS(long time) {
this.timeToLive = time;
@@ -244,8 +241,7 @@ public class RequestContext {
}
/**
- * @param svcLogicContext
- * The service logic context to be associated with this request
+ * @param svcLogicContext The service logic context to be associated with this request
*/
public void setSvcLogicContext(SvcLogicContext svcLogicContext) {
this.svcLogicContext = svcLogicContext;
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/RequestFailedException.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/RequestFailedException.java
index 32ff30274..614f4bb1e 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/RequestFailedException.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/RequestFailedException.java
@@ -81,8 +81,7 @@ public class RequestFailedException extends Exception {
}
/**
- * @param message
- * The error message
+ * @param message The error message
*/
public RequestFailedException(String message) {
super(message);
@@ -92,14 +91,10 @@ public class RequestFailedException extends Exception {
* Construct the request failed exception with the operation being performed, reason for the failure, http status
* code that is most appropriate, and the server we were processing.
*
- * @param operation
- * The operation being performed
- * @param reason
- * The reason that the operation was failed
- * @param status
- * The http status code that is most appropriate
- * @param server
- * The server that we were processing
+ * @param operation The operation being performed
+ * @param reason The reason that the operation was failed
+ * @param status The http status code that is most appropriate
+ * @param server The server that we were processing
*/
@SuppressWarnings("nls")
public RequestFailedException(String operation, String reason, HttpStatus status, Server server) {
@@ -118,14 +113,10 @@ public class RequestFailedException extends Exception {
* Construct the request failed exception with the operation being performed, reason for the failure, http status
* code that is most appropriate, and the stack we were processing.
*
- * @param operation
- * The operation being performed
- * @param reason
- * The reason that the operation was failed
- * @param status
- * The http status code that is most appropriate
- * @param stack
- * The stack that we were processing
+ * @param operation The operation being performed
+ * @param reason The reason that the operation was failed
+ * @param status The http status code that is most appropriate
+ * @param stack The stack that we were processing
*/
@SuppressWarnings("nls")
public RequestFailedException(String operation, String reason, HttpStatus status, Stack stack) {
@@ -143,16 +134,11 @@ public class RequestFailedException extends Exception {
* Construct the request failed exception with the operation being performed, reason for the failure, http status
* code that is most appropriate, and the server we were processing.
*
- * @param ex
- * The exception that we are wrapping
- * @param operation
- * The operation being performed
- * @param reason
- * The reason that the operation was failed
- * @param status
- * The http status code that is most appropriate
- * @param server
- * The server that we were processing
+ * @param ex The exception that we are wrapping
+ * @param operation The operation being performed
+ * @param reason The reason that the operation was failed
+ * @param status The http status code that is most appropriate
+ * @param server The server that we were processing
*/
@SuppressWarnings("nls")
public RequestFailedException(Throwable ex, String operation, String reason, HttpStatus status, Server server) {
@@ -167,33 +153,27 @@ public class RequestFailedException extends Exception {
}
/**
- * @param message
- * The error message
- * @param cause
- * A nested exception
+ * @param message The error message
+ * @param cause A nested exception
*/
public RequestFailedException(String message, Throwable cause) {
super(message, cause);
}
/**
- * @param message
- * The error message
- * @param cause
- * A nested exception
- * @param enableSuppression
- * whether or not suppression is enabled or disabled
- * @param writableStackTrace
- * whether or not the stack trace should be writable
+ * @param message The error message
+ * @param cause A nested exception
+ * @param enableSuppression whether or not suppression is enabled or disabled
+ * @param writableStackTrace whether or not the stack trace should be writable
*/
- public RequestFailedException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
+ public RequestFailedException(String message, Throwable cause, boolean enableSuppression,
+ boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
/**
- * @param cause
- * the cause (which is saved for later retrieval by the {@link #getCause()} method). (A null value is
- * permitted, and indicates that the cause is nonexistent or unknown.)
+ * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method). (A null value is
+ * permitted, and indicates that the cause is nonexistent or unknown.)
*/
public RequestFailedException(Throwable cause) {
super(cause);
@@ -235,24 +215,21 @@ public class RequestFailedException extends Exception {
}
/**
- * @param operation
- * The operation being performed
+ * @param operation The operation being performed
*/
public void setOperation(String operation) {
this.operation = operation;
}
/**
- * @param reason
- * The reason for the failure
+ * @param reason The reason for the failure
*/
public void setReason(String reason) {
this.reason = reason;
}
/**
- * @param server
- * The server being operated upon
+ * @param server The server being operated upon
*/
public void setServer(Server server) {
this.server = server;
@@ -262,16 +239,14 @@ public class RequestFailedException extends Exception {
}
/**
- * @param serverId
- * The id of the server being operated upon
+ * @param serverId The id of the server being operated upon
*/
public void setServerId(String serverId) {
this.serverId = serverId;
}
/**
- * @param status
- * The status of the request
+ * @param status The status of the request
*/
public void setStatus(HttpStatus status) {
this.status = status;
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ServiceCatalog.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ServiceCatalog.java
index 702542dd6..917d6f450 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ServiceCatalog.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ServiceCatalog.java
@@ -38,7 +38,6 @@ import java.util.Set;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
-
import com.att.cdp.exceptions.ContextConnectionException;
import com.att.cdp.exceptions.ZoneException;
import com.att.cdp.openstack.util.ExceptionMapper;
@@ -46,8 +45,9 @@ import com.att.cdp.pal.util.Time;
import com.att.cdp.zones.ContextFactory;
import com.att.cdp.zones.spi.AbstractService;
import com.att.cdp.zones.spi.RequestState;
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
import com.att.cdp.zones.spi.AbstractService.State;
-
import com.woorea.openstack.base.client.OpenStackBaseException;
import com.woorea.openstack.base.client.OpenStackClientConnector;
import com.woorea.openstack.base.client.OpenStackResponseException;
@@ -87,7 +87,11 @@ import com.woorea.openstack.keystone.model.authentication.UsernamePassword;
* caching the full service catalog since there is no way to list only a portion of it.
* </p>
*/
-public class ServiceCatalog {
+public abstract class ServiceCatalog {
+ /**
+ * The openstack connector version to use
+ */
+ public static final String CLIENT_CONNECTOR_CLASS = "com.woorea.openstack.connector.JaxRs20Connector";
/**
* The service name for the compute service endpoint
@@ -95,6 +99,10 @@ public class ServiceCatalog {
public static final String COMPUTE_SERVICE = "compute"; //$NON-NLS-1$
/**
+ * The default domain for authentication
+ */
+ public static final String DEFAULT_DOMAIN = "Default";
+ /**
* The service name for the identity service endpoint
*/
public static final String IDENTITY_SERVICE = "identity"; //$NON-NLS-1$
@@ -105,11 +113,21 @@ public class ServiceCatalog {
public static final String IMAGE_SERVICE = "image"; //$NON-NLS-1$
/**
+ * The service name for the metering service endpoint
+ */
+ public static final String METERING_SERVICE = "metering"; //$NON-NLS-1$
+
+ /**
* The service name for the network service endpoint
*/
public static final String NETWORK_SERVICE = "network"; //$NON-NLS-1$
/**
+ * The service name for the persistent object service endpoint
+ */
+ public static final String OBJECT_SERVICE = "object-store"; //$NON-NLS-1$
+
+ /**
* The service name for the orchestration service endpoint
*/
public static final String ORCHESTRATION_SERVICE = "orchestration"; //$NON-NLS-1$
@@ -120,176 +138,98 @@ public class ServiceCatalog {
public static final String VOLUME_SERVICE = "volume"; //$NON-NLS-1$
/**
- * The service name for the persistent object service endpoint
+ * The logger to be used
*/
- public static final String OBJECT_SERVICE = "object-store"; //$NON-NLS-1$
+ protected static final EELFLogger logger = EELFManager.getInstance().getLogger(ServiceCatalog.class);
/**
- * The service name for the metering service endpoint
+ * The password for authentication
*/
- public static final String METERING_SERVICE = "metering"; //$NON-NLS-1$
+ protected String credential;
/**
- * The Openstack Access object that manages the authenticated token and access control
+ * The domain for authentication
*/
- private Access access;
-
+ protected String domain;
/**
* The time (local) that the token expires and we need to re-authenticate
*/
- @SuppressWarnings("unused")
- private long expiresLocal;
+ protected long expiresLocal;
/**
- * The set of all regions that have been defined
+ * The url of the identity service
*/
- private Set<String> regions;
+ protected String identityURL;
/**
- * The read/write lock used to protect the cache contents
+ * The user id for authentication
*/
- private ReadWriteLock rwLock;
+ protected String principal;
/**
- * A map of endpoints for each service organized by service type
+ * The project or tenant identifier
*/
- private Map<String /* Service Type */, List<Service.Endpoint>> serviceEndpoints;
+ protected String projectIdentifier;
/**
- * A map of service types that are published
+ * Properties for proxy information
*/
- private Map<String /* Service Type */, Service> serviceTypes;
+ protected Properties properties;
/**
- * The tenant that we are accessing
+ * The set of all regions that have been defined
*/
- private Tenant tenant;
+ protected Set<String> regions;
/**
- * A "token provider" that manages the authentication token that we obtain when logging in
+ * The read/write lock used to protect the cache contents
*/
- private OpenStackSimpleTokenProvider tokenProvider;
-
- public static final String CLIENT_CONNECTOR_CLASS = "com.woorea.openstack.connector.JaxRs20Connector";
+ protected ReadWriteLock rwLock;
/**
- * Create the ServiceCatalog cache and load it from the specified provider
+ * Create the ServiceCatalog cache
*
- * @param identityURL
- * The identity service URL to connect to
- * @param tenantIdentifier
- * The name or id of the tenant to authenticate with. If the ID is a UUID format (32-character
- * hexadecimal string), then the authentication is done using the tenant ID, otherwise it is done using
- * the name.
- * @param principal
- * The user id to authenticate to the provider
- * @param credential
- * The password to authenticate to the provider
- * @param properties
- * Additional properties used to configure the connection, such as proxy and trusted hosts lists
+ * @param identityURL The identity service URL to connect to
+ * @param tenantIdentifier The name or id of the tenant to authenticate with. If the ID is a UUID format
+ * (32-character hexadecimal string), then the authentication is done using the tenant ID, otherwise it is
+ * done using the name.
+ * @param principal The user id to authenticate to the provider
+ * @param credential The password to authenticate to the provider
+ * @param properties Additional properties used to configure the connection, such as proxy and trusted hosts lists
* @throws ZoneException
* @throws ClassNotFoundException
* @throws IllegalAccessException
* @throws InstantiationException
*/
- public ServiceCatalog(String identityURL, String tenantIdentifier, String principal, String credential,
- Properties properties) throws ZoneException {
+ public ServiceCatalog(String identityURL, String projectIdentifier, String principal, String credential,
+ String domain, Properties properties) {
+ this.identityURL = identityURL;
+ this.projectIdentifier = projectIdentifier;
+ this.principal = principal;
+ this.credential = credential;
+ this.domain = domain;
+ this.properties = properties;
rwLock = new ReentrantReadWriteLock();
- serviceTypes = new HashMap<>();
- serviceEndpoints = new HashMap<>();
regions = new HashSet<>();
-
- Class<?> connectorClass;
- OpenStackClientConnector connector;
- try {
- connectorClass = Class.forName(CLIENT_CONNECTOR_CLASS);
- connector = (OpenStackClientConnector) connectorClass.newInstance();
- } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
- e.printStackTrace();
- return;
- }
- Keystone keystone = new Keystone(identityURL, connector);
-
- String proxyHost = properties.getProperty(ContextFactory.PROPERTY_PROXY_HOST);
- String proxyPort = properties.getProperty(ContextFactory.PROPERTY_PROXY_PORT);
- String trustedHosts = properties.getProperty(ContextFactory.PROPERTY_TRUSTED_HOSTS, ""); //$NON-NLS-1$
- if (proxyHost != null && proxyHost.length() > 0) {
- keystone.getProperties().setProperty(com.woorea.openstack.common.client.Constants.PROXY_HOST, proxyHost);
- keystone.getProperties().setProperty(com.woorea.openstack.common.client.Constants.PROXY_PORT, proxyPort);
- }
- if (trustedHosts != null) {
- keystone.getProperties().setProperty(com.woorea.openstack.common.client.Constants.TRUST_HOST_LIST,
- trustedHosts);
- }
-
- Authentication authentication = new UsernamePassword(principal, credential);
- TokensResource tokens = keystone.tokens();
- TokensResource.Authenticate authenticate = tokens.authenticate(authentication);
- if (tenantIdentifier.length() == 32 && tenantIdentifier.matches("[0-9a-fA-F]+")) { //$NON-NLS-1$
- authenticate = authenticate.withTenantId(tenantIdentifier);
- } else {
- authenticate = authenticate.withTenantName(tenantIdentifier);
- }
-
- /*
- * We have to set up the TrackRequest TLS collection for the ExceptionMapper
- */
- trackRequest();
- RequestState.put(RequestState.PROVIDER, "OpenStackProvider");
- RequestState.put(RequestState.TENANT, tenantIdentifier);
- RequestState.put(RequestState.PRINCIPAL, principal);
-
- try {
- access = authenticate.execute();
- expiresLocal = getLocalExpiration(access);
- tenant = access.getToken().getTenant();
- tokenProvider = new OpenStackSimpleTokenProvider(access.getToken().getId());
- keystone.setTokenProvider(tokenProvider);
- parseServiceCatalog(access.getServiceCatalog());
- } catch (OpenStackBaseException e) {
- ExceptionMapper.mapException(e);
- } catch (Exception ex) {
- throw new ContextConnectionException(ex.getMessage());
- }
}
/**
* Returns the list of service endpoints for the published service type
*
- * @param serviceType
- * The service type to obtain the endpoints for
+ * @param serviceType The service type to obtain the endpoints for
* @return The list of endpoints for the service type, or null if none exist
*/
- public List<Service.Endpoint> getEndpoints(String serviceType) {
- Lock readLock = rwLock.readLock();
- readLock.lock();
- try {
- return serviceEndpoints.get(serviceType);
- } finally {
- readLock.unlock();
- }
- }
+ public abstract List<?> getEndpoints(String serviceType);
/**
- * Computes the local time when the access token will expire, after which we will need to re-login to access the
- * provider.
- *
- * @param accessKey
- * The access key used to access the provider
- * @return The local time the key expires
+ * @return The project or tenant id
*/
- private static long getLocalExpiration(Access accessKey) {
- Date now = Time.getCurrentUTCDate();
- if (accessKey != null && accessKey.getToken() != null) {
- Calendar issued = accessKey.getToken().getIssued_at();
- Calendar expires = accessKey.getToken().getExpires();
- if (issued != null && expires != null) {
- long tokenLife = expires.getTimeInMillis() - issued.getTimeInMillis();
- return now.getTime() + tokenLife;
- }
- }
- return now.getTime();
- }
+ public abstract String getProjectId();
+
+ /**
+ * @return The project or tenant name
+ */
+ public abstract String getProjectName();
/**
* @return The set of all regions that are defined
@@ -307,98 +247,31 @@ public class ServiceCatalog {
/**
* @return A list of service types that are published
*/
- public List<String> getServiceTypes() {
- Lock readLock = rwLock.readLock();
- readLock.lock();
- try {
- ArrayList<String> result = new ArrayList<>();
- result.addAll(serviceTypes.keySet());
- return result;
- } finally {
- readLock.unlock();
- }
- }
+ public abstract List<String> getServiceTypes();
/**
- * @return The tenant id
+ * This method accepts a fully qualified compute node URL and uses that to determine which region of the provider
+ * hosts that compute node.
+ *
+ * @param url The parsed URL of the compute node
+ * @return The region name, or null if no region of this tenant hosts that compute node.
*/
- public String getTenantId() {
- Lock readLock = rwLock.readLock();
- readLock.lock();
- try {
- return tenant.getId();
- } finally {
- readLock.unlock();
- }
- }
-
- /**
- * @return The tenant name
- */
- public String getTenantName() {
- Lock readLock = rwLock.readLock();
- readLock.lock();
- try {
- return tenant.getName();
- } finally {
- readLock.unlock();
- }
- }
+ public abstract String getVMRegion(VMURL url);
/**
* Returns an indication if the specified service type is published by this provider
*
- * @param serviceType
- * The service type to check for
+ * @param serviceType The service type to check for
* @return True if a service of that type is published
*/
- public boolean isServicePublished(String serviceType) {
- Lock readLock = rwLock.readLock();
- readLock.lock();
- try {
- return serviceTypes.containsKey(serviceType);
- } finally {
- readLock.unlock();
- }
- }
+ public abstract boolean isServicePublished(String serviceType);
/**
- * Parses the service catalog and caches the results
+ * Load the Service Catalog from the specified provider
*
- * @param services
- * The list of services published by this provider
+ * @throws ZoneException
*/
- private void parseServiceCatalog(List<Service> services) {
- Lock lock = rwLock.writeLock();
- lock.lock();
- try {
- serviceTypes.clear();
- serviceEndpoints.clear();
- regions.clear();
-
- for (Service service : services) {
- String type = service.getType();
- serviceTypes.put(type, service);
-
- List<Service.Endpoint> endpoints = service.getEndpoints();
- for (Service.Endpoint endpoint : endpoints) {
- List<Service.Endpoint> endpointList = serviceEndpoints.get(type);
- if (endpointList == null) {
- endpointList = new ArrayList<>();
- serviceEndpoints.put(type, endpointList);
- }
- endpointList.add(endpoint);
-
- String region = endpoint.getRegion();
- if (!regions.contains(region)) {
- regions.add(region);
- }
- }
- }
- } finally {
- lock.unlock();
- }
- }
+ public abstract void init() throws ZoneException;
/**
* This method is used to provide a diagnostic listing of the service catalog
@@ -406,38 +279,7 @@ public class ServiceCatalog {
* @see java.lang.Object#toString()
*/
@Override
- public String toString() {
-
- StringBuilder builder = new StringBuilder();
- Lock lock = rwLock.readLock();
- lock.lock();
- try {
- builder.append(String.format("Service Catalog: tenant %s, id[%s], description[%s]\n", tenant.getName(), //$NON-NLS-1$
- tenant.getId(), tenant.getDescription()));
- if (regions != null && !regions.isEmpty()) {
- builder.append(String.format("%d regions:\n", regions.size())); //$NON-NLS-1$
- for (String region : regions) {
- builder.append("\t" + region + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- builder.append(String.format("%d services:\n", serviceEndpoints.size())); //$NON-NLS-1$
- for (String serviceType : serviceEndpoints.keySet()) {
- List<Endpoint> endpoints = serviceEndpoints.get(serviceType);
- Service service = serviceTypes.get(serviceType);
-
- builder.append(String.format("\t%s [%s] - %d endpoints\n", service.getType(), service.getName(), //$NON-NLS-1$
- endpoints.size()));
- for (Endpoint endpoint : endpoints) {
- builder.append(String.format("\t\tRegion [%s], public URL [%s]\n", endpoint.getRegion(), //$NON-NLS-1$
- endpoint.getPublicURL()));
- }
- }
- } finally {
- lock.unlock();
- }
-
- return builder.toString();
- }
+ public abstract String toString();
/**
* Initializes the request state for the current requested service.
@@ -451,9 +293,8 @@ public class ServiceCatalog {
* up one more call and assumes that method is the request that we are "tracking".
* </p>
*
- * @param states
- * A variable argument list of additional state values that the caller wants to add to the request state
- * thread-local object to track the context.
+ * @param states A variable argument list of additional state values that the caller wants to add to the request
+ * state thread-local object to track the context.
*/
protected void trackRequest(State... states) {
RequestState.clear();
@@ -469,7 +310,7 @@ public class ServiceCatalog {
StackTraceElement element = null;
for (; index < stack.length; index++) {
element = stack[index];
- if ("trackRequest".equals(element.getMethodName())) { //$NON-NLS-1$
+ if ("trackRequest".equals(element.getMethodName())) { //$NON-NLS-1$
break;
}
}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ServiceCatalogFactory.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ServiceCatalogFactory.java
new file mode 100644
index 000000000..63d4a31f1
--- /dev/null
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ServiceCatalogFactory.java
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * Licensed 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.adapter.iaas.impl;
+
+import java.util.Properties;
+
+public class ServiceCatalogFactory {
+
+ /**
+ * This method accepts a fully qualified identity service URL and uses that to determine which version of the
+ * serviceCatalog to load.
+ *
+ * @param url The parsed URL of the identity service
+ * @param projectIdentifier The project or tenant to be used to connect to the service
+ * @param principal The principal or user to be used to connect to the service
+ * @param ceredential The credential or password to be used to connect to the service
+ * @param properties Properties object for proxy information
+ * @return The serviceCatalog for identity service version specified in the url, null if not supported.
+ */
+ public static ServiceCatalog getServiceCatalog(String url, String projectIdentifier, String principal,
+ String credential, String domain, Properties properties) {
+ String version = IdentityURL.parseURL(url).getVersion();
+ String prefix = version.split("\\.")[0];
+
+ if (prefix != null) {
+ switch (prefix) {
+ case "v2":
+ return new ServiceCatalogV2(url, projectIdentifier, principal, credential, properties);
+ case "v3":
+ return new ServiceCatalogV3(url, projectIdentifier, principal, credential, domain, properties);
+ }
+ }
+ return null;
+ }
+}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ServiceCatalogV2.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ServiceCatalogV2.java
new file mode 100644
index 000000000..889035510
--- /dev/null
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ServiceCatalogV2.java
@@ -0,0 +1,380 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * Licensed 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.adapter.iaas.impl;
+
+import com.att.cdp.exceptions.ContextConnectionException;
+import com.att.cdp.exceptions.ZoneException;
+import com.att.cdp.openstack.util.ExceptionMapper;
+import com.att.cdp.pal.util.Time;
+import com.att.cdp.zones.ContextFactory;
+import com.att.cdp.zones.spi.RequestState;
+import com.woorea.openstack.base.client.OpenStackBaseException;
+import com.woorea.openstack.base.client.OpenStackClientConnector;
+import com.woorea.openstack.base.client.OpenStackSimpleTokenProvider;
+import com.woorea.openstack.keystone.Keystone;
+import com.woorea.openstack.keystone.api.TokensResource;
+import com.woorea.openstack.keystone.model.Access;
+import com.woorea.openstack.keystone.model.Access.Service;
+import com.woorea.openstack.keystone.model.Access.Service.Endpoint;
+import com.woorea.openstack.keystone.model.Authentication;
+import com.woorea.openstack.keystone.model.Tenant;
+import com.woorea.openstack.keystone.model.authentication.UsernamePassword;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.locks.Lock;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * This class is used to capture and cache the service catalog for a specific OpenStack provider.
+ * <p>
+ * This is needed because the way the servers are represented in the ECOMP product is as their fully qualified URL's.
+ * This is very problematic, because we cant identify their region from the URL, URL's change, and we cant identify the
+ * versions of the service implementations. In otherwords, the URL does not provide us enough information.
+ * </p>
+ * <p>
+ * The zone abstraction layer is designed to detect the versions of the services dynamically, and step up or down to
+ * match those reported versions. In order to do that, we need to know before hand what region we are accessing (since
+ * the supported versions may be different by regions). We will need to authenticate to the identity service in order to
+ * do this, plus we have to duplicate the code supporting proxies and trusted hosts that exists in the abstraction
+ * layer, but that cant be helped.
+ * </p>
+ * <p>
+ * What we do to circumvent this is connect to the provider using the lowest supported identity api, and read the entire
+ * service catalog into this object. Then, we parse the vm URL to extract the host and port and match that to the
+ * compute services defined in the catalog. When we find a compute service that has the same host name and port,
+ * whatever region that service is supporting is the region for that server.
+ * </p>
+ * <p>
+ * While we really only need to do this for compute nodes, there is no telling what other situations may arise where the
+ * full service catalog may be needed. Also, there is very little additional cost (additional RAM) associated with
+ * caching the full service catalog since there is no way to list only a portion of it.
+ * </p>
+ */
+public class ServiceCatalogV2 extends ServiceCatalog {
+
+ /**
+ * The Openstack Access object that manages the authenticated token and access control
+ */
+ private Access access;
+
+ /**
+ * A map of endpoints for each service organized by service type
+ */
+ private Map<String /* Service Type */, List<Service.Endpoint>> serviceEndpoints;
+
+ /**
+ * A map of service types that are published
+ */
+ private Map<String /* Service Type */, Service> serviceTypes;
+
+ /**
+ * The tenant that we are accessing
+ */
+ private Tenant tenant;
+
+ /**
+ * A "token provider" that manages the authentication token that we obtain when logging in
+ */
+ private OpenStackSimpleTokenProvider tokenProvider;
+
+ public ServiceCatalogV2(String identityURL, String tenantIdentifier, String principal, String credential,
+ Properties properties) {
+ super(identityURL, tenantIdentifier, principal, credential, null, properties);
+ }
+
+ @Override
+ public void init() throws ZoneException {
+ serviceTypes = new HashMap<>();
+ serviceEndpoints = new HashMap<>();
+ Class<?> connectorClass;
+ OpenStackClientConnector connector;
+ try {
+ connectorClass = Class.forName(CLIENT_CONNECTOR_CLASS);
+ connector = (OpenStackClientConnector) connectorClass.newInstance();
+ } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
+ e.printStackTrace();
+ return;
+ }
+ Keystone keystone = new Keystone(identityURL, connector);
+
+ String proxyHost = properties.getProperty(ContextFactory.PROPERTY_PROXY_HOST);
+ String proxyPort = properties.getProperty(ContextFactory.PROPERTY_PROXY_PORT);
+ String trustedHosts = properties.getProperty(ContextFactory.PROPERTY_TRUSTED_HOSTS, ""); //$NON-NLS-1$
+ if (proxyHost != null && proxyHost.length() > 0) {
+ keystone.getProperties().setProperty(com.woorea.openstack.common.client.Constants.PROXY_HOST, proxyHost);
+ keystone.getProperties().setProperty(com.woorea.openstack.common.client.Constants.PROXY_PORT, proxyPort);
+ }
+ if (trustedHosts != null) {
+ keystone.getProperties().setProperty(com.woorea.openstack.common.client.Constants.TRUST_HOST_LIST,
+ trustedHosts);
+ }
+
+ Authentication authentication = new UsernamePassword(principal, credential);
+ TokensResource tokens = keystone.tokens();
+ TokensResource.Authenticate authenticate = tokens.authenticate(authentication);
+ if (projectIdentifier.length() == 32 && projectIdentifier.matches("[0-9a-fA-F]+")) { //$NON-NLS-1$
+ authenticate = authenticate.withTenantId(projectIdentifier);
+ } else {
+ authenticate = authenticate.withTenantName(projectIdentifier);
+ }
+
+ /*
+ * We have to set up the TrackRequest TLS collection for the ExceptionMapper
+ */
+ trackRequest();
+ RequestState.put(RequestState.PROVIDER, "OpenStackProvider");
+ RequestState.put(RequestState.TENANT, projectIdentifier);
+ RequestState.put(RequestState.PRINCIPAL, principal);
+
+ try {
+ access = authenticate.execute();
+ expiresLocal = getLocalExpiration(access);
+ tenant = access.getToken().getTenant();
+ tokenProvider = new OpenStackSimpleTokenProvider(access.getToken().getId());
+ keystone.setTokenProvider(tokenProvider);
+ parseServiceCatalog(access.getServiceCatalog());
+ } catch (OpenStackBaseException e) {
+ ExceptionMapper.mapException(e);
+ } catch (Exception ex) {
+ throw new ContextConnectionException(ex.getMessage());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public List<Service.Endpoint> getEndpoints(String serviceType) {
+ Lock readLock = rwLock.readLock();
+ readLock.lock();
+ try {
+ return serviceEndpoints.get(serviceType);
+ } finally {
+ readLock.unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getProjectId() {
+ Lock readLock = rwLock.readLock();
+ readLock.lock();
+ try {
+ return tenant.getId();
+ } finally {
+ readLock.unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getProjectName() {
+ Lock readLock = rwLock.readLock();
+ readLock.lock();
+ try {
+ return tenant.getName();
+ } finally {
+ readLock.unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Set<String> getRegions() {
+ Lock readLock = rwLock.readLock();
+ readLock.lock();
+ try {
+ return regions;
+ } finally {
+ readLock.unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public List<String> getServiceTypes() {
+ Lock readLock = rwLock.readLock();
+ readLock.lock();
+ try {
+ ArrayList<String> result = new ArrayList<>();
+ result.addAll(serviceTypes.keySet());
+ return result;
+ } finally {
+ readLock.unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getVMRegion(VMURL url) {
+ String region = null;
+ Pattern urlPattern = Pattern.compile("[^:]+://([^:/]+)(?::([0-9]+)).*");
+
+ if (url != null) {
+ for (Endpoint endpoint : getEndpoints(ServiceCatalog.COMPUTE_SERVICE)) {
+ String endpointUrl = endpoint.getPublicURL();
+ Matcher matcher = urlPattern.matcher(endpointUrl);
+ if (matcher.matches()) {
+ if (url.getHost().equals(matcher.group(1))) {
+ if (url.getPort() != null) {
+ if (!url.getPort().equals(matcher.group(2))) {
+ continue;
+ }
+ }
+
+ region = endpoint.getRegion();
+ break;
+ }
+ }
+ }
+ }
+ return region;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isServicePublished(String serviceType) {
+ Lock readLock = rwLock.readLock();
+ readLock.lock();
+ try {
+ return serviceTypes.containsKey(serviceType);
+ } finally {
+ readLock.unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String toString() {
+
+ StringBuilder builder = new StringBuilder();
+ Lock lock = rwLock.readLock();
+ lock.lock();
+ try {
+ builder.append(String.format("Service Catalog: tenant %s, id[%s], description[%s]\n", tenant.getName(), //$NON-NLS-1$
+ tenant.getId(), tenant.getDescription()));
+ if (regions != null && !regions.isEmpty()) {
+ builder.append(String.format("%d regions:\n", regions.size())); //$NON-NLS-1$
+ for (String region : regions) {
+ builder.append("\t" + region + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ builder.append(String.format("%d services:\n", serviceEndpoints.size())); //$NON-NLS-1$
+ for (String serviceType : serviceEndpoints.keySet()) {
+ List<Service.Endpoint> endpoints = serviceEndpoints.get(serviceType);
+ Service service = serviceTypes.get(serviceType);
+
+ builder.append(String.format("\t%s [%s] - %d endpoints\n", service.getType(), service.getName(), //$NON-NLS-1$
+ endpoints.size()));
+ for (Service.Endpoint endpoint : endpoints) {
+ builder.append(String.format("\t\tRegion [%s], public URL [%s]\n", endpoint.getRegion(), //$NON-NLS-1$
+ endpoint.getPublicURL()));
+ }
+ }
+ } finally {
+ lock.unlock();
+ }
+
+ return builder.toString();
+ }
+
+ /**
+ * Parses the service catalog and caches the results
+ *
+ * @param services The list of services published by this provider
+ */
+ private void parseServiceCatalog(List<Service> services) {
+ Lock lock = rwLock.writeLock();
+ lock.lock();
+ try {
+ serviceTypes.clear();
+ serviceEndpoints.clear();
+ regions.clear();
+
+ for (Service service : services) {
+ String type = service.getType();
+ serviceTypes.put(type, service);
+
+ List<Service.Endpoint> endpoints = service.getEndpoints();
+ for (Service.Endpoint endpoint : endpoints) {
+ List<Service.Endpoint> endpointList = serviceEndpoints.get(type);
+ if (endpointList == null) {
+ endpointList = new ArrayList<>();
+ serviceEndpoints.put(type, endpointList);
+ }
+ endpointList.add(endpoint);
+
+ String region = endpoint.getRegion();
+ if (!regions.contains(region)) {
+ regions.add(region);
+ }
+ }
+ }
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Computes the local time when the access token will expire, after which we will need to re-login to access the
+ * provider.
+ *
+ * @param accessKey The access key used to access the provider
+ * @return The local time the key expires
+ */
+ private static long getLocalExpiration(Access accessKey) {
+ Date now = Time.getCurrentUTCDate();
+ if (accessKey != null && accessKey.getToken() != null) {
+ Calendar issued = accessKey.getToken().getIssued_at();
+ Calendar expires = accessKey.getToken().getExpires();
+ if (issued != null && expires != null) {
+ long tokenLife = expires.getTimeInMillis() - issued.getTimeInMillis();
+ return now.getTime() + tokenLife;
+ }
+ }
+ return now.getTime();
+ }
+}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ServiceCatalogV3.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ServiceCatalogV3.java
new file mode 100644
index 000000000..9cd67995e
--- /dev/null
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/ServiceCatalogV3.java
@@ -0,0 +1,402 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP : APPC
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Copyright (C) 2017 Amdocs
+ * =============================================================================
+ * Licensed 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.
+ *
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.appc.adapter.iaas.impl;
+
+import com.att.cdp.exceptions.ContextConnectionException;
+import com.att.cdp.exceptions.ZoneException;
+import com.att.cdp.openstack.util.ExceptionMapper;
+import com.att.cdp.pal.util.Time;
+import com.att.cdp.zones.ContextFactory;
+import com.att.cdp.zones.spi.RequestState;
+import com.woorea.openstack.base.client.OpenStackBaseException;
+import com.woorea.openstack.base.client.OpenStackClientConnector;
+import com.woorea.openstack.base.client.OpenStackSimpleTokenProvider;
+import com.woorea.openstack.keystone.v3.Keystone;
+import com.woorea.openstack.keystone.v3.api.TokensResource;
+import com.woorea.openstack.keystone.v3.model.Authentication;
+import com.woorea.openstack.keystone.v3.model.Authentication.Identity;
+import com.woorea.openstack.keystone.v3.model.Authentication.Scope;
+import com.woorea.openstack.keystone.v3.model.Token;
+import com.woorea.openstack.keystone.v3.model.Token.Project;
+import com.woorea.openstack.keystone.v3.model.Token.Service;
+import com.woorea.openstack.keystone.v3.model.Token.Service.Endpoint;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * This class is used to capture and cache the service catalog for a specific OpenStack provider.
+ * <p>
+ * This is needed because the way the servers are represented in the ECOMP product is as their fully qualified URL's.
+ * This is very problematic, because we cant identify their region from the URL, URL's change, and we cant identify the
+ * versions of the service implementations. In otherwords, the URL does not provide us enough information.
+ * </p>
+ * <p>
+ * The zone abstraction layer is designed to detect the versions of the services dynamically, and step up or down to
+ * match those reported versions. In order to do that, we need to know before hand what region we are accessing (since
+ * the supported versions may be different by regions). We will need to authenticate to the identity service in order to
+ * do this, plus we have to duplicate the code supporting proxies and trusted hosts that exists in the abstraction
+ * layer, but that cant be helped.
+ * </p>
+ * <p>
+ * What we do to circumvent this is connect to the provider using the lowest supported identity api, and read the entire
+ * service catalog into this object. Then, we parse the vm URL to extract the host and port and match that to the
+ * compute services defined in the catalog. When we find a compute service that has the same host name and port,
+ * whatever region that service is supporting is the region for that server.
+ * </p>
+ * <p>
+ * While we really only need to do this for compute nodes, there is no telling what other situations may arise where the
+ * full service catalog may be needed. Also, there is very little additional cost (additional RAM) associated with
+ * caching the full service catalog since there is no way to list only a portion of it.
+ * </p>
+ */
+public class ServiceCatalogV3 extends ServiceCatalog {
+
+ /**
+ * The project that we are accessing
+ */
+ private Project project;
+
+ /**
+ * A map of endpoints for each service organized by service type
+ */
+ private Map<String /* Service Type */, List<Service.Endpoint>> serviceEndpoints;
+
+ /**
+ * A map of service types that are published
+ */
+ private Map<String /* Service Type */, Service> serviceTypes;
+
+ /**
+ * The Openstack Access object that manages the authenticated token and access control
+ */
+ private Token token;
+
+ /**
+ * A "token provider" that manages the authentication token that we obtain when logging in
+ */
+ private OpenStackSimpleTokenProvider tokenProvider;
+
+ /**
+ * {@inheritDoc}
+ */
+ public ServiceCatalogV3(String identityURL, String projectIdentifier, String principal, String credential,
+ String domain, Properties properties) {
+ super(identityURL, projectIdentifier, principal, credential, domain, properties);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void init() throws ZoneException {
+ rwLock = new ReentrantReadWriteLock();
+ serviceTypes = new HashMap<>();
+ serviceEndpoints = new HashMap<>();
+ regions = new HashSet<>();
+ Class<?> connectorClass;
+ OpenStackClientConnector connector;
+ try {
+ connectorClass = Class.forName(CLIENT_CONNECTOR_CLASS);
+ connector = (OpenStackClientConnector) connectorClass.newInstance();
+ } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
+ e.printStackTrace();
+ return;
+ }
+ Keystone keystone = new Keystone(identityURL, connector);
+
+ String proxyHost = properties.getProperty(ContextFactory.PROPERTY_PROXY_HOST);
+ String proxyPort = properties.getProperty(ContextFactory.PROPERTY_PROXY_PORT);
+ String trustedHosts = properties.getProperty(ContextFactory.PROPERTY_TRUSTED_HOSTS, ""); //$NON-NLS-1$
+ if (proxyHost != null && proxyHost.length() > 0) {
+ keystone.getProperties().setProperty(com.woorea.openstack.common.client.Constants.PROXY_HOST, proxyHost);
+ keystone.getProperties().setProperty(com.woorea.openstack.common.client.Constants.PROXY_PORT, proxyPort);
+ }
+ if (trustedHosts != null) {
+ keystone.getProperties().setProperty(com.woorea.openstack.common.client.Constants.TRUST_HOST_LIST,
+ trustedHosts);
+ }
+
+ // create identity
+ Identity identity = Identity.password(domain, principal, credential);
+
+ // create scope
+ Scope scope = null;
+ if (projectIdentifier.length() == 32 && projectIdentifier.matches("[0-9a-fA-F]+")) { //$NON-NLS-1$
+ // authenticate = authenticate.withTenantId(projectIdentifier);
+ scope = Scope.project(projectIdentifier);
+ } else {
+ // authenticate = authenticate.withTenantName(projectIdentifier);
+ scope = Scope.project(domain, projectIdentifier);
+ }
+
+ Authentication authentication = new Authentication();
+ authentication.setIdentity(identity);
+ authentication.setScope(scope);
+
+ TokensResource tokens = keystone.tokens();
+ TokensResource.Authenticate authenticate = tokens.authenticate(authentication);
+
+ /*
+ * We have to set up the TrackRequest TLS collection for the ExceptionMapper
+ */
+ trackRequest();
+ RequestState.put(RequestState.PROVIDER, "OpenStackProvider");
+ RequestState.put(RequestState.TENANT, projectIdentifier);
+ RequestState.put(RequestState.PRINCIPAL, principal);
+
+ try {
+ token = authenticate.execute();
+ expiresLocal = getLocalExpiration(token);
+ project = token.getProject();
+ tokenProvider = new OpenStackSimpleTokenProvider(token.getId());
+ keystone.setTokenProvider(tokenProvider);
+ parseServiceCatalog(token.getCatalog());
+ } catch (OpenStackBaseException e) {
+ ExceptionMapper.mapException(e);
+ } catch (Exception ex) {
+ throw new ContextConnectionException(ex.getMessage());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public List<Service.Endpoint> getEndpoints(String serviceType) {
+ Lock readLock = rwLock.readLock();
+ readLock.lock();
+ try {
+ return serviceEndpoints.get(serviceType);
+ } finally {
+ readLock.unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getProjectId() {
+ Lock readLock = rwLock.readLock();
+ readLock.lock();
+ try {
+ return project.getId();
+ } finally {
+ readLock.unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getProjectName() {
+ Lock readLock = rwLock.readLock();
+ readLock.lock();
+ try {
+ return project.getName();
+ } finally {
+ readLock.unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Set<String> getRegions() {
+ Lock readLock = rwLock.readLock();
+ readLock.lock();
+ try {
+ return regions;
+ } finally {
+ readLock.unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public List<String> getServiceTypes() {
+ Lock readLock = rwLock.readLock();
+ readLock.lock();
+ try {
+ ArrayList<String> result = new ArrayList<>();
+ result.addAll(serviceTypes.keySet());
+ return result;
+ } finally {
+ readLock.unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getVMRegion(VMURL url) {
+ String region = null;
+ Pattern urlPattern = Pattern.compile("[^:]+://([^:/]+)(?::([0-9]+)).*");
+
+ if (url != null) {
+ for (Endpoint endpoint : getEndpoints(ServiceCatalog.COMPUTE_SERVICE)) {
+ String endpointUrl = endpoint.getUrl();
+ Matcher matcher = urlPattern.matcher(endpointUrl);
+ if (matcher.matches()) {
+ if (url.getHost().equals(matcher.group(1))) {
+ if (url.getPort() != null) {
+ if (!url.getPort().equals(matcher.group(2))) {
+ continue;
+ }
+ }
+
+ region = endpoint.getRegion();
+ break;
+ }
+ }
+ }
+ }
+ return region;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isServicePublished(String serviceType) {
+ Lock readLock = rwLock.readLock();
+ readLock.lock();
+ try {
+ return serviceTypes.containsKey(serviceType);
+ } finally {
+ readLock.unlock();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String toString() {
+
+ StringBuilder builder = new StringBuilder();
+ Lock lock = rwLock.readLock();
+ lock.lock();
+ try {
+ builder.append(String.format("Service Catalog: tenant %s, id[%s]\n", project.getName(), //$NON-NLS-1$
+ project.getId()));
+ if (regions != null && !regions.isEmpty()) {
+ builder.append(String.format("%d regions:\n", regions.size())); //$NON-NLS-1$
+ for (String region : regions) {
+ builder.append("\t" + region + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ builder.append(String.format("%d services:\n", serviceEndpoints.size())); //$NON-NLS-1$
+ for (String serviceType : serviceEndpoints.keySet()) {
+ List<Service.Endpoint> endpoints = serviceEndpoints.get(serviceType);
+ Service service = serviceTypes.get(serviceType);
+
+ builder.append(String.format("\t%s - %d endpoints\n", service.getType(), //$NON-NLS-1$
+ endpoints.size()));
+ for (Service.Endpoint endpoint : endpoints) {
+ builder.append(String.format("\t\tRegion [%s], public URL [%s]\n", endpoint.getRegion(), //$NON-NLS-1$
+ endpoint.getUrl()));
+ }
+ }
+ } finally {
+ lock.unlock();
+ }
+
+ return builder.toString();
+ }
+
+ /**
+ * Parses the service catalog and caches the results
+ *
+ * @param services The list of services published by this provider
+ */
+ private void parseServiceCatalog(List<Service> services) {
+ Lock lock = rwLock.writeLock();
+ lock.lock();
+ try {
+ serviceTypes.clear();
+ serviceEndpoints.clear();
+ regions.clear();
+
+ for (Service service : services) {
+ String type = service.getType();
+ serviceTypes.put(type, service);
+
+ List<Service.Endpoint> endpoints = service.getEndpoints();
+ for (Service.Endpoint endpoint : endpoints) {
+ List<Service.Endpoint> endpointList = serviceEndpoints.get(type);
+ if (endpointList == null) {
+ endpointList = new ArrayList<>();
+ serviceEndpoints.put(type, endpointList);
+ }
+ endpointList.add(endpoint);
+
+ String region = endpoint.getRegion();
+ if (!regions.contains(region)) {
+ regions.add(region);
+ }
+ }
+ }
+ } finally {
+ lock.unlock();
+ }
+ }
+
+ /**
+ * Computes the local time when the access token will expire, after which we will need to re-login to access the
+ * provider.
+ *
+ * @param accessKey The access key used to access the provider
+ * @return The local time the key expires
+ */
+ private static long getLocalExpiration(Token accessToken) {
+ Date now = Time.getCurrentUTCDate();
+ if (accessToken != null) {
+ Calendar issued = accessToken.getIssuedAt();
+ Calendar expires = accessToken.getExpiresAt();
+ if (issued != null && expires != null) {
+ long tokenLife = expires.getTimeInMillis() - issued.getTimeInMillis();
+ return now.getTime() + tokenLife;
+ }
+ }
+ return now.getTime();
+ }
+}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/TenantCache.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/TenantCache.java
index db049484e..ff349c76b 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/TenantCache.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/TenantCache.java
@@ -30,7 +30,6 @@ import java.util.Map;
import java.util.Properties;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-
import org.openecomp.appc.Constants;
import org.openecomp.appc.configuration.Configuration;
import org.openecomp.appc.configuration.ConfigurationFactory;
@@ -47,7 +46,7 @@ import com.att.cdp.zones.Provider;
import com.att.eelf.configuration.EELFLogger;
import com.att.eelf.configuration.EELFManager;
import com.woorea.openstack.connector.JaxRs20Connector;
-//import com.sun.jersey.api.client.ClientHandlerException;
+// import com.sun.jersey.api.client.ClientHandlerException;
import com.woorea.openstack.keystone.model.Access.Service.Endpoint;
/**
@@ -63,9 +62,15 @@ public class TenantCache implements Allocator<Context>, Destructor<Context> {
public static final String POOL_PROVIDER_NAME = "pool.provider.name";
public static final String POOL_TENANT_NAME = "pool.tenant.name";
- //public static final String CLIENT_CONNECTOR_CLASS = "com.woorea.openstack.connector.JerseyConnector";
+ // public static final String CLIENT_CONNECTOR_CLASS =
+ // "com.woorea.openstack.connector.JerseyConnector";
public static final String CLIENT_CONNECTOR_CLASS = "com.woorea.openstack.connector.JaxRs20Connector";
/**
+ * The domain to use to authenticate
+ */
+ private String domain;
+
+ /**
* The provider we are part of
*/
private ProviderCache provider;
@@ -118,8 +123,7 @@ public class TenantCache implements Allocator<Context>, Destructor<Context> {
/**
* Construct the cache of tenants for the specified provider
*
- * @param provider
- * The provider
+ * @param provider The provider
*/
public TenantCache(ProviderCache provider) {
configuration = ConfigurationFactory.getConfiguration();
@@ -165,13 +169,19 @@ public class TenantCache implements Allocator<Context>, Destructor<Context> {
String url = provider.getIdentityURL();
String tenant = tenantName == null ? tenantId : tenantName;
Properties properties = configuration.getProperties();
+ catalog = ServiceCatalogFactory.getServiceCatalog(url, tenant, userid, password, domain, properties);
+
+ if (catalog == null) {
+ logger.error(Msg.IAAS_UNSUPPORTED_IDENTITY_SERVICE, url);
+ return;
+ }
int attempt = 1;
while (attempt <= limit) {
try {
- catalog = new ServiceCatalog(url, tenant, userid, password, properties);
- tenantId = catalog.getTenantId();
- tenantName = catalog.getTenantName();
+ catalog.init();
+ tenantId = catalog.getProjectId();
+ tenantName = catalog.getProjectName();
for (String region : catalog.getRegions()) {
try {
@@ -180,13 +190,13 @@ public class TenantCache implements Allocator<Context>, Destructor<Context> {
pool.setProperty(ContextFactory.PROPERTY_TENANT, tenantName);
pool.setProperty(ContextFactory.PROPERTY_CLIENT_CONNECTOR_CLASS, CLIENT_CONNECTOR_CLASS);
pool.setProperty(ContextFactory.PROPERTY_RETRY_DELAY,
- configuration.getProperty(Constants.PROPERTY_RETRY_DELAY));
+ configuration.getProperty(Constants.PROPERTY_RETRY_DELAY));
pool.setProperty(ContextFactory.PROPERTY_RETRY_LIMIT,
- configuration.getProperty(Constants.PROPERTY_RETRY_LIMIT));
+ configuration.getProperty(Constants.PROPERTY_RETRY_LIMIT));
pool.setProperty(ContextFactory.PROPERTY_REGION, region);
if (properties.getProperty(ContextFactory.PROPERTY_TRUSTED_HOSTS) != null) {
pool.setProperty(ContextFactory.PROPERTY_TRUSTED_HOSTS,
- properties.getProperty(ContextFactory.PROPERTY_TRUSTED_HOSTS));
+ properties.getProperty(ContextFactory.PROPERTY_TRUSTED_HOSTS));
}
pool.setAllocator(this);
pool.setDestructor(this);
@@ -202,7 +212,8 @@ public class TenantCache implements Allocator<Context>, Destructor<Context> {
} catch (ContextConnectionException e) {
attempt++;
if (attempt <= limit) {
- logger.error(Msg.CONNECTION_FAILED_RETRY, provider.getProviderName(), url, tenantName, tenantId, e.getMessage(), Integer.toString(delay), Integer.toString(attempt),
+ logger.error(Msg.CONNECTION_FAILED_RETRY, provider.getProviderName(), url, tenantName, tenantId,
+ e.getMessage(), Integer.toString(delay), Integer.toString(attempt),
Integer.toString(limit));
try {
@@ -211,7 +222,7 @@ public class TenantCache implements Allocator<Context>, Destructor<Context> {
// ignore
}
}
- } catch ( ZoneException e) {
+ } catch (ZoneException e) {
logger.error(e.getMessage());
break;
}
@@ -226,38 +237,31 @@ public class TenantCache implements Allocator<Context>, Destructor<Context> {
* This method accepts a fully qualified compute node URL and uses that to determine which region of the provider
* hosts that compute node.
*
- * @param url
- * The parsed URL of the compute node
+ * @param url The parsed URL of the compute node
* @return The region name, or null if no region of this tenant hosts that compute node.
*/
public String determineRegion(VMURL url) {
logger.debug(String.format("Attempting to determine VM region for %s", url));
- String region = null;
- Pattern urlPattern = Pattern.compile("[^:]+://([^:/]+)(?::([0-9]+)).*");
-
- if (url != null) {
- for (Endpoint endpoint : catalog.getEndpoints(ServiceCatalog.COMPUTE_SERVICE)) {
- String endpointUrl = endpoint.getPublicURL();
- Matcher matcher = urlPattern.matcher(endpointUrl);
- if (matcher.matches()) {
- if (url.getHost().equals(matcher.group(1))) {
- if (url.getPort() != null) {
- if (!url.getPort().equals(matcher.group(2))) {
- continue;
- }
- }
-
- region = endpoint.getRegion();
- break;
- }
- }
- }
- }
+ String region = catalog.getVMRegion(url);
logger.debug(String.format("Region for %s is %s", url, region));
return region;
}
/**
+ * @return the value of the domain
+ */
+ public String getDomain() {
+ return domain;
+ }
+
+ /**
+ * @param domain the value for domain
+ */
+ public void setDomain(String domain) {
+ this.domain = domain;
+ }
+
+ /**
* @return the value of provider
*/
public ProviderCache getProvider() {
@@ -265,8 +269,7 @@ public class TenantCache implements Allocator<Context>, Destructor<Context> {
}
/**
- * @param provider
- * the value for provider
+ * @param provider the value for provider
*/
public void setProvider(ProviderCache provider) {
this.provider = provider;
@@ -280,8 +283,7 @@ public class TenantCache implements Allocator<Context>, Destructor<Context> {
}
/**
- * @param password
- * the value for password
+ * @param password the value for password
*/
public void setPassword(String password) {
this.password = password;
@@ -295,8 +297,7 @@ public class TenantCache implements Allocator<Context>, Destructor<Context> {
}
/**
- * @param tenantId
- * the value for tenantId
+ * @param tenantId the value for tenantId
*/
public void setTenantId(String tenantId) {
this.tenantId = tenantId;
@@ -310,8 +311,7 @@ public class TenantCache implements Allocator<Context>, Destructor<Context> {
}
/**
- * @param tenantName
- * the value for tenantName
+ * @param tenantName the value for tenantName
*/
public void setTenantName(String tenantName) {
this.tenantName = tenantName;
@@ -325,8 +325,7 @@ public class TenantCache implements Allocator<Context>, Destructor<Context> {
}
/**
- * @param userid
- * the value for userid
+ * @param userid the value for userid
*/
public void setUserid(String userid) {
this.userid = userid;
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/VMURL.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/VMURL.java
index d9c9c7ba6..2860b5aea 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/VMURL.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/impl/VMURL.java
@@ -36,8 +36,8 @@ public class VMURL {
* The regular expression pattern used to parse the URL. Capturing groups are used to identify and extract the
* various component parts of the URL.
*/
- private static Pattern pattern = Pattern
- .compile("(\\p{Alnum}+)://([^/:]+)(?::([0-9]+))?(/.*)?/(v[0-9\\.]+)/([^/]+)/servers/([^/]+)");
+ private static Pattern pattern =
+ Pattern.compile("(\\p{Alnum}+)://([^/:]+)(?::([0-9]+))?(/.*)?/(v[0-9\\.]+)/([^/]+)/servers/([^/]+)");
/**
* The URL scheme or protocol, such as HTTP or HTTPS
@@ -87,8 +87,7 @@ public class VMURL {
* This static method is used to parse the provided server URL string and return a parse results object (VMURL)
* which represents the state of the parse.
*
- * @param serverUrl
- * The server URL to be parsed
+ * @param serverUrl The server URL to be parsed
* @return The VMURL parse results object, or null if the URL was not valid or null.
*/
public static VMURL parseURL(String serverUrl) {
@@ -153,7 +152,7 @@ public class VMURL {
}
/**
- * @return The version of the service
+ * @return The version of the service
*/
public String getVersion() {
return version;
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/api/IProviderOperation.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/api/IProviderOperation.java
index 349fa1935..6a1459772 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/api/IProviderOperation.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/api/IProviderOperation.java
@@ -28,7 +28,6 @@ import org.openecomp.appc.adapter.iaas.impl.ProviderCache;
import org.openecomp.appc.exceptions.APPCException;
import com.att.cdp.zones.model.ModelObject;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
-
import java.util.Map;
/**
@@ -38,26 +37,37 @@ public interface IProviderOperation {
/**
* perform specific provider operation
+ *
* @param params
* @param context
* @return Object represents Stack, Server Or Image
*/
- ModelObject doOperation(Map<String,String> params, SvcLogicContext context) throws APPCException;
+ ModelObject doOperation(Map<String, String> params, SvcLogicContext context) throws APPCException;
/**
* sets a cache of providers that are predefined.
+ *
* @param providerCache
*/
void setProviderCache(Map<String /* provider name */, ProviderCache> providerCache);
/**
* should be initialized by user
+ *
+ * @param defaultDomain
+ */
+ void setDefaultDomain(String defaultDomain);
+
+ /**
+ * should be initialized by user
+ *
* @param defaultUser
*/
void setDefaultUser(String defaultUser);
/**
* should be initialized by user
+ *
* @param defaultPass
*/
void setDefaultPass(String defaultPass);
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/api/ProviderOperationFactory.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/api/ProviderOperationFactory.java
index 22109a425..39ef4a8ae 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/api/ProviderOperationFactory.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/api/ProviderOperationFactory.java
@@ -27,12 +27,12 @@ package org.openecomp.appc.adapter.iaas.provider.operation.api;
import org.openecomp.appc.adapter.iaas.provider.operation.impl.*;
import org.openecomp.appc.adapter.iaas.provider.operation.common.enums.Operation;
import org.openecomp.appc.exceptions.APPCException;
-
import java.util.HashMap;
import java.util.Map;
/**
* Singleton factory of provider operations objects with cache
+ *
* @since September 26, 2016
*/
public class ProviderOperationFactory {
@@ -115,7 +115,7 @@ public class ProviderOperationFactory {
default:
throw new APPCException("Unsupported provider operation.");
}
- operations.put(op,opObject);
+ operations.put(op, opObject);
}
return opObject;
}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/common/constants/Property.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/common/constants/Property.java
index de1cf815d..9a0249456 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/common/constants/Property.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/common/constants/Property.java
@@ -32,6 +32,7 @@ public class Property {
public static final String PROVIDER = "provider";
public static final String PROVIDER_IDENTITY = "identity";
public static final String PROVIDER_TENANT = "tenant";
+ public static final String PROVIDER_TENANT_DOMAIN = "Default";
public static final String PROVIDER_TENANT_NAME = "name";
public static final String PROVIDER_TENANT_PASSWORD = "password";
public static final String PROVIDER_TENANT_USERID = "userid";
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/common/enums/Operation.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/common/enums/Operation.java
index 759d8e807..857c7a7f0 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/common/enums/Operation.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/common/enums/Operation.java
@@ -29,67 +29,67 @@ package org.openecomp.appc.adapter.iaas.provider.operation.common.enums;
*/
public enum Operation {
EVACUATE_SERVICE {
- public String toString(){
+ public String toString() {
return "evacuateServer";
}
},
MIGRATE_SERVICE {
- public String toString(){
+ public String toString() {
return "migrateServer";
}
},
REBUILD_SERVICE {
- public String toString(){
+ public String toString() {
return "rebuildServer";
}
},
RESTART_SERVICE {
- public String toString(){
+ public String toString() {
return "restartServer";
}
},
VMSTATUSCHECK_SERVICE {
- public String toString(){
+ public String toString() {
return "vmStatuschecker";
}
},
SNAPSHOT_SERVICE {
- public String toString(){
+ public String toString() {
return "createSnapshot";
}
},
TERMINATE_STACK {
- public String toString(){
+ public String toString() {
return "terminateStack";
}
},
SNAPSHOT_STACK {
- public String toString(){
+ public String toString() {
return "snapshotStack";
}
},
START_SERVICE {
- public String toString(){
+ public String toString() {
return "startServer";
}
},
STOP_SERVICE {
- public String toString(){
+ public String toString() {
return "stopServer";
}
},
TERMINATE_SERVICE {
- public String toString(){
+ public String toString() {
return "terminateServer";
}
},
LOOKUP_SERVICE {
- public String toString(){
+ public String toString() {
return "lookupServer";
}
},
- RESTORE_STACK{
- public String toString(){
+ RESTORE_STACK {
+ public String toString() {
return "restoreStack";
}
}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/common/enums/Outcome.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/common/enums/Outcome.java
index 4007b26b2..c62c1b25d 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/common/enums/Outcome.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/common/enums/Outcome.java
@@ -29,12 +29,12 @@ package org.openecomp.appc.adapter.iaas.provider.operation.common.enums;
*/
public enum Outcome {
FAILURE {
- public String toString(){
+ public String toString() {
return "failure";
}
},
SUCCESS {
- public String toString(){
+ public String toString() {
return "success";
}
}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/CreateSnapshot.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/CreateSnapshot.java
index e54ed86a5..b4c55253d 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/CreateSnapshot.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/CreateSnapshot.java
@@ -51,13 +51,11 @@ import org.openecomp.appc.configuration.ConfigurationFactory;
import org.openecomp.appc.exceptions.APPCException;
import org.openecomp.appc.i18n.Msg;
import org.slf4j.MDC;
-
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import java.util.TimeZone;
-
import static org.openecomp.appc.adapter.iaas.provider.operation.common.constants.Constants.DATE_FORMAT;
import static org.openecomp.appc.adapter.utils.Constants.ADAPTER_NAME;
@@ -72,7 +70,7 @@ public class CreateSnapshot extends ProviderServerOperation {
SimpleDateFormat df = new SimpleDateFormat(DATE_FORMAT);
metricsLogger.info("Snapshot Name Generated: Snapshot of %s at %s", server, df.format(new Date()));
-
+
return String.format("Snapshot of %s at %s", server, df.format(new Date()));
}
@@ -85,10 +83,10 @@ public class CreateSnapshot extends ProviderServerOperation {
setTimeForMetricsLogger();
- logger.info(String.format("Creating snapshot of server %s (%s) with name %s",
- server.getName(), server.getId(), snapshotName));
- metricsLogger.info(String.format("Creating snapshot of server %s (%s) with name %s",
- server.getName(), server.getId(), snapshotName));
+ logger.info(String.format("Creating snapshot of server %s (%s) with name %s", server.getName(), server.getId(),
+ snapshotName));
+ metricsLogger.info(String.format("Creating snapshot of server %s (%s) with name %s", server.getName(),
+ server.getId(), snapshotName));
// Request Snapshot
String msg;
@@ -161,7 +159,8 @@ public class CreateSnapshot extends ProviderServerOperation {
String appName = configuration.getProperty(Constants.PROPERTY_APPLICATION_NAME);
String vm_url = params.get(ProviderAdapter.PROPERTY_INSTANCE_URL);
VMURL vm = VMURL.parseURL(vm_url);
- if (validateVM(rc, appName, vm_url, vm)) return null;
+ if (validateVM(rc, appName, vm_url, vm))
+ return null;
IdentityURL ident = IdentityURL.parseURL(params.get(ProviderAdapter.PROPERTY_IDENTITY_URL));
String identStr = (ident == null) ? null : ident.toString();
@@ -177,8 +176,8 @@ public class CreateSnapshot extends ProviderServerOperation {
snapshot = createSnapshot(rc, server);
doSuccess(rc);
} else {
- msg = EELFResourceManager.format(Msg.REBUILD_SERVER_FAILED,
- server.getName(), server.getId(), "Accessing Image Service Failed");
+ msg = EELFResourceManager.format(Msg.REBUILD_SERVER_FAILED, server.getName(), server.getId(),
+ "Accessing Image Service Failed");
logger.error(msg);
metricsLogger.error(msg);
doFailure(rc, HttpStatus.FORBIDDEN_403, msg);
@@ -212,7 +211,7 @@ public class CreateSnapshot extends ProviderServerOperation {
setTimeForMetricsLogger();
metricsLogger.info("Executing Provider Operation: Create Snapshot");
-
+
return createSnapshot(params, context);
}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/EvacuateServer.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/EvacuateServer.java
index f2466d377..45473e349 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/EvacuateServer.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/EvacuateServer.java
@@ -55,7 +55,6 @@ import com.att.eelf.i18n.EELFResourceManager;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.glassfish.grizzly.http.util.HttpStatus;
import org.slf4j.MDC;
-
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Arrays;
@@ -63,7 +62,6 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
-
import static org.openecomp.appc.adapter.utils.Constants.ADAPTER_NAME;
public class EvacuateServer extends ProviderServerOperation {
@@ -92,7 +90,8 @@ public class EvacuateServer extends ProviderServerOperation {
Server.Status.SUSPENDED, Server.Status.PAUSED);
}
} catch (RequestFailedException e) {
- // evacuate is a special case. If the server is still in a Pending state, we want to continue with evacuate
+ // evacuate is a special case. If the server is still in a Pending state, we want to
+ // continue with evacuate
logger.info("Evacuate server - ignore RequestFailedException from waitForStateChange() ...");
}
@@ -105,8 +104,8 @@ public class EvacuateServer extends ProviderServerOperation {
logger.debug("Calling CDP moveServer - server id = " + server.getId());
service.moveServer(server.getId(), target_host);
// Wait for completion, expecting the server to go to a non pending state
- waitForStateChange(rc, server, Server.Status.READY, Server.Status.RUNNING,
- Server.Status.ERROR, Server.Status.SUSPENDED, Server.Status.PAUSED);
+ waitForStateChange(rc, server, Server.Status.READY, Server.Status.RUNNING, Server.Status.ERROR,
+ Server.Status.SUSPENDED, Server.Status.PAUSED);
break;
} catch (ContextConnectionException e) {
msg = EELFResourceManager.format(Msg.CONNECTION_FAILED_RETRY, provider.getName(), service.getURL(),
@@ -120,8 +119,8 @@ public class EvacuateServer extends ProviderServerOperation {
}
} catch (ZoneException e) {
- msg = EELFResourceManager.format(Msg.EVACUATE_SERVER_FAILED,
- server.getName(), server.getId(), e.getMessage());
+ msg = EELFResourceManager.format(Msg.EVACUATE_SERVER_FAILED, server.getName(), server.getId(),
+ e.getMessage());
logger.error(msg);
metricsLogger.error(msg);
throw new RequestFailedException("Evacute Server", msg, HttpStatus.BAD_GATEWAY_502, server);
@@ -138,7 +137,8 @@ public class EvacuateServer extends ProviderServerOperation {
/**
- * @see org.openecomp.appc.adapter.iaas.ProviderAdapter#evacuateServer(java.util.Map, org.openecomp.sdnc.sli.SvcLogicContext)
+ * @see org.openecomp.appc.adapter.iaas.ProviderAdapter#evacuateServer(java.util.Map,
+ * org.openecomp.sdnc.sli.SvcLogicContext)
*/
private Server evacuateServer(Map<String, String> params, SvcLogicContext ctx) throws APPCException {
Server server = null;
@@ -156,7 +156,8 @@ public class EvacuateServer extends ProviderServerOperation {
String appName = configuration.getProperty(Constants.PROPERTY_APPLICATION_NAME);
String vm_url = params.get(ProviderAdapter.PROPERTY_INSTANCE_URL);
VMURL vm = VMURL.parseURL(vm_url);
- if (validateVM(rc, appName, vm_url, vm)) return null;
+ if (validateVM(rc, appName, vm_url, vm))
+ return null;
IdentityURL ident = IdentityURL.parseURL(params.get(ProviderAdapter.PROPERTY_IDENTITY_URL));
String identStr = (ident == null) ? null : ident.toString();
@@ -175,8 +176,8 @@ public class EvacuateServer extends ProviderServerOperation {
// check target host status
if (isComputeNodeDown(context, targethost_id)) {
- msg = EELFResourceManager.format(Msg.EVACUATE_SERVER_FAILED, server.getName(),
- server.getId(), "Target host " + targethost_id + " status is not UP/ENABLED");
+ msg = EELFResourceManager.format(Msg.EVACUATE_SERVER_FAILED, server.getName(), server.getId(),
+ "Target host " + targethost_id + " status is not UP/ENABLED");
logger.error(msg);
metricsLogger.error(msg);
throw new RequestFailedException("Evacuate Server", msg, HttpStatus.BAD_REQUEST_400, server);
@@ -192,34 +193,35 @@ public class EvacuateServer extends ProviderServerOperation {
logger.debug("Hostname before evacuate: " + hypervisor + ", After evacuate: "
+ hypervisor_after_evacuate);
- // check hypervisor host name after evacuate. If it is unchanged, the evacuate failed.
+ // check hypervisor host name after evacuate. If it is unchanged, the evacuate
+ // failed.
if ((hypervisor != null) && (hypervisor.equals(hypervisor_after_evacuate))) {
- msg = EELFResourceManager.format(Msg.EVACUATE_SERVER_FAILED, server.getName(),
- server.getId(), "Hypervisor host " + hypervisor
+ msg = EELFResourceManager.format(Msg.EVACUATE_SERVER_FAILED, server.getName(), server.getId(),
+ "Hypervisor host " + hypervisor
+ " after evacuate is the same as before evacuate. Provider (ex. Openstack) recovery actions may be needed.");
logger.error(msg);
metricsLogger.error(msg);
- throw new RequestFailedException("Evacuate Server", msg,
- HttpStatus.INTERNAL_SERVER_ERROR_500, server);
+ throw new RequestFailedException("Evacuate Server", msg, HttpStatus.INTERNAL_SERVER_ERROR_500,
+ server);
}
// check VM status after evacuate
if (server.getStatus() == Server.Status.ERROR) {
- msg = EELFResourceManager.format(Msg.EVACUATE_SERVER_FAILED, server.getName(),
- server.getId(),
+ msg = EELFResourceManager.format(Msg.EVACUATE_SERVER_FAILED, server.getName(), server.getId(),
"VM is in ERROR state after evacuate. Provider (ex. Openstack) recovery actions may be needed.");
logger.error(msg);
metricsLogger.error(msg);
- throw new RequestFailedException("Evacuate Server", msg,
- HttpStatus.INTERNAL_SERVER_ERROR_500, server);
+ throw new RequestFailedException("Evacuate Server", msg, HttpStatus.INTERNAL_SERVER_ERROR_500,
+ server);
}
context.close();
doSuccess(rc);
ctx.setAttribute("EVACUATE_STATUS", "SUCCESS");
- // If a snapshot exists, do a rebuild to apply the latest snapshot to the evacuated server.
+ // If a snapshot exists, do a rebuild to apply the latest snapshot to the
+ // evacuated server.
// This is the default behavior unless the optional parameter is set to FALSE.
if ((rebuild_vm == null) || !(rebuild_vm.equalsIgnoreCase("false"))) {
List<Image> snapshots = server.getSnapshots();
@@ -238,14 +240,15 @@ public class EvacuateServer extends ProviderServerOperation {
if (error_code != HttpStatus.OK_200.getStatusCode()) {
logger.debug("Rebuild after evacuate failed - error code=" + error_code
+ ", message=" + ctx.getAttribute(
- org.openecomp.appc.Constants.ATTRIBUTE_ERROR_MESSAGE));
+ org.openecomp.appc.Constants.ATTRIBUTE_ERROR_MESSAGE));
msg = EELFResourceManager.format(Msg.EVACUATE_SERVER_REBUILD_FAILED,
server.getName(), hypervisor, hypervisor_after_evacuate,
ctx.getAttribute(org.openecomp.appc.Constants.ATTRIBUTE_ERROR_MESSAGE));
logger.error(msg);
metricsLogger.error(msg);
ctx.setAttribute("EVACUATE_STATUS", "ERROR");
- // update error message while keeping the error code the same as before
+ // update error message while keeping the error code the
+ // same as before
doFailure(rc, HttpStatus.getHttpStatus(error_code), msg);
}
} catch (NumberFormatException e) {
@@ -265,8 +268,8 @@ public class EvacuateServer extends ProviderServerOperation {
doFailure(rc, e.getStatus(), e.getMessage());
} catch (Exception e1) {
msg = EELFResourceManager.format(Msg.SERVER_OPERATION_EXCEPTION, e1, e1.getClass().getSimpleName(),
- Operation.EVACUATE_SERVICE.toString(),
- vm_url, context == null ? "Unknown" : context.getTenantName());
+ Operation.EVACUATE_SERVICE.toString(), vm_url,
+ context == null ? "Unknown" : context.getTenantName());
logger.error(msg, e1);
metricsLogger.error(msg, e1);
doFailure(rc, HttpStatus.INTERNAL_SERVER_ERROR_500, msg);
@@ -284,14 +287,13 @@ public class EvacuateServer extends ProviderServerOperation {
/*
* Check if a Compute node is down.
*
- * This method attempts to find a given host in the list of hypervisors for a given
- * context. The only case where a node is considered down is if a matching hypervisor
- * is found and it's state and status are not UP/ENABLED.
+ * This method attempts to find a given host in the list of hypervisors for a given context. The only case where a
+ * node is considered down is if a matching hypervisor is found and it's state and status are not UP/ENABLED.
+ *
+ * @param context The current context
+ *
+ * @param host The host name (short or fully qualified) of a compute node
*
- * @param context
- * The current context
- * @param host
- * The host name (short or fully qualified) of a compute node
* @return true if the node is determined as down, false for all other cases
*/
private boolean isComputeNodeDown(Context context, String host) throws ZoneException {
@@ -299,7 +301,7 @@ public class EvacuateServer extends ProviderServerOperation {
boolean node_down = false;
// Check host status. A node is considered down only if a matching target host is
- // found and it's state/status is not UP/ENABLED.
+ // found and it's state/status is not UP/ENABLED.
if ((host != null) && !(host.isEmpty())) {
List<Hypervisor> hypervisors = service.getHypervisors();
logger.debug("List of Hypervisors retrieved: " + Arrays.toString(hypervisors.toArray()));
@@ -308,8 +310,8 @@ public class EvacuateServer extends ProviderServerOperation {
// host matches one of the hypervisors
State hstate = h.getState();
Status hstatus = h.getStatus();
- logger.debug("Host matching hypervisor: " + h.getHostName() + ", State/Status: "
- + hstate.toString() + "/" + hstatus.toString());
+ logger.debug("Host matching hypervisor: " + h.getHostName() + ", State/Status: " + hstate.toString()
+ + "/" + hstatus.toString());
if (hstate != State.UP || hstatus != Status.ENABLED) {
node_down = true;
}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/LookupServer.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/LookupServer.java
index 0152fc650..4c5c61670 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/LookupServer.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/LookupServer.java
@@ -44,10 +44,8 @@ import com.att.eelf.configuration.EELFManager;
import com.att.eelf.i18n.EELFResourceManager;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.glassfish.grizzly.http.util.HttpStatus;
-
import java.io.IOException;
import java.util.Map;
-
import static org.openecomp.appc.adapter.utils.Constants.ADAPTER_NAME;
public class LookupServer extends ProviderServerOperation {
@@ -59,11 +57,11 @@ public class LookupServer extends ProviderServerOperation {
public Server lookupServer(Map<String, String> params, SvcLogicContext ctx) throws APPCException {
Server server = null;
RequestContext rc = new RequestContext(ctx);
- rc.isAlive(); //should we test the return and fail if false?
+ rc.isAlive(); // should we test the return and fail if false?
String vm_url = null;
try {
- //process vm_url
+ // process vm_url
validateParametersExist(params, ProviderAdapter.PROPERTY_INSTANCE_URL,
ProviderAdapter.PROPERTY_PROVIDER_NAME);
@@ -74,33 +72,31 @@ public class LookupServer extends ProviderServerOperation {
return null;
}
- //use try with resource to ensure context is closed (returned to pool)
+ // use try with resource to ensure context is closed (returned to pool)
try (Context context = resolveContext(rc, params, appName, vm_url)) {
- //resloveContext & getContext call doFailure and log errors before returning null
- if (context != null){
+ // resloveContext & getContext call doFailure and log errors before returning null
+ if (context != null) {
rc.reset();
server = lookupServer(rc, context, vm.getServerId());
logger.debug(Msg.SERVER_FOUND, vm_url, context.getTenantName(), server.getStatus().toString());
ctx.setAttribute("serverFound", "success");
- String msg =
- EELFResourceManager.format(Msg.SUCCESS_EVENT_MESSAGE, "LookupServer", vm_url);
+ String msg = EELFResourceManager.format(Msg.SUCCESS_EVENT_MESSAGE, "LookupServer", vm_url);
ctx.setAttribute(org.openecomp.appc.Constants.ATTRIBUTE_SUCCESS_MESSAGE, msg);
doSuccess(rc);
}
} catch (ZoneException e) {
- //server not found
+ // server not found
String msg = EELFResourceManager.format(Msg.SERVER_NOT_FOUND, e, vm_url);
logger.error(msg);
doFailure(rc, HttpStatus.NOT_FOUND_404, msg);
ctx.setAttribute("serverFound", "failure");
- } catch (IOException e) {
- //exception closing context
+ } catch (IOException e) {
+ // exception closing context
String msg = EELFResourceManager.format(Msg.CLOSE_CONTEXT_FAILED, e, vm_url);
logger.error(msg);
} catch (Exception e1) {
- String msg = EELFResourceManager.format(Msg.SERVER_OPERATION_EXCEPTION,
- e1, e1.getClass().getSimpleName(),
- Operation.LOOKUP_SERVICE.toString(), vm_url, "Unknown" );
+ String msg = EELFResourceManager.format(Msg.SERVER_OPERATION_EXCEPTION, e1,
+ e1.getClass().getSimpleName(), Operation.LOOKUP_SERVICE.toString(), vm_url, "Unknown");
logger.error(msg, e1);
doFailure(rc, HttpStatus.INTERNAL_SERVER_ERROR_500, msg);
}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/MigrateServer.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/MigrateServer.java
index e45bdfa61..2477c9afa 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/MigrateServer.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/MigrateServer.java
@@ -49,7 +49,6 @@ import org.openecomp.appc.exceptions.APPCException;
import org.openecomp.appc.i18n.Msg;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.slf4j.MDC;
-
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Arrays;
@@ -57,7 +56,6 @@ import java.util.Collection;
import java.util.Date;
import java.util.Map;
import java.util.TimeZone;
-
import static org.openecomp.appc.adapter.iaas.provider.operation.common.enums.Operation.MIGRATE_SERVICE;
import static org.openecomp.appc.adapter.utils.Constants.ADAPTER_NAME;
@@ -104,8 +102,8 @@ public class MigrateServer extends ProviderServerOperation {
setTimeForMetricsLogger();
// Is the skip Hypervisor check attribute populated?
- String skipHypervisorCheck = null;
- if (svcCtx != null) {
+ String skipHypervisorCheck = configuration.getProperty("org.openecomp.appc.iaas.skiphypervisorchek");
+ if (skipHypervisorCheck == null && svcCtx != null) {
skipHypervisorCheck = svcCtx.getAttribute(ProviderAdapter.SKIP_HYPERVISOR_CHECK);
}
@@ -154,7 +152,8 @@ public class MigrateServer extends ProviderServerOperation {
}
/**
- * @see org.openecomp.appc.adapter.iaas.ProviderAdapter#migrateServer(java.util.Map, org.openecomp.sdnc.sli.SvcLogicContext)
+ * @see org.openecomp.appc.adapter.iaas.ProviderAdapter#migrateServer(java.util.Map,
+ * org.openecomp.sdnc.sli.SvcLogicContext)
*/
private Server migrateServer(Map<String, String> params, SvcLogicContext ctx) throws APPCException {
Server server = null;
@@ -171,7 +170,8 @@ public class MigrateServer extends ProviderServerOperation {
String appName = configuration.getProperty(Constants.PROPERTY_APPLICATION_NAME);
VMURL vm = VMURL.parseURL(vm_url);
- if (validateVM(rc, appName, vm_url, vm)) return null;
+ if (validateVM(rc, appName, vm_url, vm))
+ return null;
IdentityURL ident = IdentityURL.parseURL(params.get(ProviderAdapter.PROPERTY_IDENTITY_URL));
String identStr = (ident == null) ? null : ident.toString();
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/RebuildServer.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/RebuildServer.java
index 0f089b108..ad7d15b85 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/RebuildServer.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/RebuildServer.java
@@ -54,14 +54,12 @@ import org.openecomp.appc.exceptions.APPCException;
import org.openecomp.appc.i18n.Msg;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.slf4j.MDC;
-
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
-
import static org.openecomp.appc.adapter.iaas.provider.operation.common.enums.Operation.STOP_SERVICE;
import static org.openecomp.appc.adapter.utils.Constants.ADAPTER_NAME;
@@ -75,10 +73,9 @@ public class RebuildServer extends ProviderServerOperation {
* Rebuild the indicated server with the indicated image. This method assumes the server has been determined to be
* in the correct state to do the rebuild.
*
- * @param rc The request context that manages the state and recovery of the request for the life of
- * its processing.
+ * @param rc The request context that manages the state and recovery of the request for the life of its processing.
* @param server the server to be rebuilt
- * @param image The image to be used (or snapshot)
+ * @param image The image to be used (or snapshot)
* @throws RequestFailedException if the server does not change state in the allotted time
*/
@SuppressWarnings("nls")
@@ -88,8 +85,8 @@ public class RebuildServer extends ProviderServerOperation {
String msg;
Context context = server.getContext();
Provider provider = context.getProvider();
- ComputeService service = context.getComputeService();
-
+ ComputeService service = context.getComputeService();
+
/*
* Set Time for Metrics Logger
*/
@@ -121,8 +118,8 @@ public class RebuildServer extends ProviderServerOperation {
metricsLogger.trace("Sleep threw interrupted exception, should never occur");
}
} catch (ZoneException e) {
- msg = EELFResourceManager.format(Msg.REBUILD_SERVER_FAILED,
- server.getName(), server.getId(), e.getMessage());
+ msg = EELFResourceManager.format(Msg.REBUILD_SERVER_FAILED, server.getName(), server.getId(),
+ e.getMessage());
logger.error(msg);
metricsLogger.error(msg);
throw new RequestFailedException("Rebuild Server", msg, HttpStatus.BAD_GATEWAY_502, server);
@@ -151,10 +148,9 @@ public class RebuildServer extends ProviderServerOperation {
* a VM from a bootable volume, where the bootable volume itself is not rebuilt, serves no purpose.
* </p>
*
- * @param rc The request context that manages the state and recovery of the request for the life of
- * its processing.
+ * @param rc The request context that manages the state and recovery of the request for the life of its processing.
* @param server The server to be rebuilt
- * @throws ZoneException When error occurs
+ * @throws ZoneException When error occurs
* @throws RequestFailedException When server status is error
*/
@SuppressWarnings("nls")
@@ -179,11 +175,9 @@ public class RebuildServer extends ProviderServerOperation {
}
/*
- * Pending is a bit of a special case. If we find the server is in a
- * pending state, then the provider is in the process of changing state
- * of the server. So, lets try to wait a little bit and see if the state
- * settles down to one we can deal with. If not, then we have to fail
- * the request.
+ * Pending is a bit of a special case. If we find the server is in a pending state, then the provider is in the
+ * process of changing state of the server. So, lets try to wait a little bit and see if the state settles down
+ * to one we can deal with. If not, then we have to fail the request.
*/
Context context = server.getContext();
Provider provider = context.getProvider();
@@ -195,8 +189,8 @@ public class RebuildServer extends ProviderServerOperation {
}
// Is the skip Hypervisor check attribute populated?
- String skipHypervisorCheck = null;
- if (ctx != null) {
+ String skipHypervisorCheck = configuration.getProperty("org.openecomp.appc.iaas.skiphypervisorchek");
+ if (skipHypervisorCheck == null && ctx != null) {
skipHypervisorCheck = ctx.getAttribute(ProviderAdapter.SKIP_HYPERVISOR_CHECK);
}
@@ -208,10 +202,8 @@ public class RebuildServer extends ProviderServerOperation {
}
/*
- * Get the image to use. This is determined by the presence or
- * absence of snapshot images. If any snapshots exist, then the
- * latest snapshot is used, otherwise the image used to construct
- * the VM is used.
+ * Get the image to use. This is determined by the presence or absence of snapshot images. If any snapshots
+ * exist, then the latest snapshot is used, otherwise the image used to construct the VM is used.
*/
List<Image> snapshots = server.getSnapshots();
String imageToUse;
@@ -225,16 +217,16 @@ public class RebuildServer extends ProviderServerOperation {
while (rc.attempt()) {
try {
/*
- * We are just trying to make sure that the image exists.
- * We arent interested in the details at this point.
+ * We are just trying to make sure that the image exists. We arent interested in the details at
+ * this point.
*/
imageService.getImage(imageToUse);
break;
} catch (ContextConnectionException e) {
msg = EELFResourceManager.format(Msg.CONNECTION_FAILED_RETRY, provider.getName(),
imageService.getURL(), context.getTenant().getName(), context.getTenant().getId(),
- e.getMessage(), Long.toString(rc.getRetryDelay()),
- Integer.toString(rc.getAttempts()), Integer.toString(rc.getRetryLimit()));
+ e.getMessage(), Long.toString(rc.getRetryDelay()), Integer.toString(rc.getAttempts()),
+ Integer.toString(rc.getRetryLimit()));
logger.error(msg, e);
metricsLogger.error(msg);
rc.delay();
@@ -335,7 +327,8 @@ public class RebuildServer extends ProviderServerOperation {
}
/**
- * @see org.openecomp.appc.adapter.iaas.ProviderAdapter#rebuildServer(java.util.Map, org.openecomp.sdnc.sli.SvcLogicContext)
+ * @see org.openecomp.appc.adapter.iaas.ProviderAdapter#rebuildServer(java.util.Map,
+ * org.openecomp.sdnc.sli.SvcLogicContext)
*/
@SuppressWarnings("nls")
public Server rebuildServer(Map<String, String> params, SvcLogicContext ctx) throws APPCException {
@@ -353,7 +346,8 @@ public class RebuildServer extends ProviderServerOperation {
String appName = configuration.getProperty(Constants.PROPERTY_APPLICATION_NAME);
String vm_url = params.get(ProviderAdapter.PROPERTY_INSTANCE_URL);
VMURL vm = VMURL.parseURL(vm_url);
- if (validateVM(rc, appName, vm_url, vm)) return null;
+ if (validateVM(rc, appName, vm_url, vm))
+ return null;
IdentityURL ident = IdentityURL.parseURL(params.get(ProviderAdapter.PROPERTY_IDENTITY_URL));
String identStr = (ident == null) ? null : ident.toString();
@@ -373,8 +367,8 @@ public class RebuildServer extends ProviderServerOperation {
doSuccess(rc);
ctx.setAttribute("REBUILD_STATUS", "SUCCESS");
} else {
- msg = EELFResourceManager.format(Msg.REBUILD_SERVER_FAILED,
- server.getName(), server.getId(), "Accessing Image Service Failed");
+ msg = EELFResourceManager.format(Msg.REBUILD_SERVER_FAILED, server.getName(), server.getId(),
+ "Accessing Image Service Failed");
logger.error(msg);
metricsLogger.error(msg);
doFailure(rc, HttpStatus.FORBIDDEN_403, msg);
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/RestartServer.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/RestartServer.java
index 33c4c6b20..5adb7f313 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/RestartServer.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/RestartServer.java
@@ -45,13 +45,11 @@ import org.openecomp.appc.exceptions.UnknownProviderException;
import org.openecomp.appc.i18n.Msg;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.slf4j.MDC;
-
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import java.util.TimeZone;
-
import static org.openecomp.appc.adapter.iaas.provider.operation.common.enums.Operation.RESTART_SERVICE;
import static org.openecomp.appc.adapter.utils.Constants.ADAPTER_NAME;
@@ -65,8 +63,7 @@ public class RestartServer extends ProviderServerOperation {
* This method handles the case of restarting a server once we have found the server and have obtained the abstract
* representation of the server via the context (i.e., the "Server" object from the CDP-Zones abstraction).
*
- * @param rc The request context that manages the state and recovery of the request for the life of
- * its processing.
+ * @param rc The request context that manages the state and recovery of the request for the life of its processing.
* @param server The server object representing the server we want to operate on
* @throws ZoneException when error occurs.
* @throws RequestFailedException when server status is error.
@@ -75,11 +72,9 @@ public class RestartServer extends ProviderServerOperation {
private void restartServer(RequestContext rc, Server server, SvcLogicContext ctx)
throws ZoneException, RequestFailedException {
/*
- * Pending is a bit of a special case. If we find the server is in a
- * pending state, then the provider is in the process of changing state
- * of the server. So, lets try to wait a little bit and see if the state
- * settles down to one we can deal with. If not, then we have to fail
- * the request.
+ * Pending is a bit of a special case. If we find the server is in a pending state, then the provider is in the
+ * process of changing state of the server. So, lets try to wait a little bit and see if the state settles down
+ * to one we can deal with. If not, then we have to fail the request.
*/
String msg;
if (server.getStatus().equals(Server.Status.PENDING)) {
@@ -89,8 +84,8 @@ public class RestartServer extends ProviderServerOperation {
setTimeForMetricsLogger("restart server");
- String skipHypervisorCheck = null;
- if (ctx != null) {
+ String skipHypervisorCheck = configuration.getProperty("org.openecomp.appc.iaas.skiphypervisorchek");
+ if (skipHypervisorCheck == null && ctx != null) {
skipHypervisorCheck = ctx.getAttribute(ProviderAdapter.SKIP_HYPERVISOR_CHECK);
}
@@ -168,16 +163,20 @@ public class RestartServer extends ProviderServerOperation {
* This method is used to restart an existing virtual machine given the fully qualified URL of the machine.
* <p>
* The fully qualified URL contains enough information to locate the appropriate server. The URL is of the form
+ *
* <pre>
* [scheme]://[host[:port]] / [path] / [tenant_id] / servers / [vm_id]
- * </pre> Where the various parts of the URL can be parsed and extracted and used to locate the appropriate service
- * in the provider service catalog. This then allows us to open a context using the CDP abstraction, obtain the
- * server by its UUID, and then perform the restart.
+ * </pre>
+ *
+ * Where the various parts of the URL can be parsed and extracted and used to locate the appropriate service in the
+ * provider service catalog. This then allows us to open a context using the CDP abstraction, obtain the server by
+ * its UUID, and then perform the restart.
* </p>
*
* @throws UnknownProviderException If the provider cannot be found
* @throws IllegalArgumentException if the expected argument(s) are not defined or are invalid
- * @see org.openecomp.appc.adapter.iaas.ProviderAdapter#restartServer(java.util.Map, org.openecomp.sdnc.sli.SvcLogicContext)
+ * @see org.openecomp.appc.adapter.iaas.ProviderAdapter#restartServer(java.util.Map,
+ * org.openecomp.sdnc.sli.SvcLogicContext)
*/
@SuppressWarnings("nls")
private Server restartServer(Map<String, String> params, SvcLogicContext ctx)
@@ -201,7 +200,8 @@ public class RestartServer extends ProviderServerOperation {
String vm_url = params.get(ProviderAdapter.PROPERTY_INSTANCE_URL);
VMURL vm = VMURL.parseURL(vm_url);
- if (validateVM(rc, appName, vm_url, vm)) return null;
+ if (validateVM(rc, appName, vm_url, vm))
+ return null;
IdentityURL ident = IdentityURL.parseURL(params.get(ProviderAdapter.PROPERTY_IDENTITY_URL));
String identStr = (ident == null) ? null : ident.toString();
@@ -218,8 +218,7 @@ public class RestartServer extends ProviderServerOperation {
context.close();
doSuccess(rc);
ctx.setAttribute("RESTART_STATUS", "SUCCESS");
- String msg = EELFResourceManager.format(Msg.SUCCESS_EVENT_MESSAGE,
- "RestartServer", vm_url);
+ String msg = EELFResourceManager.format(Msg.SUCCESS_EVENT_MESSAGE, "RestartServer", vm_url);
ctx.setAttribute(org.openecomp.appc.Constants.ATTRIBUTE_SUCCESS_MESSAGE, msg);
}
} catch (RequestFailedException e) {
@@ -230,8 +229,9 @@ public class RestartServer extends ProviderServerOperation {
metricsLogger.error(msg);
doFailure(rc, HttpStatus.NOT_FOUND_404, msg);
} catch (Exception e1) {
- String msg = EELFResourceManager.format(Msg.SERVER_OPERATION_EXCEPTION, e1, e1.getClass().getSimpleName(),
- RESTART_SERVICE.toString(), vm_url, context == null ? "Unknown" : context.getTenantName());
+ String msg = EELFResourceManager.format(Msg.SERVER_OPERATION_EXCEPTION, e1,
+ e1.getClass().getSimpleName(), RESTART_SERVICE.toString(), vm_url,
+ context == null ? "Unknown" : context.getTenantName());
logger.error(msg, e1);
metricsLogger.error(msg, e1);
doFailure(rc, HttpStatus.INTERNAL_SERVER_ERROR_500, msg);
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/RestoreStack.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/RestoreStack.java
index 83dfb92d1..397f63a56 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/RestoreStack.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/RestoreStack.java
@@ -50,9 +50,7 @@ import org.openecomp.appc.adapter.openstack.heat.StackResource;
import org.openecomp.appc.exceptions.APPCException;
import org.openecomp.appc.i18n.Msg;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
-
import java.util.Map;
-
import static org.openecomp.appc.adapter.utils.Constants.ADAPTER_NAME;
public class RestoreStack extends ProviderStackOperation {
@@ -62,10 +60,10 @@ public class RestoreStack extends ProviderStackOperation {
private void restoreStack(Stack stack, String snapshotId) throws ZoneException, RequestFailedException {
Context context = stack.getContext();
- OpenStackContext osContext = (OpenStackContext)context;
+ OpenStackContext osContext = (OpenStackContext) context;
final HeatConnector heatConnector = osContext.getHeatConnector();
- ((OpenStackContext)context).refreshIfStale(heatConnector);
+ ((OpenStackContext) context).refreshIfStale(heatConnector);
trackRequest(context);
RequestState.put("SERVICE", "Orchestration");
@@ -105,10 +103,8 @@ public class RestoreStack extends ProviderStackOperation {
try {
- validateParametersExist(params,
- ProviderAdapter.PROPERTY_INSTANCE_URL,
- ProviderAdapter.PROPERTY_PROVIDER_NAME,
- ProviderAdapter.PROPERTY_STACK_ID,
+ validateParametersExist(params, ProviderAdapter.PROPERTY_INSTANCE_URL,
+ ProviderAdapter.PROPERTY_PROVIDER_NAME, ProviderAdapter.PROPERTY_STACK_ID,
ProviderAdapter.PROPERTY_INPUT_SNAPSHOT_ID);
String stackId = params.get(ProviderAdapter.PROPERTY_STACK_ID);
@@ -118,13 +114,13 @@ public class RestoreStack extends ProviderStackOperation {
context = resolveContext(rc, params, appName, vm_url);
if (context != null) {
- stack = lookupStack(rc, context, stackId);
- logger.debug(Msg.STACK_FOUND, vm_url, context.getTenantName(), stack.getStatus().toString());
- logger.info(EELFResourceManager.format(Msg.TERMINATING_STACK, stack.getName()));
- restoreStack(stack, snapshotId);
- logger.info(EELFResourceManager.format(Msg.TERMINATE_STACK, stack.getName()));
- context.close();
- doSuccess(rc);
+ stack = lookupStack(rc, context, stackId);
+ logger.debug(Msg.STACK_FOUND, vm_url, context.getTenantName(), stack.getStatus().toString());
+ logger.info(EELFResourceManager.format(Msg.TERMINATING_STACK, stack.getName()));
+ restoreStack(stack, snapshotId);
+ logger.info(EELFResourceManager.format(Msg.TERMINATE_STACK, stack.getName()));
+ context.close();
+ doSuccess(rc);
} else {
ctx.setAttribute(Constants.DG_ATTRIBUTE_STATUS, "failure");
}
@@ -134,12 +130,10 @@ public class RestoreStack extends ProviderStackOperation {
logger.error(msg);
doFailure(rc, HttpStatus.NOT_FOUND_404, msg, e);
} catch (RequestFailedException e) {
- logger.error(EELFResourceManager.format(Msg.MISSING_PARAMETER_IN_REQUEST,
- e.getReason(), "restoreStack"));
+ logger.error(EELFResourceManager.format(Msg.MISSING_PARAMETER_IN_REQUEST, e.getReason(), "restoreStack"));
doFailure(rc, e.getStatus(), e.getMessage(), e);
} catch (Exception e1) {
- String msg = EELFResourceManager.format(Msg.STACK_OPERATION_EXCEPTION,
- e1, e1.getClass().getSimpleName(),
+ String msg = EELFResourceManager.format(Msg.STACK_OPERATION_EXCEPTION, e1, e1.getClass().getSimpleName(),
"restoreStack", vm_url, null == context ? "n/a" : context.getTenantName());
logger.error(msg, e1);
doFailure(rc, HttpStatus.INTERNAL_SERVER_ERROR_500, msg, e1);
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/SnapshotStack.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/SnapshotStack.java
index c53b9c194..97ac5c80a 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/SnapshotStack.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/SnapshotStack.java
@@ -53,13 +53,11 @@ import org.openecomp.appc.exceptions.APPCException;
import org.openecomp.appc.i18n.Msg;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.slf4j.MDC;
-
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import java.util.TimeZone;
-
import static org.openecomp.appc.adapter.utils.Constants.ADAPTER_NAME;
public class SnapshotStack extends ProviderStackOperation {
@@ -73,10 +71,10 @@ public class SnapshotStack extends ProviderStackOperation {
Snapshot snapshot = new Snapshot();
Context context = stack.getContext();
- OpenStackContext osContext = (OpenStackContext)context;
+ OpenStackContext osContext = (OpenStackContext) context;
final HeatConnector heatConnector = osContext.getHeatConnector();
- ((OpenStackContext)context).refreshIfStale(heatConnector);
+ ((OpenStackContext) context).refreshIfStale(heatConnector);
trackRequest(context);
RequestState.put("SERVICE", "Orchestration");
@@ -133,8 +131,8 @@ public class SnapshotStack extends ProviderStackOperation {
Snapshot snapshot = snapshotStack(rc, stack);
- ctx.setAttribute(ProviderAdapter.DG_OUTPUT_PARAM_NAMESPACE +
- ProviderAdapter.PROPERTY_SNAPSHOT_ID, snapshot.getId());
+ ctx.setAttribute(ProviderAdapter.DG_OUTPUT_PARAM_NAMESPACE + ProviderAdapter.PROPERTY_SNAPSHOT_ID,
+ snapshot.getId());
logger.info(EELFResourceManager.format(Msg.STACK_SNAPSHOTED, stack.getName(), snapshot.getId()));
metricsLogger.info(EELFResourceManager.format(Msg.STACK_SNAPSHOTED, stack.getName(), snapshot.getId()));
@@ -150,14 +148,12 @@ public class SnapshotStack extends ProviderStackOperation {
metricsLogger.error(msg);
doFailure(rc, HttpStatus.NOT_FOUND_404, msg, e);
} catch (RequestFailedException e) {
- logger.error(EELFResourceManager.format(Msg.MISSING_PARAMETER_IN_REQUEST,
- e.getReason(), "snapshotStack"));
- metricsLogger.error(EELFResourceManager.format(Msg.MISSING_PARAMETER_IN_REQUEST,
- e.getReason(), "snapshotStack"));
+ logger.error(EELFResourceManager.format(Msg.MISSING_PARAMETER_IN_REQUEST, e.getReason(), "snapshotStack"));
+ metricsLogger.error(
+ EELFResourceManager.format(Msg.MISSING_PARAMETER_IN_REQUEST, e.getReason(), "snapshotStack"));
doFailure(rc, e.getStatus(), e.getMessage(), e);
} catch (Exception e1) {
- String msg = EELFResourceManager.format(Msg.STACK_OPERATION_EXCEPTION,
- e1, e1.getClass().getSimpleName(),
+ String msg = EELFResourceManager.format(Msg.STACK_OPERATION_EXCEPTION, e1, e1.getClass().getSimpleName(),
"snapshotStack", vm_url, null == context ? "n/a" : context.getTenantName());
logger.error(msg, e1);
metricsLogger.error(msg);
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/StartServer.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/StartServer.java
index b5379b8ad..09781a254 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/StartServer.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/StartServer.java
@@ -43,9 +43,7 @@ import com.att.eelf.configuration.EELFManager;
import com.att.eelf.i18n.EELFResourceManager;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.glassfish.grizzly.http.util.HttpStatus;
-
import java.util.Map;
-
import static org.openecomp.appc.adapter.iaas.provider.operation.common.enums.Operation.START_SERVICE;
import static org.openecomp.appc.adapter.utils.Constants.ADAPTER_NAME;
@@ -54,7 +52,8 @@ public class StartServer extends ProviderServerOperation {
private static final EELFLogger logger = EELFManager.getInstance().getLogger(StartServer.class);
/**
- * @see org.openecomp.appc.adapter.iaas.ProviderAdapter#startServer(java.util.Map, org.openecomp.sdnc.sli.SvcLogicContext)
+ * @see org.openecomp.appc.adapter.iaas.ProviderAdapter#startServer(java.util.Map,
+ * org.openecomp.sdnc.sli.SvcLogicContext)
*/
@SuppressWarnings("nls")
public Server startServer(Map<String, String> params, SvcLogicContext ctx) throws APPCException {
@@ -71,7 +70,8 @@ public class StartServer extends ProviderServerOperation {
String vm_url = params.get(ProviderAdapter.PROPERTY_INSTANCE_URL);
VMURL vm = VMURL.parseURL(vm_url);
- if (validateVM(rc, appName, vm_url, vm)) return null;
+ if (validateVM(rc, appName, vm_url, vm))
+ return null;
IdentityURL ident = IdentityURL.parseURL(params.get(ProviderAdapter.PROPERTY_IDENTITY_URL));
String identStr = (ident == null) ? null : ident.toString();
@@ -91,11 +91,9 @@ public class StartServer extends ProviderServerOperation {
*/
/*
- * Pending is a bit of a special case. If we find the server is in a
- * pending state, then the provider is in the process of changing state
- * of the server. So, lets try to wait a little bit and see if the state
- * settles down to one we can deal with. If not, then we have to fail
- * the request.
+ * Pending is a bit of a special case. If we find the server is in a pending state, then the
+ * provider is in the process of changing state of the server. So, lets try to wait a little bit and
+ * see if the state settles down to one we can deal with. If not, then we have to fail the request.
*/
if (server.getStatus().equals(Server.Status.PENDING)) {
@@ -106,11 +104,11 @@ public class StartServer extends ProviderServerOperation {
switch (server.getStatus()) {
case DELETED:
// Nothing to do, the server is gone
- msg = EELFResourceManager.format(Msg.SERVER_DELETED,
- server.getName(), server.getId(), server.getTenantId(), "started");
+ msg = EELFResourceManager.format(Msg.SERVER_DELETED, server.getName(), server.getId(),
+ server.getTenantId(), "started");
logger.error(msg);
- throw new RequestFailedException(
- "Start Server", msg, HttpStatus.METHOD_NOT_ALLOWED_405, server);
+ throw new RequestFailedException("Start Server", msg, HttpStatus.METHOD_NOT_ALLOWED_405,
+ server);
case RUNNING:
// Nothing to do, the server is already running
@@ -119,11 +117,11 @@ public class StartServer extends ProviderServerOperation {
case ERROR:
// Server is in error state
- msg = EELFResourceManager.format(Msg.SERVER_ERROR_STATE,
- server.getName(), server.getId(), server.getTenantId(), "start");
+ msg = EELFResourceManager.format(Msg.SERVER_ERROR_STATE, server.getName(), server.getId(),
+ server.getTenantId(), "start");
logger.error(msg);
- throw new RequestFailedException(
- "Start Server", msg, HttpStatus.METHOD_NOT_ALLOWED_405, server);
+ throw new RequestFailedException("Start Server", msg, HttpStatus.METHOD_NOT_ALLOWED_405,
+ server);
case READY:
// Server is stopped attempt to start the server
@@ -149,15 +147,13 @@ public class StartServer extends ProviderServerOperation {
server.getTenantId(), server.getStatus().name());
generateEvent(rc, false, msg);
logger.error(msg);
- throw new RequestFailedException(
- "Start Server", msg, HttpStatus.METHOD_NOT_ALLOWED_405, server);
+ throw new RequestFailedException("Start Server", msg, HttpStatus.METHOD_NOT_ALLOWED_405,
+ server);
}
context.close();
doSuccess(rc);
ctx.setAttribute("START_STATUS", "SUCCESS");
- }
- else
- {
+ } else {
ctx.setAttribute("START_STATUS", "CONTEXT_NOT_FOUND");
}
} catch (ResourceNotFoundException e) {
@@ -165,8 +161,9 @@ public class StartServer extends ProviderServerOperation {
logger.error(msg);
doFailure(rc, HttpStatus.NOT_FOUND_404, msg);
} catch (Exception e1) {
- String msg = EELFResourceManager.format(Msg.SERVER_OPERATION_EXCEPTION, e1, e1.getClass().getSimpleName(),
- START_SERVICE.toString(), vm_url, context == null ? "Unknown" : context.getTenantName());
+ String msg = EELFResourceManager.format(Msg.SERVER_OPERATION_EXCEPTION, e1,
+ e1.getClass().getSimpleName(), START_SERVICE.toString(), vm_url,
+ context == null ? "Unknown" : context.getTenantName());
logger.error(msg, e1);
doFailure(rc, HttpStatus.INTERNAL_SERVER_ERROR_500, msg);
}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/StopServer.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/StopServer.java
index ae6109995..0587061c7 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/StopServer.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/StopServer.java
@@ -43,9 +43,7 @@ import com.att.eelf.configuration.EELFManager;
import com.att.eelf.i18n.EELFResourceManager;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.glassfish.grizzly.http.util.HttpStatus;
-
import java.util.Map;
-
import static org.openecomp.appc.adapter.iaas.provider.operation.common.enums.Operation.STOP_SERVICE;
import static org.openecomp.appc.adapter.utils.Constants.ADAPTER_NAME;
@@ -55,7 +53,8 @@ public class StopServer extends ProviderServerOperation {
private static EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger();
/**
- * @see org.openecomp.appc.adapter.iaas.ProviderAdapter#stopServer(java.util.Map, org.openecomp.sdnc.sli.SvcLogicContext)
+ * @see org.openecomp.appc.adapter.iaas.ProviderAdapter#stopServer(java.util.Map,
+ * org.openecomp.sdnc.sli.SvcLogicContext)
*/
@SuppressWarnings("nls")
public Server stopServer(Map<String, String> params, SvcLogicContext ctx) throws APPCException {
@@ -73,7 +72,8 @@ public class StopServer extends ProviderServerOperation {
ctx.setAttribute("STOP_STATUS", "SUCCESS");
VMURL vm = VMURL.parseURL(vm_url);
- if (validateVM(rc, appName, vm_url, vm)) return null;
+ if (validateVM(rc, appName, vm_url, vm))
+ return null;
IdentityURL ident = IdentityURL.parseURL(params.get(ProviderAdapter.PROPERTY_IDENTITY_URL));
String identStr = (ident == null) ? null : ident.toString();
@@ -86,18 +86,16 @@ public class StopServer extends ProviderServerOperation {
rc.reset();
server = lookupServer(rc, context, vm.getServerId());
logger.debug(Msg.SERVER_FOUND, vm_url, context.getTenantName(), server.getStatus().toString());
-
+
String msg;
/*
* We determine what to do based on the current state of the server
*/
/*
- * Pending is a bit of a special case. If we find the server is in a
- * pending state, then the provider is in the process of changing state
- * of the server. So, lets try to wait a little bit and see if the state
- * settles down to one we can deal with. If not, then we have to fail
- * the request.
+ * Pending is a bit of a special case. If we find the server is in a pending state, then the
+ * provider is in the process of changing state of the server. So, lets try to wait a little bit and
+ * see if the state settles down to one we can deal with. If not, then we have to fail the request.
*/
if (server.getStatus().equals(Server.Status.PENDING)) {
@@ -108,13 +106,13 @@ public class StopServer extends ProviderServerOperation {
switch (server.getStatus()) {
case DELETED:
// Nothing to do, the server is gone
- msg = EELFResourceManager.format(Msg.SERVER_DELETED,
- server.getName(), server.getId(), server.getTenantId(), "stopped");
+ msg = EELFResourceManager.format(Msg.SERVER_DELETED, server.getName(), server.getId(),
+ server.getTenantId(), "stopped");
generateEvent(rc, false, msg);
logger.error(msg);
metricsLogger.error(msg);
- throw new RequestFailedException(
- "Stop Server", msg, HttpStatus.METHOD_NOT_ALLOWED_405, server);
+ throw new RequestFailedException("Stop Server", msg, HttpStatus.METHOD_NOT_ALLOWED_405,
+ server);
case RUNNING:
// Attempt to stop the server
@@ -125,13 +123,13 @@ public class StopServer extends ProviderServerOperation {
case ERROR:
// Server is in error state
- msg = EELFResourceManager.format(Msg.SERVER_ERROR_STATE,
- server.getName(), server.getId(), server.getTenantId(), "stop");
+ msg = EELFResourceManager.format(Msg.SERVER_ERROR_STATE, server.getName(), server.getId(),
+ server.getTenantId(), "stop");
generateEvent(rc, false, msg);
logger.error(msg);
metricsLogger.error(msg);
- throw new RequestFailedException(
- "Stop Server", msg, HttpStatus.METHOD_NOT_ALLOWED_405, server);
+ throw new RequestFailedException("Stop Server", msg, HttpStatus.METHOD_NOT_ALLOWED_405,
+ server);
case READY:
// Nothing to do, the server was already stopped
@@ -158,13 +156,13 @@ public class StopServer extends ProviderServerOperation {
default:
// Hmmm, unknown status, should never occur
- msg = EELFResourceManager.format(Msg.UNKNOWN_SERVER_STATE,
- server.getName(), server.getId(), server.getTenantId(), server.getStatus().name());
+ msg = EELFResourceManager.format(Msg.UNKNOWN_SERVER_STATE, server.getName(), server.getId(),
+ server.getTenantId(), server.getStatus().name());
generateEvent(rc, false, msg);
logger.error(msg);
metricsLogger.error(msg);
- throw new RequestFailedException(
- "Stop Server", msg, HttpStatus.METHOD_NOT_ALLOWED_405, server);
+ throw new RequestFailedException("Stop Server", msg, HttpStatus.METHOD_NOT_ALLOWED_405,
+ server);
}
context.close();
doSuccess(rc);
@@ -172,7 +170,7 @@ public class StopServer extends ProviderServerOperation {
msg = EELFResourceManager.format(Msg.SUCCESS_EVENT_MESSAGE, "StopServer", vm_url);
ctx.setAttribute(org.openecomp.appc.Constants.ATTRIBUTE_SUCCESS_MESSAGE, msg);
- }else{
+ } else {
ctx.setAttribute("STOP_STATUS", "CONTEXT_NOT_FOUND");
}
} catch (ResourceNotFoundException e) {
@@ -180,14 +178,14 @@ public class StopServer extends ProviderServerOperation {
logger.error(msg);
doFailure(rc, HttpStatus.NOT_FOUND_404, msg);
} catch (Exception e1) {
- String msg = EELFResourceManager.format(Msg.SERVER_OPERATION_EXCEPTION, e1, e1.getClass().getSimpleName(),
- STOP_SERVICE.toString(), vm_url, context == null ? "Unknown" : context.getTenantName());
+ String msg =
+ EELFResourceManager.format(Msg.SERVER_OPERATION_EXCEPTION, e1, e1.getClass().getSimpleName(),
+ STOP_SERVICE.toString(), vm_url, context == null ? "Unknown" : context.getTenantName());
logger.error(msg, e1);
doFailure(rc, HttpStatus.INTERNAL_SERVER_ERROR_500, msg);
}
} catch (RequestFailedException e) {
- logger.error(EELFResourceManager.format(Msg.STOP_SERVER_FAILED,
- appName, "n/a", "n/a", e.getMessage()));
+ logger.error(EELFResourceManager.format(Msg.STOP_SERVER_FAILED, appName, "n/a", "n/a", e.getMessage()));
doFailure(rc, e.getStatus(), e.getMessage());
}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/TerminateServer.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/TerminateServer.java
index b3d34bc45..51000601a 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/TerminateServer.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/TerminateServer.java
@@ -47,9 +47,7 @@ import org.openecomp.appc.adapter.iaas.provider.operation.impl.base.ProviderServ
import org.openecomp.appc.exceptions.UnknownProviderException;
import org.openecomp.appc.i18n.Msg;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
-
import java.util.Map;
-
import static org.openecomp.appc.adapter.iaas.provider.operation.common.enums.Operation.RESTART_SERVICE;
import static org.openecomp.appc.adapter.iaas.provider.operation.common.enums.Operation.TERMINATE_SERVICE;
import static org.openecomp.appc.adapter.utils.Constants.ADAPTER_NAME;
@@ -61,10 +59,8 @@ public class TerminateServer extends ProviderServerOperation {
/**
* Start the server and wait for it to enter a running state
*
- * @param rc
- * The request context that manages the state and recovery of the request for the life of its processing.
- * @param server
- * The server to be started
+ * @param rc The request context that manages the state and recovery of the request for the life of its processing.
+ * @param server The server to be started
* @throws ZoneException when error occurs
* @throws RequestFailedException when request failed
*/
@@ -100,10 +96,8 @@ public class TerminateServer extends ProviderServerOperation {
* This method handles the case of restarting a server once we have found the server and have obtained the abstract
* representation of the server via the context (i.e., the "Server" object from the CDP-Zones abstraction).
*
- * @param rc
- * The request context that manages the state and recovery of the request for the life of its processing.
- * @param server
- * The server object representing the server we want to operate on
+ * @param rc The request context that manages the state and recovery of the request for the life of its processing.
+ * @param server The server object representing the server we want to operate on
* @throws ZoneException when error occurs
*/
@SuppressWarnings("nls")
@@ -167,18 +161,20 @@ public class TerminateServer extends ProviderServerOperation {
* This method is used to delete an existing virtual machine given the fully qualified URL of the machine.
* <p>
* The fully qualified URL contains enough information to locate the appropriate server. The URL is of the form
+ *
* <pre>
* [scheme]://[host[:port]] / [path] / [tenant_id] / servers / [vm_id]
- * </pre> Where the various parts of the URL can be parsed and extracted and used to locate the appropriate service
- * in the provider service catalog. This then allows us to open a context using the CDP abstraction, obtain the
- * server by its UUID, and then perform the restart.
+ * </pre>
+ *
+ * Where the various parts of the URL can be parsed and extracted and used to locate the appropriate service in the
+ * provider service catalog. This then allows us to open a context using the CDP abstraction, obtain the server by
+ * its UUID, and then perform the restart.
* </p>
*
- * @throws UnknownProviderException
- * If the provider cannot be found
- * @throws IllegalArgumentException
- * if the expected argument(s) are not defined or are invalid
- * @see org.openecomp.appc.adapter.iaas.ProviderAdapter#terminateServer(java.util.Map, org.openecomp.sdnc.sli.SvcLogicContext)
+ * @throws UnknownProviderException If the provider cannot be found
+ * @throws IllegalArgumentException if the expected argument(s) are not defined or are invalid
+ * @see org.openecomp.appc.adapter.iaas.ProviderAdapter#terminateServer(java.util.Map,
+ * org.openecomp.sdnc.sli.SvcLogicContext)
*/
@SuppressWarnings("nls")
public Server terminateServer(Map<String, String> params, SvcLogicContext ctx)
@@ -197,7 +193,8 @@ public class TerminateServer extends ProviderServerOperation {
ctx.setAttribute("TERMINATE_STATUS", "SUCCESS");
VMURL vm = VMURL.parseURL(vm_url);
- if (validateVM(rc, appName, vm_url, vm)) return null;
+ if (validateVM(rc, appName, vm_url, vm))
+ return null;
IdentityURL ident = IdentityURL.parseURL(params.get(ProviderAdapter.PROPERTY_IDENTITY_URL));
String identStr = (ident == null) ? null : ident.toString();
@@ -222,15 +219,15 @@ public class TerminateServer extends ProviderServerOperation {
doFailure(rc, HttpStatus.NOT_FOUND_404, msg);
ctx.setAttribute("TERMINATE_STATUS", "SERVER_NOT_FOUND");
} catch (Exception e1) {
- String msg = EELFResourceManager.format(Msg.SERVER_OPERATION_EXCEPTION,
- e1, e1.getClass().getSimpleName(), RESTART_SERVICE.toString(),
- vm_url, context == null ? "Unknown" : context.getTenantName());
+ String msg = EELFResourceManager.format(Msg.SERVER_OPERATION_EXCEPTION, e1,
+ e1.getClass().getSimpleName(), RESTART_SERVICE.toString(), vm_url,
+ context == null ? "Unknown" : context.getTenantName());
logger.error(msg, e1);
doFailure(rc, HttpStatus.INTERNAL_SERVER_ERROR_500, msg);
}
} catch (RequestFailedException e) {
- logger.error(EELFResourceManager.format(Msg.TERMINATE_SERVER_FAILED,
- appName, "n/a", "n/a", e.getMessage()));
+ logger.error(
+ EELFResourceManager.format(Msg.TERMINATE_SERVER_FAILED, appName, "n/a", "n/a", e.getMessage()));
doFailure(rc, e.getStatus(), e.getMessage());
ctx.setAttribute("TERMINATE_STATUS", "ERROR");
}
@@ -243,6 +240,6 @@ public class TerminateServer extends ProviderServerOperation {
throws UnknownProviderException {
setMDC(TERMINATE_SERVICE.toString(), "App-C IaaS Adapter:Terminate", ADAPTER_NAME);
logOperation(Msg.TERMINATING_SERVER, params, context);
- return terminateServer(params,context);
+ return terminateServer(params, context);
}
}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/TerminateStack.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/TerminateStack.java
index a8987bbe1..a9ee122db 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/TerminateStack.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/TerminateStack.java
@@ -43,9 +43,7 @@ import com.att.eelf.configuration.EELFManager;
import com.att.eelf.i18n.EELFResourceManager;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.glassfish.grizzly.http.util.HttpStatus;
-
import java.util.Map;
-
import static org.openecomp.appc.adapter.utils.Constants.ADAPTER_NAME;
public class TerminateStack extends ProviderStackOperation {
@@ -99,8 +97,7 @@ public class TerminateStack extends ProviderStackOperation {
logger.info(EELFResourceManager.format(Msg.TERMINATE_STACK, stack.getName()));
context.close();
doSuccess(rc);
- String msg = EELFResourceManager.format(Msg.SUCCESS_EVENT_MESSAGE,
- "TerminateStack", vm_url);
+ String msg = EELFResourceManager.format(Msg.SUCCESS_EVENT_MESSAGE, "TerminateStack", vm_url);
ctx.setAttribute(org.openecomp.appc.Constants.ATTRIBUTE_SUCCESS_MESSAGE, msg);
}
} catch (ResourceNotFoundException e) {
@@ -108,8 +105,9 @@ public class TerminateStack extends ProviderStackOperation {
logger.error(msg);
doFailure(rc, HttpStatus.NOT_FOUND_404, msg);
} catch (Exception e1) {
- String msg = EELFResourceManager.format(Msg.STACK_OPERATION_EXCEPTION, e1, e1.getClass().getSimpleName(),
- Operation.TERMINATE_STACK.toString(), vm_url, context.getTenantName());
+ String msg =
+ EELFResourceManager.format(Msg.STACK_OPERATION_EXCEPTION, e1, e1.getClass().getSimpleName(),
+ Operation.TERMINATE_STACK.toString(), vm_url, context.getTenantName());
logger.error(msg, e1);
doFailure(rc, HttpStatus.INTERNAL_SERVER_ERROR_500, msg);
}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/VmStatuschecker.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/VmStatuschecker.java
index 68fa454fd..8175a14f5 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/VmStatuschecker.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/VmStatuschecker.java
@@ -46,9 +46,7 @@ import org.openecomp.appc.configuration.ConfigurationFactory;
import org.openecomp.appc.exceptions.UnknownProviderException;
import org.openecomp.appc.i18n.Msg;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
-
import java.util.Map;
-
import static org.openecomp.appc.adapter.iaas.provider.operation.common.enums.Operation.RESTART_SERVICE;
import static org.openecomp.appc.adapter.utils.Constants.ADAPTER_NAME;
@@ -75,7 +73,8 @@ public class VmStatuschecker extends ProviderServerOperation {
String vm_url = params.get(ProviderAdapter.PROPERTY_INSTANCE_URL);
VMURL vm = VMURL.parseURL(vm_url);
- if (validateVM(rc, appName, vm_url, vm)) return null;
+ if (validateVM(rc, appName, vm_url, vm))
+ return null;
IdentityURL ident = IdentityURL.parseURL(params.get(ProviderAdapter.PROPERTY_IDENTITY_URL));
String identStr = (ident == null) ? null : ident.toString();
@@ -137,9 +136,9 @@ public class VmStatuschecker extends ProviderServerOperation {
logger.error(msg);
doFailure(rc, HttpStatus.NOT_FOUND_404, msg);
} catch (Exception e1) {
- String msg = EELFResourceManager.format(Msg.SERVER_OPERATION_EXCEPTION,
- e1, e1.getClass().getSimpleName(), RESTART_SERVICE.toString(),
- vm_url, context == null ? "Unknown" : context.getTenantName());
+ String msg = EELFResourceManager.format(Msg.SERVER_OPERATION_EXCEPTION, e1,
+ e1.getClass().getSimpleName(), RESTART_SERVICE.toString(), vm_url,
+ context == null ? "Unknown" : context.getTenantName());
logger.error(msg, e1);
doFailure(rc, HttpStatus.INTERNAL_SERVER_ERROR_500, msg);
}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/base/ProviderOperation.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/base/ProviderOperation.java
index 8ae075365..02226bbc9 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/base/ProviderOperation.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/base/ProviderOperation.java
@@ -44,19 +44,14 @@ import com.att.eelf.i18n.EELFResourceManager;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.glassfish.grizzly.http.util.HttpStatus;
import org.slf4j.MDC;
-
import java.net.URI;
import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
-
import static org.openecomp.appc.adapter.iaas.provider.operation.common.constants.Constants.MDC_ADAPTER;
import static org.openecomp.appc.adapter.iaas.provider.operation.common.constants.Constants.MDC_SERVICE;
import static com.att.eelf.configuration.Configuration.MDC_SERVICE_NAME;
-/**
- * @since September 26, 2016
- */
public abstract class ProviderOperation implements IProviderOperation {
private static final EELFLogger logger = EELFManager.getInstance().getLogger(ProviderOperation.class);
@@ -80,20 +75,27 @@ public abstract class ProviderOperation implements IProviderOperation {
DEFAULT_PASS = defaultPass;
}
+ @Override
+ public void setDefaultDomain(String defaultDomain) {
+ DEFAULT_DOMAIN = defaultDomain;
+ }
+
/**
* The username and password to use for dynamically created connections
*/
private static String DEFAULT_USER;
private static String DEFAULT_PASS;
+ private static String DEFAULT_DOMAIN;
/**
* set MDC props
+ *
* @param service
* @param serviceName
* @param adapterName
*/
- protected void setMDC(String service, String serviceName, String adapterName){
+ protected void setMDC(String service, String serviceName, String adapterName) {
MDC.put(MDC_ADAPTER, adapterName);
MDC.put(MDC_SERVICE, service);
MDC.put(MDC_SERVICE_NAME, serviceName);
@@ -101,11 +103,12 @@ public abstract class ProviderOperation implements IProviderOperation {
/**
* initial log of the operation
+ *
* @param msg
* @param params
* @param context
*/
- protected void logOperation(Msg msg, Map<String, String> params, SvcLogicContext context){
+ protected void logOperation(Msg msg, Map<String, String> params, SvcLogicContext context) {
String appName = configuration.getProperty(org.openecomp.appc.Constants.PROPERTY_APPLICATION_NAME);
logger.info(msg, appName);
@@ -117,8 +120,7 @@ public abstract class ProviderOperation implements IProviderOperation {
/**
* This method is used to dump the value of the parameters to the log for debugging purposes.
*
- * @param parameters
- * The parameters to be printed to the log
+ * @param parameters The parameters to be printed to the log
*/
private void debugParameters(Map<String, String> parameters) {
for (String key : parameters.keySet()) {
@@ -129,12 +131,9 @@ public abstract class ProviderOperation implements IProviderOperation {
/**
* This method is used to create a diagnostic dump of the context for the log
*
- * @param context
- * The context to be dumped
+ * @param context The context to be dumped
*/
- @SuppressWarnings({
- "nls", "static-method"
- })
+ @SuppressWarnings({"nls", "static-method"})
private void debugContext(SvcLogicContext context) {
Set<String> keys = context.getAttributeKeySet();
StringBuilder builder = new StringBuilder();
@@ -171,17 +170,15 @@ public abstract class ProviderOperation implements IProviderOperation {
* This method is used to validate that the parameters contain all required property names, and that the values are
* non-null and non-empty strings. We are still not ensured that the value is valid, but at least it exists.
*
- * @param parameters
- * The parameters to be checked
- * @param propertyNames
- * The list of property names that are required to be present.
- * @throws RequestFailedException
- * If the parameters are not valid
+ * @param parameters The parameters to be checked
+ * @param propertyNames The list of property names that are required to be present.
+ * @throws RequestFailedException If the parameters are not valid
*/
protected void validateParametersExist(Map<String, String> parameters, String... propertyNames)
throws RequestFailedException {
boolean success = true;
- StringBuilder msg = new StringBuilder(EELFResourceManager.format(Msg.MISSING_REQUIRED_PROPERTIES, MDC.get(MDC_SERVICE)));
+ StringBuilder msg =
+ new StringBuilder(EELFResourceManager.format(Msg.MISSING_REQUIRED_PROPERTIES, MDC.get(MDC_SERVICE)));
msg.append(Constants.NL);
for (String propertyName : propertyNames) {
String value = parameters.get(propertyName);
@@ -196,20 +193,21 @@ public abstract class ProviderOperation implements IProviderOperation {
if (!success) {
logger.error(msg.toString());
- throw new RequestFailedException("Check Parameters", msg.toString(), HttpStatus.BAD_REQUEST_400, (Server)null);
+ throw new RequestFailedException("Check Parameters", msg.toString(), HttpStatus.BAD_REQUEST_400,
+ (Server) null);
}
}
/**
- * @param rc
- * The request context that manages the state and recovery of the request for the life of its processing.
+ * @param rc The request context that manages the state and recovery of the request for the life of its processing.
* @param code
* @param message
*/
protected void doFailure(RequestContext rc, HttpStatus code, String message) {
try {
doFailure(rc, code, message, null);
- } catch (APPCException ignored) {/* never happens */}
+ } catch (APPCException ignored) {
+ /* never happens */}
}
protected void doFailure(RequestContext rc, HttpStatus code, String message, Throwable cause) throws APPCException {
@@ -228,18 +226,19 @@ public abstract class ProviderOperation implements IProviderOperation {
svcLogic.setAttribute(org.openecomp.appc.Constants.ATTRIBUTE_ERROR_CODE, status);
svcLogic.setAttribute(org.openecomp.appc.Constants.ATTRIBUTE_ERROR_MESSAGE, msg);
- if (null != cause) throw new APPCException(cause);
+ if (null != cause)
+ throw new APPCException(cause);
}
/**
- * @param rc
- * The request context that manages the state and recovery of the request for the life of its processing.
+ * @param rc The request context that manages the state and recovery of the request for the life of its processing.
*/
@SuppressWarnings("static-method")
protected void doSuccess(RequestContext rc) {
SvcLogicContext svcLogic = rc.getSvcLogicContext();
svcLogic.setStatus(Outcome.SUCCESS.toString());
- svcLogic.setAttribute(org.openecomp.appc.Constants.ATTRIBUTE_ERROR_CODE, Integer.toString(HttpStatus.OK_200.getStatusCode()));
+ svcLogic.setAttribute(org.openecomp.appc.Constants.ATTRIBUTE_ERROR_CODE,
+ Integer.toString(HttpStatus.OK_200.getStatusCode()));
}
protected boolean validateVM(RequestContext rc, String appName, String vm_url, VMURL vm)
@@ -265,7 +264,7 @@ public abstract class ProviderOperation implements IProviderOperation {
// This will probably never get hit bc of an earlier check while parsing
// the string to a VMURL
try {
- //noinspection ResultOfMethodCallIgnored
+ // noinspection ResultOfMethodCallIgnored
URI.create(vm.toString());
} catch (Exception e) {
throw new RequestFailedException(
@@ -294,7 +293,7 @@ public abstract class ProviderOperation implements IProviderOperation {
cache.setProviderName(ident.toString());
// cache.setProviderType("OpenStack");
- TenantCache tenant = cache.addTenant(vm.getTenantId(),null, DEFAULT_USER, DEFAULT_PASS);
+ TenantCache tenant = cache.addTenant(vm.getTenantId(), null, DEFAULT_USER, DEFAULT_PASS, DEFAULT_DOMAIN);
// Make sure we could initialize the the cache otherwise return null
if (tenant != null && tenant.isInitialized()) {
@@ -309,12 +308,9 @@ public abstract class ProviderOperation implements IProviderOperation {
* supported provider, regardless of region(s), and to return an opened context that can be used to access that
* server.
*
- * @param rc
- * The request context that wraps and manages the state of the request
- * @param selfLinkURL
- * The fully-qualified self-link URL of the server
- * @param providerName
- * The name of the provider to be searched
+ * @param rc The request context that wraps and manages the state of the request
+ * @param selfLinkURL The fully-qualified self-link URL of the server
+ * @param providerName The name of the provider to be searched
* @return The context that can be used to access the server, or null if not found.
*/
@SuppressWarnings("nls")
@@ -346,8 +342,8 @@ public abstract class ProviderOperation implements IProviderOperation {
if (cache != null) {
providerCache.put(cache.getProviderName(), cache);
} else {
- String msg =
- EELFResourceManager.format(Msg.UNKNOWN_PROVIDER, providerName, providerCache.keySet().toString());
+ String msg = EELFResourceManager.format(Msg.UNKNOWN_PROVIDER, providerName,
+ providerCache.keySet().toString());
logger.error(msg);
doFailure(rc, HttpStatus.INTERNAL_SERVER_ERROR_500, msg);
return null;
@@ -355,8 +351,8 @@ public abstract class ProviderOperation implements IProviderOperation {
}
if (providerName == null) {
- logger
- .debug(String.format("Using the default provider cache [%s] since no valid identity url was passed in.",
+ logger.debug(
+ String.format("Using the default provider cache [%s] since no valid identity url was passed in.",
cache.getIdentityURL()));
}
@@ -364,12 +360,12 @@ public abstract class ProviderOperation implements IProviderOperation {
String identityURL = cache.getIdentityURL();
TenantCache tenantCache = cache.getTenant(vm.getTenantId());
- if(tenantCache == null){
- //no tenantCache matching tenant, add tenant to the provider cache
- tenantCache = cache.addTenant(vm.getTenantId(),null,DEFAULT_USER, DEFAULT_PASS);
+ if (tenantCache == null) {
+ // no tenantCache matching tenant, add tenant to the provider cache
+ tenantCache = cache.addTenant(vm.getTenantId(), null, DEFAULT_USER, DEFAULT_PASS, DEFAULT_DOMAIN);
- if(tenantCache == null){
- //tenant not found
+ if (tenantCache == null) {
+ // tenant not found
String msg = EELFResourceManager.format(Msg.SERVER_NOT_FOUND, selfLinkURL);
logger.error(msg);
doFailure(rc, HttpStatus.NOT_FOUND_404, msg);
@@ -377,7 +373,7 @@ public abstract class ProviderOperation implements IProviderOperation {
}
}
- //reserve the context
+ // reserve the context
String tenantName = tenantCache.getTenantName();
String tenantId = tenantCache.getTenantId();
String region = tenantCache.determineRegion(vm);
@@ -390,8 +386,8 @@ public abstract class ProviderOperation implements IProviderOperation {
Context context = pool.reserve();
/*
- * Insert logic here to test the context for connectivity because we may have gotten one from
- * the pool that was previously created.
+ * Insert logic here to test the context for connectivity because we may have gotten one from the
+ * pool that was previously created.
*/
if (context.isStale()) {
context.relogin();
@@ -446,15 +442,12 @@ public abstract class ProviderOperation implements IProviderOperation {
-
-
-
-
- protected abstract ModelObject executeProviderOperation(Map<String, String> params, SvcLogicContext context) throws APPCException;
+ protected abstract ModelObject executeProviderOperation(Map<String, String> params, SvcLogicContext context)
+ throws APPCException;
@Override
public ModelObject doOperation(Map<String, String> params, SvcLogicContext context) throws APPCException {
- return executeProviderOperation(params,context);
+ return executeProviderOperation(params, context);
}
}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/base/ProviderServerOperation.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/base/ProviderServerOperation.java
index b7ad626ce..d2c34d034 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/base/ProviderServerOperation.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/base/ProviderServerOperation.java
@@ -52,24 +52,19 @@ import java.util.List;
/**
* @since September 29, 2016
*/
-public abstract class ProviderServerOperation extends ProviderOperation{
+public abstract class ProviderServerOperation extends ProviderOperation {
private static final EELFLogger logger = EELFManager.getInstance().getLogger(ProviderServerOperation.class);
/**
* Looks up the indicated server using the provided context and returns the server to the caller
*
- * @param rc
- * The request context
- * @param context
- * The provider context
- * @param id
- * The id of the server
+ * @param rc The request context
+ * @param context The provider context
+ * @param id The id of the server
* @return The server, or null if there is a problem
- * @throws ZoneException
- * If the server cannot be found
- * @throws RequestFailedException
- * If the server cannot be found because we cant connect to the provider
+ * @throws ZoneException If the server cannot be found
+ * @throws RequestFailedException If the server cannot be found because we cant connect to the provider
*/
@SuppressWarnings("nls")
protected Server lookupServer(RequestContext rc, Context context, String id)
@@ -106,10 +101,8 @@ public abstract class ProviderServerOperation extends ProviderOperation{
/**
* Resume a suspended server and wait for it to enter a running state
*
- * @param rc
- * The request context that manages the state and recovery of the request for the life of its processing.
- * @param server
- * The server to be resumed
+ * @param rc The request context that manages the state and recovery of the request for the life of its processing.
+ * @param server The server to be resumed
* @throws ZoneException
* @throws RequestFailedException
*/
@@ -167,14 +160,10 @@ public abstract class ProviderServerOperation extends ProviderOperation{
* exceptions are thrown from this method.
* </p>
*
- * @param rc
- * The request context that manages the state and recovery of the request for the life of its processing.
- * @param image
- * The server to wait on
- * @param desiredStates
- * A variable list of desired states, any one of which is allowed.
- * @throws RequestFailedException
- * If the request times out or fails for some reason
+ * @param rc The request context that manages the state and recovery of the request for the life of its processing.
+ * @param image The server to wait on
+ * @param desiredStates A variable list of desired states, any one of which is allowed.
+ * @throws RequestFailedException If the request times out or fails for some reason
* @throws NotLoggedInException
*/
@SuppressWarnings("nls")
@@ -246,14 +235,10 @@ public abstract class ProviderServerOperation extends ProviderOperation{
* exceptions are thrown from this method.
* </p>
*
- * @param rc
- * The request context that manages the state and recovery of the request for the life of its processing.
- * @param server
- * The server to wait on
- * @param desiredStates
- * A variable list of desired states, any one of which is allowed.
- * @throws RequestFailedException
- * If the request times out or fails for some reason
+ * @param rc The request context that manages the state and recovery of the request for the life of its processing.
+ * @param server The server to wait on
+ * @param desiredStates A variable list of desired states, any one of which is allowed.
+ * @throws RequestFailedException If the request times out or fails for some reason
*/
@SuppressWarnings("nls")
protected void waitForStateChange(RequestContext rc, Server server, Server.Status... desiredStates)
@@ -291,8 +276,8 @@ public abstract class ProviderServerOperation extends ProviderOperation{
list.add(desiredState.name());
}
String reason = EELFResourceManager.format(Msg.STATE_CHANGE_EXCEPTION, e.getClass().getSimpleName(),
- "server", server.getName(), server.getId(), StringHelper.asList(list), server.getStatus().name(),
- e.getMessage());
+ "server", server.getName(), server.getId(), StringHelper.asList(list),
+ server.getStatus().name(), e.getMessage());
logger.error(reason);
logger.error(EELFResourceManager.format(e));
@@ -317,10 +302,8 @@ public abstract class ProviderServerOperation extends ProviderOperation{
/**
* Stop the specified server and wait for it to stop
*
- * @param rc
- * The request context that manages the state and recovery of the request for the life of its processing.
- * @param server
- * The server to be stopped
+ * @param rc The request context that manages the state and recovery of the request for the life of its processing.
+ * @param server The server to be stopped
* @throws ZoneException
* @throws RequestFailedException
*/
@@ -357,10 +340,8 @@ public abstract class ProviderServerOperation extends ProviderOperation{
/**
* Start the server and wait for it to enter a running state
*
- * @param rc
- * The request context that manages the state and recovery of the request for the life of its processing.
- * @param server
- * The server to be started
+ * @param rc The request context that manages the state and recovery of the request for the life of its processing.
+ * @param server The server to be started
* @throws ZoneException
* @throws RequestFailedException
*/
@@ -397,10 +378,8 @@ public abstract class ProviderServerOperation extends ProviderOperation{
/**
* Un-Pause a paused server and wait for it to enter a running state
*
- * @param rc
- * The request context that manages the state and recovery of the request for the life of its processing.
- * @param server
- * The server to be un-paused
+ * @param rc The request context that manages the state and recovery of the request for the life of its processing.
+ * @param server The server to be un-paused
* @throws ZoneException
* @throws RequestFailedException
*/
@@ -438,153 +417,143 @@ public abstract class ProviderServerOperation extends ProviderOperation{
/**
* Generates the event indicating what happened
*
- * @param rc
- * The request context that manages the state and recovery of the request for the life of its processing.
- * @param success
- * True if the event represents a successful outcome
- * @param msg
- * The detailed message
+ * @param rc The request context that manages the state and recovery of the request for the life of its processing.
+ * @param success True if the event represents a successful outcome
+ * @param msg The detailed message
*/
- protected void generateEvent(@SuppressWarnings("unused") RequestContext rc, @SuppressWarnings("unused") boolean success, @SuppressWarnings("unused") String msg) {
+ protected void generateEvent(@SuppressWarnings("unused") RequestContext rc,
+ @SuppressWarnings("unused") boolean success, @SuppressWarnings("unused") String msg) {
// indication to the DG to generate the event?
}
-
+
/**
* Checks if the VM is connected to the Virtual Network and reachable
*
- * @param rc
- * The request context that manages the state and recovery of the request for the life of its processing.
- * @param server
- * The server object representing the server we want to operate on
- * @param context
- * The interface cloud service provider to access services or the object model, or both
-
+ * @param rc The request context that manages the state and recovery of the request for the life of its processing.
+ * @param server The server object representing the server we want to operate on
+ * @param context The interface cloud service provider to access services or the object model, or both
+ *
*/
- protected void checkVirtualMachineNetworkStatus(RequestContext rc, Server server, Context context)
- throws ZoneException, RequestFailedException {
-
- logger.info("Performing the VM Server networking status checks...");
- List<Port> ports = server.getPorts();
-
- NetworkService netSvc = context.getNetworkService();
-
- String msg;
- for (Port port : ports) {
-
- switch (port.getPortState().toString().toUpperCase()) {
- /**
- * The port is connected, configured, and usable for communication
- */
- case "ONLINE":
- Network network = netSvc.getNetworkById(port.getNetwork());
- // Subnet subnet = netSvc.getSubnetById(port.getSubnetId());
- if (!network.getStatus().equals(Network.Status.ACTIVE.toString())) {
- msg = EELFResourceManager.format(Msg.SERVER_NETWORK_ERROR, server.getName(), port.getId());
- logger.error(msg);
- doFailure(rc, HttpStatus.PRECONDITION_FAILED_412, msg);
- throw new RequestFailedException("VM Server Network is DOWN", msg.toString(), HttpStatus.PRECONDITION_FAILED_412,
- server);
- }
- break;
-
- /**
- * The port is disconnected or powered-off and cannot be used for
- * communication
- */
- case "OFFLINE":
- msg = EELFResourceManager.format(Msg.SERVER_NETWORK_ERROR, server.getName(), port.getId());
- logger.error(msg);
- doFailure(rc, HttpStatus.PRECONDITION_FAILED_412, msg);
- throw new RequestFailedException("VM Server Port status is OFFLINE", msg.toString(), HttpStatus.PRECONDITION_FAILED_412,
- server);
-
- /**
- * The port's status is changing because of some event or operation.
- * The final state is yet to be determined.
- */
- case "PENDING":
- msg = EELFResourceManager.format(Msg.SERVER_NETWORK_ERROR, server.getName(), port.getId());
- logger.error(msg);
- doFailure(rc, HttpStatus.PRECONDITION_FAILED_412, msg);
- throw new RequestFailedException("VM Server Port status is PENDING", msg.toString(), HttpStatus.PRECONDITION_FAILED_412,
- server);
-
- /**
- * The port is in an unknown state and cannot be used.
- */
- case "UNKNOWN":
- msg = EELFResourceManager.format(Msg.SERVER_NETWORK_ERROR, server.getName(), port.getId());
- logger.error(msg);
- doFailure(rc, HttpStatus.PRECONDITION_FAILED_412, msg);
- throw new RequestFailedException("VM Server Port status is UNKNOWN", msg.toString(), HttpStatus.PRECONDITION_FAILED_412,
- server);
- }
-
- }
- logger.info("Passed the VM Server the Hypervisor status checks..");
-
- }
-
- /**
+ protected void checkVirtualMachineNetworkStatus(RequestContext rc, Server server, Context context)
+ throws ZoneException, RequestFailedException {
+
+ logger.info("Performing the VM Server networking status checks...");
+ List<Port> ports = server.getPorts();
+
+ NetworkService netSvc = context.getNetworkService();
+
+ String msg;
+ for (Port port : ports) {
+
+ switch (port.getPortState().toString().toUpperCase()) {
+ /**
+ * The port is connected, configured, and usable for communication
+ */
+ case "ONLINE":
+ Network network = netSvc.getNetworkById(port.getNetwork());
+ // Subnet subnet = netSvc.getSubnetById(port.getSubnetId());
+ if (!network.getStatus().equals(Network.Status.ACTIVE.toString())) {
+ msg = EELFResourceManager.format(Msg.SERVER_NETWORK_ERROR, server.getName(), port.getId());
+ logger.error(msg);
+ doFailure(rc, HttpStatus.PRECONDITION_FAILED_412, msg);
+ throw new RequestFailedException("VM Server Network is DOWN", msg.toString(),
+ HttpStatus.PRECONDITION_FAILED_412, server);
+ }
+ break;
+
+ /**
+ * The port is disconnected or powered-off and cannot be used for communication
+ */
+ case "OFFLINE":
+ msg = EELFResourceManager.format(Msg.SERVER_NETWORK_ERROR, server.getName(), port.getId());
+ logger.error(msg);
+ doFailure(rc, HttpStatus.PRECONDITION_FAILED_412, msg);
+ throw new RequestFailedException("VM Server Port status is OFFLINE", msg.toString(),
+ HttpStatus.PRECONDITION_FAILED_412, server);
+
+ /**
+ * The port's status is changing because of some event or operation. The final state is yet to be
+ * determined.
+ */
+ case "PENDING":
+ msg = EELFResourceManager.format(Msg.SERVER_NETWORK_ERROR, server.getName(), port.getId());
+ logger.error(msg);
+ doFailure(rc, HttpStatus.PRECONDITION_FAILED_412, msg);
+ throw new RequestFailedException("VM Server Port status is PENDING", msg.toString(),
+ HttpStatus.PRECONDITION_FAILED_412, server);
+
+ /**
+ * The port is in an unknown state and cannot be used.
+ */
+ case "UNKNOWN":
+ msg = EELFResourceManager.format(Msg.SERVER_NETWORK_ERROR, server.getName(), port.getId());
+ logger.error(msg);
+ doFailure(rc, HttpStatus.PRECONDITION_FAILED_412, msg);
+ throw new RequestFailedException("VM Server Port status is UNKNOWN", msg.toString(),
+ HttpStatus.PRECONDITION_FAILED_412, server);
+ }
+
+ }
+ logger.info("Passed the VM Server the Hypervisor status checks..");
+
+ }
+
+ /**
* Checks if the VM is connected to the Virtual Network and reachable
*
- * @param server
- * The server object representing the server we want to operate on
+ * @param server The server object representing the server we want to operate on
*/
- protected void checkHypervisor(Server server)
- throws ZoneException, RequestFailedException {
-
- logger.info("Performing the Hypervisor status checks..");
-
- String msg = null;
- if(server.getHypervisor() != null && server.getHypervisor().getStatus() != null && server.getHypervisor().getState() != null)
- {
- String status = null, state = null;
-
- status = server.getHypervisor().getStatus().toString();
- state = server.getHypervisor().getState().toString();
-
- if (!status.equals(Hypervisor.Status.ENABLED.toString()) || !state.equals(Hypervisor.State.UP.toString()))
- {
- msg = EELFResourceManager.format(Msg.HYPERVISOR_DOWN_ERROR, server.getHypervisor().getHostName(), server.getName());
- logger.error(msg.toString());
-
- //doFailure(rc, HttpStatus.PRECONDITION_FAILED_412, msg);
- throw new RequestFailedException("Hypervisor status DOWN or NOT ENABLED", msg.toString(), HttpStatus.PRECONDITION_FAILED_412,
- server);
-
- }
- }
- else
- {
- msg = EELFResourceManager.format(Msg.HYPERVISOR_STATUS_UKNOWN, server.getName());
- logger.error(msg.toString());
-
- throw new RequestFailedException("Unable to determine Hypervisor status", msg.toString(), HttpStatus.PRECONDITION_FAILED_412,
- server);
- }
-
- logger.info("Passed the Hypervisor status checks..");
-
- }
-
- /**
+ protected void checkHypervisor(Server server) throws ZoneException, RequestFailedException {
+
+ logger.info("Performing the Hypervisor status checks..");
+
+ String msg = null;
+ if (server.getHypervisor() != null && server.getHypervisor().getStatus() != null
+ && server.getHypervisor().getState() != null) {
+ String status = null, state = null;
+
+ status = server.getHypervisor().getStatus().toString();
+ state = server.getHypervisor().getState().toString();
+
+ if (!status.equals(Hypervisor.Status.ENABLED.toString()) || !state.equals(Hypervisor.State.UP.toString())) {
+ msg = EELFResourceManager.format(Msg.HYPERVISOR_DOWN_ERROR, server.getHypervisor().getHostName(),
+ server.getName());
+ logger.error(msg.toString());
+
+ // doFailure(rc, HttpStatus.PRECONDITION_FAILED_412, msg);
+ throw new RequestFailedException("Hypervisor status DOWN or NOT ENABLED", msg.toString(),
+ HttpStatus.PRECONDITION_FAILED_412, server);
+
+ }
+ } else {
+ msg = EELFResourceManager.format(Msg.HYPERVISOR_STATUS_UKNOWN, server.getName());
+ logger.error(msg.toString());
+
+ throw new RequestFailedException("Unable to determine Hypervisor status", msg.toString(),
+ HttpStatus.PRECONDITION_FAILED_412, server);
+ }
+
+ logger.info("Passed the Hypervisor status checks..");
+
+ }
+
+ /**
* Checks if a Host machine is reachable
*
- * @param ipAddress
- * IP Address of the Host Machine.
- * @param server
- * The server object representing the Virtual Machine server
+ * @param ipAddress IP Address of the Host Machine.
+ * @param server The server object representing the Virtual Machine server
* @return boolean
- *
+ *
*/
- /*private boolean isHostReachable(String ipAddress) throws IOException {
-
- InetAddress address = InetAddress.getByName(ipAddress);
-
- return address.isReachable(15000);
-
-
- }*/
-
+ /*
+ * private boolean isHostReachable(String ipAddress) throws IOException {
+ *
+ * InetAddress address = InetAddress.getByName(ipAddress);
+ *
+ * return address.isReachable(15000);
+ *
+ *
+ * }
+ */
+
}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/base/ProviderStackOperation.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/base/ProviderStackOperation.java
index 9579fec33..fa59ffbae 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/base/ProviderStackOperation.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/base/ProviderStackOperation.java
@@ -45,13 +45,9 @@ import com.att.eelf.i18n.EELFResourceManager;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import com.woorea.openstack.base.client.OpenStackBaseException;
import org.glassfish.grizzly.http.util.HttpStatus;
-
import java.util.List;
-/**
- * @since September 29, 2016
- */
-public abstract class ProviderStackOperation extends ProviderOperation{
+public abstract class ProviderStackOperation extends ProviderOperation {
private static final EELFLogger logger = EELFManager.getInstance().getLogger(ProviderStackOperation.class);
@@ -59,7 +55,8 @@ public abstract class ProviderStackOperation extends ProviderOperation{
protected void trackRequest(Context context, AbstractService.State... states) {
RequestState.clear();
- if (null == states) return;
+ if (null == states)
+ return;
for (AbstractService.State state : states) {
RequestState.put(state.getName(), state.getValue());
}
@@ -71,7 +68,7 @@ public abstract class ProviderStackOperation extends ProviderOperation{
StackTraceElement element;
for (; index < stack.length; index++) {
element = stack[index];
- if ("trackRequest".equals(element.getMethodName())) { //$NON-NLS-1$
+ if ("trackRequest".equals(element.getMethodName())) { //$NON-NLS-1$
break;
}
}
@@ -90,7 +87,9 @@ public abstract class ProviderStackOperation extends ProviderOperation{
}
}
-/* Changed the 'pollInterval' type as long. Thread.sleep method needs 'long millis' as an argument */
+ /*
+ * Changed the 'pollInterval' type as long. Thread.sleep method needs 'long millis' as an argument
+ */
private boolean checkStatus(String expectedStatus, long pollInterval, String actualStatus) {
if (actualStatus.toUpperCase().equals(expectedStatus)) {
return true;
@@ -112,8 +111,10 @@ public abstract class ProviderStackOperation extends ProviderOperation{
while (System.currentTimeMillis() < maxTimeToWait) {
String stackStatus = stackResource.show(stack.getName(), stack.getId()).execute().getStackStatus();
logger.debug("Stack status : " + stackStatus);
- if (stackStatus.toUpperCase().contains("FAILED")) return false;
- if(checkStatus(expectedStatus, pollInterval, stackStatus)) return true;
+ if (stackStatus.toUpperCase().contains("FAILED"))
+ return false;
+ if (checkStatus(expectedStatus, pollInterval, stackStatus))
+ return true;
}
throw new TimeoutException("Timeout waiting for stack status change");
}
@@ -158,11 +159,14 @@ public abstract class ProviderStackOperation extends ProviderOperation{
}
- protected boolean waitForStackStatus(RequestContext rc, Stack stack, Stack.Status expectedStatus) throws ZoneException, RequestFailedException {
+ protected boolean waitForStackStatus(RequestContext rc, Stack stack, Stack.Status expectedStatus)
+ throws ZoneException, RequestFailedException {
SvcLogicContext ctx = rc.getSvcLogicContext();
Context context = stack.getContext();
StackService stackService = context.getStackService();
-/* Changed the 'pollInterval' type as long. Thread.sleep method needs 'long millis' as an argument */
+ /*
+ * Changed the 'pollInterval' type as long. Thread.sleep method needs 'long millis' as an argument
+ */
long pollInterval = configuration.getIntegerProperty(Constants.PROPERTY_OPENSTACK_POLL_INTERVAL);
int timeout = configuration.getIntegerProperty(Constants.PROPERTY_STACK_STATE_CHANGE_TIMEOUT);
long maxTimeToWait = System.currentTimeMillis() + (long) timeout * 1000;
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/SnapshotResource.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/SnapshotResource.java
index ff3f95d3f..04468187c 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/SnapshotResource.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/SnapshotResource.java
@@ -26,7 +26,6 @@ package org.openecomp.appc.adapter.openstack.heat;
import org.openecomp.appc.adapter.openstack.heat.model.CreateSnapshotParams;
import org.openecomp.appc.adapter.openstack.heat.model.Snapshot;
-
import com.woorea.openstack.base.client.Entity;
import com.woorea.openstack.base.client.HttpMethod;
import com.woorea.openstack.base.client.OpenStackClient;
@@ -55,19 +54,22 @@ public class SnapshotResource {
public class CreateSnapshot extends OpenStackRequest<Snapshot> {
public CreateSnapshot(String stackName, String stackID, CreateSnapshotParams params) {
- super(client, HttpMethod.POST, "/stacks/" + stackName + "/" + stackID + "/snapshots", Entity.json(params), Snapshot.class);
+ super(client, HttpMethod.POST, "/stacks/" + stackName + "/" + stackID + "/snapshots", Entity.json(params),
+ Snapshot.class);
}
}
public class RestoreSnapshot extends OpenStackRequest<Void> {
public RestoreSnapshot(String stackName, String stackID, String snapshotID) {
- super(client, HttpMethod.POST, "/stacks/" + stackName + "/" + stackID + "/snapshots/" + snapshotID + "/restore", null, Void.class);
+ super(client, HttpMethod.POST,
+ "/stacks/" + stackName + "/" + stackID + "/snapshots/" + snapshotID + "/restore", null, Void.class);
}
}
public class ShowSnapshot extends OpenStackRequest<Snapshot> {
public ShowSnapshot(String stackName, String stackID, String snapshotID) {
- super(client, HttpMethod.GET, "/stacks/" + stackName + "/" + stackID + "/snapshots/" + snapshotID, null, Snapshot.class);
+ super(client, HttpMethod.GET, "/stacks/" + stackName + "/" + stackID + "/snapshots/" + snapshotID, null,
+ Snapshot.class);
}
}
}
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/StackResource.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/StackResource.java
index b9b7bccf2..a559b04a8 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/StackResource.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/StackResource.java
@@ -26,7 +26,6 @@ package org.openecomp.appc.adapter.openstack.heat;
import org.openecomp.appc.adapter.openstack.heat.model.CreateSnapshotParams;
import org.openecomp.appc.adapter.openstack.heat.model.Snapshot;
-
import com.woorea.openstack.base.client.Entity;
import com.woorea.openstack.base.client.HttpMethod;
import com.woorea.openstack.base.client.OpenStackClient;
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/CreateSnapshotParams.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/CreateSnapshotParams.java
index 22c677c52..4d8901cf2 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/CreateSnapshotParams.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/CreateSnapshotParams.java
@@ -32,9 +32,7 @@ import org.apache.commons.lang.builder.ToStringBuilder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("org.jsonschema2pojo")
-@JsonPropertyOrder({
- "name"
-})
+@JsonPropertyOrder({"name"})
public class CreateSnapshotParams {
@JsonProperty("name")
@@ -42,8 +40,7 @@ public class CreateSnapshotParams {
/**
*
- * @return
- * The name
+ * @return The name
*/
@JsonProperty("name")
public String getName() {
@@ -52,8 +49,7 @@ public class CreateSnapshotParams {
/**
*
- * @param name
- * The name
+ * @param name The name
*/
@JsonProperty("name")
public void setName(String name) {
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Data.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Data.java
index c7aa5d2be..3581818e0 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Data.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Data.java
@@ -33,17 +33,8 @@ import org.apache.commons.lang.builder.ToStringBuilder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("org.jsonschema2pojo")
-@JsonPropertyOrder({
- "status",
- "name",
- "stack_user_project_id",
- "environment",
- "template",
- "action",
- "project_id",
- "id",
- "resources"
-})
+@JsonPropertyOrder({"status", "name", "stack_user_project_id", "environment", "template", "action", "project_id", "id",
+ "resources"})
public class Data {
@JsonProperty("status")
@@ -70,8 +61,7 @@ public class Data {
/**
*
- * @return
- * The status
+ * @return The status
*/
@JsonProperty("status")
public String getStatus() {
@@ -80,8 +70,7 @@ public class Data {
/**
*
- * @param status
- * The status
+ * @param status The status
*/
@JsonProperty("status")
public void setStatus(String status) {
@@ -90,8 +79,7 @@ public class Data {
/**
*
- * @return
- * The name
+ * @return The name
*/
@JsonProperty("name")
public String getName() {
@@ -100,8 +88,7 @@ public class Data {
/**
*
- * @param name
- * The name
+ * @param name The name
*/
@JsonProperty("name")
public void setName(String name) {
@@ -110,8 +97,7 @@ public class Data {
/**
*
- * @return
- * The stackUserProjectId
+ * @return The stackUserProjectId
*/
@JsonProperty("stack_user_project_id")
public String getStackUserProjectId() {
@@ -120,8 +106,7 @@ public class Data {
/**
*
- * @param stackUserProjectId
- * The stack_user_project_id
+ * @param stackUserProjectId The stack_user_project_id
*/
@JsonProperty("stack_user_project_id")
public void setStackUserProjectId(String stackUserProjectId) {
@@ -130,8 +115,7 @@ public class Data {
/**
*
- * @return
- * The environment
+ * @return The environment
*/
@JsonProperty("environment")
public Environment getEnvironment() {
@@ -140,8 +124,7 @@ public class Data {
/**
*
- * @param environment
- * The environment
+ * @param environment The environment
*/
@JsonProperty("environment")
public void setEnvironment(Environment environment) {
@@ -150,8 +133,7 @@ public class Data {
/**
*
- * @return
- * The template
+ * @return The template
*/
@JsonProperty("template")
public Template getTemplate() {
@@ -160,8 +142,7 @@ public class Data {
/**
*
- * @param template
- * The template
+ * @param template The template
*/
@JsonProperty("template")
public void setTemplate(Template template) {
@@ -170,8 +151,7 @@ public class Data {
/**
*
- * @return
- * The action
+ * @return The action
*/
@JsonProperty("action")
public String getAction() {
@@ -180,8 +160,7 @@ public class Data {
/**
*
- * @param action
- * The action
+ * @param action The action
*/
@JsonProperty("action")
public void setAction(String action) {
@@ -190,8 +169,7 @@ public class Data {
/**
*
- * @return
- * The projectId
+ * @return The projectId
*/
@JsonProperty("project_id")
public String getProjectId() {
@@ -200,8 +178,7 @@ public class Data {
/**
*
- * @param projectId
- * The project_id
+ * @param projectId The project_id
*/
@JsonProperty("project_id")
public void setProjectId(String projectId) {
@@ -210,8 +187,7 @@ public class Data {
/**
*
- * @return
- * The id
+ * @return The id
*/
@JsonProperty("id")
public String getId() {
@@ -220,8 +196,7 @@ public class Data {
/**
*
- * @param id
- * The id
+ * @param id The id
*/
@JsonProperty("id")
public void setId(String id) {
@@ -230,8 +205,7 @@ public class Data {
/**
*
- * @return
- * The resources
+ * @return The resources
*/
@JsonProperty("resources")
public Resources__ getResources() {
@@ -240,8 +214,7 @@ public class Data {
/**
*
- * @param resources
- * The resources
+ * @param resources The resources
*/
@JsonProperty("resources")
public void setResources(Resources__ resources) {
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Environment.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Environment.java
index ea166200a..10adaedbd 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Environment.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Environment.java
@@ -33,10 +33,7 @@ import org.apache.commons.lang.builder.ToStringBuilder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("org.jsonschema2pojo")
-@JsonPropertyOrder({
- "parameters",
- "resource_registry"
-})
+@JsonPropertyOrder({"parameters", "resource_registry"})
public class Environment {
@JsonProperty("parameters")
@@ -48,8 +45,7 @@ public class Environment {
/**
*
- * @return
- * The parameters
+ * @return The parameters
*/
@JsonProperty("parameters")
public Parameters getParameters() {
@@ -58,8 +54,7 @@ public class Environment {
/**
*
- * @param parameters
- * The parameters
+ * @param parameters The parameters
*/
@JsonProperty("parameters")
public void setParameters(Parameters parameters) {
@@ -68,8 +63,7 @@ public class Environment {
/**
*
- * @return
- * The resourceRegistry
+ * @return The resourceRegistry
*/
@JsonProperty("resource_registry")
public ResourceRegistry getResourceRegistry() {
@@ -78,8 +72,7 @@ public class Environment {
/**
*
- * @param resourceRegistry
- * The resource_registry
+ * @param resourceRegistry The resource_registry
*/
@JsonProperty("resource_registry")
public void setResourceRegistry(ResourceRegistry resourceRegistry) {
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Properties.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Properties.java
index d04d2413c..3be9461f4 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Properties.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Properties.java
@@ -32,9 +32,7 @@ import org.apache.commons.lang.builder.ToStringBuilder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("org.jsonschema2pojo")
-@JsonPropertyOrder({
- "size"
-})
+@JsonPropertyOrder({"size"})
public class Properties {
@JsonProperty("size")
@@ -42,8 +40,7 @@ public class Properties {
/**
*
- * @return
- * The size
+ * @return The size
*/
@JsonProperty("size")
public int getSize() {
@@ -52,8 +49,7 @@ public class Properties {
/**
*
- * @param size
- * The size
+ * @param size The size
*/
@JsonProperty("size")
public void setSize(int size) {
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/ResourceData.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/ResourceData.java
index 8df4d8bf5..8ac70e3ea 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/ResourceData.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/ResourceData.java
@@ -32,9 +32,7 @@ import org.apache.commons.lang.builder.ToStringBuilder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("org.jsonschema2pojo")
-@JsonPropertyOrder({
- "backup_id"
-})
+@JsonPropertyOrder({"backup_id"})
public class ResourceData {
@JsonProperty("backup_id")
@@ -42,8 +40,7 @@ public class ResourceData {
/**
*
- * @return
- * The backupId
+ * @return The backupId
*/
@JsonProperty("backup_id")
public String getBackupId() {
@@ -52,8 +49,7 @@ public class ResourceData {
/**
*
- * @param backupId
- * The backup_id
+ * @param backupId The backup_id
*/
@JsonProperty("backup_id")
public void setBackupId(String backupId) {
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/ResourceRegistry.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/ResourceRegistry.java
index ad421b38a..c214c41ea 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/ResourceRegistry.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/ResourceRegistry.java
@@ -33,9 +33,7 @@ import org.apache.commons.lang.builder.ToStringBuilder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("org.jsonschema2pojo")
-@JsonPropertyOrder({
- "resources"
-})
+@JsonPropertyOrder({"resources"})
public class ResourceRegistry {
@JsonProperty("resources")
@@ -44,8 +42,7 @@ public class ResourceRegistry {
/**
*
- * @return
- * The resources
+ * @return The resources
*/
@JsonProperty("resources")
public Resources getResources() {
@@ -54,8 +51,7 @@ public class ResourceRegistry {
/**
*
- * @param resources
- * The resources
+ * @param resources The resources
*/
@JsonProperty("resources")
public void setResources(Resources resources) {
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Resources_.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Resources_.java
index 45f67c71e..cbacd77d9 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Resources_.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Resources_.java
@@ -33,9 +33,7 @@ import org.apache.commons.lang.builder.ToStringBuilder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("org.jsonschema2pojo")
-@JsonPropertyOrder({
- "volume"
-})
+@JsonPropertyOrder({"volume"})
public class Resources_ {
@JsonProperty("volume")
@@ -44,8 +42,7 @@ public class Resources_ {
/**
*
- * @return
- * The volume
+ * @return The volume
*/
@JsonProperty("volume")
public Volume getVolume() {
@@ -54,8 +51,7 @@ public class Resources_ {
/**
*
- * @param volume
- * The volume
+ * @param volume The volume
*/
@JsonProperty("volume")
public void setVolume(Volume volume) {
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Resources__.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Resources__.java
index 4b5cbc79b..b389c2d83 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Resources__.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Resources__.java
@@ -33,9 +33,7 @@ import org.apache.commons.lang.builder.ToStringBuilder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("org.jsonschema2pojo")
-@JsonPropertyOrder({
- "volume"
-})
+@JsonPropertyOrder({"volume"})
public class Resources__ {
@JsonProperty("volume")
@@ -44,8 +42,7 @@ public class Resources__ {
/**
*
- * @return
- * The volume
+ * @return The volume
*/
@JsonProperty("volume")
public Volume_ getVolume() {
@@ -54,8 +51,7 @@ public class Resources__ {
/**
*
- * @param volume
- * The volume
+ * @param volume The volume
*/
@JsonProperty("volume")
public void setVolume(Volume_ volume) {
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Snapshot.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Snapshot.java
index 062ce1daa..548035635 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Snapshot.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Snapshot.java
@@ -33,14 +33,7 @@ import org.apache.commons.lang.builder.ToStringBuilder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("org.jsonschema2pojo")
-@JsonPropertyOrder({
- "id",
- "name",
- "status",
- "status_reason",
- "creation_time",
- "data"
-})
+@JsonPropertyOrder({"id", "name", "status", "status_reason", "creation_time", "data"})
public class Snapshot {
@JsonProperty("id")
@@ -59,8 +52,7 @@ public class Snapshot {
/**
*
- * @return
- * The id
+ * @return The id
*/
@JsonProperty("id")
public String getId() {
@@ -69,8 +61,7 @@ public class Snapshot {
/**
*
- * @param id
- * The id
+ * @param id The id
*/
@JsonProperty("id")
public void setId(String id) {
@@ -79,8 +70,7 @@ public class Snapshot {
/**
*
- * @return
- * The name
+ * @return The name
*/
@JsonProperty("name")
public String getName() {
@@ -89,8 +79,7 @@ public class Snapshot {
/**
*
- * @param name
- * The name
+ * @param name The name
*/
@JsonProperty("name")
public void setName(String name) {
@@ -99,8 +88,7 @@ public class Snapshot {
/**
*
- * @return
- * The status
+ * @return The status
*/
@JsonProperty("status")
public String getStatus() {
@@ -109,8 +97,7 @@ public class Snapshot {
/**
*
- * @param status
- * The status
+ * @param status The status
*/
@JsonProperty("status")
public void setStatus(String status) {
@@ -119,8 +106,7 @@ public class Snapshot {
/**
*
- * @return
- * The statusReason
+ * @return The statusReason
*/
@JsonProperty("status_reason")
public String getStatusReason() {
@@ -129,8 +115,7 @@ public class Snapshot {
/**
*
- * @param statusReason
- * The status_reason
+ * @param statusReason The status_reason
*/
@JsonProperty("status_reason")
public void setStatusReason(String statusReason) {
@@ -139,8 +124,7 @@ public class Snapshot {
/**
*
- * @return
- * The creationTime
+ * @return The creationTime
*/
@JsonProperty("creation_time")
public String getCreationTime() {
@@ -149,8 +133,7 @@ public class Snapshot {
/**
*
- * @param creationTime
- * The creation_time
+ * @param creationTime The creation_time
*/
@JsonProperty("creation_time")
public void setCreationTime(String creationTime) {
@@ -159,8 +142,7 @@ public class Snapshot {
/**
*
- * @return
- * The data
+ * @return The data
*/
@JsonProperty("data")
public Data getData() {
@@ -169,8 +151,7 @@ public class Snapshot {
/**
*
- * @param data
- * The data
+ * @param data The data
*/
@JsonProperty("data")
public void setData(Data data) {
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/SnapshotDetails.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/SnapshotDetails.java
index 816a8d499..172072d5a 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/SnapshotDetails.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/SnapshotDetails.java
@@ -33,9 +33,7 @@ import org.apache.commons.lang.builder.ToStringBuilder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("org.jsonschema2pojo")
-@JsonPropertyOrder({
- "snapshot"
-})
+@JsonPropertyOrder({"snapshot"})
public class SnapshotDetails {
@JsonProperty("snapshot")
@@ -44,8 +42,7 @@ public class SnapshotDetails {
/**
*
- * @return
- * The snapshot
+ * @return The snapshot
*/
@JsonProperty("snapshot")
public Snapshot getSnapshot() {
@@ -54,8 +51,7 @@ public class SnapshotDetails {
/**
*
- * @param snapshot
- * The snapshot
+ * @param snapshot The snapshot
*/
@JsonProperty("snapshot")
public void setSnapshot(Snapshot snapshot) {
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/SnapshotRestoreResponse.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/SnapshotRestoreResponse.java
index 6dae3bdf1..5e829bad9 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/SnapshotRestoreResponse.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/SnapshotRestoreResponse.java
@@ -32,11 +32,7 @@ import org.apache.commons.lang.builder.ToStringBuilder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("org.jsonschema2pojo")
-@JsonPropertyOrder({
- "code",
- "message",
- "title"
-})
+@JsonPropertyOrder({"code", "message", "title"})
public class SnapshotRestoreResponse {
@JsonProperty("code")
@@ -48,8 +44,7 @@ public class SnapshotRestoreResponse {
/**
*
- * @return
- * The code
+ * @return The code
*/
@JsonProperty("code")
public String getCode() {
@@ -58,8 +53,7 @@ public class SnapshotRestoreResponse {
/**
*
- * @param code
- * The code
+ * @param code The code
*/
@JsonProperty("code")
public void setCode(String code) {
@@ -68,8 +62,7 @@ public class SnapshotRestoreResponse {
/**
*
- * @return
- * The message
+ * @return The message
*/
@JsonProperty("message")
public String getMessage() {
@@ -78,8 +71,7 @@ public class SnapshotRestoreResponse {
/**
*
- * @param message
- * The message
+ * @param message The message
*/
@JsonProperty("message")
public void setMessage(String message) {
@@ -88,8 +80,7 @@ public class SnapshotRestoreResponse {
/**
*
- * @return
- * The title
+ * @return The title
*/
@JsonProperty("title")
public String getTitle() {
@@ -98,8 +89,7 @@ public class SnapshotRestoreResponse {
/**
*
- * @param title
- * The title
+ * @param title The title
*/
@JsonProperty("title")
public void setTitle(String title) {
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Template.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Template.java
index 08ab7475b..fd762dc2a 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Template.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Template.java
@@ -33,10 +33,7 @@ import org.apache.commons.lang.builder.ToStringBuilder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("org.jsonschema2pojo")
-@JsonPropertyOrder({
- "heat_template_version",
- "resources"
-})
+@JsonPropertyOrder({"heat_template_version", "resources"})
public class Template {
@JsonProperty("heat_template_version")
@@ -47,8 +44,7 @@ public class Template {
/**
*
- * @return
- * The heatTemplateVersion
+ * @return The heatTemplateVersion
*/
@JsonProperty("heat_template_version")
public String getHeatTemplateVersion() {
@@ -57,8 +53,7 @@ public class Template {
/**
*
- * @param heatTemplateVersion
- * The heat_template_version
+ * @param heatTemplateVersion The heat_template_version
*/
@JsonProperty("heat_template_version")
public void setHeatTemplateVersion(String heatTemplateVersion) {
@@ -67,8 +62,7 @@ public class Template {
/**
*
- * @return
- * The resources
+ * @return The resources
*/
@JsonProperty("resources")
public Resources_ getResources() {
@@ -77,8 +71,7 @@ public class Template {
/**
*
- * @param resources
- * The resources
+ * @param resources The resources
*/
@JsonProperty("resources")
public void setResources(Resources_ resources) {
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Volume.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Volume.java
index 9f3471012..9173fe832 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Volume.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Volume.java
@@ -33,10 +33,7 @@ import org.apache.commons.lang.builder.ToStringBuilder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("org.jsonschema2pojo")
-@JsonPropertyOrder({
- "type",
- "properties"
-})
+@JsonPropertyOrder({"type", "properties"})
public class Volume {
@JsonProperty("type")
@@ -47,8 +44,7 @@ public class Volume {
/**
*
- * @return
- * The type
+ * @return The type
*/
@JsonProperty("type")
public String getType() {
@@ -57,8 +53,7 @@ public class Volume {
/**
*
- * @param type
- * The type
+ * @param type The type
*/
@JsonProperty("type")
public void setType(String type) {
@@ -67,8 +62,7 @@ public class Volume {
/**
*
- * @return
- * The properties
+ * @return The properties
*/
@JsonProperty("properties")
public Properties getProperties() {
@@ -77,8 +71,7 @@ public class Volume {
/**
*
- * @param properties
- * The properties
+ * @param properties The properties
*/
@JsonProperty("properties")
public void setProperties(Properties properties) {
diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Volume_.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Volume_.java
index 9fd08b6da..abad08f98 100644
--- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Volume_.java
+++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/openstack/heat/model/Volume_.java
@@ -33,15 +33,7 @@ import org.apache.commons.lang.builder.ToStringBuilder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("org.jsonschema2pojo")
-@JsonPropertyOrder({
- "status",
- "name",
- "resource_data",
- "resource_id",
- "action",
- "type",
- "metadata"
-})
+@JsonPropertyOrder({"status", "name", "resource_data", "resource_id", "action", "type", "metadata"})
public class Volume_ {
@JsonProperty("status")
@@ -63,8 +55,7 @@ public class Volume_ {
/**
*
- * @return
- * The status
+ * @return The status
*/
@JsonProperty("status")
public String getStatus() {
@@ -73,8 +64,7 @@ public class Volume_ {
/**
*
- * @param status
- * The status
+ * @param status The status
*/
@JsonProperty("status")
public void setStatus(String status) {
@@ -83,8 +73,7 @@ public class Volume_ {
/**
*
- * @return
- * The name
+ * @return The name
*/
@JsonProperty("name")
public String getName() {
@@ -93,8 +82,7 @@ public class Volume_ {
/**
*
- * @param name
- * The name
+ * @param name The name
*/
@JsonProperty("name")
public void setName(String name) {
@@ -103,8 +91,7 @@ public class Volume_ {
/**
*
- * @return
- * The resourceData
+ * @return The resourceData
*/
@JsonProperty("resource_data")
public ResourceData getResourceData() {
@@ -113,8 +100,7 @@ public class Volume_ {
/**
*
- * @param resourceData
- * The resource_data
+ * @param resourceData The resource_data
*/
@JsonProperty("resource_data")
public void setResourceData(ResourceData resourceData) {
@@ -123,8 +109,7 @@ public class Volume_ {
/**
*
- * @return
- * The resourceId
+ * @return The resourceId
*/
@JsonProperty("resource_id")
public String getResourceId() {
@@ -133,8 +118,7 @@ public class Volume_ {
/**
*
- * @param resourceId
- * The resource_id
+ * @param resourceId The resource_id
*/
@JsonProperty("resource_id")
public void setResourceId(String resourceId) {
@@ -143,8 +127,7 @@ public class Volume_ {
/**
*
- * @return
- * The action
+ * @return The action
*/
@JsonProperty("action")
public String getAction() {
@@ -153,8 +136,7 @@ public class Volume_ {
/**
*
- * @param action
- * The action
+ * @param action The action
*/
@JsonProperty("action")
public void setAction(String action) {
@@ -163,8 +145,7 @@ public class Volume_ {
/**
*
- * @return
- * The type
+ * @return The type
*/
@JsonProperty("type")
public String getType() {
@@ -173,8 +154,7 @@ public class Volume_ {
/**
*
- * @param type
- * The type
+ * @param type The type
*/
@JsonProperty("type")
public void setType(String type) {
@@ -183,8 +163,7 @@ public class Volume_ {
/**
*
- * @return
- * The metadata
+ * @return The metadata
*/
@JsonProperty("metadata")
public Metadata getMetadata() {
@@ -193,8 +172,7 @@ public class Volume_ {
/**
*
- * @param metadata
- * The metadata
+ * @param metadata The metadata
*/
@JsonProperty("metadata")
public void setMetadata(Metadata metadata) {