aboutsummaryrefslogtreecommitdiffstats
path: root/appc-provider
diff options
context:
space:
mode:
authorPatrick Brady <pb071s@att.com>2017-06-01 10:45:37 -0700
committerPatrick Brady <pb071s@att.com>2017-06-02 13:05:15 -0700
commitc7d0075d223eab9f89fd28853c4b138792059be9 (patch)
tree40aa3e41e598ea7a59bcf6899a2004c1abab11c2 /appc-provider
parent8aac2df744820304ee29354333661699e9695939 (diff)
Merge of new rebased code
Change-Id: I9b8d1f69eb3e0af1935ed8304fea4bf54c1aac47 Signed-off-by: Patrick Brady <pb071s@att.com>
Diffstat (limited to 'appc-provider')
-rw-r--r--appc-provider/appc-provider-bundle/pom.xml435
-rw-r--r--appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/AppcProvider.java17
-rw-r--r--appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/AppcProviderClient.java58
-rw-r--r--appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/AppcProviderLcm.java299
-rw-r--r--appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/lcm/util/RequestInputBuilder.java10
-rw-r--r--appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/lcm/util/ValidationService.java8
-rw-r--r--appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/topology/TopologyService.java79
-rw-r--r--appc-provider/appc-provider-features/src/main/resources/features.xml4
-rw-r--r--appc-provider/appc-provider-model/pom.xml196
-rw-r--r--appc-provider/appc-provider-model/src/main/yang/appc-provider-lcm.yang694
-rw-r--r--appc-provider/appc-provider-model/src/main/yang/appc-provider.yang16
11 files changed, 1056 insertions, 760 deletions
diff --git a/appc-provider/appc-provider-bundle/pom.xml b/appc-provider/appc-provider-bundle/pom.xml
index 2606a7f60..dc468d8fd 100644
--- a/appc-provider/appc-provider-bundle/pom.xml
+++ b/appc-provider/appc-provider-bundle/pom.xml
@@ -1,215 +1,226 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>appc-provider</artifactId>
- <groupId>org.openecomp.appc</groupId>
- <version>1.1.0-SNAPSHOT</version>
- </parent>
- <artifactId>appc-provider-bundle</artifactId>
- <packaging>bundle</packaging>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Export-Package>org.opendaylight.controller.config.yang.config.sample_provider.impl</Export-Package>
- <Export-Package>org.openecomp.appc.provider</Export-Package>
- <Import-Package>!groovy.lang,!javax.jms,!org.codehaus.commons.compiler,!org.codehaus.groovy.*,!org.codehaus.janino,!com.ibm.icu.*,!com.sun.faces.*,!org.apache.log,*;resolution:=optional</Import-Package>
- <Embed-Dependency>appc-common,eelf-core,logback-core,logback-classic;scope=compile|runtime;inline=false,domain-model-lib,appc-command-executor-api,appc-request-handler-api</Embed-Dependency>
- <Embed-Transitive>true</Embed-Transitive>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-maven-plugin</artifactId>
- <version>${odl.yangtools.version}</version>
- <executions>
- <execution>
- <id>config</id>
- <goals>
- <goal>generate-sources</goal>
- </goals>
- <configuration>
- <codeGenerators>
- <generator>
- <codeGeneratorClass>org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator</codeGeneratorClass>
- <outputBaseDir>${jmxGeneratorPath}</outputBaseDir>
- <additionalConfiguration>
- <namespaceToPackage1>urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang</namespaceToPackage1>
- </additionalConfiguration>
- </generator>
- <generator>
- <codeGeneratorClass>org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl</codeGeneratorClass>
- <outputBaseDir>${salGeneratorPath}</outputBaseDir>
- </generator>
- </codeGenerators>
- <inspectDependencies>true</inspectDependencies>
- </configuration>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>org.opendaylight.mdsal</groupId>
- <artifactId>maven-sal-api-gen-plugin</artifactId>
- <version>${odl.sal.api.gen.plugin.version}</version>
- <type>jar</type>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>yang-jmx-generator-plugin</artifactId>
- <version>${odl.yang.jmx.generator.version}</version>
- </dependency>
- </dependencies>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-artifacts</id>
- <goals>
- <goal>attach-artifact</goal>
- </goals>
- <phase>package</phase>
- <configuration>
- <artifacts>
- <artifact>
- <file>${project.build.directory}/classes/initial/appc-provider.xml</file>
- <type>xml</type>
- <classifier>config</classifier>
- </artifact>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- <pluginManagement>
- <plugins>
- <!--This plugin's configuration is used to store Eclipse m2e settings
- only. It has no influence on the Maven build itself. -->
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <versionRange>[1.9.1,)</versionRange>
- <goals>
- <goal>add-source</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore />
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.openecomp.appc</groupId>
- <artifactId>appc-request-handler-api</artifactId>
- <version>1.1.0-SNAPSHOT</version>
- <type>bundle</type>
- <scope>provided</scope>
- <exclusions>
- <exclusion>
- <groupId>org.openecomp.appc</groupId>
- <artifactId>domain-model-lib</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.openecomp.appc</groupId>
- <artifactId>appc-common</artifactId>
- <version>${project.version}</version>
- <classifier>jar-with-dependencies</classifier>
- </dependency>
- <dependency>
- <groupId>org.openecomp.appc</groupId>
- <artifactId>appc-provider-model</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <!-- ADDED THIS ARTIFACT TO BE ABLE TO FIND org.openecomp.appc.domainmodel.lcm -->
- <dependency>
- <groupId>org.openecomp.appc</groupId>
- <artifactId>domain-model-lib</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>config-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-binding-config</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-binding-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-common-util</artifactId>
- </dependency>
- <dependency>
- <groupId>org.openecomp.sdnc.core</groupId>
- <artifactId>sli-common</artifactId>
- </dependency>
- <dependency>
- <groupId>org.openecomp.sdnc.core</groupId>
- <artifactId>sli-provider</artifactId>
- </dependency>
- <dependency>
- <artifactId>sal-test-model</artifactId>
- <groupId>org.opendaylight.controller</groupId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <artifactId>sal-rest-connector</artifactId>
- <groupId>org.opendaylight.netconf</groupId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-binding-broker-impl</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>sal-binding-broker-impl</artifactId>
- <classifier>tests</classifier>
- <version>${odl.mdsal.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <!-- TEMP CODE -->
- <dependency>
- <groupId>org.json</groupId>
- <artifactId>json</artifactId>
- </dependency>
- </dependencies>
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>appc-provider</artifactId>
+ <groupId>org.openecomp.appc</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>appc-provider-bundle</artifactId>
+ <packaging>bundle</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Export-Package>org.opendaylight.controller.config.yang.config.sample_provider.impl</Export-Package>
+ <Export-Package>org.openecomp.appc.provider</Export-Package>
+ <!-- <Import-Package>!groovy.lang,!javax.jms,!org.codehaus.commons.compiler,!org.codehaus.groovy.*,!org.codehaus.janino,!com.ibm.icu.*,!com.sun.faces.*,!org.apache.log,*;resolution:=optional</Import-Package> -->
+ <!-- <Embed-Dependency>appc-common,eelf-core,logback-core,logback-classic;scope=compile|runtime;inline=false,domain-model-lib,appc-command-executor-api,appc-request-handler-api</Embed-Dependency> -->
+ <Import-Package>
+ org.openecomp.appc.i18n,
+ org.openecomp.appc.logging,
+ org.openecomp.appc.util,
+ com.att.eelf.configuration,
+ com.att.eelf.i18n,
+ *;resolution:=optional
+ </Import-Package>
+ <Embed-Dependency>
+ appc-common;scope=compile|runtime;inline=false
+ </Embed-Dependency>
+ <Embed-Transitive>true</Embed-Transitive>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-maven-plugin</artifactId>
+ <version>${odl.yangtools.version}</version>
+ <executions>
+ <execution>
+ <id>config</id>
+ <goals>
+ <goal>generate-sources</goal>
+ </goals>
+ <configuration>
+ <codeGenerators>
+ <generator>
+ <codeGeneratorClass>org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator</codeGeneratorClass>
+ <outputBaseDir>${jmxGeneratorPath}</outputBaseDir>
+ <additionalConfiguration>
+ <namespaceToPackage1>urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang</namespaceToPackage1>
+ </additionalConfiguration>
+ </generator>
+ <generator>
+ <codeGeneratorClass>org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl</codeGeneratorClass>
+ <outputBaseDir>${salGeneratorPath}</outputBaseDir>
+ </generator>
+ </codeGenerators>
+ <inspectDependencies>true</inspectDependencies>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>maven-sal-api-gen-plugin</artifactId>
+ <version>${odl.sal.api.gen.plugin.version}</version>
+ <type>jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>yang-jmx-generator-plugin</artifactId>
+ <version>${odl.yang.jmx.generator.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>${project.build.directory}/classes/initial/appc-provider.xml</file>
+ <type>xml</type>
+ <classifier>config</classifier>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store Eclipse
+ m2e settings only. It has no influence on the Maven build itself. -->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <versionRange>[1.9.1,)</versionRange>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore />
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.openecomp.appc</groupId>
+ <artifactId>appc-request-handler-api</artifactId>
+ <version>${project.version}</version>
+ <type>bundle</type>
+ <scope>provided</scope>
+<!-- <exclusions> -->
+<!-- <exclusion> -->
+<!-- <groupId>org.openecomp.appc</groupId> -->
+<!-- <artifactId>domain-model-lib</artifactId> -->
+<!-- </exclusion> -->
+<!-- </exclusions> -->
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.appc</groupId>
+ <artifactId>appc-common</artifactId>
+ <version>${project.version}</version>
+<!-- <classifier>jar-with-dependencies</classifier> -->
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.appc</groupId>
+ <artifactId>appc-provider-model</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <!-- ADDED THIS ARTIFACT TO BE ABLE TO FIND org.openecomp.appc.domainmodel.lcm -->
+<!-- <dependency> -->
+<!-- <groupId>org.openecomp.appc</groupId> -->
+<!-- <artifactId>domain-model-lib</artifactId> -->
+<!-- <version>${project.version}</version> -->
+<!-- </dependency> -->
+
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>config-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-binding-config</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-binding-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-common-util</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdnc.core</groupId>
+ <artifactId>sli-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdnc.core</groupId>
+ <artifactId>sli-provider</artifactId>
+ </dependency>
+ <dependency>
+ <artifactId>sal-test-model</artifactId>
+ <groupId>org.opendaylight.controller</groupId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <artifactId>sal-rest-connector</artifactId>
+ <groupId>org.opendaylight.netconf</groupId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-binding-broker-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-binding-broker-impl</artifactId>
+ <classifier>tests</classifier>
+ <version>${odl.mdsal.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <!-- TEMP CODE -->
+ <dependency>
+ <groupId>org.json</groupId>
+ <artifactId>json</artifactId>
+ </dependency>
+ </dependencies>
</project>
diff --git a/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/AppcProvider.java b/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/AppcProvider.java
index c65cc656e..1177504d4 100644
--- a/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/AppcProvider.java
+++ b/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/AppcProvider.java
@@ -155,10 +155,7 @@ public class AppcProvider implements AutoCloseable, AppcProviderService {
rpcRegistry = rpcProviderRegistry;
if (rpcRegistry != null) {
- logger.info("rpcRegistry was not null");
rpcRegistration = rpcRegistry.addRpcImplementation(AppcProviderService.class, this);
- } else {
- logger.error("rpcRegistry WAS NULL");
}
logger.info(Msg.COMPONENT_INITIALIZED, appName, "provider");
@@ -263,5 +260,19 @@ public Future<RpcResult<ModifyConfigOutput>> modifyConfig(ModifyConfigInput inpu
RpcResult<SnapshotOutput> result = topology.snapshot(hdr, vnf);
return Futures.immediateFuture(result);
}
+
+
+ /**
+ * Checks status of a VM
+ */
+ @Override
+ public Future<RpcResult<VmstatuscheckOutput>> vmstatuscheck(VmstatuscheckInput input) {
+ CommonRequestHeader hdr = input.getCommonRequestHeader();
+ VnfResource vnf = input.getVnfResource();
+
+ TopologyService topology = new TopologyService(this);
+ RpcResult<VmstatuscheckOutput> result = topology.vmstatuscheck(hdr, vnf);
+ return Futures.immediateFuture(result);
+ }
}
diff --git a/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/AppcProviderClient.java b/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/AppcProviderClient.java
index 0224784d6..4dd026127 100644
--- a/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/AppcProviderClient.java
+++ b/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/AppcProviderClient.java
@@ -30,10 +30,15 @@ import org.openecomp.sdnc.sli.provider.SvcLogicService;
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;
import org.osgi.framework.ServiceReference;
+import org.slf4j.MDC;
import static com.att.eelf.configuration.Configuration.*;
import java.util.Properties;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.TimeZone;
public class AppcProviderClient {
@@ -44,15 +49,20 @@ public class AppcProviderClient {
public AppcProviderClient() {
BundleContext bctx = FrameworkUtil.getBundle(SvcLogicService.class).getBundleContext();
-
- // Get SvcLogicService reference
- ServiceReference sref = bctx.getServiceReference(SvcLogicService.NAME);
- if (sref != null) {
- svcLogic = (SvcLogicService) bctx.getService(sref);
-
- } else {
- LOG.warn("Cannot find service reference for " + SvcLogicService.NAME);
-
+ //Handle BundleContext returning null
+ if (bctx == null){
+ LOG.warn("Cannot find bundle context for " + SvcLogicService.NAME);
+ }
+ else{
+ // Get SvcLogicService reference
+ ServiceReference sref = bctx.getServiceReference(SvcLogicService.NAME);
+ if (sref != null) {
+ svcLogic = (SvcLogicService) bctx.getService(sref);
+
+ } else {
+ LOG.warn("Cannot find service reference for " + SvcLogicService.NAME);
+
+ }
}
}
@@ -64,10 +74,40 @@ public class AppcProviderClient {
public Properties execute(String module, String rpc, String version, String mode, Properties parms)
throws SvcLogicException {
+ /*
+ * Set End time for Metrics Logger
+ */
+ long startTime = System.currentTimeMillis();
+ TimeZone tz = TimeZone.getTimeZone("UTC");
+ DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
+ df.setTimeZone(tz);
+ String startTimeStr = df.format(new Date());
+ long endTime = System.currentTimeMillis();
+ long duration = endTime - startTime;
+ String endTimeStr = String.valueOf(endTime);
+ String durationStr = String.valueOf(duration);
+ String endTimeStrUTC = df.format(new Date());
+ MDC.put("EndTimestamp", endTimeStrUTC);
+ MDC.put("ElapsedTime", durationStr);
+ MDC.put("TargetEntity", "sli");
+ MDC.put("TargetServiceName", "execute");
+ MDC.put("ClassName", "org.openecomp.appc.provider.AppcProviderClient");
+
LOG.debug("Parameters passed to SLI: " + StringHelper.propertiesToString(parms));
metricsLogger.info("Parameters passed to SLI: " + StringHelper.propertiesToString(parms));
Properties respProps = svcLogic.execute(module, rpc, version, mode, parms);
+
+ /*
+ * Set End time for Metrics Logger
+ */
+ endTime = System.currentTimeMillis();
+ duration = endTime - startTime;
+ endTimeStr = String.valueOf(endTime);
+ durationStr = String.valueOf(duration);
+ endTimeStrUTC = df.format(new Date());
+ MDC.put("EndTimestamp", endTimeStrUTC);
+ MDC.put("ElapsedTime", durationStr);
LOG.debug("Parameters returned by SLI: " + StringHelper.propertiesToString(respProps));
metricsLogger.info("Parameters returned by SLI: " + StringHelper.propertiesToString(respProps));
diff --git a/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/AppcProviderLcm.java b/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/AppcProviderLcm.java
index 6d186ab5f..a340aa046 100644
--- a/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/AppcProviderLcm.java
+++ b/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/AppcProviderLcm.java
@@ -30,64 +30,10 @@ import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.Action;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.AppcProviderLcmService;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.AuditInput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.AuditOutput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.AuditOutputBuilder;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.CheckLockInput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.CheckLockOutput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.CheckLockOutputBuilder;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.EvacuateInput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.EvacuateOutput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.EvacuateOutputBuilder;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.HealthCheckInput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.HealthCheckOutput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.HealthCheckOutputBuilder;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.LiveUpgradeInput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.LiveUpgradeOutput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.LiveUpgradeOutputBuilder;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.LockInput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.LockOutput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.LockOutputBuilder;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.MigrateInput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.MigrateOutput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.MigrateOutputBuilder;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.ModifyConfigInput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.ModifyConfigOutput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.ModifyConfigOutputBuilder;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.RebuildInput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.RebuildOutput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.RebuildOutputBuilder;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.RestartInput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.RestartOutput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.RestartOutputBuilder;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.RollbackInput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.RollbackOutput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.RollbackOutputBuilder;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.SnapshotInput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.SnapshotOutput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.SnapshotOutputBuilder;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.SoftwareUploadInput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.SoftwareUploadOutput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.SoftwareUploadOutputBuilder;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.StopInput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.StopOutput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.StopOutputBuilder;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.SyncInput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.SyncOutput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.SyncOutputBuilder;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.TerminateInput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.TerminateOutput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.TerminateOutputBuilder;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.TestInput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.TestOutput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.TestOutputBuilder;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.UnlockInput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.UnlockOutput;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.UnlockOutputBuilder;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.status.Status;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.status.StatusBuilder;
+import org.opendaylight.yang.gen.v1.org.openecomp.appc.lcm.rev160108.common.header.CommonHeader;
+import org.opendaylight.yang.gen.v1.org.openecomp.appc.lcm.rev160108.*;
+import org.opendaylight.yang.gen.v1.org.openecomp.appc.lcm.rev160108.status.Status;
+import org.opendaylight.yang.gen.v1.org.openecomp.appc.lcm.rev160108.status.StatusBuilder;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.openecomp.appc.Constants;
@@ -153,13 +99,13 @@ public class AppcProviderLcm implements AutoCloseable, AppcProviderLcmService {
* @param rpcProviderRegistry
*/
@SuppressWarnings({
- "javadoc", "nls"
+ "javadoc", "nls"
})
public AppcProviderLcm(DataBroker dataBroker, NotificationProviderService notificationProviderService,
RpcProviderRegistry rpcProviderRegistry) {
String appName = configuration.getProperty(Constants.PROPERTY_APPLICATION_NAME);
- logger.info(Msg.COMPONENT_INITIALIZING, appName, "provider");
+ logger.info(Msg.COMPONENT_INITIALIZING, appName, "provider-lcm");
executor = Executors.newFixedThreadPool(1);
this.dataBroker = dataBroker;
@@ -242,7 +188,14 @@ public class AppcProviderLcm implements AutoCloseable, AppcProviderLcmService {
Status status = ValidationService.getInstance().validateInput(input.getCommonHeader(), input.getAction(), action);
if(null == status) {
try {
- RequestHandlerInput request = new RequestInputBuilder().requestContext().commonHeader(input.getCommonHeader()).actionIdentifiers(input.getActionIdentifiers()).payload(input.getPayload()).action(action).rpcName(rpcName).build();
+ RequestHandlerInput request = new RequestInputBuilder().requestContext()
+ .commonHeader(input.getCommonHeader())
+ .actionIdentifiers(input.getActionIdentifiers())
+ .payload(input.getPayload())
+ .action(action)
+ .rpcName(rpcName)
+ .build();
+
status = buildStatusWithDispatcherOutput(executeRequest(request));
logger.info(String.format("Execute of '%s' finished with status %s. Reason: %s", input.getActionIdentifiers(), status.getCode(), status.getMessage()));
} catch (ParseException e) {
@@ -405,7 +358,7 @@ public class AppcProviderLcm implements AutoCloseable, AppcProviderLcmService {
Status status = ValidationService.getInstance().validateInput(input.getCommonHeader(), input.getAction(), action);
if(null == status) {
try {
- RequestHandlerInput request = new RequestInputBuilder().requestContext().commonHeader(input.getCommonHeader()).actionIdentifiers(input.getActionIdentifiers()).action(action).rpcName(rpcName).build();
+ RequestHandlerInput request = new RequestInputBuilder().requestContext().commonHeader(input.getCommonHeader()).actionIdentifiers(input.getActionIdentifiers()).payload(input.getPayload()).action(action).rpcName(rpcName).build();
status = buildStatusWithDispatcherOutput(executeRequest(request));
logger.info(String.format("Execute of '%s' finished with status %s. Reason: %s", input.getActionIdentifiers(), status.getCode(), status.getMessage()));
} catch (ParseException e) {
@@ -447,7 +400,7 @@ public class AppcProviderLcm implements AutoCloseable, AppcProviderLcmService {
private RequestHandlerOutput executeRequest(RequestHandlerInput request){
RequestHandler handler = getRequestHandler();
- RequestHandlerOutput requestHandlerOutput=null;
+ RequestHandlerOutput requestHandlerOutput;
try {
requestHandlerOutput = handler.handleRequest(request);
} catch (Exception e) {
@@ -521,14 +474,96 @@ public class AppcProviderLcm implements AutoCloseable, AppcProviderLcmService {
return Futures.immediateFuture(result);
}
+ @Override
+ public Future<RpcResult<ConfigureOutput>> configure(ConfigureInput input) {
+ logger.debug("Input received : " + input.toString());
+ ConfigureOutputBuilder outputBuilder = new ConfigureOutputBuilder();
+ String action = Action.Configure.toString() ;
+ String rpcName = "configure";
+ Status status = ValidationService.getInstance().validateInput(input.getCommonHeader(), input.getAction(), action);
+ if(null == status) {
+ try {
+ RequestHandlerInput request = new RequestInputBuilder().requestContext().commonHeader(input.getCommonHeader()).actionIdentifiers(input.getActionIdentifiers()).payload(input.getPayload()).action(action).rpcName(rpcName).build();
+ status = buildStatusWithDispatcherOutput(executeRequest(request));
+ logger.info(String.format("Execute of '%s' finished with status %s. Reason: %s", input.getActionIdentifiers(), status.getCode(), status.getMessage()));
+ } catch (ParseException e) {
+ status = buildParsingErrorStatus(e);
+
+ LoggingUtils.logErrorMessage(
+ LoggingConstants.TargetNames.APPC_PROVIDER,
+ String.format(COMMON_ERROR_MESSAGE_TEMPLATE, action, e.getMessage()),
+ this.getClass().getName());
+
+ }
+ }
+ outputBuilder.setCommonHeader(input.getCommonHeader());
+ outputBuilder.setStatus(status);
+ RpcResult<ConfigureOutput> result = RpcResultBuilder.<ConfigureOutput> status(true).withResult(outputBuilder.build()).build();
+ return Futures.immediateFuture(result);
+ }
+
+ @Override
+ public Future<RpcResult<ConfigModifyOutput>> configModify(ConfigModifyInput input) {
+ logger.debug("Input received : " + input.toString());
+ ConfigModifyOutputBuilder outputBuilder = new ConfigModifyOutputBuilder();
+ String action = Action.ConfigModify.toString() ;
+ String rpcName = "config-modify";
+ Status status = ValidationService.getInstance().validateInput(input.getCommonHeader(), input.getAction(), action);
+ if(null == status) {
+ try {
+ RequestHandlerInput request = new RequestInputBuilder().requestContext().commonHeader(input.getCommonHeader()).actionIdentifiers(input.getActionIdentifiers()).payload(input.getPayload()).action(action).rpcName(rpcName).build();
+ status = buildStatusWithDispatcherOutput(executeRequest(request));
+ logger.info(String.format("Execute of '%s' finished with status %s. Reason: %s", input.getActionIdentifiers(), status.getCode(), status.getMessage()));
+ } catch (ParseException e) {
+ status = buildParsingErrorStatus(e);
+
+ LoggingUtils.logErrorMessage(
+ LoggingConstants.TargetNames.APPC_PROVIDER,
+ String.format(COMMON_ERROR_MESSAGE_TEMPLATE, action, e.getMessage()),
+ this.getClass().getName());
+
+ }
+ }
+ outputBuilder.setCommonHeader(input.getCommonHeader());
+ outputBuilder.setStatus(status);
+ RpcResult<ConfigModifyOutput> result = RpcResultBuilder.<ConfigModifyOutput> status(true).withResult(outputBuilder.build()).build();
+ return Futures.immediateFuture(result);
+ }
+
+ @Override
+ public Future<RpcResult<ConfigScaleoutOutput>> configScaleout(ConfigScaleoutInput input) {
+ logger.debug("Input received : " + input.toString());
+ ConfigScaleoutOutputBuilder outputBuilder = new ConfigScaleoutOutputBuilder();
+ String action = Action.ConfigScaleOut.toString() ;
+ String rpcName = "config-scaleout";
+ Status status = ValidationService.getInstance().validateInput(input.getCommonHeader(), input.getAction(), action);
+ if(null == status) {
+ try {
+ RequestHandlerInput request = new RequestInputBuilder().requestContext().commonHeader(input.getCommonHeader()).actionIdentifiers(input.getActionIdentifiers()).payload(input.getPayload()).action(action).rpcName(rpcName).build();
+ status = buildStatusWithDispatcherOutput(executeRequest(request));
+ logger.info(String.format("Execute of '%s' finished with status %s. Reason: %s", input.getActionIdentifiers(), status.getCode(), status.getMessage()));
+ } catch (ParseException e) {
+ status = buildParsingErrorStatus(e);
+ LoggingUtils.logErrorMessage(
+ LoggingConstants.TargetNames.APPC_PROVIDER,
+ String.format(COMMON_ERROR_MESSAGE_TEMPLATE, action, e.getMessage()),
+ this.getClass().getName());
+
+ }
+ }
+ outputBuilder.setCommonHeader(input.getCommonHeader());
+ outputBuilder.setStatus(status);
+ RpcResult<ConfigScaleoutOutput> result = RpcResultBuilder.<ConfigScaleoutOutput> status(true).withResult(outputBuilder.build()).build();
+ return Futures.immediateFuture(result);
+ }
@Override
- public Future<RpcResult<ModifyConfigOutput>> modifyConfig(ModifyConfigInput input) {
+ public Future<RpcResult<ConfigRestoreOutput>> configRestore(ConfigRestoreInput input) {
logger.debug("Input received : " + input.toString());
- ModifyConfigOutputBuilder outputBuilder = new ModifyConfigOutputBuilder();
- String action = Action.ModifyConfig.toString() ;
- String rpcName = "modify-config";
+ ConfigRestoreOutputBuilder outputBuilder = new ConfigRestoreOutputBuilder();
+ String action = Action.ConfigRestore.toString() ;
+ String rpcName = "config-restore";
Status status = ValidationService.getInstance().validateInput(input.getCommonHeader(), input.getAction(), action);
if(null == status) {
try {
@@ -547,7 +582,7 @@ public class AppcProviderLcm implements AutoCloseable, AppcProviderLcmService {
}
outputBuilder.setCommonHeader(input.getCommonHeader());
outputBuilder.setStatus(status);
- RpcResult<ModifyConfigOutput> result = RpcResultBuilder.<ModifyConfigOutput> status(true).withResult(outputBuilder.build()).build();
+ RpcResult<ConfigRestoreOutput> result = RpcResultBuilder.<ConfigRestoreOutput> status(true).withResult(outputBuilder.build()).build();
return Futures.immediateFuture(result);
}
@@ -608,6 +643,46 @@ public class AppcProviderLcm implements AutoCloseable, AppcProviderLcmService {
return Futures.immediateFuture(result);
}
+ /**
+ * Starts a specific VNF
+ *
+ * @see org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.AppcProviderLcmService#start(StartInput)
+ */
+ @Override
+ public Future<RpcResult<StartOutput>> start(StartInput input) {
+ logger.debug("Input received : " + input.toString());
+
+ StartOutputBuilder outputBuilder = new StartOutputBuilder();
+ String action = Action.Start.toString() ;
+ String rpcName = Action.Start.name().toLowerCase();
+ Status status = ValidationService.getInstance().validateInput(input.getCommonHeader(), input.getAction(), action);
+ if(null == status) {
+ try {
+ RequestHandlerInput request = new RequestInputBuilder().requestContext()
+ .commonHeader(input.getCommonHeader())
+ .actionIdentifiers(input.getActionIdentifiers())
+ .payload(input.getPayload())
+ .action(action)
+ .rpcName(rpcName).build();
+ status = buildStatusWithDispatcherOutput(executeRequest(request));
+ logger.info(String.format("Execute of '%s' finished with status %s. Reason: %s", input.getActionIdentifiers(), status.getCode(), status.getMessage()));
+ } catch (ParseException e) {
+ status = buildParsingErrorStatus(e);
+
+ LoggingUtils.logErrorMessage(
+ LoggingConstants.TargetNames.APPC_PROVIDER,
+ String.format(COMMON_ERROR_MESSAGE_TEMPLATE, action, e.getMessage()),
+ this.getClass().getName());
+
+ }
+ }
+ outputBuilder.setCommonHeader(input.getCommonHeader());
+ outputBuilder.setStatus(status);
+ RpcResult<StartOutput> result = RpcResultBuilder.<StartOutput> status(true).withResult(outputBuilder.build()).build();
+ return Futures.immediateFuture(result);
+ }
+
+
@Override
public Future<RpcResult<AuditOutput>> audit(AuditInput input) {
logger.debug("Input received : " + input.toString());
@@ -617,7 +692,7 @@ public class AppcProviderLcm implements AutoCloseable, AppcProviderLcmService {
Status status = ValidationService.getInstance().validateInput(input.getCommonHeader(), input.getAction(), action);
if(null == status) {
try {
- RequestHandlerInput request = new RequestInputBuilder().requestContext().commonHeader(input.getCommonHeader()).actionIdentifiers(input.getActionIdentifiers()).action(action).rpcName(rpcName).build();
+ RequestHandlerInput request = new RequestInputBuilder().requestContext().commonHeader(input.getCommonHeader()).actionIdentifiers(input.getActionIdentifiers()).payload(input.getPayload()).action(action).rpcName(rpcName).build();
status = buildStatusWithDispatcherOutput(executeRequest(request));
logger.info(String.format("Execute of '%s' finished with status %s. Reason: %s", input.getActionIdentifiers(), status.getCode(), status.getMessage()));
} catch (ParseException e) {
@@ -813,6 +888,92 @@ public class AppcProviderLcm implements AutoCloseable, AppcProviderLcmService {
return Futures.immediateFuture(result);
}
+ @Override
+ public Future<RpcResult<ConfigBackupOutput>> configBackup(ConfigBackupInput input) {
+ logger.debug("Input received : " + input.toString());
+ ConfigBackupOutputBuilder outputBuilder = new ConfigBackupOutputBuilder();
+ String action = Action.ConfigBackup.toString() ;
+ String rpcName = Action.ConfigBackup.name().toLowerCase();
+ Status status = ValidationService.getInstance().validateInput(input.getCommonHeader(), input.getAction(), action);
+ if(null == status) {
+ try {
+ RequestHandlerInput request = new RequestInputBuilder().requestContext().commonHeader(input.getCommonHeader()).actionIdentifiers(input.getActionIdentifiers()).action(action).rpcName(rpcName).build();
+ status = buildStatusWithDispatcherOutput(executeRequest(request));
+ logger.info(String.format("Execute of '%s' finished with status %s. Reason: %s", input.getActionIdentifiers(), status.getCode(), status.getMessage()));
+ } catch (ParseException e) {
+ status = buildParsingErrorStatus(e);
+
+ LoggingUtils.logErrorMessage(
+ LoggingConstants.TargetNames.APPC_PROVIDER,
+ String.format(COMMON_ERROR_MESSAGE_TEMPLATE, action, e.getMessage()),
+ this.getClass().getName());
+
+ }
+ }
+ outputBuilder.setCommonHeader(input.getCommonHeader());
+ outputBuilder.setStatus(status);
+ RpcResult<ConfigBackupOutput> result = RpcResultBuilder.<ConfigBackupOutput> status(true).withResult(outputBuilder.build()).build();
+ return Futures.immediateFuture(result);
+ }
+
+
+ @Override
+ public Future<RpcResult<ConfigBackupDeleteOutput>> configBackupDelete(ConfigBackupDeleteInput input) {
+ logger.debug("Input received : " + input.toString());
+ ConfigBackupDeleteOutputBuilder outputBuilder = new ConfigBackupDeleteOutputBuilder();
+ String action = Action.ConfigBackupDelete.toString() ;
+ String rpcName = Action.ConfigBackupDelete.name().toLowerCase();
+ Status status = ValidationService.getInstance().validateInput(input.getCommonHeader(), input.getAction(), action);
+ if(null == status) {
+ try {
+ RequestHandlerInput request = new RequestInputBuilder().requestContext().commonHeader(input.getCommonHeader()).actionIdentifiers(input.getActionIdentifiers()).action(action).rpcName(rpcName).build();
+ status = buildStatusWithDispatcherOutput(executeRequest(request));
+ logger.info(String.format("Execute of '%s' finished with status %s. Reason: %s", input.getActionIdentifiers(), status.getCode(), status.getMessage()));
+ } catch (ParseException e) {
+ status = buildParsingErrorStatus(e);
+
+ LoggingUtils.logErrorMessage(
+ LoggingConstants.TargetNames.APPC_PROVIDER,
+ String.format(COMMON_ERROR_MESSAGE_TEMPLATE, action, e.getMessage()),
+ this.getClass().getName());
+
+ }
+ }
+ outputBuilder.setCommonHeader(input.getCommonHeader());
+ outputBuilder.setStatus(status);
+ RpcResult<ConfigBackupDeleteOutput> result = RpcResultBuilder.<ConfigBackupDeleteOutput> status(true).withResult(outputBuilder.build()).build();
+ return Futures.immediateFuture(result);
+ }
+
+
+ @Override
+ public Future<RpcResult<ConfigExportOutput>> configExport(ConfigExportInput input) {
+ logger.debug("Input received : " + input.toString());
+ ConfigExportOutputBuilder outputBuilder = new ConfigExportOutputBuilder();
+ String action = Action.ConfigExport.toString() ;
+ String rpcName = Action.ConfigExport.name().toLowerCase();
+ Status status = ValidationService.getInstance().validateInput(input.getCommonHeader(), input.getAction(), action);
+ if(null == status) {
+ try {
+ RequestHandlerInput request = new RequestInputBuilder().requestContext().commonHeader(input.getCommonHeader()).actionIdentifiers(input.getActionIdentifiers()).action(action).rpcName(rpcName).build();
+ status = buildStatusWithDispatcherOutput(executeRequest(request));
+ logger.info(String.format("Execute of '%s' finished with status %s. Reason: %s", input.getActionIdentifiers(), status.getCode(), status.getMessage()));
+ } catch (ParseException e) {
+ status = buildParsingErrorStatus(e);
+
+ LoggingUtils.logErrorMessage(
+ LoggingConstants.TargetNames.APPC_PROVIDER,
+ String.format(COMMON_ERROR_MESSAGE_TEMPLATE, action, e.getMessage()),
+ this.getClass().getName());
+
+ }
+ }
+ outputBuilder.setCommonHeader(input.getCommonHeader());
+ outputBuilder.setStatus(status);
+ RpcResult<ConfigExportOutput> result = RpcResultBuilder.<ConfigExportOutput> status(true).withResult(outputBuilder.build()).build();
+ return Futures.immediateFuture(result);
+ }
+
private String convertActionNameToUrl(String action) {
String regex = "([a-z])([A-Z]+)";
String replacement = "$1-$2";
diff --git a/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/lcm/util/RequestInputBuilder.java b/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/lcm/util/RequestInputBuilder.java
index 248492df8..0a535f28a 100644
--- a/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/lcm/util/RequestInputBuilder.java
+++ b/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/lcm/util/RequestInputBuilder.java
@@ -23,11 +23,12 @@ package org.openecomp.appc.provider.lcm.util;
import java.text.ParseException;
import java.text.SimpleDateFormat;
+import java.util.TimeZone;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.Payload;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.action.identifiers.ActionIdentifiers;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.common.header.CommonHeader;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.common.header.common.header.Flags;
+import org.opendaylight.yang.gen.v1.org.openecomp.appc.lcm.rev160108.Payload;
+import org.opendaylight.yang.gen.v1.org.openecomp.appc.lcm.rev160108.action.identifiers.ActionIdentifiers;
+import org.opendaylight.yang.gen.v1.org.openecomp.appc.lcm.rev160108.common.header.CommonHeader;
+import org.opendaylight.yang.gen.v1.org.openecomp.appc.lcm.rev160108.common.header.common.header.Flags;
import org.openecomp.appc.domainmodel.lcm.Flags.Mode;
import org.openecomp.appc.domainmodel.lcm.RequestContext;
import org.openecomp.appc.domainmodel.lcm.VNFOperation;
@@ -92,6 +93,7 @@ public class RequestInputBuilder {
if(null != commonHeader.getTimestamp()) {
SimpleDateFormat format = new SimpleDateFormat(FORMAT);
format.setLenient(false);
+ format.setTimeZone(TimeZone.getTimeZone("UTC"));
header.setTimestamp(format.parse(commonHeader.getTimestamp().getValue()).toInstant());
}else{
throw new ParseException("Missing mandatory parameter : timestamp " , 0);
diff --git a/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/lcm/util/ValidationService.java b/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/lcm/util/ValidationService.java
index fe2fdc142..a16ab0bed 100644
--- a/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/lcm/util/ValidationService.java
+++ b/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/lcm/util/ValidationService.java
@@ -21,10 +21,10 @@
package org.openecomp.appc.provider.lcm.util;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.Action;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.common.header.CommonHeader;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.status.Status;
-import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160108.status.StatusBuilder;
+import org.opendaylight.yang.gen.v1.org.openecomp.appc.lcm.rev160108.Action;
+import org.opendaylight.yang.gen.v1.org.openecomp.appc.lcm.rev160108.common.header.CommonHeader;
+import org.opendaylight.yang.gen.v1.org.openecomp.appc.lcm.rev160108.status.Status;
+import org.opendaylight.yang.gen.v1.org.openecomp.appc.lcm.rev160108.status.StatusBuilder;
import org.openecomp.appc.Constants;
import org.openecomp.appc.configuration.Configuration;
import org.openecomp.appc.configuration.ConfigurationFactory;
diff --git a/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/topology/TopologyService.java b/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/topology/TopologyService.java
index ea88982c1..166fb9612 100644
--- a/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/topology/TopologyService.java
+++ b/appc-provider/appc-provider-bundle/src/main/java/org/openecomp/appc/provider/topology/TopologyService.java
@@ -51,6 +51,8 @@ import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160104.UUID;
import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160104.common.request.header.CommonRequestHeader;
import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160104.vnf.resource.VnfResource;
import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160104.config.payload.ConfigPayload;
+import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160104.VmstatuscheckOutput;
+import org.opendaylight.yang.gen.v1.org.openecomp.appc.rev160104.VmstatuscheckOutputBuilder;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.openecomp.appc.Constants;
@@ -616,6 +618,83 @@ public class TopologyService {
RpcResultBuilder.<SnapshotOutput> status(true).withResult(sob.build()).build();
return rpcResult;
}
+
+/**************************************************/
+
+ public RpcResult<VmstatuscheckOutput> vmstatuscheck(CommonRequestHeader hdr, VnfResource vnf) {
+ long startTime = System.currentTimeMillis();
+ String requestId = hdr.getServiceRequestId();
+
+ MDC.clear();
+ MDC.put(MDC_REMOTE_HOST, "");
+ MDC.put(MDC_KEY_REQUEST_ID, requestId);
+ MDC.put(MDC_SERVICE_NAME, "App-C Provider:vmstatuscheck");
+ MDC.put(MDC_SERVICE_INSTANCE_ID, "");
+ try {
+ MDC.put(MDC_SERVER_FQDN, InetAddress.getLocalHost().getHostName());
+ MDC.put(MDC_SERVER_IP_ADDRESS, InetAddress.getLocalHost().getHostAddress());
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ MDC.put(MDC_INSTANCE_UUID, java.util.UUID.randomUUID().toString());
+ MDC.put(MDC_ALERT_SEVERITY, "0");
+ logger.info(String.format("Starting VMSTATUSCHECK for request with id [%s]", requestId));
+
+ performanceLogger.info(String.format("Performance Logger: App-C vmstatuscheck initiated. Start Time: [%s]. Request ID: [%s]", startTime, requestId));
+ auditLogger.info(String.format("Audit Logger: App-C vmstatuscheck initiated. Start Time: [%s]. Request ID: [%s]", startTime, requestId));
+ metricsLogger.info(String.format("Metrics Logger: App-C vmstatuscheck initiated. Start Time: [%s]. Request ID: [%s]", startTime, requestId));
+
+ /*
+ * Copy any needed inputs or other values into the properties to be passed to the DG model
+ */
+ UUID vmId = vnf.getVmId();
+ Properties properties = new Properties();
+ properties.put(Constants.CONTEXT_ACTION, "vmstatuschecking");
+ properties.put(Constants.CONTEXT_REQID, requestId);
+ properties.put(Constants.CONTEXT_VMID, vmId.getValue());
+ properties.put(Constants.STATUS_GETTER, "checking");
+
+
+
+
+ UUID identityUrl = vnf.getIdentityUrl();
+ if (identityUrl != null) {
+ properties.put(Constants.CONTEXT_IDENTITY_URL, identityUrl.getValue());
+ }
+ /*
+ * Attempt to call the DG with the appropriate properties
+ */
+ boolean success = callGraph(properties);
+
+ /*
+ * Generate the appropriate response
+ */
+ String statusStr = success ? "SUCCESS" : "FAILURE";
+ String infomsg =
+ String.format("VMSTATUSCHECK '%s' finished with status %s. Reason: %s", requestId, statusStr, reason);
+ logger.info(infomsg);
+ long endTime = System.currentTimeMillis();
+ auditLogger.info(String.format("Audit Logger: VMSTATUSCHECK '%s' finished with status %s. Start Time: [%s]. End Time: [%s]. Request ID: [%s]. Reason:%s", requestId, statusStr, startTime, endTime, requestId, reason));
+ metricsLogger.info(String.format("Metrics Logger: VMSTATUSCHECK '%s' finished with status %s. Start Time: [%s]. End Time: [%s]. Request ID: [%s]. Reason:%s", requestId, statusStr, startTime, endTime, requestId, reason));
+ //logger.info(String.format("Step1 [%s]", Constants.STATUS_GETTER));
+ String tempstring2 = properties.getProperty(Constants.STATUS_GETTER).trim();
+ //logger.info(String.format("Step2 [%s]", tempstring2));
+
+
+ VmstatuscheckOutputBuilder vob = new VmstatuscheckOutputBuilder();
+ long duration = System.currentTimeMillis() - startTime;
+ vob.setCommonResponseHeader(ResponseHeaderBuilder.buildHeader(success, requestId, reason, duration));
+ vob.setStatMsg(tempstring2);
+
+ // Status must be set to true to indicate that our return is expected
+ RpcResult<VmstatuscheckOutput> rpcResult =
+ RpcResultBuilder.<VmstatuscheckOutput> status(true).withResult(vob.build()).build();
+ return rpcResult;
+ }
+
+ /*************************************************/
+
+
private boolean callGraph(Properties props) {
String moduleName = configuration.getProperty(Constants.PROPERTY_MODULE_NAME);
diff --git a/appc-provider/appc-provider-features/src/main/resources/features.xml b/appc-provider/appc-provider-features/src/main/resources/features.xml
index f67333648..c9a1bf424 100644
--- a/appc-provider/appc-provider-features/src/main/resources/features.xml
+++ b/appc-provider/appc-provider-features/src/main/resources/features.xml
@@ -25,13 +25,9 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.2.0 http://karaf.apache.org/xmlns/features/v1.2.0">
-<!-- <repository>mvn:org.opendaylight.mdsal/features-mdsal/${odl.mdsal.version}/xml/features</repository> -->
<repository>mvn:org.opendaylight.mdsal/features-mdsal/${odl.mdsal.features.version}/xml/features</repository>
<feature name='appc-provider' description="application controller" version='${project.version}'>
- <!--<feature version="${project.version}">appc-aai-adapter</feature>-->
- <!-- Most applications will have a dependency on the ODL MD-SAL Broker -->
- <!-- <feature version="${broker-mdsal.version}">odl-mdsal-broker</feature> -->
<feature version="${broker-mdsal.version}">odl-mdsal-broker</feature>
<bundle>mvn:org.openecomp.appc/appc-provider-model/${project.version}</bundle>
<bundle>mvn:org.openecomp.appc/appc-provider-bundle/${project.version}</bundle>
diff --git a/appc-provider/appc-provider-model/pom.xml b/appc-provider/appc-provider-model/pom.xml
index 492c30517..23685725e 100644
--- a/appc-provider/appc-provider-model/pom.xml
+++ b/appc-provider/appc-provider-model/pom.xml
@@ -1,88 +1,118 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>appc-provider</artifactId>
- <groupId>org.openecomp.appc</groupId>
- <version>1.1.0-SNAPSHOT</version>
- </parent>
- <artifactId>appc-provider-model</artifactId>
- <packaging>bundle</packaging>
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>appc-provider</artifactId>
+ <groupId>org.openecomp.appc</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>appc-provider-model</artifactId>
+ <packaging>bundle</packaging>
- <build>
+ <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Import-Package>*</Import-Package>
- </instructions>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-maven-plugin</artifactId>
- <version>${odl.yangtools.version}</version>
- <dependencies>
- <dependency>
- <groupId>org.opendaylight.mdsal</groupId>
- <artifactId>maven-sal-api-gen-plugin</artifactId>
- <version>${odl.sal.api.gen.plugin.version}</version>
- <type>jar</type>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <goals>
- <goal>generate-sources</goal>
- </goals>
- <configuration>
- <yangFilesRootDir>${yang.file.directory}</yangFilesRootDir>
- <codeGenerators>
- <generator>
- <codeGeneratorClass>org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl</codeGeneratorClass>
- <outputBaseDir>${salGeneratorPath}</outputBaseDir>
- </generator>
- </codeGenerators>
- <inspectDependencies>true</inspectDependencies>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.12</version>
- <executions>
- <execution>
- <id>add-generated-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <!-- project.build.directory defaults to be the "target" folder -->
- <source>${project.build.directory}/generated-sources/yang-gen-sal</source>
- </sources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.opendaylight.mdsal</groupId>
- <artifactId>yang-binding</artifactId>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-common</artifactId>
- </dependency>
- </dependencies>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Import-Package>*</Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-maven-plugin</artifactId>
+ <version>${odl.yangtools.version}</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>maven-sal-api-gen-plugin</artifactId>
+ <version>${odl.sal.api.gen.plugin.version}</version>
+ <type>jar</type>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate-sources</goal>
+ </goals>
+ <configuration>
+ <yangFilesRootDir>${yang.file.directory}</yangFilesRootDir>
+ <codeGenerators>
+ <generator>
+ <codeGeneratorClass>org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl</codeGeneratorClass>
+ <outputBaseDir>${salGeneratorPath}</outputBaseDir>
+ </generator>
+ </codeGenerators>
+ <inspectDependencies>true</inspectDependencies>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- <plugin> -->
+ <!-- <groupId>org.codehaus.mojo</groupId> -->
+ <!-- <artifactId>build-helper-maven-plugin</artifactId> -->
+ <!-- <version>1.12</version> -->
+ <!-- <executions> -->
+ <!-- <execution> -->
+ <!-- <id>add-generated-source</id> -->
+ <!-- <phase>generate-sources</phase> -->
+ <!-- <goals> -->
+ <!-- <goal>add-source</goal> -->
+ <!-- </goals> -->
+ <!-- <configuration> -->
+ <!-- <sources> -->
+ <!-- project.build.directory defaults to be the "target" folder -->
+ <!-- <source>${project.build.directory}/generated-sources/yang-gen-sal</source> -->
+ <!-- </sources> -->
+ <!-- </configuration> -->
+ <!-- </execution> -->
+ <!-- </executions> -->
+ <!-- </plugin> -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-install-plugin</artifactId>
+ <version>2.5.2</version>
+ <executions>
+ <execution>
+ <id>yang</id>
+ <phase>initialize</phase>
+ <goals>
+ <goal>install-file</goal>
+ </goals>
+ <configuration>
+ <file>${project.basedir}/src/main/yang/appc-provider-lcm.yang</file>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>${project.artifactId}</artifactId>
+ <version>${project.version}</version>
+ <packaging>yang</packaging>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>yang-binding</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-inet-types</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.model</groupId>
+ <artifactId>ietf-yang-types</artifactId>
+ </dependency>
+ </dependencies>
</project>
diff --git a/appc-provider/appc-provider-model/src/main/yang/appc-provider-lcm.yang b/appc-provider/appc-provider-model/src/main/yang/appc-provider-lcm.yang
index 6f2d0b480..422b3197b 100644
--- a/appc-provider/appc-provider-model/src/main/yang/appc-provider-lcm.yang
+++ b/appc-provider/appc-provider-model/src/main/yang/appc-provider-lcm.yang
@@ -19,7 +19,7 @@
module appc-provider-lcm {
yang-version 1;
- namespace "org:openecomp:appc";
+ namespace "org:openecomp:appc:lcm";
prefix appc-provider-lcm;
organization "Copyright 2017 AT&T Intellectual Property.";
@@ -43,47 +43,11 @@ module appc-provider-lcm {
* APP-C controller functions.
**********************************************************************************/
- /*
- * Define a common definition of a UUID
- */
- typedef UUID {
- type string {
- length "1..255";
- }
- description "Universally Unique ID";
- }
-
- /*
- * Define the name of the provider region/LCP to connect to
- */
- typedef LCP {
- type string {
- length "1..255";
- }
- description "The local control plane name (OpenStack region name) of the provider";
- }
-
- /*
- * Define a common definition of a time stamp (expressed as a formatted string) as follows
- *
- * yyyy-MM-dd HH:mm:ss.SSSSSSSS
- *
- * yyyy ...... exactly 4 digit year, e.g., 2015
- * MM ........ 1 or 2 digit month of year, e.g., 7
- * dd ........ 1 or 2 digit day of month, e.g., 29
- * HH ........ 1 or 2 digit hour of day (24-hour clock) in UTC, e.g., 17
- * mm ........ 1 or 2 digit minute of the hour, e.g. 31
- * ss ........ 1 or 2 digit seconds of the minute, e.g., 28
- * SSSSSS .... 1-6 digit microseconds
- */
- typedef TIMESTAMP {
- type string {
- length "16..28";
- pattern "[0-9]{4}-[0-9]{1,2}-[0-9]{1,2} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}.[0-9]{1,6}";
- }
- }
+
typedef ZULU {
+ description "Define a common definition of a time stamp (expressed as a formatted
+ string) as follows yyyy-MM-ddTHH:mm:ss.SSSSSSSSZ";
type string {
length "16..28";
pattern "[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}T[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}.[0-9]{1,6}Z";
@@ -96,27 +60,34 @@ module appc-provider-lcm {
}
typedef action {
- type enumeration {
- enum "Restart";
- enum "Rebuild";
- enum "Migrate";
- enum "Evacuate";
- enum "Snapshot";
- enum "Rollback";
- enum "Sync";
- enum "Audit";
- enum "Stop";
- enum "Terminate";
- enum "SoftwareUpload";
- enum "HealthCheck";
- enum "LiveUpgrade";
- enum "ModifyConfig";
- enum "Lock";
- enum "Unlock";
- enum "Test";
- enum "CheckLock";
- }
- description "The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate";
+ type enumeration {
+ enum "Restart";
+ enum "Rebuild";
+ enum "Migrate";
+ enum "Evacuate";
+ enum "Snapshot";
+ enum "Rollback";
+ enum "Sync";
+ enum "Audit";
+ enum "Stop";
+ enum "Start";
+ enum "Terminate";
+ enum "SoftwareUpload";
+ enum "HealthCheck";
+ enum "LiveUpgrade";
+ enum "Lock";
+ enum "Unlock";
+ enum "Test";
+ enum "CheckLock";
+ enum "Configure";
+ enum "ConfigModify";
+ enum "ConfigScaleOut";
+ enum "ConfigRestore";
+ enum "ConfigBackup";
+ enum "ConfigBackupDelete";
+ enum "ConfigExport";
+ }
+ description "The action to be taken by APP-C, e.g. Restart, Rebuild, Migrate";
}
/**********************************************************************************
@@ -127,27 +98,7 @@ module appc-provider-lcm {
* (called the service-request-id) is meaningful to the caller and is included on
* all responses from the services.
**********************************************************************************/
- grouping common-request-header {
- description "A common header for all requests";
- container common-request-header {
- leaf service-request-id {
- description "An identifier meaningful to the caller to correlate all responses";
- type string;
- mandatory true;
- }
-
- leaf time-to-live {
- description "The alloted time to perform the operation, in seconds. If the
- operation cannot be completed in this amount of time, the operation is
- aborted. If set to zero, no timeout exists and the operation will continue
- until it completes or fails. If omitted, the default value of 0 is used.";
- type uint32 {
- range "0..86400";
- }
- mandatory false;
- }
- }
- }
+
/**********************************************************************************
* Basic manipulation of a VNF (or VM) will typically include querying the current
@@ -157,27 +108,7 @@ module appc-provider-lcm {
* information is used across all of these services, so it has been defined as a
* common structure here and is referenced in the appropriate RPC definitions.
**********************************************************************************/
- grouping vnf-resource {
- description "The data that uniquely identifies a virtual network function (or vm)";
- container vnf-resource {
- leaf vm-id {
- description "The UUID of the resource. For backwards compatibility, this can be
- the self-link URL of the VM.";
- type UUID;
- mandatory true;
- }
- leaf identity-url {
- description "The identity url used to access the resource";
- type UUID;
- mandatory false;
- }
- leaf tenant-id {
- description "The id of the provider tenant that owns the resource";
- type string;
- mandatory false;
- }
- }
- }
+
/**********************************************************************************
* All responses will include this standard header
@@ -185,32 +116,7 @@ module appc-provider-lcm {
* The standard response header includes the time of completion as well as a
* success|failure indication
**********************************************************************************/
- grouping common-response-header {
- description "A common header for all responses defining success or failure
- and the time stamp when completed";
- container common-response-header {
- leaf service-request-id {
- description "An identifier meaningful to the caller to correlate all responses";
- type string;
- }
- leaf success {
- description "True indicates the request was successful";
- type boolean;
- }
- leaf reason {
- description "If success=false, the failure reason. Otherwise, undefined.";
- type string;
- }
- leaf completed {
- description "The formatted time stamp when the operation was completed.";
- type TIMESTAMP;
- }
- leaf duration {
- description "The amount of time used (in seconds) to process the request";
- type uint32;
- }
- }
- }
+
/**********************************************************************************
@@ -219,43 +125,55 @@ module appc-provider-lcm {
* The standard common header is used to define a correlation identification for
* the request that is returned on all responses.
**********************************************************************************/
- grouping common-header {
+
+
+
+ grouping common-header {
+ description "A common header for all APP-C requests";
+ container common-header {
description "A common header for all APP-C requests";
- container common-header {
- description "A common header for all APP-C requests";
- leaf timestamp {
- description "timestamp is in ISO 8601 timestamp format ZULU offset";
- type ZULU;
- mandatory true;
- }
+ leaf timestamp {
+ description "timestamp is in ISO 8601 timestamp format ZULU offset";
+ type ZULU;
+ mandatory true;
+ }
- leaf api-ver {
- description "api-ver is the API version identifier. A given release of APPC should support all previous versions of APPC API (correlate with general requirements)";
- type string {
- pattern "[2]\.\d\d"{
- error-message "API Version 2.XX is supported at this end point";
- }
+ leaf api-ver {
+ description "api-ver is the API version identifier. A given release of APPC
+ should support all previous versions of APPC API (correlate with
+ general requirements)";
+ type string {
+ pattern "[2]\.\d\d" {
+ error-message "API Version 2.XX is supported at this end point";
}
- mandatory true;
}
+ mandatory true;
+ }
- leaf originator-id {
- description "originator-id an identifier of the calling system which can be used addressing purposes, i.e. returning asynchronous response to the proper destination over DMaaP (especially in case of multiple consumers of APP-C APIs)";
- type string;
- mandatory true;
- }
+ leaf originator-id {
+ description "originator-id an identifier of the calling system which can be
+ used addressing purposes, i.e. returning asynchronous response
+ to the proper destination over DMaaP (especially in case of multiple
+ consumers of APP-C APIs)";
+ type string;
+ mandatory true;
+ }
- leaf request-id {
- description "UUID for the request ID. An OSS/BSS identifier for the request that caused the current action. Multiple API calls may be made with the same request-id The request-id shall be recorded throughout the operations on a single request";
- type string;
- mandatory true;
- }
+ leaf request-id {
+ description "UUID for the request ID. An OSS/BSS identifier for the request
+ that caused the current action. Multiple API calls may be made
+ with the same request-id The request-id shall be recorded throughout
+ the operations on a single request";
+ type string;
+ mandatory true;
+ }
- leaf sub-request-id {
- description "Uniquely identifies a specific LCM action. It is persistent over the life-cycle of a single request";
- type string;
- mandatory false;
- }
+ leaf sub-request-id {
+ description "Uniquely identifies a specific LCM action. It is persistent over
+ the life-cycle of a single request";
+ type string;
+ mandatory false;
+ }
/**********************************************************************************
@@ -271,61 +189,80 @@ module appc-provider-lcm {
* * Optionally resume command acceptance and processing
* - NORMAL - Obverse of EXCLUSIVE, the default one.
**********************************************************************************/
- container flags {
- description "Flags are generic flags that apply to any and all commands, all are optional";
- leaf mode {
- type enumeration {
- enum "EXCLUSIVE";
- enum "NORMAL";
- }
- description "EXCLUSIVE (accept no queued requests on this VNF while processing) or NORMAL (queue other requests until complete)";
- mandatory false;
- }
- leaf force {
- type enumeration {
- enum "TRUE";
- enum "FALSE";
- }
- description "TRUE/FALSE - Execute action even if target is in unstable (i.e. locked, transiting, etc.) state";
- mandatory false;
- }
- leaf ttl {
- description "<0....N> - The timeout value (expressed in seconds) for action execution, between action being received by APPC and action initiation";
- type uint16;
- mandatory false;
+ container flags {
+ description "Flags are generic flags that apply to any and all commands, all
+ are optional";
+ leaf mode {
+ type enumeration {
+ enum "EXCLUSIVE";
+ enum "NORMAL";
}
- }
- }
- }
-
-
- grouping action-identifiers {
- description "A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate";
- container action-identifiers {
- description "A block containing the action arguments. These are used to specify the object upon which APP-C LCM command is to operate";
- leaf service-instance-id {
- description "identifies a specific service the command refers to. When multiple APP-C instances are used and applied to a subset of services, this will become significant . The field is mandatory when the vnf-id is empty";
- type string;
+ description "EXCLUSIVE (accept no queued requests on this VNF while processing)
+ or NORMAL (queue other requests until complete)";
mandatory false;
}
- leaf vnf-id {
- description "identifies the VNF to which this action is to be applied(vnf-id uniquely identifies the service-instance referred to). Note that some actions are applied to multiple VNFs in the same service. When this is the case, vnf-id may be left out, but service-instance-id must appear. The field is mandatory when service-instance-id is empty";
- type string;
+ leaf force {
+ type enumeration {
+ enum "TRUE";
+ enum "FALSE";
+ }
+ description "TRUE/FALSE - Execute action even if target is in unstable (i.e.
+ locked, transiting, etc.) state";
mandatory false;
}
- leaf vnfc-name {
- description "identifies the VNFC to which this action is to be applied. Some actions apply only to a component within a VNF (e.g. RESTART is sometimes applied to on VM only). In such a case, the name of the VNFC is used to search for the component within the VNF";
- type string;
+ leaf ttl {
+ description "<0....N> - The timeout value (expressed in seconds) for action
+ execution, between action being received by APPC and action initiation";
+ type uint16;
mandatory false;
}
- leaf vserver-id {
- description "identifies a specific VM within the given service/vnf to which this action is to be applied";
- type string;
- mandatory false;
}
}
}
+
+ grouping action-identifiers {
+ description "A block containing the action arguments. These are used to specify
+ the object upon which APP-C LCM command is to operate";
+ container action-identifiers {
+ description "A block containing the action arguments. These are used to specify
+ the object upon which APP-C LCM command is to operate";
+ leaf service-instance-id {
+ description "identifies a specific service the command refers to. When multiple
+ APP-C instances are used and applied to a subset of services,
+ this will become significant . The field is mandatory when the
+ vnf-id is empty";
+ type string;
+ mandatory false;
+ }
+ leaf vnf-id {
+ description "identifies the VNF to which this action is to be applied(vnf-id
+ uniquely identifies the service-instance referred to). Note that
+ some actions are applied to multiple VNFs in the same service.
+ When this is the case, vnf-id may be left out, but service-instance-id
+ must appear. The field is mandatory when service-instance-id is
+ empty";
+ type string;
+ mandatory false;
+ }
+ leaf vnfc-name {
+ description "identifies the VNFC to which this action is to be applied. Some
+ actions apply only to a component within a VNF (e.g. RESTART is
+ sometimes applied to on VM only). In such a case, the name of
+ the VNFC is used to search for the component within the VNF";
+ type string;
+ mandatory false;
+ }
+ leaf vserver-id {
+ description "identifies a specific VM within the given service/vnf to which
+ this action is to be applied";
+ type string;
+ mandatory false;
+ }
+ }
+ }
+
+
grouping status {
description "The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement";
container status {
@@ -344,163 +281,6 @@ module appc-provider-lcm {
}
- /**********************************************************************************
- * NEW API ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- * All requests will include this standard header
- *
- * The standard request header is used to define a correlation identification for
- * the request that is returned on all responses. This correlation identifier
- * (called the service-request-id) is meaningful to the caller and is included on
- * all responses from the services.
- **********************************************************************************/
- grouping RequestHeader {
- container RequestHeader {
- description "A common header for all APP-C requests";
- leaf TimeStamp {
- description "TimeStamp is in ISO 8601 timestamp format ZULU offset";
- type TIMESTAMP;
- mandatory true;
- }
-
- leaf APIver {
- description "APIver is the API version identifier. A given release of APPC should support all previous versions of APPC API (correlate with general requirements)";
- type string;
- mandatory true;
- }
-
- leaf OriginatorID {
- description "OriginatorID an identifier of the calling system which can be used addressing purposes, i.e. returning asynchronous response to the proper destination over DMaaP (especially in case of multiple consumers of APP-C APIs)";
- type string;
- mandatory true;
- }
-
- leaf TransactionID {
- description "Identifiers that may be generated when multiple responses or handling passes are needed for a given request, allowing the request itself to be tracked";
- type string;
- mandatory true;
- }
-
- leaf-list RequestTrack {
- description "Identifiers that may be generated when multiple responses or handling passes are needed for a given request, allowing the request itself to be tracked";
- type string;
- }
-
- /**********************************************************************************
- * Flags are generic flags that apply to any and all commands, all are optional
- * FORCE = TRUE/FALSE - Execute command even if target is in unstable (i.e. locked, transiting, etc) state. Specific behaviour of forced commands varies, but implies cancellation of previous command and an override by the new command. The FALSE value is used by default.
- * TTL = <0....N> - The timeout value for command execution, expressed in seconds
- * MODE = EXCLUSIVE/NORMAL - defines execution mode as follows:
- * - EXCLUSIVE � on encountering an exclusive command, the APP-C will:
- * * Cease accepting additional command requests
-
- * Complete execution of outstanding commands
- * * Execute the exclusive command to completion
- * * Optionally report the result of the command
- * * Optionally resume command acceptance and processing
- * - NORMAL - Obverse of EXCLUSIVE, the default one.
- **********************************************************************************/
- container Flags {
- description "Flags are generic flags that apply to any and all commands, all are optional";
- leaf FORCE {
- description "TRUE/FALSE - Execute action even if target is in unstable (i.e. locked, transiting, etc) state.";
- type string;
- mandatory false;
- }
- leaf TTL {
- description "<0....N> - The timeout value for action execution, expressed in seconds";
- type string;
- mandatory false;
- }
- leaf MODE {
- description "EXCLUSIVE/NORMAL - defines execution mode";
- type string;
- mandatory false;
- }
- }
- }
- }
-
- grouping RequestParameters {
- description "The request contains the entry of command-specific and is opaque to the APP-C handler";
- leaf Action {
- description "The actual action to be taken";
- type string;
- mandatory true;
- }
- leaf TargetID {
- description "The specific VF a component of which is to be affected";
- type string;
- mandatory true;
- }
- leaf ObjectID {
- description "The specific VFC within a VF to be affected";
- type string;
- mandatory true;
- }
- leaf Payload {
- description "An action-specific value opaque to the APPC handler.
- The value can be any valid JSON type (primitive, object, collection of those two).
- APPC will pass the value as raw JSON string to the executing LCM action.";
- type string;
- mandatory true;
- }
- }
-
- grouping ResponseHeader {
- description "The response to an APP-C command or control is, likewise, encoded in a JSON object. ";
- container ResponseHeader {
- description "The response to an APP-C command or control is, likewise, encoded in a JSON object. ";
- leaf TimeStamp {
- description "TimeStamp is in ISO 8601 timestamp format ZULU offset";
- type TIMESTAMP;
- mandatory true;
- }
-
- leaf APIver {
- description "APIver is the API version identifier. A given release of APPC should support all previous versions of APPC API (correlate with general requirements)";
- type string;
- mandatory true;
- }
-
- leaf ResponseID {
- description "ResponseID an identifier of the calling system which can be used addressing purposes, i.e. returning asynchronous response to the proper destination over DMaaP (especially in case of multiple consumers of APP-C APIs)";
- type string;
- mandatory true;
- }
-
- leaf-list SubResponseID {
- description "Identifiers that may be generated when multiple responses or handling passes are needed for a given request, allowing the request itself to be tracked";
- type string;
- }
- }
- }
-
- grouping ResponseAttributes {
- description "The response contains the status of executed functionality";
- container Status {
- description "The specific response codes are to be aligned with ASDC reference doc (main table removed to avoid duplication and digression from main table). See ASDC and ECOMP Distribution Consumer Interface Agreement";
- leaf Code {
- description "Response code value";
- type uint32;
- mandatory true;
- }
- leaf Value {
- description "Response code description";
- type string;
- mandatory true;
- }
- }
- leaf Payload {
- description "Payload - the entry is command-specific and is opaque to the APP-C handler.
- The value can be any valid JSON type (primitive, object, collection of those two).
- APP-C will pass the value as raw JSON string to appropriate addressee";
- type string;
- mandatory false;
- }
- }
-
-
-
@@ -677,10 +457,18 @@ module appc-provider-lcm {
mandatory true;
}
uses action-identifiers;
+ leaf payload {
+ type payload;
+ mandatory false;
+ }
}
output {
uses common-header;
uses status;
+ leaf payload {
+ type payload;
+ mandatory false;
+ }
}
}
@@ -707,26 +495,103 @@ module appc-provider-lcm {
}
}
- /**********************************************************************************
- * Define the modify-config service
- **********************************************************************************/
- rpc modify-config {
- description "An operation to modify-config the configurations of a virtual network function (or VM)";
+
+ rpc configure {
+ description "An operation to configure the configurations of a virtual network
+ function (or VM)";
input {
uses common-header;
leaf action {
- type action;
- mandatory true;
+ type action;
+ mandatory true;
}
uses action-identifiers;
leaf payload {
- type payload;
- mandatory false;
+ type payload;
+ mandatory false;
+ }
+ }
+ output {
+ uses common-header;
+ uses status;
+ leaf payload {
+ type payload;
+ mandatory false;
+ }
+ }
+ }
+
+ rpc config-modify {
+ description "Use the ModifyConfig command when a full configuration cycle is either not required or is considered too costly. The ModifyConfig LCM action affects only a subset of the total configuration data of a VNF. The set of configuration parameters to be affected is a subset of the total configuration data of the target VNF type. The payload block must contain the configuration parameters to be modified and their values. A successful modify returns a success response. A failed modify returns a failure response and the specific failure messages in the response payload block";
+ input {
+ uses common-header;
+ leaf action {
+ type action;
+ mandatory true;
+ }
+ uses action-identifiers;
+ leaf payload {
+ type payload;
+ mandatory false;
}
}
output {
uses common-header;
uses status;
+ leaf payload {
+ type payload;
+ mandatory false;
+ }
+ }
+ }
+
+ rpc config-scaleout {
+ description "An operation to scaleout the configurations of a virtual network
+ function (or VM)";
+ input {
+ uses common-header;
+ leaf action {
+ type action;
+ mandatory true;
+ }
+ uses action-identifiers;
+ leaf payload {
+ type payload;
+ mandatory false;
+ }
+ }
+ output {
+ uses common-header;
+ uses status;
+ leaf payload {
+ type payload;
+ mandatory false;
+ }
+ }
+ }
+
+ rpc config-restore {
+ description "An operation to restore the configurations of a virtual network
+ function (or VM)";
+ input {
+ uses common-header;
+ leaf action {
+ type action;
+ mandatory true;
+ }
+ uses action-identifiers;
+ leaf payload {
+ type payload;
+ mandatory false;
+ }
+ }
+ output {
+ uses common-header;
+ uses status;
+ leaf payload {
+ type payload;
+ mandatory false;
+ }
}
}
@@ -776,6 +641,26 @@ module appc-provider-lcm {
}
}
+ rpc start {
+ description "An operation to start a virtual network function (or VM)";
+ input {
+ uses common-header;
+ leaf action {
+ type action;
+ mandatory true;
+ }
+ uses action-identifiers;
+ leaf payload {
+ type payload;
+ mandatory false;
+ }
+ }
+ output {
+ uses common-header;
+ uses status;
+ }
+ }
+
/**********************************************************************************
* Define the audit service
**********************************************************************************/
@@ -788,10 +673,18 @@ module appc-provider-lcm {
mandatory true;
}
uses action-identifiers;
+ leaf payload {
+ type payload;
+ mandatory false;
+ }
}
output {
uses common-header;
uses status;
+ leaf payload {
+ type payload;
+ mandatory false;
+ }
}
}
@@ -893,8 +786,8 @@ module appc-provider-lcm {
}
/**********************************************************************************
- * Define the VNF unlock service
- **********************************************************************************/
+ * Define the VNF unlock service
+ **********************************************************************************/
rpc unlock {
description "An operation to perform VNF unlock operation";
input {
@@ -943,6 +836,65 @@ module appc-provider-lcm {
}
+ rpc config-backup {
+ description "An operation to Backup configurations of a virtual network function
+ (or VM)";
+ input {
+ uses common-header;
+ leaf action {
+ type action;
+ mandatory true;
+ }
+ uses action-identifiers;
+ }
+ output {
+ uses common-header;
+ uses status;
+ leaf payload {
+ type payload;
+ mandatory false;
+ }
+ }
+ }
+
+ rpc config-backup-delete {
+ description "An operation to Delete backup configurations of a virtual network
+ function (or VM)";
+ input {
+ uses common-header;
+ leaf action {
+ type action;
+ mandatory true;
+ }
+ uses action-identifiers;
+ }
+ output {
+ uses common-header;
+ uses status;
+ leaf payload {
+ type payload;
+ mandatory false;
+ }
+ }
+ }
+
+ rpc config-export {
+ description "An operation to Export configurations of a virtual network function
+ (or VM)";
+ input {
+ uses common-header;
+ leaf action {
+ type action;
+ mandatory true;
+ }
+ uses action-identifiers;
+ }
+ output {
+ uses common-header;
+ uses status;
+ }
+ }
+
/**********************************************************************************
* Additional RPCs added here...
**********************************************************************************/
diff --git a/appc-provider/appc-provider-model/src/main/yang/appc-provider.yang b/appc-provider/appc-provider-model/src/main/yang/appc-provider.yang
index 6bdccf483..5430c9624 100644
--- a/appc-provider/appc-provider-model/src/main/yang/appc-provider.yang
+++ b/appc-provider/appc-provider-model/src/main/yang/appc-provider.yang
@@ -392,7 +392,7 @@ module appc-provider {
* FORCE = TRUE/FALSE - Execute command even if target is in unstable (i.e. locked, transiting, etc) state. Specific behaviour of forced commands varies, but implies cancellation of previous command and an override by the new command. The FALSE value is used by default.
* TTL = <0....N> - The timeout value for command execution, expressed in seconds
* MODE = EXCLUSIVE/NORMAL - defines execution mode as follows:
- * - EXCLUSIVE � on encountering an exclusive command, the APP-C will:
+ * - EXCLUSIVE � on encountering an exclusive command, the APP-C will:
* * Cease accepting additional command requests
* Complete execution of outstanding commands
@@ -616,5 +616,19 @@ module appc-provider {
}
}
+ rpc vmstatuscheck {
+ description "An operation to check status of a VM";
+ input {
+ uses common-request-header;
+ uses vnf-resource;
+ }
+ output {
+ uses common-response-header;
+ leaf stat-msg {
+ description "The status of the VM requested";
+ type string;
+ }
+ }
+ }
}