diff options
Diffstat (limited to 'lcm/provider')
54 files changed, 4442 insertions, 0 deletions
diff --git a/lcm/provider/pom.xml b/lcm/provider/pom.xml new file mode 100755 index 000000000..03f34e6ba --- /dev/null +++ b/lcm/provider/pom.xml @@ -0,0 +1,101 @@ +<?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> + <groupId>org.onap.ccsdk.parent</groupId> + <artifactId>binding-parent</artifactId> + <version>2.1.0</version> + <relativePath/> + </parent> + + <groupId>org.onap.ccsdk.sli.northbound</groupId> + <artifactId>lcm-provider</artifactId> + <version>1.1.1-SNAPSHOT</version> + <packaging>bundle</packaging> + + <name>ccsdk-sli-northbound :: lcm :: ${project.artifactId}</name> + + <properties> + <ccsdk.sli.northbound.version>${project.version}</ccsdk.sli.northbound.version> + </properties> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.onap.ccsdk.sli.core</groupId> + <artifactId>sli-core-artifacts</artifactId> + <version>${ccsdk.sli.core.version}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + <dependencies> + <dependency> + <groupId>org.onap.ccsdk.sli.northbound</groupId> + <artifactId>lcm-model</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>org.opendaylight.controller</groupId> + <artifactId>sal-binding-api</artifactId> + </dependency> + <dependency> + <groupId>org.opendaylight.controller</groupId> + <artifactId>sal-binding-broker-impl</artifactId> + </dependency> + <dependency> + <groupId>org.opendaylight.controller</groupId> + <artifactId>sal-common-util</artifactId> + </dependency> + + <dependency> + <groupId>org.onap.ccsdk.sli.core</groupId> + <artifactId>sli-common</artifactId> + </dependency> + <dependency> + <groupId>org.onap.ccsdk.sli.core</groupId> + <artifactId>sli-provider</artifactId> + </dependency> + <dependency> + <groupId>org.onap.ccsdk.sli.core</groupId> + <artifactId>sli-provider-base</artifactId> + <version>${ccsdk.sli.core.version}</version> + </dependency> + <dependency> + <groupId>org.opendaylight.controller</groupId> + <artifactId>sal-core-api</artifactId> + </dependency> + <dependency> + <groupId>org.opendaylight.yangtools</groupId> + <artifactId>yang-data-impl</artifactId> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.mockito</groupId> + <artifactId>mockito-core</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.apache.derby</groupId> + <artifactId>derby</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.osgi</groupId> + <artifactId>org.osgi.core</artifactId> + <scope>test</scope> + </dependency> + </dependencies> +</project> diff --git a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java new file mode 100644 index 000000000..100496e39 --- /dev/null +++ b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmProvider.java @@ -0,0 +1,1126 @@ +package org.onap.ccsdk.sli.northbound; +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * Modifications Copyright © 2018 IBM. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Properties; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper; +import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; +import org.opendaylight.controller.md.sal.binding.impl.AbstractForwardedDataBroker; +import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker; +import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; +import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.*; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.common.header.CommonHeaderBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.status.StatusBuilder; +import org.opendaylight.yangtools.yang.common.RpcResult; +import org.opendaylight.yangtools.yang.common.RpcResultBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; + +import org.onap.ccsdk.sli.northbound.LcmResponseCode.*; + +/** + * Defines a base implementation for your provider. This class extends from a + * helper class which provides storage for the most commonly used components of + * the MD-SAL. Additionally the base class provides some basic logging and + * initialization / clean up methods. + * + */ +public class LcmProvider implements AutoCloseable, LCMService { + + private class CommonLcmFields { + private StatusBuilder statusBuilder; + private CommonHeaderBuilder commonHeaderBuilder; + private Payload payload; + + public CommonLcmFields(StatusBuilder statusBuilder, CommonHeaderBuilder commonHeaderBuilder) { + this.statusBuilder = statusBuilder; + this.commonHeaderBuilder = commonHeaderBuilder; + this.payload = null; + } + + public CommonLcmFields(StatusBuilder statusBuilder, CommonHeaderBuilder commonHeaderBuilder, Payload payload) { + this.statusBuilder = statusBuilder; + this.commonHeaderBuilder = commonHeaderBuilder; + this.payload = payload; + } + + public StatusBuilder getStatusBuilder() { + return statusBuilder; + } + + public CommonHeaderBuilder getCommonHeaderBuilder() { + return commonHeaderBuilder; + } + + public Payload getPayload() { + return payload; + } + } + + private static final Logger LOG = LoggerFactory.getLogger(LcmProvider.class); + + private static final String exceptionMessage = "Caught exception"; + + private static final String APPLICATION_NAME = "LCM"; + + private final ExecutorService executor; + protected DataBroker dataBroker; + protected DOMDataBroker domDataBroker; + protected NotificationPublishService notificationService; + protected RpcProviderRegistry rpcRegistry; + private final LcmSliClient lcmSliClient; + + protected BindingAwareBroker.RpcRegistration<LCMService> rpcRegistration; + + public LcmProvider(final DataBroker dataBroker, final NotificationPublishService notificationPublishService, + final RpcProviderRegistry rpcProviderRegistry, final LcmSliClient lcmSliClient) { + + LOG.info("Creating provider for {}", APPLICATION_NAME); + executor = Executors.newFixedThreadPool(1); + this.dataBroker = dataBroker; + if (dataBroker instanceof AbstractForwardedDataBroker) { + domDataBroker = ((AbstractForwardedDataBroker) dataBroker).getDelegate(); + } + notificationService = notificationPublishService; + rpcRegistry = rpcProviderRegistry; + this.lcmSliClient = lcmSliClient; + initialize(); + } + + public void initialize() { + LOG.info("Initializing {} for {}", this.getClass().getName(), APPLICATION_NAME); + + if (rpcRegistration == null) { + if (rpcRegistry != null) { + rpcRegistration = rpcRegistry.addRpcImplementation(LCMService.class, this); + LOG.info("Initialization complete for {}", APPLICATION_NAME); + } else { + LOG.warn("Error initializing {} : rpcRegistry unset", APPLICATION_NAME); + } + } + } + + protected void initializeChild() { + // Override if you have custom initialization intelligence + } + + @Override + public void close() throws Exception { + LOG.info("Closing provider for " + APPLICATION_NAME); + executor.shutdown(); + rpcRegistration.close(); + LOG.info("Successfully closed provider for " + APPLICATION_NAME); + } + + + + @Override + public ListenableFuture<RpcResult<CheckLockOutput>> checkLock(CheckLockInput input) { + CheckLockInputBuilder iBuilder = new CheckLockInputBuilder(input); + CheckLockOutputBuilder oBuilder = new CheckLockOutputBuilder(); + + try { + CommonLcmFields retval = callDG("check-lock", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<CheckLockOutput> rpcResult = + RpcResultBuilder.<CheckLockOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + + } + + @Override + public ListenableFuture<RpcResult<RebootOutput>> reboot(RebootInput input) { + RebootInputBuilder iBuilder = new RebootInputBuilder(input); + RebootOutputBuilder oBuilder = new RebootOutputBuilder(); + + try { + CommonLcmFields retval = callDG("reboot", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<RebootOutput> rpcResult = + RpcResultBuilder.<RebootOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<UpgradeBackupOutput>> upgradeBackup(UpgradeBackupInput input) { + UpgradeBackupInputBuilder iBuilder = new UpgradeBackupInputBuilder(input); + UpgradeBackupOutputBuilder oBuilder = new UpgradeBackupOutputBuilder(); + + try { + CommonLcmFields retval = callDG("upgrade-backup", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<UpgradeBackupOutput> rpcResult = + RpcResultBuilder.<UpgradeBackupOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<RollbackOutput>> rollback(RollbackInput input) { + RollbackInputBuilder iBuilder = new RollbackInputBuilder(input); + RollbackOutputBuilder oBuilder = new RollbackOutputBuilder(); + + try { + CommonLcmFields retval = callDG("rollback", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + if (retval.getPayload() != null) { + oBuilder.setPayload(retval.getPayload()); + } + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<RollbackOutput> rpcResult = + RpcResultBuilder.<RollbackOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<SyncOutput>> sync(SyncInput input) { + SyncInputBuilder iBuilder = new SyncInputBuilder(input); + SyncOutputBuilder oBuilder = new SyncOutputBuilder(); + + try { + CommonLcmFields retval = callDG("sync", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<SyncOutput> rpcResult = + RpcResultBuilder.<SyncOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<QueryOutput>> query(QueryInput input) { + QueryInputBuilder iBuilder = new QueryInputBuilder(input); + QueryOutputBuilder oBuilder = new QueryOutputBuilder(); + + try { + CommonLcmFields retval = callDG("query", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<QueryOutput> rpcResult = + RpcResultBuilder.<QueryOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<ConfigExportOutput>> configExport(ConfigExportInput input) { + ConfigExportInputBuilder iBuilder = new ConfigExportInputBuilder(input); + ConfigExportOutputBuilder oBuilder = new ConfigExportOutputBuilder(); + + try { + CommonLcmFields retval = callDG("config-export", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<ConfigExportOutput> rpcResult = + RpcResultBuilder.<ConfigExportOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<StopApplicationOutput>> stopApplication(StopApplicationInput input) { + StopApplicationInputBuilder iBuilder = new StopApplicationInputBuilder(input); + StopApplicationOutputBuilder oBuilder = new StopApplicationOutputBuilder(); + + try { + CommonLcmFields retval = callDG("stop-application", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<StopApplicationOutput> rpcResult = + RpcResultBuilder.<StopApplicationOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<SoftwareUploadOutput>> softwareUpload(SoftwareUploadInput input) { + SoftwareUploadInputBuilder iBuilder = new SoftwareUploadInputBuilder(input); + SoftwareUploadOutputBuilder oBuilder = new SoftwareUploadOutputBuilder(); + + try { + CommonLcmFields retval = callDG("software-upload", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<SoftwareUploadOutput> rpcResult = + RpcResultBuilder.<SoftwareUploadOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<ResumeTrafficOutput>> resumeTraffic(ResumeTrafficInput input) { + ResumeTrafficInputBuilder iBuilder = new ResumeTrafficInputBuilder(input); + ResumeTrafficOutputBuilder oBuilder = new ResumeTrafficOutputBuilder(); + + try { + CommonLcmFields retval = callDG("resume-traffic", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<ResumeTrafficOutput> rpcResult = + RpcResultBuilder.<ResumeTrafficOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<DistributeTrafficOutput>> distributeTraffic(DistributeTrafficInput input) { + DistributeTrafficInputBuilder iBuilder = new DistributeTrafficInputBuilder(input); + DistributeTrafficOutputBuilder oBuilder = new DistributeTrafficOutputBuilder(); + + try { + CommonLcmFields retval = callDG("distribute-traffic", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<DistributeTrafficOutput> rpcResult = + RpcResultBuilder.<DistributeTrafficOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<ConfigureOutput>> configure(ConfigureInput input) { + ConfigureInputBuilder iBuilder = new ConfigureInputBuilder(input); + ConfigureOutputBuilder oBuilder = new ConfigureOutputBuilder(); + + try { + CommonLcmFields retval = callDG("configure", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<ConfigureOutput> rpcResult = + RpcResultBuilder.<ConfigureOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<ActionStatusOutput>> actionStatus(ActionStatusInput input) { + ActionStatusInputBuilder iBuilder = new ActionStatusInputBuilder(input); + ActionStatusOutputBuilder oBuilder = new ActionStatusOutputBuilder(); + + try { + CommonLcmFields retval = callDG("action-status", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<ActionStatusOutput> rpcResult = + RpcResultBuilder.<ActionStatusOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<UpgradePreCheckOutput>> upgradePreCheck(UpgradePreCheckInput input) { + UpgradePreCheckInputBuilder iBuilder = new UpgradePreCheckInputBuilder(input); + UpgradePreCheckOutputBuilder oBuilder = new UpgradePreCheckOutputBuilder(); + + try { + CommonLcmFields retval = callDG("upgrade-pre-check", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + if (retval.getPayload() != null) { + oBuilder.setPayload(retval.getPayload()); + } + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<UpgradePreCheckOutput> rpcResult = + RpcResultBuilder.<UpgradePreCheckOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<LiveUpgradeOutput>> liveUpgrade(LiveUpgradeInput input) { + LiveUpgradeInputBuilder iBuilder = new LiveUpgradeInputBuilder(input); + LiveUpgradeOutputBuilder oBuilder = new LiveUpgradeOutputBuilder(); + + try { + CommonLcmFields retval = callDG("live-upgrade", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<LiveUpgradeOutput> rpcResult = + RpcResultBuilder.<LiveUpgradeOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<ConfigModifyOutput>> configModify(ConfigModifyInput input) { + ConfigModifyInputBuilder iBuilder = new ConfigModifyInputBuilder(input); + ConfigModifyOutputBuilder oBuilder = new ConfigModifyOutputBuilder(); + + try { + CommonLcmFields retval = callDG("config-modify", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<ConfigModifyOutput> rpcResult = + RpcResultBuilder.<ConfigModifyOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<RestartOutput>> restart(RestartInput input) { + RestartInputBuilder iBuilder = new RestartInputBuilder(input); + RestartOutputBuilder oBuilder = new RestartOutputBuilder(); + + try { + CommonLcmFields retval = callDG("restart", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<RestartOutput> rpcResult = + RpcResultBuilder.<RestartOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<HealthCheckOutput>> healthCheck(HealthCheckInput input) { + HealthCheckInputBuilder iBuilder = new HealthCheckInputBuilder(input); + HealthCheckOutputBuilder oBuilder = new HealthCheckOutputBuilder(); + + try { + CommonLcmFields retval = callDG("health-check", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<HealthCheckOutput> rpcResult = + RpcResultBuilder.<HealthCheckOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<LockOutput>> lock(LockInput input) { + LockInputBuilder iBuilder = new LockInputBuilder(input); + LockOutputBuilder oBuilder = new LockOutputBuilder(); + + try { + CommonLcmFields retval = callDG("lock", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<LockOutput> rpcResult = + RpcResultBuilder.<LockOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<TerminateOutput>> terminate(TerminateInput input) { + TerminateInputBuilder iBuilder = new TerminateInputBuilder(input); + TerminateOutputBuilder oBuilder = new TerminateOutputBuilder(); + + try { + CommonLcmFields retval = callDG("terminate", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<TerminateOutput> rpcResult = + RpcResultBuilder.<TerminateOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<AttachVolumeOutput>> attachVolume(AttachVolumeInput input) { + AttachVolumeInputBuilder iBuilder = new AttachVolumeInputBuilder(input); + AttachVolumeOutputBuilder oBuilder = new AttachVolumeOutputBuilder(); + + try { + CommonLcmFields retval = callDG("attach-volume", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<AttachVolumeOutput> rpcResult = + RpcResultBuilder.<AttachVolumeOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<MigrateOutput>> migrate(MigrateInput input) { + MigrateInputBuilder iBuilder = new MigrateInputBuilder(input); + MigrateOutputBuilder oBuilder = new MigrateOutputBuilder(); + + try { + CommonLcmFields retval = callDG("migrate", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<MigrateOutput> rpcResult = + RpcResultBuilder.<MigrateOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<QuiesceTrafficOutput>> quiesceTraffic(QuiesceTrafficInput input) { + QuiesceTrafficInputBuilder iBuilder = new QuiesceTrafficInputBuilder(input); + QuiesceTrafficOutputBuilder oBuilder = new QuiesceTrafficOutputBuilder(); + + try { + CommonLcmFields retval = callDG("quiesce-traffic", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<QuiesceTrafficOutput> rpcResult = + RpcResultBuilder.<QuiesceTrafficOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<ConfigRestoreOutput>> configRestore(ConfigRestoreInput input) { + ConfigRestoreInputBuilder iBuilder = new ConfigRestoreInputBuilder(input); + ConfigRestoreOutputBuilder oBuilder = new ConfigRestoreOutputBuilder(); + + try { + CommonLcmFields retval = callDG("config-restore", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<ConfigRestoreOutput> rpcResult = + RpcResultBuilder.<ConfigRestoreOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<UpgradeBackoutOutput>> upgradeBackout(UpgradeBackoutInput input) { + UpgradeBackoutInputBuilder iBuilder = new UpgradeBackoutInputBuilder(input); + UpgradeBackoutOutputBuilder oBuilder = new UpgradeBackoutOutputBuilder(); + + try { + CommonLcmFields retval = callDG("upgrade-backout", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<UpgradeBackoutOutput> rpcResult = + RpcResultBuilder.<UpgradeBackoutOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<EvacuateOutput>> evacuate(EvacuateInput input) { + EvacuateInputBuilder iBuilder = new EvacuateInputBuilder(input); + EvacuateOutputBuilder oBuilder = new EvacuateOutputBuilder(); + + try { + CommonLcmFields retval = callDG("evacuate", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<EvacuateOutput> rpcResult = + RpcResultBuilder.<EvacuateOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<UnlockOutput>> unlock(UnlockInput input) { + UnlockInputBuilder iBuilder = new UnlockInputBuilder(input); + UnlockOutputBuilder oBuilder = new UnlockOutputBuilder(); + + try { + CommonLcmFields retval = callDG("unlock", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<UnlockOutput> rpcResult = + RpcResultBuilder.<UnlockOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<ConfigBackupDeleteOutput>> configBackupDelete(ConfigBackupDeleteInput input) { + ConfigBackupDeleteInputBuilder iBuilder = new ConfigBackupDeleteInputBuilder(input); + ConfigBackupDeleteOutputBuilder oBuilder = new ConfigBackupDeleteOutputBuilder(); + + try { + CommonLcmFields retval = callDG("config-backup-delete", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<ConfigBackupDeleteOutput> rpcResult = + RpcResultBuilder.<ConfigBackupDeleteOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<UpgradeSoftwareOutput>> upgradeSoftware(UpgradeSoftwareInput input) { + UpgradeSoftwareInputBuilder iBuilder = new UpgradeSoftwareInputBuilder(input); + UpgradeSoftwareOutputBuilder oBuilder = new UpgradeSoftwareOutputBuilder(); + + try { + CommonLcmFields retval = callDG("upgrade-software", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<UpgradeSoftwareOutput> rpcResult = + RpcResultBuilder.<UpgradeSoftwareOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<DownloadNESwOutput>> downloadNESw(DownloadNESwInput input) { + DownloadNESwInputBuilder iBuilder = new DownloadNESwInputBuilder(input); + DownloadNESwOutputBuilder oBuilder = new DownloadNESwOutputBuilder(); + + try { + CommonLcmFields retval = callDG("download-n-e-sw", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + if (retval.getPayload() != null) { + oBuilder.setPayload(retval.getPayload()); + } + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<DownloadNESwOutput> rpcResult = + RpcResultBuilder.<DownloadNESwOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<ActivateNESwOutput>> activateNESw(ActivateNESwInput input) { + ActivateNESwInputBuilder iBuilder = new ActivateNESwInputBuilder(input); + ActivateNESwOutputBuilder oBuilder = new ActivateNESwOutputBuilder(); + + try { + CommonLcmFields retval = callDG("activate-n-e-sw", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + if (retval.getPayload() != null) { + oBuilder.setPayload(retval.getPayload()); + } + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<ActivateNESwOutput> rpcResult = + RpcResultBuilder.<ActivateNESwOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<StopOutput>> stop(StopInput input) { + StopInputBuilder iBuilder = new StopInputBuilder(input); + StopOutputBuilder oBuilder = new StopOutputBuilder(); + + try { + CommonLcmFields retval = callDG("stop", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<StopOutput> rpcResult = + RpcResultBuilder.<StopOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<DetachVolumeOutput>> detachVolume(DetachVolumeInput input) { + DetachVolumeInputBuilder iBuilder = new DetachVolumeInputBuilder(input); + DetachVolumeOutputBuilder oBuilder = new DetachVolumeOutputBuilder(); + + try { + CommonLcmFields retval = callDG("detach-volume", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<DetachVolumeOutput> rpcResult = + RpcResultBuilder.<DetachVolumeOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<ConfigScaleOutOutput>> configScaleOut(ConfigScaleOutInput input) { + ConfigScaleOutInputBuilder iBuilder = new ConfigScaleOutInputBuilder(input); + ConfigScaleOutOutputBuilder oBuilder = new ConfigScaleOutOutputBuilder(); + + try { + CommonLcmFields retval = callDG("config-scale-out", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<ConfigScaleOutOutput> rpcResult = + RpcResultBuilder.<ConfigScaleOutOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<UpgradePostCheckOutput>> upgradePostCheck(UpgradePostCheckInput input) { + UpgradePostCheckInputBuilder iBuilder = new UpgradePostCheckInputBuilder(input); + UpgradePostCheckOutputBuilder oBuilder = new UpgradePostCheckOutputBuilder(); + + try { + CommonLcmFields retval = callDG("upgrade-post-check", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + if (retval.getPayload() != null) { + oBuilder.setPayload(retval.getPayload()); + } + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<UpgradePostCheckOutput> rpcResult = + RpcResultBuilder.<UpgradePostCheckOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<TestOutput>> test(TestInput input) { + TestInputBuilder iBuilder = new TestInputBuilder(input); + TestOutputBuilder oBuilder = new TestOutputBuilder(); + + try { + CommonLcmFields retval = callDG("test", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<TestOutput> rpcResult = + RpcResultBuilder.<TestOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<StartApplicationOutput>> startApplication(StartApplicationInput input) { + StartApplicationInputBuilder iBuilder = new StartApplicationInputBuilder(input); + StartApplicationOutputBuilder oBuilder = new StartApplicationOutputBuilder(); + + try { + CommonLcmFields retval = callDG("start-application", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<StartApplicationOutput> rpcResult = + RpcResultBuilder.<StartApplicationOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<ConfigBackupOutput>> configBackup(ConfigBackupInput input) { + ConfigBackupInputBuilder iBuilder = new ConfigBackupInputBuilder(input); + ConfigBackupOutputBuilder oBuilder = new ConfigBackupOutputBuilder(); + + try { + CommonLcmFields retval = callDG("config-backup", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<ConfigBackupOutput> rpcResult = + RpcResultBuilder.<ConfigBackupOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<RebuildOutput>> rebuild(RebuildInput input) { + RebuildInputBuilder iBuilder = new RebuildInputBuilder(input); + RebuildOutputBuilder oBuilder = new RebuildOutputBuilder(); + + try { + CommonLcmFields retval = callDG("rebuild", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<RebuildOutput> rpcResult = + RpcResultBuilder.<RebuildOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<AuditOutput>> audit(AuditInput input) { + AuditInputBuilder iBuilder = new AuditInputBuilder(input); + AuditOutputBuilder oBuilder = new AuditOutputBuilder(); + + try { + CommonLcmFields retval = callDG("audit", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<AuditOutput> rpcResult = + RpcResultBuilder.<AuditOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<StartOutput>> start(StartInput input) { + StartInputBuilder iBuilder = new StartInputBuilder(input); + StartOutputBuilder oBuilder = new StartOutputBuilder(); + + try { + CommonLcmFields retval = callDG("start", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<StartOutput> rpcResult = + RpcResultBuilder.<StartOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + @Override + public ListenableFuture<RpcResult<SnapshotOutput>> snapshot(SnapshotInput input) { + SnapshotInputBuilder iBuilder = new SnapshotInputBuilder(input); + SnapshotOutputBuilder oBuilder = new SnapshotOutputBuilder(); + + try { + CommonLcmFields retval = callDG("snapshot", iBuilder.build()); + oBuilder.setStatus(retval.getStatusBuilder().build()); + oBuilder.setCommonHeader(retval.getCommonHeaderBuilder().build()); + } catch (LcmRpcInvocationException e) { + LOG.debug(exceptionMessage, e); + oBuilder.setCommonHeader(e.getCommonHeader()); + oBuilder.setStatus(e.getStatus()); + } + + RpcResult<SnapshotOutput> rpcResult = + RpcResultBuilder.<SnapshotOutput> status(true).withResult(oBuilder.build()).build(); + // return error + return Futures.immediateFuture(rpcResult); + } + + private CommonLcmFields callDG(String rpcName, Object input) throws LcmRpcInvocationException { + + StatusBuilder statusBuilder = new StatusBuilder(); + + if (input == null) { + LOG.debug("Rejecting " +rpcName+ " because of invalid input"); + statusBuilder.setCode(LcmResponseCode.REJECT_INVALID_INPUT.getValue()); + statusBuilder.setMessage("REJECT - INVALID INPUT. Missing input"); + CommonHeaderBuilder hBuilder = new CommonHeaderBuilder(); + hBuilder.setApiVer("1"); + hBuilder.setOriginatorId("unknown"); + hBuilder.setRequestId("unset"); + hBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + throw new LcmRpcInvocationException(statusBuilder.build(), hBuilder.build()); + } + + CommonHeaderBuilder hBuilder = new CommonHeaderBuilder(((CommonHeader)input).getCommonHeader()); + + // add input to parms + LOG.info("Adding INPUT data for "+ rpcName +" input: " + input.toString()); + Properties inputProps = new Properties(); + MdsalHelper.toProperties(inputProps, input); + + Properties respProps = new Properties(); + + // Call SLI sync method + try + { + if (lcmSliClient.hasGraph("LCM", rpcName , null, "sync")) + { + try + { + respProps = lcmSliClient.execute("LCM", rpcName, null, "sync", inputProps, domDataBroker); + } + catch (Exception e) + { + LOG.error("Caught exception executing service logic for "+ rpcName, e); + statusBuilder.setCode(LcmResponseCode.FAILURE_DG_FAILURE.getValue()); + statusBuilder.setMessage("FAILURE - DG FAILURE ("+e.getMessage()+")"); + throw new LcmRpcInvocationException(statusBuilder.build(), hBuilder.build()); + } + } else { + LOG.error("No service logic active for LCM: '" + rpcName + "'"); + + statusBuilder.setCode(LcmResponseCode.REJECT_DG_NOT_FOUND.getValue()); + statusBuilder.setMessage("FAILURE - DG not found for action "+rpcName); + throw new LcmRpcInvocationException(statusBuilder.build(), hBuilder.build()); + } + } + catch (Exception e) + { + LOG.error("Caught exception looking for service logic", e); + + statusBuilder.setCode(LcmResponseCode.FAILURE_DG_FAILURE.getValue()); + statusBuilder.setMessage("FAILURE - Unexpected error looking for DG ("+e.getMessage()+")"); + throw new LcmRpcInvocationException(statusBuilder.build(), hBuilder.build()); + } + + + StatusBuilder sBuilder = new StatusBuilder(); + MdsalHelper.toBuilder(respProps, sBuilder); + MdsalHelper.toBuilder(respProps, hBuilder); + + Payload payload = null; + String payloadValue = respProps.getProperty("payload"); + if (payloadValue != null) { + payload = new Payload(payloadValue); + } + + String statusCode = sBuilder.getCode().toString(); + + if (!"400".equals(statusCode)) { + LOG.error("Returned FAILED for "+rpcName+" error code: '" + statusCode + "'"); + } else { + LOG.info("Returned SUCCESS for "+rpcName+" "); + } + + return new CommonLcmFields(sBuilder, hBuilder, payload); + + } + +} diff --git a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmResponseCode.java b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmResponseCode.java new file mode 100644 index 000000000..76001c860 --- /dev/null +++ b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmResponseCode.java @@ -0,0 +1,51 @@ +package org.onap.ccsdk.sli.northbound; + +public enum LcmResponseCode { + + // Accepted category + ACCEPT_ACCEPTED(100), + // Error category + ERROR_UNEXPECTED_ERROR(200), + // Rejected category + REJECT_REJECTED(300), + REJECT_INVALID_INPUT(301), + REJECT_MISSING_PARAM(302), + REJECT_PARSING_FAILED(303), + REJECT_NO_TRANSITION(304), + REJECT_ACTION_NOT_SUPPORTED(305), + REJECT_VNF_NOT_FOUND(306), + REJECT_DG_NOT_FOUND(307), + REJECT_WORKFLOW_NOT_FOUND(308), + REJECT_UNSTABLE_VNF(309), + REJECT_LOCKING_FAILURE(310), + REJECT_EXPIRED_REQUEST(311), + REJECT_DUPLICATE_REQUEST(312), + REJECT_MISSING_AAI_DATA(313), + REJECT_MULTIPLE_REQUESTS_FOR_SEARCH(315), + REJECT_POLICY_VALIDATION_FAILURE(316), + // Success category + SUCCESS(400), + // Failure category + FAILURE_DG_FAILURE(401), + FAILURE_NO_TRANSITION(402), + FAILURE_AAI_FAILURE(403), + FAILURE_EXPIRED_REQUEST(404), + FAILURE_UNEXPECTED_FAILURE(405), + FAILURE_UNSTABLE_VNF(406), + FAILURE_REQUEST_NOT_SUPPORTED(450), + // Partial success + PARTIAL_SUCCESS(500); + + + + private int value; + private LcmResponseCode(int value) { + this.value = value; + } + + public int getValue() { + return value; + } + + +} diff --git a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmRpcInvocationException.java b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmRpcInvocationException.java new file mode 100644 index 000000000..2ae2200a8 --- /dev/null +++ b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmRpcInvocationException.java @@ -0,0 +1,25 @@ +package org.onap.ccsdk.sli.northbound; + +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.common.header.CommonHeader; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.status.Status; + +public class LcmRpcInvocationException extends SvcLogicException { + + private Status status; + private CommonHeader commonHeader; + + public LcmRpcInvocationException(Status status, CommonHeader commonHeader) { + this.status = status; + this.commonHeader = commonHeader; + } + + public Status getStatus() { + return status; + } + + public CommonHeader getCommonHeader() { + return commonHeader; + } + +} diff --git a/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmSliClient.java b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmSliClient.java new file mode 100644 index 000000000..54e53c776 --- /dev/null +++ b/lcm/provider/src/main/java/org/onap/ccsdk/sli/northbound/LcmSliClient.java @@ -0,0 +1,99 @@ +package org.onap.ccsdk.sli.northbound; +/*- + * ============LICENSE_START======================================================= + * openECOMP : SDN-C + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights + * reserved. + * Modifications Copyright © 2018 IBM. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + + + +import java.util.Properties; + +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.onap.ccsdk.sli.core.sli.provider.SvcLogicService; +import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class LcmSliClient { + + private static final Logger LOG = LoggerFactory.getLogger(LcmSliClient.class); + + private final SvcLogicService svcLogicService; + + private String ErrorCode = "error-code"; + + public LcmSliClient(final SvcLogicService svcLogicService) { + this.svcLogicService = svcLogicService; + } + + public boolean hasGraph(String module, String rpc, String version, String mode) throws SvcLogicException + { + return svcLogicService.hasGraph(module, rpc, version, mode); + } + + + public Properties execute(String module, String rpc, String version, String mode, Properties parms, DOMDataBroker dataBroker) + throws SvcLogicException { + + + if (LOG.isDebugEnabled()) + { + LOG.debug("Parameters passed to SLI"); + + for (Object key : parms.keySet()) { + String parmName = (String) key; + String parmValue = parms.getProperty(parmName); + + LOG.debug(parmName+" = "+parmValue); + + } + } + + Properties respProps = svcLogicService.execute(module, rpc, version, mode, parms, dataBroker); + + if (LOG.isDebugEnabled()) + { + LOG.debug("Parameters returned by SLI"); + + for (Object key : respProps.keySet()) { + String parmName = (String) key; + String parmValue = respProps.getProperty(parmName); + + LOG.debug(parmName+" = "+parmValue); + + } + } + + if ("failure".equalsIgnoreCase(respProps.getProperty("SvcLogic.status"))) { + + if (!respProps.containsKey(ErrorCode)) { + respProps.setProperty(ErrorCode, "500"); + } + } else { + if (!respProps.containsKey(ErrorCode)) { + respProps.setProperty(ErrorCode, "200"); + } + } + + + return respProps; + } + +} diff --git a/lcm/provider/src/main/resources/OSGI-INF/blueprint/lcm-blueprint.xml b/lcm/provider/src/main/resources/OSGI-INF/blueprint/lcm-blueprint.xml new file mode 100644 index 000000000..5597d0801 --- /dev/null +++ b/lcm/provider/src/main/resources/OSGI-INF/blueprint/lcm-blueprint.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" + xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0" + odl:use-default-for-reference-types="true"> + + <reference id="svcLogicService" + interface="org.onap.ccsdk.sli.core.sli.provider.SvcLogicService" /> + + <bean id="client" class="org.onap.ccsdk.sli.northbound.LcmSliClient"> + <argument ref="svcLogicService" /> + </bean> + + <reference id="dataBroker" + interface="org.opendaylight.controller.md.sal.binding.api.DataBroker" + odl:type="default" /> + + <reference id="notificationService" + interface="org.opendaylight.controller.md.sal.binding.api.NotificationPublishService" + odl:type="default" /> + + <reference id="rpcRegistry" + interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry" + odl:type="default" /> + + <bean id="provider" class="org.onap.ccsdk.sli.northbound.LcmProvider"> + <argument ref="dataBroker" /> + <argument ref="notificationService" /> + <argument ref="rpcRegistry" /> + <argument ref="client" /> + </bean> + + <odl:rpc-implementation ref="provider"/> + +</blueprint>
\ No newline at end of file diff --git a/lcm/provider/src/main/resources/org/opendaylight/blueprint/lcm-blueprint.xml b/lcm/provider/src/main/resources/org/opendaylight/blueprint/lcm-blueprint.xml new file mode 100644 index 000000000..5597d0801 --- /dev/null +++ b/lcm/provider/src/main/resources/org/opendaylight/blueprint/lcm-blueprint.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" + xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0" + odl:use-default-for-reference-types="true"> + + <reference id="svcLogicService" + interface="org.onap.ccsdk.sli.core.sli.provider.SvcLogicService" /> + + <bean id="client" class="org.onap.ccsdk.sli.northbound.LcmSliClient"> + <argument ref="svcLogicService" /> + </bean> + + <reference id="dataBroker" + interface="org.opendaylight.controller.md.sal.binding.api.DataBroker" + odl:type="default" /> + + <reference id="notificationService" + interface="org.opendaylight.controller.md.sal.binding.api.NotificationPublishService" + odl:type="default" /> + + <reference id="rpcRegistry" + interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry" + odl:type="default" /> + + <bean id="provider" class="org.onap.ccsdk.sli.northbound.LcmProvider"> + <argument ref="dataBroker" /> + <argument ref="notificationService" /> + <argument ref="rpcRegistry" /> + <argument ref="client" /> + </bean> + + <odl:rpc-implementation ref="provider"/> + +</blueprint>
\ No newline at end of file diff --git a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java new file mode 100644 index 000000000..b73151e8d --- /dev/null +++ b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java @@ -0,0 +1,1601 @@ +package org.onap.ccsdk.sli.northbound; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.fail; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.io.InputStream; +import java.net.URL; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Properties; +import java.util.concurrent.ExecutionException; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.onap.ccsdk.sli.core.sli.SvcLogicLoader; +import org.onap.ccsdk.sli.core.sli.SvcLogicStore; +import org.onap.ccsdk.sli.core.sli.SvcLogicStoreFactory; +import org.onap.ccsdk.sli.core.sli.provider.SvcLogicClassResolver; +import org.onap.ccsdk.sli.core.sli.provider.SvcLogicPropertiesProviderImpl; +import org.onap.ccsdk.sli.core.sli.provider.SvcLogicServiceImpl; +import org.opendaylight.controller.md.sal.binding.api.DataBroker; +import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; +import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; +import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.Action; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ActionStatusInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ActionStatusOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.AttachVolumeInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.AttachVolumeOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.AuditInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.AuditOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.CheckLockInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.CheckLockOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigBackupDeleteInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigBackupDeleteOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigBackupInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigBackupOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigExportInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigExportOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigModifyInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigModifyOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigRestoreInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigRestoreOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigScaleOutInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigScaleOutOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigureInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ConfigureOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DetachVolumeInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DetachVolumeOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DistributeTrafficInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DistributeTrafficOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.EvacuateInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.EvacuateOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.HealthCheckInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.HealthCheckOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.LCMService; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.LiveUpgradeInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.LiveUpgradeOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.LockInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.LockOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.MigrateInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.MigrateOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.Payload; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.QueryInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.QueryOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.QuiesceTrafficInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.QuiesceTrafficOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.RebootInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.RebootOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.RestartInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.RestartOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ResumeTrafficInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ResumeTrafficOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.RollbackInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.RollbackOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.SnapshotInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.SnapshotOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.SoftwareUploadInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.SoftwareUploadOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.StartApplicationInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.StartApplicationOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.StartInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.StartOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.StopApplicationInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.StopApplicationOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.StopInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.StopOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.SyncInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.SyncOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.TerminateInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.TerminateOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.TestInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.TestOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UnlockInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UnlockOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradeBackoutInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradeBackoutOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradeBackupInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradeBackupOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradePostCheckInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradePostCheckOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradePreCheckInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradePreCheckOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradeSoftwareInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.UpgradeSoftwareOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DownloadNESwInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.DownloadNESwOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ActivateNESwInputBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ActivateNESwOutput; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.ZULU; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.action.identifiers.ActionIdentifiersBuilder; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.common.header.CommonHeaderBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TestLcmProvider { + + Logger LOG = LoggerFactory.getLogger(LcmProvider.class); + private LcmProvider provider; + + /** + * @throws java.lang.Exception + */ + @Before + public void setUp() throws Exception { + DataBroker dataBroker = mock(DataBroker.class); + NotificationPublishService notifyService = mock(NotificationPublishService.class); + RpcProviderRegistry rpcRegistry = mock(RpcProviderRegistry.class); + BindingAwareBroker.RpcRegistration<LCMService> rpcRegistration = (BindingAwareBroker.RpcRegistration<LCMService>) mock(BindingAwareBroker.RpcRegistration.class); + when(rpcRegistry.addRpcImplementation(any(Class.class), any(LCMService.class))).thenReturn(rpcRegistration); + + + // Load svclogic.properties and get a SvcLogicStore + InputStream propStr = TestLcmProvider.class.getResourceAsStream("/svclogic.properties"); + Properties svcprops = new Properties(); + svcprops.load(propStr); + + SvcLogicStore store = SvcLogicStoreFactory.getSvcLogicStore(svcprops); + + assertNotNull(store); + + URL graphUrl = TestLcmProvider.class.getClassLoader().getResource("graphs"); + + if (graphUrl == null) { + fail("Cannot find graphs directory"); + } + + SvcLogicLoader loader = new SvcLogicLoader(graphUrl.getPath(), store); + loader.loadAndActivate(); + + // Create a ServiceLogicService + SvcLogicServiceImpl svc = new SvcLogicServiceImpl(new SvcLogicPropertiesProviderImpl(), + new SvcLogicClassResolver()); + + // Finally ready to create sliapiProvider + LcmSliClient client = new LcmSliClient(svc); + provider = new LcmProvider(dataBroker, notifyService, rpcRegistry, client); + } + + /** + * @throws java.lang.Exception + */ + @After + public void tearDown() throws Exception { + provider.close(); + } + + + @Test + public void testCheckLock() { + CheckLockInputBuilder builder = new CheckLockInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.CheckLock); + + try { + CheckLockOutput results = provider.checkLock(builder.build()).get().getResult(); + LOG.info("CheckLock returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("CheckLock threw exception"); + } + + } + + @Test + public void testReboot() { + RebootInputBuilder builder = new RebootInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Reboot); + builder.setPayload(mock(Payload.class)); + + + try { + RebootOutput results = provider.reboot(builder.build()).get().getResult(); + LOG.info("Reboot returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Reboot threw exception"); + } + } + + @Test + public void testUpgradeBackup() { + UpgradeBackupInputBuilder builder = new UpgradeBackupInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.UpgradeBackup); + builder.setPayload(mock(Payload.class)); + + + + try { + UpgradeBackupOutput results = provider.upgradeBackup(builder.build()).get().getResult(); + LOG.info("UpgradeBackout returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("CheckLock threw exception"); + } + } + + @Test + public void testRollback() { + RollbackInputBuilder builder = new RollbackInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Rollback); + builder.setPayload(mock(Payload.class)); + + + try { + RollbackOutput results = provider.rollback(builder.build()).get().getResult(); + LOG.info("Rollback returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Rollback threw exception"); + } + } + + @Test + public void testSync() { + SyncInputBuilder builder = new SyncInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Sync); + builder.setPayload(mock(Payload.class)); + + + try { + SyncOutput results = provider.sync(builder.build()).get().getResult(); + LOG.info("Sync returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Sync threw exception"); + } + } + + @Test + public void testQuery() { + QueryInputBuilder builder = new QueryInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Query); + + + try { + QueryOutput results = provider.query(builder.build()).get().getResult(); + LOG.info("Query returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Query threw exception"); + } + + } + + @Test + public void testConfigExport() { + ConfigExportInputBuilder builder = new ConfigExportInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.ConfigExport); + + + try { + ConfigExportOutput results = provider.configExport(builder.build()).get().getResult(); + LOG.info("ConfigExport returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("ConfigExport threw exception"); + } + } + + @Test + public void testStopApplication() { + + StopApplicationInputBuilder builder = new StopApplicationInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.StopApplication); + builder.setPayload(mock(Payload.class)); + + + try { + StopApplicationOutput results = provider.stopApplication(builder.build()).get().getResult(); + LOG.info("StopApplication returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("StopApplication threw exception"); + } + } + + @Test + public void testSoftwareUpload() { + SoftwareUploadInputBuilder builder = new SoftwareUploadInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.SoftwareUpload); + builder.setPayload(mock(Payload.class)); + + + try { + SoftwareUploadOutput results = provider.softwareUpload(builder.build()).get().getResult(); + LOG.info("SoftwareUpload returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("SoftwareUpload threw exception"); + } + } + + @Test + public void testResumeTraffic() { + ResumeTrafficInputBuilder builder = new ResumeTrafficInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.ResumeTraffic); + builder.setPayload(mock(Payload.class)); + + + try { + ResumeTrafficOutput results = provider.resumeTraffic(builder.build()).get().getResult(); + LOG.info("ResumeTraffic returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("ResumeTraffic threw exception"); + } + } + + @Test + public void testDistributeTraffic() { + DistributeTrafficInputBuilder builder = new DistributeTrafficInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.DistributeTraffic); + builder.setPayload(mock(Payload.class)); + + + try { + DistributeTrafficOutput results = provider.distributeTraffic(builder.build()).get().getResult(); + LOG.info("DistributeTraffic returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("DistributeTraffic threw exception"); + } + } + + @Test + public void testConfigure() { + ConfigureInputBuilder builder = new ConfigureInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Configure); + builder.setPayload(mock(Payload.class)); + + + try { + ConfigureOutput results = provider.configure(builder.build()).get().getResult(); + LOG.info("Configure returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Configure threw exception"); + } + } + + @Test + public void testActionStatus() { + ActionStatusInputBuilder builder = new ActionStatusInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.ActionStatus); + builder.setPayload(mock(Payload.class)); + + + try { + ActionStatusOutput results = provider.actionStatus(builder.build()).get().getResult(); + LOG.info("ActionStatus returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("ActionStatus threw exception"); + } + } + + @Test + public void testUpgradePreCheck() { + UpgradePreCheckInputBuilder builder = new UpgradePreCheckInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.UpgradePreCheck); + builder.setPayload(mock(Payload.class)); + + + try { + UpgradePreCheckOutput results = provider.upgradePreCheck(builder.build()).get().getResult(); + LOG.info("UpgradePreCheck returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("UpgradePreCheck threw exception"); + } + } + + @Test + public void testLiveUpgrade() { + LiveUpgradeInputBuilder builder = new LiveUpgradeInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.LiveUpgrade); + builder.setPayload(mock(Payload.class)); + + + try { + LiveUpgradeOutput results = provider.liveUpgrade(builder.build()).get().getResult(); + LOG.info("LiveUpgrade returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("LiveUpgrade threw exception"); + } + } + + @Test + public void testConfigModify() { + ConfigModifyInputBuilder builder = new ConfigModifyInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.ConfigModify); + builder.setPayload(mock(Payload.class)); + + + try { + ConfigModifyOutput results = provider.configModify(builder.build()).get().getResult(); + LOG.info("ConfigModify returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("ConfigModify threw exception"); + } + } + + @Test + public void testRestart() { + RestartInputBuilder builder = new RestartInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Restart); + builder.setPayload(mock(Payload.class)); + + + try { + RestartOutput results = provider.restart(builder.build()).get().getResult(); + LOG.info("Restart returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Restart threw exception"); + } + } + + @Test + public void testHealthCheck() { + HealthCheckInputBuilder builder = new HealthCheckInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.HealthCheck); + builder.setPayload(mock(Payload.class)); + + + try { + HealthCheckOutput results = provider.healthCheck(builder.build()).get().getResult(); + LOG.info("HealthCheck returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("HealthCheck threw exception"); + } + } + + @Test + public void testLock() { + LockInputBuilder builder = new LockInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Lock); + builder.setPayload(mock(Payload.class)); + + + try { + LockOutput results = provider.lock(builder.build()).get().getResult(); + LOG.info("Lock returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Lock threw exception"); + } + } + + @Test + public void testTerminate() { + TerminateInputBuilder builder = new TerminateInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Terminate); + builder.setPayload(mock(Payload.class)); + + + try { + TerminateOutput results = provider.terminate(builder.build()).get().getResult(); + LOG.info("Terminate returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Terminate threw exception"); + } + } + + @Test + public void testAttachVolume() { + AttachVolumeInputBuilder builder = new AttachVolumeInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.AttachVolume); + builder.setPayload(mock(Payload.class)); + + + try { + AttachVolumeOutput results = provider.attachVolume(builder.build()).get().getResult(); + LOG.info("AttachVolume returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("AttachVolume threw exception"); + } + } + + @Test + public void testMigrate() { + MigrateInputBuilder builder = new MigrateInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Migrate); + builder.setPayload(mock(Payload.class)); + + + try { + MigrateOutput results = provider.migrate(builder.build()).get().getResult(); + LOG.info("Migrate returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Migrate threw exception"); + } + } + + @Test + public void testQuiesceTraffic() { + QuiesceTrafficInputBuilder builder = new QuiesceTrafficInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.QuiesceTraffic); + builder.setPayload(mock(Payload.class)); + + + try { + QuiesceTrafficOutput results = provider.quiesceTraffic(builder.build()).get().getResult(); + LOG.info("QuiesceTraffic returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("QuiesceTraffic threw exception"); + } + } + + @Test + public void testConfigRestore() { + ConfigRestoreInputBuilder builder = new ConfigRestoreInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.ConfigRestore); + builder.setPayload(mock(Payload.class)); + + + try { + ConfigRestoreOutput results = provider.configRestore(builder.build()).get().getResult(); + LOG.info("ConfigRestore returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("ConfigRestore threw exception"); + } + } + + @Test + public void testUpgradeBackout() { + UpgradeBackoutInputBuilder builder = new UpgradeBackoutInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.UpgradeBackout); + builder.setPayload(mock(Payload.class)); + + + try { + UpgradeBackoutOutput results = provider.upgradeBackout(builder.build()).get().getResult(); + LOG.info("UpgradeBackout returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("UpgradeBackout threw exception"); + } + } + + @Test + public void testEvacuate() { + EvacuateInputBuilder builder = new EvacuateInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Evacuate); + builder.setPayload(mock(Payload.class)); + + + try { + EvacuateOutput results = provider.evacuate(builder.build()).get().getResult(); + LOG.info("Evacuate returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Evacuate threw exception"); + } + } + + @Test + public void testUnlock() { + UnlockInputBuilder builder = new UnlockInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Unlock); + builder.setPayload(mock(Payload.class)); + + + try { + UnlockOutput results = provider.unlock(builder.build()).get().getResult(); + LOG.info("Unlock returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Unlock threw exception"); + } + } + + @Test + public void testConfigBackupDelete() { + ConfigBackupDeleteInputBuilder builder = new ConfigBackupDeleteInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.ConfigBackupDelete); + + + try { + ConfigBackupDeleteOutput results = provider.configBackupDelete(builder.build()).get().getResult(); + LOG.info("ConfigBackupDelete returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("ConfigBackupDelete threw exception"); + } + } + + @Test + public void testUpgradeSoftware() { + UpgradeSoftwareInputBuilder builder = new UpgradeSoftwareInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.UpgradeSoftware); + builder.setPayload(mock(Payload.class)); + + + try { + UpgradeSoftwareOutput results = provider.upgradeSoftware(builder.build()).get().getResult(); + LOG.info("UpgradeSoftware returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("UpgradeSoftware threw exception"); + } + } + + @Test + public void testDownloadNESw() { + DownloadNESwInputBuilder builder = new DownloadNESwInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setPnfName("my-pnf"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.DownloadNESw); + builder.setPayload(mock(Payload.class)); + + + try { + DownloadNESwOutput results = provider.downloadNESw(builder.build()).get().getResult(); + LOG.info("DownloadNESw returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("DownloadNESw threw exception"); + } + } + + @Test + public void testActivateNESw() { + ActivateNESwInputBuilder builder = new ActivateNESwInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setPnfName("my-pnf"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.ActivateNESw); + builder.setPayload(mock(Payload.class)); + + + try { + ActivateNESwOutput results = provider.activateNESw(builder.build()).get().getResult(); + LOG.info("ActivateNESw returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("ActivateNESw threw exception"); + } + } + + @Test + public void testStop() { + StopInputBuilder builder = new StopInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Stop); + builder.setPayload(mock(Payload.class)); + + + try { + StopOutput results = provider.stop(builder.build()).get().getResult(); + LOG.info("Stop returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Stop threw exception"); + } + } + + @Test + public void testDetachVolume() { + DetachVolumeInputBuilder builder = new DetachVolumeInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.DetachVolume); + builder.setPayload(mock(Payload.class)); + + + try { + DetachVolumeOutput results = provider.detachVolume(builder.build()).get().getResult(); + LOG.info("DetachVolume returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("DetachVolume threw exception"); + } + } + + @Test + public void testConfigScaleOut() { + ConfigScaleOutInputBuilder builder = new ConfigScaleOutInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.ConfigScaleOut); + builder.setPayload(mock(Payload.class)); + + + try { + ConfigScaleOutOutput results = provider.configScaleOut(builder.build()).get().getResult(); + LOG.info("ConfigScaleOut returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("ConfigScaleOut threw exception"); + } + } + + @Test + public void testUpgradePostCheck() { + UpgradePostCheckInputBuilder builder = new UpgradePostCheckInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.UpgradePostCheck); + builder.setPayload(mock(Payload.class)); + + + try { + UpgradePostCheckOutput results = provider.upgradePostCheck(builder.build()).get().getResult(); + LOG.info("UpgradePostCheck returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("UpgradePostCheck threw exception"); + } + } + + @Test + public void testTest() { + TestInputBuilder builder = new TestInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Test); + builder.setPayload(mock(Payload.class)); + + + try { + TestOutput results = provider.test(builder.build()).get().getResult(); + LOG.info("Test returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Test threw exception"); + } + } + + @Test + public void testStartApplication() { + StartApplicationInputBuilder builder = new StartApplicationInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.StartApplication); + builder.setPayload(mock(Payload.class)); + + + try { + StartApplicationOutput results = provider.startApplication(builder.build()).get().getResult(); + LOG.info("StartApplication returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("StartApplication threw exception"); + } + } + + @Test + public void testConfigBackup() { + ConfigBackupInputBuilder builder = new ConfigBackupInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.ConfigBackup); + builder.setPayload(mock(Payload.class)); + + + try { + ConfigBackupOutput results = provider.configBackup(builder.build()).get().getResult(); + LOG.info("ConfigBackup returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("ConfigBackup threw exception"); + } + } + + @Test + public void testRebuild() { + ConfigBackupInputBuilder builder = new ConfigBackupInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.ConfigBackup); + builder.setPayload(mock(Payload.class)); + + + try { + ConfigBackupOutput results = provider.configBackup(builder.build()).get().getResult(); + LOG.info("ConfigBackup returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("ConfigBackup threw exception"); + } + } + + @Test + public void testAudit() { + AuditInputBuilder builder = new AuditInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Audit); + builder.setPayload(mock(Payload.class)); + + + try { + AuditOutput results = provider.audit(builder.build()).get().getResult(); + LOG.info("Audit returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Audit threw exception"); + } + } + + @Test + public void testStart() { + StartInputBuilder builder = new StartInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Start); + builder.setPayload(mock(Payload.class)); + + + try { + StartOutput results = provider.start(builder.build()).get().getResult(); + LOG.info("Start returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Start threw exception"); + } + } + + @Test + public void testSnapshot() { + SnapshotInputBuilder builder = new SnapshotInputBuilder(); + + CommonHeaderBuilder hdrBuilder = new CommonHeaderBuilder(); + hdrBuilder.setApiVer("1"); + hdrBuilder.setFlags(null); + hdrBuilder.setOriginatorId("jUnit"); + hdrBuilder.setRequestId("123"); + hdrBuilder.setTimestamp(new ZULU(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date()))); + builder.setCommonHeader(hdrBuilder.build()); + + ActionIdentifiersBuilder aBuilder = new ActionIdentifiersBuilder(); + aBuilder.setServiceInstanceId("SVCID-123"); + aBuilder.setVfModuleId("vf-module-1"); + aBuilder.setVnfcName("my-vnfc"); + aBuilder.setVnfId("123"); + aBuilder.setVserverId("123"); + builder.setActionIdentifiers(aBuilder.build()); + + builder.setAction(Action.Snapshot); + builder.setPayload(mock(Payload.class)); + + + try { + SnapshotOutput results = provider.snapshot(builder.build()).get().getResult(); + LOG.info("Snapshot returned status {} : {}", results.getStatus().getCode(), results.getStatus().getMessage()); + assert(results.getStatus().getCode() == 400); + } catch (InterruptedException | ExecutionException e) { + LOG.error("Caught exception", e); + fail("Snapshot threw exception"); + } + } + +} diff --git a/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmRpcInvocationException.java b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmRpcInvocationException.java new file mode 100644 index 000000000..f95e83250 --- /dev/null +++ b/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmRpcInvocationException.java @@ -0,0 +1,20 @@ +package org.onap.ccsdk.sli.northbound; + +import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.common.header.CommonHeader; +import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.lcm.rev180329.status.Status; + +public class TestLcmRpcInvocationException { + + @Test(expected = SvcLogicException.class) + public void testLcmRpcInvocationException() throws SvcLogicException{ + Status status = null; + CommonHeader commonHeader = null; + LcmRpcInvocationException exception = new LcmRpcInvocationException(status, commonHeader); + assert(exception.getStatus() == status); + assert(exception.getCommonHeader() == commonHeader); + throw exception; + } +} diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Audit.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Audit.xml new file mode 100644 index 000000000..34c84ed9a --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Audit.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='audit' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Configure.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Configure.xml new file mode 100644 index 000000000..a37f0675a --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Configure.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='configure' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Evacuate.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Evacuate.xml new file mode 100644 index 000000000..216bd418b --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Evacuate.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='evacuate' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Lock.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Lock.xml new file mode 100644 index 000000000..6479d3ec5 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Lock.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='lock' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Migrate.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Migrate.xml new file mode 100644 index 000000000..9c8959681 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Migrate.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='migrate' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Query.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Query.xml new file mode 100644 index 000000000..5d0312292 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Query.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='query' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Reboot.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Reboot.xml new file mode 100644 index 000000000..f117f9606 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Reboot.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='reboot' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Rebuild.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Rebuild.xml new file mode 100644 index 000000000..e721bc5a7 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Rebuild.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='rebuild' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Restart.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Restart.xml new file mode 100644 index 000000000..b47091af2 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Restart.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='restart' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Rollback.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Rollback.xml new file mode 100644 index 000000000..6844d0482 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Rollback.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='rollback' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Snapshot.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Snapshot.xml new file mode 100644 index 000000000..6d0f8b039 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Snapshot.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='snapshot' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Start.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Start.xml new file mode 100644 index 000000000..5998614ab --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Start.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='start' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Stop.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Stop.xml new file mode 100644 index 000000000..f752725de --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Stop.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='stop' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Sync.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Sync.xml new file mode 100644 index 000000000..5741175cf --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Sync.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='sync' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Terminate.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Terminate.xml new file mode 100644 index 000000000..0f2758a89 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Terminate.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='terminate' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Test.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Test.xml new file mode 100644 index 000000000..5ce002d0c --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Test.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='test' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_Unlock.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_Unlock.xml new file mode 100644 index 000000000..d506c2fd5 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_Unlock.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='unlock' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_action-status.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_action-status.xml new file mode 100644 index 000000000..435a62d95 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_action-status.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='action-status' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_activate-n-e-sw.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_activate-n-e-sw.xml new file mode 100644 index 000000000..44343dd5f --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_activate-n-e-sw.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='activate-n-e-sw' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_attach-volume.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_attach-volume.xml new file mode 100644 index 000000000..b073f9b7e --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_attach-volume.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='attach-volume' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_check-lock.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_check-lock.xml new file mode 100644 index 000000000..e07bf133d --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_check-lock.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='check-lock' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_config-backup-delete.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_config-backup-delete.xml new file mode 100644 index 000000000..5366c30a0 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_config-backup-delete.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='config-backup-delete' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_config-backup.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_config-backup.xml new file mode 100644 index 000000000..e32e5fe5b --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_config-backup.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='config-backup' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_config-export.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_config-export.xml new file mode 100644 index 000000000..fd6596bac --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_config-export.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='config-export' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_config-modify.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_config-modify.xml new file mode 100644 index 000000000..76782f432 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_config-modify.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='config-modify' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_config-restore.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_config-restore.xml new file mode 100644 index 000000000..e0ed71b8a --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_config-restore.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='config-restore' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_config-scale-out.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_config-scale-out.xml new file mode 100644 index 000000000..5200feb8a --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_config-scale-out.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='config-scale-out' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_detach-volume.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_detach-volume.xml new file mode 100644 index 000000000..117a3e31a --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_detach-volume.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='detach-volume' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_distribute-traffic.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_distribute-traffic.xml new file mode 100644 index 000000000..14ff1134c --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_distribute-traffic.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='distribute-traffic' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_download-n-e-sw.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_download-n-e-sw.xml new file mode 100644 index 000000000..6bb0e765c --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_download-n-e-sw.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='download-n-e-sw' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_health-check.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_health-check.xml new file mode 100644 index 000000000..cf0f773e6 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_health-check.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='health-check' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_live-upgrade.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_live-upgrade.xml new file mode 100644 index 000000000..02fb050f8 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_live-upgrade.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='live-upgrade' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_quiesce-traffic.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_quiesce-traffic.xml new file mode 100644 index 000000000..0770b3dfc --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_quiesce-traffic.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='quiesce-traffic' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_resume-traffic.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_resume-traffic.xml new file mode 100644 index 000000000..7e0f1d6b3 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_resume-traffic.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='resume-traffic' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_software-upload.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_software-upload.xml new file mode 100644 index 000000000..a9eb58ac4 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_software-upload.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='software-upload' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_start-application.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_start-application.xml new file mode 100644 index 000000000..9b422a83c --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_start-application.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='start-application' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_stop-application.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_stop-application.xml new file mode 100644 index 000000000..91dc4fca6 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_stop-application.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='stop-application' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_update-software.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_update-software.xml new file mode 100644 index 000000000..75440c2a0 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_update-software.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='upgrade-software' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-backout.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-backout.xml new file mode 100644 index 000000000..d48d6817a --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-backout.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='upgrade-backout' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-backup.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-backup.xml new file mode 100644 index 000000000..d81651a83 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-backup.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='upgrade-backup' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-post-check.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-post-check.xml new file mode 100644 index 000000000..ba2798a41 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-post-check.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='upgrade-post-check' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-pre-check.xml b/lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-pre-check.xml new file mode 100644 index 000000000..1aaf18fff --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/LCM_upgrade-pre-check.xml @@ -0,0 +1,30 @@ +<!-- + ============LICENSE_START======================================================= + openECOMP : SDN-C + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property. All rights + reserved. + ================================================================================ + 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. + ============LICENSE_END========================================================= + --> + +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" + module='LCM' version='1.0.0'> + <method rpc='upgrade-pre-check' mode='sync'> + <set> + <parameter name='status.code' value='400' /> + <parameter name='status.message' value='SUCCESS' /> + </set> + </method> +</service-logic> diff --git a/lcm/provider/src/test/resources/graphs/lcm/graph.versions b/lcm/provider/src/test/resources/graphs/lcm/graph.versions new file mode 100644 index 000000000..420bcf619 --- /dev/null +++ b/lcm/provider/src/test/resources/graphs/lcm/graph.versions @@ -0,0 +1,42 @@ +LCM restart 1.0.0 sync +LCM rebuild 1.0.0 sync +LCM migrate 1.0.0 sync +LCM evacuate 1.0.0 sync +LCM snapshot 1.0.0 sync +LCM rollback 1.0.0 sync +LCM sync 1.0.0 sync +LCM audit 1.0.0 sync +LCM stop 1.0.0 sync +LCM start 1.0.0 sync +LCM terminate 1.0.0 sync +LCM software-upload 1.0.0 sync +LCM health-check 1.0.0 sync +LCM live-upgrade 1.0.0 sync +LCM lock 1.0.0 sync +LCM unlock 1.0.0 sync +LCM test 1.0.0 sync +LCM check-lock 1.0.0 sync +LCM configure 1.0.0 sync +LCM config-modify 1.0.0 sync +LCM config-scale-out 1.0.0 sync +LCM config-restore 1.0.0 sync +LCM config-backup 1.0.0 sync +LCM config-backup-delete 1.0.0 sync +LCM config-export 1.0.0 sync +LCM stop-application 1.0.0 sync +LCM start-application 1.0.0 sync +LCM quiesce-traffic 1.0.0 sync +LCM resume-traffic 1.0.0 sync +LCM distribute-traffic 1.0.0 sync +LCM upgrade-pre-check 1.0.0 sync +LCM upgrade-software 1.0.0 sync +LCM download-n-e-sw 1.0.0 sync +LCM activate-n-e-sw 1.0.0 sync +LCM upgrade-post-check 1.0.0 sync +LCM upgrade-backup 1.0.0 sync +LCM upgrade-backout 1.0.0 sync +LCM action-status 1.0.0 sync +LCM query 1.0.0 sync +LCM reboot 1.0.0 sync +LCM attach-volume 1.0.0 sync +LCM detach-volume 1.0.0 sync diff --git a/lcm/provider/src/test/resources/simplelogger.properties b/lcm/provider/src/test/resources/simplelogger.properties new file mode 100644 index 000000000..001dfd427 --- /dev/null +++ b/lcm/provider/src/test/resources/simplelogger.properties @@ -0,0 +1,22 @@ +### +# ============LICENSE_START======================================================= +# ONAP : CCSDK +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. +# ================================================================================ +# 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. +# ============LICENSE_END========================================================= +### + +org.slf4j.simpleLogger.defaultLogLevel=debug diff --git a/lcm/provider/src/test/resources/svclogic.properties b/lcm/provider/src/test/resources/svclogic.properties new file mode 100644 index 000000000..426960f76 --- /dev/null +++ b/lcm/provider/src/test/resources/svclogic.properties @@ -0,0 +1,27 @@ +### +# ============LICENSE_START======================================================= +# ONAP : CCSDK +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. +# ================================================================================ +# 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. +# ============LICENSE_END========================================================= +### + +org.onap.ccsdk.sli.dbtype = jdbc +org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:sdnctl;create=true +org.onap.ccsdk.sli.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver +org.onap.ccsdk.sli.jdbc.database = sdnctl +org.onap.ccsdk.sli.jdbc.user = test +org.onap.ccsdk.sli.jdbc.password = test |