import org.apache.commons.lang.StringUtils;
import org.onap.aai.inventory.v21.GenericVnf;
import org.onap.ccsdk.sli.adaptors.aai.data.AAIDatum;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;
try {
Reader reader = new InputStreamReader(in, StandardCharsets.UTF_8);
- Properties properties = new Properties();
+ Properties properties = new EnvProperties();
properties.load(reader);
LOG.info("loaded " + properties.size());
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
import org.onap.ccsdk.sli.core.sli.SvcLogicResource;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
import org.onap.aai.inventory.v21.GenericVnf;
import org.onap.aai.inventory.v21.PhysicalLink;
import org.onap.aai.inventory.v21.ResultData;
}
private static Properties getProperties(URL url) {
- Properties properties = new Properties();
+ Properties properties = new EnvProperties();
try {
properties.load(url.openStream());
} catch (IOException exc) {
}
InputStream is = null;
- Properties props = new Properties();
+ Properties props = new EnvProperties();
try {
if(LOG.isDebugEnabled())
import org.onap.ccsdk.sli.core.utils.PropertiesFileResolver;
import org.onap.ccsdk.sli.core.utils.common.BundleContextFileResolver;
import org.onap.ccsdk.sli.core.utils.common.CoreDefaultFileResolver;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
import org.onap.ccsdk.sli.core.utils.common.SdncConfigEnvVarFileResolver;
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;
final File propertiesFile = determinePropertiesFile();
if (propertiesFile != null) {
try(FileInputStream fileInputStream = new FileInputStream(propertiesFile)) {
- properties = new Properties();
+ properties = new EnvProperties();
properties.load(fileInputStream);
if(properties.containsKey(AAICLIENT_PROPERTY_NAME)) {
# Certificate keystore and truststore
#
org.onap.ccsdk.sli.adaptors.aai.ssl.trust=/opt/onap/ccsdk/data/stores/truststore.onap.client.jks
-org.onap.ccsdk.sli.adaptors.aai.ssl.trust.psswd=adminadmin
+org.onap.ccsdk.sli.adaptors.aai.ssl.trust.psswd=${AAI_TRUSTSTORE_PASSWORD:-adminadmin}`
org.onap.ccsdk.sli.adaptors.aai.host.certificate.ignore=true
-org.onap.ccsdk.sli.adaptors.aai.client.name=SDNC
-org.onap.ccsdk.sli.adaptors.aai.client.psswd=SDNC
+org.onap.ccsdk.sli.adaptors.aai.client.name=${AAI_CLIENT_NAME:-SDNC}
+org.onap.ccsdk.sli.adaptors.aai.client.psswd=${AAI_CLIENT_PASSWORD:-SDNC}
org.onap.ccsdk.sli.adaptors.aai.application=CCSDK
#
import org.onap.ccsdk.sli.core.utils.KarafRootFileResolver;
import org.onap.ccsdk.sli.core.utils.PropertiesFileResolver;
import org.onap.ccsdk.sli.core.utils.common.CoreDefaultFileResolver;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
import org.onap.ccsdk.sli.core.utils.common.SdncConfigEnvVarFileResolver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
final File propertiesFile = determinePropertiesFile(this);
if (propertiesFile != null) {
try (FileInputStream fileInputStream = new FileInputStream(propertiesFile)) {
- properties = new Properties();
+ properties = new EnvProperties();
properties.load(fileInputStream);
} catch (final IOException e) {
LOG.error("Failed to load properties for file: {}", propertiesFile.toString(),
InputStream propStr = getClass().getResourceAsStream("/" + ANSIBLEADAPTER_PROP_FILE_NAME);
if (propStr != null) {
- properties = new Properties();
+ properties = new EnvProperties();
try {
properties.load(propStr);
propStr.close();
import org.onap.ccsdk.sli.core.utils.KarafRootFileResolver;
import org.onap.ccsdk.sli.core.utils.PropertiesFileResolver;
import org.onap.ccsdk.sli.core.utils.common.CoreDefaultFileResolver;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
import org.onap.ccsdk.sli.core.utils.common.SdncConfigEnvVarFileResolver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
final File propertiesFile = determinePropertiesFile(this);
if (propertiesFile != null) {
try (FileInputStream fileInputStream = new FileInputStream(propertiesFile)) {
- properties = new Properties();
+ properties = new EnvProperties();
properties.load(fileInputStream);
} catch (final IOException e) {
LOG.error("Failed to load properties for file: {}", propertiesFile.toString(),
InputStream propStr = getClass().getResourceAsStream("/" + MDSALRESOURCE_PROP_FILE_NAME);
if (propStr != null) {
- properties = new Properties();
+ properties = new EnvProperties();
try {
properties.load(propStr);
propStr.close();
# ============LICENSE_END=========================================================
###
-org.onap.ccsdk.sli.adaptors.resource.mdsal.sdnc-user=admin
-org.onap.ccsdk.sli.adaptors.resource.mdsal.sdnc-passwd=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U
+org.onap.ccsdk.sli.adaptors.resource.mdsal.sdnc-user=${ODL_USER:-admin}
+org.onap.ccsdk.sli.adaptors.resource.mdsal.sdnc-passwd=${ODL_PASSWORD:-Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U}
org.onap.ccsdk.sli.adaptors.resource.mdsal.sdnc-host=localhost
org.onap.ccsdk.sli.adaptors.resource.mdsal.sdnc-protocol=http
org.onap.ccsdk.sli.adaptors.resource.mdsal.sdnc-port=8181
###
org.onap.ccsdk.sli.adaptors.dbtype = jdbc
-org.onap.ccsdk.sli.adaptors.jdbc.url = jdbc:mysql://dbhost:3306/sdnctl
-org.onap.ccsdk.sli.adaptors.jdbc.database = sdnctl
-org.onap.ccsdk.sli.adaptors.jdbc.user = sdnctl
-org.onap.ccsdk.sli.adaptors.jdbc.password = gamma
+org.onap.ccsdk.sli.adaptors.jdbc.url = jdbc:mysql://dbhost:3306/${MYSQL_DATABASE}
+org.onap.ccsdk.sli.adaptors.jdbc.database = ${MYSQL_DATABASE}
+org.onap.ccsdk.sli.adaptors.jdbc.user = ${MYSQL_USER}
+org.onap.ccsdk.sli.adaptors.jdbc.password = ${MYSQL_PASSWORD}
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>binding-parent</artifactId>
<version>2.1.1-SNAPSHOT</version>
- <relativePath/>
+ <relativePath />
</parent>
<groupId>org.onap.ccsdk.sli.adaptors</groupId>
<name>ccsdk-sli-adaptors :: netbox-client :: ${project.artifactId}</name>
<dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.onap.ccsdk.sli.core</groupId>
- <artifactId>sli-core-artifacts</artifactId>
- <version>${project.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
+ <dependencies>
+ <dependency>
+ <groupId>org.onap.ccsdk.sli.core</groupId>
+ <artifactId>sli-core-artifacts</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
</dependencyManagement>
<dependencies>
import java.io.InputStream;
import java.net.URL;
import java.util.Properties;
+
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;
}
private void loadProps() {
- properties = new Properties();
+ properties = new EnvProperties();
// Try to load config from dir
final String ccsdkConfigDir =
System.getProperty(PROPERTIES_DIR_KEY, DEFAULT_PROPERTIES_DIR) + "/" + NETBOX_PROPERTY_FILE_NAME;
import org.onap.ccsdk.sli.core.utils.KarafRootFileResolver;
import org.onap.ccsdk.sli.core.utils.PropertiesFileResolver;
import org.onap.ccsdk.sli.core.utils.common.CoreDefaultFileResolver;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
import org.onap.ccsdk.sli.core.utils.common.SdncConfigEnvVarFileResolver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
final File propertiesFile = determinePropertiesFile(this);
if (propertiesFile != null) {
try (FileInputStream fileInputStream = new FileInputStream(propertiesFile)) {
- properties = new Properties();
+ properties = new EnvProperties();
properties.load(fileInputStream);
} catch (final IOException e) {
LOG.error("Failed to load properties for file: {}", propertiesFile.toString(),
InputStream propStr = getClass().getResourceAsStream("/" + SQLRESOURCE_PROP_FILE_NAME);
if (propStr != null) {
- properties = new Properties();
+ properties = new EnvProperties();
try {
properties.load(propStr);
propStr.close();
# ============LICENSE_END=========================================================
###
-org.openecomp.sdnc.resource.sql.cryptkey=QtfJMKggVk
+org.onap.sdnc.resource.sql.cryptkey=${SQL_CRYPTKEY:-duMmyCrYptkEy}
org.onap.ccsdk.sli.adaptors.dbtype=jdbc
org.onap.ccsdk.sli.adaptors.jdbc.hosts=sdnctldb01,sdnctldb02
-org.onap.ccsdk.sli.adaptors.jdbc.url=jdbc:mysql://DBHOST:3306/sdnctl
-org.onap.ccsdk.sli.adaptors.jdbc.database=sdnctl
-org.onap.ccsdk.sli.adaptors.jdbc.user=sdnctl
-org.onap.ccsdk.sli.adaptors.jdbc.password=gamma
+org.onap.ccsdk.sli.adaptors.jdbc.url=jdbc:mysql://DBHOST:3306/${MYSQL_DATABASE}
+org.onap.ccsdk.sli.adaptors.jdbc.database=${MYSQL_DATABASE}
+org.onap.ccsdk.sli.adaptors.jdbc.user=${MYSQL_USER}
+org.onap.ccsdk.sli.adaptors.jdbc.password=${MYSQL_PASSWORD}
org.onap.ccsdk.sli.adaptors.jdbc.connection.name=sdnctldb01
org.onap.ccsdk.sli.adaptors.jdbc.connection.timeout=50
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public void testExists() throws Exception {
- Properties props = new Properties();
+ Properties props = new EnvProperties();
InputStream propStr = getClass().getResourceAsStream("/svclogic.properties");
if (propStr == null) {
fail("src/test/resources/svclogic.properties missing");
# ============LICENSE_END=========================================================
###
-org.openecomp.sdnc.resource.sql.cryptkey=QtfJMKggVk
+org.onap.sdnc.resource.sql.cryptkey=${SQL_CRYPTKEY:-duMmyCrYptkEy}
org.onap.ccsdk.sli.dbtype=jdbc
org.onap.ccsdk.sli.jdbc.hosts=sdnctldb01
-org.onap.ccsdk.sli.jdbc.url=jdbc:mysql://dbhost:3306/sdnctl
+org.onap.ccsdk.sli.jdbc.url=jdbc:mysql://dbhost:3306/${MYSQL_DATABASE}
org.onap.ccsdk.sli.jdbc.driver=org.mariadb.jdbc.Driver
-org.onap.ccsdk.sli.jdbc.database=sdnctl
-org.onap.ccsdk.sli.jdbc.user=sdnctl
-org.onap.ccsdk.sli.jdbc.password=gamma
+org.onap.ccsdk.sli.jdbc.database=${MYSQL_DATABASE}
+org.onap.ccsdk.sli.jdbc.user=${MYSQL_USER}
+org.onap.ccsdk.sli.jdbc.password=${MYSQL_PASSWORD}
org.onap.ccsdk.sli.jdbc.connection.name=sdnctldb01
org.onap.ccsdk.sli.jdbc.connection.timeout=50
org.onap.ccsdk.sli.jdbc.request.timeout=100
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>binding-parent</artifactId>
<version>2.1.1-SNAPSHOT</version>
- <relativePath/>
+ <relativePath />
</parent>
<groupId>org.onap.ccsdk.sli.core</groupId>
<description>The SLI Common package includes common classes used by the various SLI subcomponents, as well as classes used by clients to interface with the service logic interpreter</description>
<properties>
- <!-- Ignore deprecated classes in coverage counts -->
- <sonar.coverage.exclusions>**/MessageWriter.java</sonar.coverage.exclusions>
+ <!-- Ignore deprecated classes in coverage counts -->
+ <sonar.coverage.exclusions>**/MessageWriter.java</sonar.coverage.exclusions>
</properties>
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <environmentVariables>
+ <MYSQL_USER>dummyUser</MYSQL_USER>
+ <MYSQL_PASSWORD>dummyPassword</MYSQL_PASSWORD>
+ <MYSQL_DATABASE>dummyDatabase</MYSQL_DATABASE>
+ </environmentVariables>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <configuration>
+ <environmentVariables>
+ <MYSQL_USER>dummyUser</MYSQL_USER>
+ <MYSQL_PASSWORD>dummyPassword</MYSQL_PASSWORD>
+ <MYSQL_DATABASE>dummyDatabase</MYSQL_DATABASE>
+ </environmentVariables>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
import java.util.Properties;
import javax.sql.rowset.CachedRowSet;
import org.onap.ccsdk.sli.core.dblib.DbLibService;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
initialized = true;
// Read properties
- Properties props = new Properties();
+ Properties props = new EnvProperties();
String propPath = System.getenv(SVCLOGIC_PROP_VAR);
if (propPath == null) {
import java.util.Properties;
import org.onap.ccsdk.sli.core.dblib.DBResourceManager;
import org.onap.ccsdk.sli.core.utils.PathValidator;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public static SvcLogicStore getSvcLogicStore(InputStream inStr) throws SvcLogicException
{
- Properties props = new Properties();
+ Properties props = new EnvProperties();
try {
props.load(inStr);
import org.junit.BeforeClass;
import org.junit.Test;
import org.onap.ccsdk.sli.core.dblib.DBResourceManager;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
InputStream propStr = ITCaseSvcLogicParser.class.getResourceAsStream("/svclogic.properties");
- Properties props = new Properties();
+ Properties props = new EnvProperties();
props.load(propStr);
InputStream propStr = ITCaseSvcLogicParser.class.getResourceAsStream("/dblib.properties");
- Properties props = new Properties();
+ Properties props = new EnvProperties();
props.load(propStr);
import java.net.URL;
import java.util.Properties;
import org.junit.Test;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
public class TestSvcLogicLoader {
InputStream propStr = ITCaseSvcLogicParser.class.getResourceAsStream("/svclogic.properties");
- Properties props = new Properties();
+ Properties props = new EnvProperties();
props.load(propStr);
###
org.onap.ccsdk.sli.dbtype = jdbc
-org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:sdnctl;create=true
+org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:${MYSQL_DATABASE};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
+org.onap.ccsdk.sli.jdbc.database = ${MYSQL_DATABASE}
+org.onap.ccsdk.sli.jdbc.user = ${MYSQL_USER}
+org.onap.ccsdk.sli.jdbc.password = ${MYSQL_PASSWORD}
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>binding-parent</artifactId>
<version>2.1.1-SNAPSHOT</version>
- <relativePath/>
+ <relativePath />
</parent>
<groupId>org.onap.ccsdk.sli.core</groupId>
<artifactId>mdsal-binding-api</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
- <artifactId>rfc6991</artifactId>
+ <dependency>
+ <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
+ <artifactId>rfc6991</artifactId>
<scope>provided</scope>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.opendaylight.bgpcep</groupId>
<artifactId>bgp-concepts</artifactId>
<scope>provided</scope>
<optional>true</optional>
</dependency>
- <dependency>
- <groupId>org.opendaylight.mdsal</groupId>
- <artifactId>mdsal-dom-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.mdsal</groupId>
- <artifactId>yang-binding</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.google.code.findbugs</groupId>
- <artifactId>annotations</artifactId>
- </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-dom-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>yang-binding</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>annotations</artifactId>
+ </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <environmentVariables>
+ <MYSQL_USER>dummyUser</MYSQL_USER>
+ <MYSQL_PASSWORD>dummyPassword</MYSQL_PASSWORD>
+ <MYSQL_DATABASE>dummyDatabase</MYSQL_DATABASE>
+ </environmentVariables>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <configuration>
+ <environmentVariables>
+ <MYSQL_USER>dummyUser</MYSQL_USER>
+ <MYSQL_PASSWORD>dummyPassword</MYSQL_PASSWORD>
+ <MYSQL_DATABASE>dummyDatabase</MYSQL_DATABASE>
+ </environmentVariables>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
import org.onap.ccsdk.sli.core.utils.KarafRootFileResolver;
import org.onap.ccsdk.sli.core.utils.PropertiesFileResolver;
import org.onap.ccsdk.sli.core.utils.common.CoreDefaultFileResolver;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
import org.onap.ccsdk.sli.core.utils.common.SdncConfigEnvVarFileResolver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private Vector<PropertiesFileResolver> sliPropertiesFileResolvers = new Vector<>();
/**
- * The configuration properties for the db connection.
+ * The configuration properties for the db connection. Use EnvProperties class, which
+ * extends Properties and resolves env variable references in values
*/
- private Properties properties;
+ private EnvProperties properties;
/**
* Set up the prioritized list of strategies for resolving dblib properties
final File propertiesFile = determinePropertiesFile(this);
if (propertiesFile != null) {
try (FileInputStream fileInputStream = new FileInputStream(propertiesFile)) {
- properties = new Properties();
+ properties = new EnvProperties();
properties.load(fileInputStream);
} catch (final IOException e) {
log.error("Failed to load properties for file: {}", propertiesFile.toString(),
InputStream propStr = getClass().getResourceAsStream("/" + SVCLOGIC_PROP_FILE_NAME);
if (propStr != null) {
- properties = new Properties();
+ properties = new EnvProperties();
try {
properties.load(propStr);
propStr.close();
import org.onap.ccsdk.sli.core.sli.provider.base.SwitchNodeExecutor;
import org.onap.ccsdk.sli.core.sli.provider.base.UpdateNodeExecutor;
import org.onap.ccsdk.sli.core.sli.provider.base.WhileNodeExecutor;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
InputStream propStr = ITCaseSvcLogicGraphExecutor.class.getResourceAsStream("/svclogic.properties");
- Properties svcprops = new Properties();
+ Properties svcprops = new EnvProperties();
svcprops.load(propStr);
SvcLogicStore store = SvcLogicStoreFactory.getSvcLogicStore(svcprops);
InputStream propStr = getClass().getResourceAsStream("/svclogic.properties");
- Properties svcprops = new Properties();
+ Properties svcprops = new EnvProperties();
svcprops.load(propStr);
###
org.onap.ccsdk.sli.dbtype = jdbc
-org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:sdnctl;create=true
+org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:${MYSQL_DATABASE};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
+org.onap.ccsdk.sli.jdbc.database = ${MYSQL_DATABASE}
+org.onap.ccsdk.sli.jdbc.user = ${MYSQL_USER}
+org.onap.ccsdk.sli.jdbc.password = ${MYSQL_PASSWORD}
-{"swagger":"2.0","info":{"description":"This module contains a collection of generally useful derived\nYANG data types for Internet addresses and related things.\n\nCopyright (c) 2013 IETF Trust and the persons identified as\nauthors of the code. All rights reserved.\n\nRedistribution and use in source and binary forms, with or\nwithout modification, is permitted pursuant to, and subject\nto the license terms contained in, the Simplified BSD License\nset forth in Section 4.c of the IETF Trust's Legal Provisions\nRelating to IETF Documents\n(http://trustee.ietf.org/license-info).\n\nThis version of this YANG module is part of RFC 6991; see\nthe RFC itself for full legal notices.,Defines API to service logic interpreter,This module contains a collection of generally useful derived\nYANG data types.\n\nCopyright (c) 2013 IETF Trust and the persons identified as\nauthors of the code. All rights reserved.\n\nRedistribution and use in source and binary forms, with or\nwithout modification, is permitted pursuant to, and subject\nto the license terms contained in, the Simplified BSD License\nset forth in Section 4.c of the IETF Trust's Legal Provisions\nRelating to IETF Documents\n(http://trustee.ietf.org/license-info).\n\nThis version of this YANG module is part of RFC 6991; see\nthe RFC itself for full legal notices.","version":"1.2.0-SNAPSHOT","title":"ietf-inet-types,SLI-API,ietf-yang-types API"},"consumes":["application/json","application/xml"],"produces":["application/json","application/xml"],"paths":{"/config/SLI-API:test-results/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.TestResults","parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.TestResults","responseSchema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"},"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}}},"post":{"tags":["SLI-API"],"description":"creates sli.api.TestResults","parameters":[{"in":"body","name":"sli.api.TestResults.body-param","description":"sli.api.TestResults to be added to list","required":false,"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"409":{"description":"Object already exists"}}},"put":{"tags":["SLI-API"],"description":"creates or updates sli.api.TestResults","parameters":[{"in":"body","name":"sli.api.TestResults.body-param","description":"sli.api.TestResults to be added or updated","required":false,"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"204":{"description":"Object modified"}}},"delete":{"tags":["SLI-API"],"description":"removes sli.api.TestResults","parameters":[],"responses":{"400":{"description":"Internal error"},"204":{"description":"Object deleted"}}}},"/config/SLI-API:test-results/SLI-API:test-result/":{"post":{"description":"creates sli.api.testresults.TestResult","parameters":[{"in":"body","name":"sli.api.testresults.TestResult.body-param","description":"sli.api.testresults.TestResult to be added to list","required":false,"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"409":{"description":"Object already exists"}}}},"/config/SLI-API:test-results/SLI-API:test-result/{test-identifier}/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"}],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.testresults.TestResult","responseSchema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"},"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}}},"post":{"tags":["SLI-API"],"description":"creates sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"},{"in":"body","name":"sli.api.testresults.TestResult.body-param","description":"sli.api.testresults.TestResult to be added to list","required":false,"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"409":{"description":"Object already exists"}}},"put":{"tags":["SLI-API"],"description":"creates or updates sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"},{"in":"body","name":"sli.api.testresults.TestResult.body-param","description":"sli.api.testresults.TestResult to be added or updated","required":false,"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"204":{"description":"Object modified"}}},"delete":{"tags":["SLI-API"],"description":"removes sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"}],"responses":{"400":{"description":"Internal error"},"204":{"description":"Object deleted"}}}},"/operational/SLI-API:test-results/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.TestResults","parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.TestResults","responseSchema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"},"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}}}},"/operational/SLI-API:test-results/SLI-API:test-result/{test-identifier}/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"}],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.testresults.TestResult","responseSchema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"},"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}}}},"/operations/SLI-API:execute-graph/":{"post":{"tags":["SLI-API"],"parameters":[{"in":"body","name":"sli.api.executegraph.Input.body-param","required":false,"schema":{"properties":{"input":{"originalRef":"#/definitions/sli.api.executegraph.Input","$ref":"#/definitions/sli.api.executegraph.Input"}}}}],"responses":{"400":{"description":"Internal error"},"200":{"description":"Correct response","responseSchema":{"originalRef":"#/definitions/sli.api.ExecuteGraph","$ref":"#/definitions/sli.api.ExecuteGraph"},"schema":{"originalRef":"#/definitions/sli.api.ExecuteGraph","$ref":"#/definitions/sli.api.ExecuteGraph"}},"201":{"description":"No response"}}}},"/operations/SLI-API:healthcheck/":{"post":{"tags":["SLI-API"],"parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"Correct response","responseSchema":{"originalRef":"#/definitions/sli.api.Healthcheck","$ref":"#/definitions/sli.api.Healthcheck"},"schema":{"originalRef":"#/definitions/sli.api.Healthcheck","$ref":"#/definitions/sli.api.Healthcheck"}},"201":{"description":"No response"}}}},"/operations/SLI-API:vlbcheck/":{"post":{"tags":["SLI-API"],"parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"Correct response","responseSchema":{"originalRef":"#/definitions/sli.api.Vlbcheck","$ref":"#/definitions/sli.api.Vlbcheck"},"schema":{"originalRef":"#/definitions/sli.api.Vlbcheck","$ref":"#/definitions/sli.api.Vlbcheck"}},"201":{"description":"No response"}}}}},"definitions":{"sli.api.ExecuteGraph":{"type":"object","properties":{"output":{"originalRef":"#/definitions/sli.api.ResponseFields","$ref":"#/definitions/sli.api.ResponseFields"}}},"sli.api.Healthcheck":{"type":"object","properties":{"output":{"originalRef":"#/definitions/sli.api.ResponseFields","$ref":"#/definitions/sli.api.ResponseFields"}}},"sli.api.ModeEnumeration":{"type":"string","enum":["sync","async"]},"sli.api.ParameterSetting":{"type":"object","properties":{"string-value":{"type":"string"},"boolean-value":{"type":"boolean"},"parameter-name":{"type":"string","description":"Parameter name"},"int-value":{"type":"integer","format":"int32"}}},"sli.api.ResponseFields":{"type":"object","properties":{"response-code":{"type":"string"},"response-message":{"type":"string"},"context-memory-json":{"type":"string"},"ack-final-indicator":{"type":"string"}}},"sli.api.TestResults":{"type":"object","properties":{"test-result":{"type":"array","items":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}}},"sli.api.Vlbcheck":{"type":"object","properties":{"output":{"originalRef":"#/definitions/sli.api.ResponseFields","$ref":"#/definitions/sli.api.ResponseFields"}}},"sli.api.executegraph.Input":{"type":"object","properties":{"mode":{"originalRef":"#/definitions/sli.api.ModeEnumeration","$ref":"#/definitions/sli.api.ModeEnumeration"},"module-name":{"type":"string"},"sli-parameter":{"type":"array","items":{"originalRef":"#/definitions/sli.api.ParameterSetting","$ref":"#/definitions/sli.api.ParameterSetting"}},"rpc-name":{"type":"string"}}},"sli.api.testresults.TestResult":{"type":"object","properties":{"results":{"type":"array","items":{"type":"string"}},"test-identifier":{"type":"string"}}}}}
\ No newline at end of file
+{"swagger":"2.0","info":{"description":"Defines API to service logic interpreter,This module contains a collection of generally useful derived\nYANG data types.\n\nCopyright (c) 2013 IETF Trust and the persons identified as\nauthors of the code. All rights reserved.\n\nRedistribution and use in source and binary forms, with or\nwithout modification, is permitted pursuant to, and subject\nto the license terms contained in, the Simplified BSD License\nset forth in Section 4.c of the IETF Trust's Legal Provisions\nRelating to IETF Documents\n(http://trustee.ietf.org/license-info).\n\nThis version of this YANG module is part of RFC 6991; see\nthe RFC itself for full legal notices.,This module contains a collection of generally useful derived\nYANG data types for Internet addresses and related things.\n\nCopyright (c) 2013 IETF Trust and the persons identified as\nauthors of the code. All rights reserved.\n\nRedistribution and use in source and binary forms, with or\nwithout modification, is permitted pursuant to, and subject\nto the license terms contained in, the Simplified BSD License\nset forth in Section 4.c of the IETF Trust's Legal Provisions\nRelating to IETF Documents\n(http://trustee.ietf.org/license-info).\n\nThis version of this YANG module is part of RFC 6991; see\nthe RFC itself for full legal notices.","version":"1.2.0-SNAPSHOT","title":"SLI-API,ietf-yang-types,ietf-inet-types API"},"consumes":["application/json","application/xml"],"produces":["application/json","application/xml"],"paths":{"/config/SLI-API:test-results/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.TestResults","parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.TestResults","schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"},"responseSchema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}}},"post":{"tags":["SLI-API"],"description":"creates sli.api.TestResults","parameters":[{"in":"body","name":"sli.api.TestResults.body-param","description":"sli.api.TestResults to be added to list","required":false,"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"409":{"description":"Object already exists"}}},"put":{"tags":["SLI-API"],"description":"creates or updates sli.api.TestResults","parameters":[{"in":"body","name":"sli.api.TestResults.body-param","description":"sli.api.TestResults to be added or updated","required":false,"schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"204":{"description":"Object modified"}}},"delete":{"tags":["SLI-API"],"description":"removes sli.api.TestResults","parameters":[],"responses":{"400":{"description":"Internal error"},"204":{"description":"Object deleted"}}}},"/config/SLI-API:test-results/SLI-API:test-result/":{"post":{"description":"creates sli.api.testresults.TestResult","parameters":[{"in":"body","name":"sli.api.testresults.TestResult.body-param","description":"sli.api.testresults.TestResult to be added to list","required":false,"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"409":{"description":"Object already exists"}}}},"/config/SLI-API:test-results/SLI-API:test-result/{test-identifier}/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"}],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.testresults.TestResult","schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"},"responseSchema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}}},"post":{"tags":["SLI-API"],"description":"creates sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"},{"in":"body","name":"sli.api.testresults.TestResult.body-param","description":"sli.api.testresults.TestResult to be added to list","required":false,"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"409":{"description":"Object already exists"}}},"put":{"tags":["SLI-API"],"description":"creates or updates sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"},{"in":"body","name":"sli.api.testresults.TestResult.body-param","description":"sli.api.testresults.TestResult to be added or updated","required":false,"schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}],"responses":{"400":{"description":"Internal error"},"201":{"description":"Object created"},"204":{"description":"Object modified"}}},"delete":{"tags":["SLI-API"],"description":"removes sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"}],"responses":{"400":{"description":"Internal error"},"204":{"description":"Object deleted"}}}},"/operational/SLI-API:test-results/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.TestResults","parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.TestResults","schema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"},"responseSchema":{"originalRef":"#/definitions/sli.api.TestResults","$ref":"#/definitions/sli.api.TestResults"}}}}},"/operational/SLI-API:test-results/SLI-API:test-result/{test-identifier}/":{"get":{"tags":["SLI-API"],"description":"returns sli.api.testresults.TestResult","parameters":[{"name":"test-identifier","in":"path","description":"Id of test-result","required":true,"type":"string"}],"responses":{"400":{"description":"Internal error"},"200":{"description":"sli.api.testresults.TestResult","schema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"},"responseSchema":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}}}},"/operations/SLI-API:execute-graph/":{"post":{"tags":["SLI-API"],"parameters":[{"in":"body","name":"sli.api.executegraph.Input.body-param","required":false,"schema":{"properties":{"input":{"originalRef":"#/definitions/sli.api.executegraph.Input","$ref":"#/definitions/sli.api.executegraph.Input"}}}}],"responses":{"400":{"description":"Internal error"},"200":{"description":"Correct response","schema":{"originalRef":"#/definitions/sli.api.ExecuteGraph","$ref":"#/definitions/sli.api.ExecuteGraph"},"responseSchema":{"originalRef":"#/definitions/sli.api.ExecuteGraph","$ref":"#/definitions/sli.api.ExecuteGraph"}},"201":{"description":"No response"}}}},"/operations/SLI-API:healthcheck/":{"post":{"tags":["SLI-API"],"parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"Correct response","schema":{"originalRef":"#/definitions/sli.api.Healthcheck","$ref":"#/definitions/sli.api.Healthcheck"},"responseSchema":{"originalRef":"#/definitions/sli.api.Healthcheck","$ref":"#/definitions/sli.api.Healthcheck"}},"201":{"description":"No response"}}}},"/operations/SLI-API:vlbcheck/":{"post":{"tags":["SLI-API"],"parameters":[],"responses":{"400":{"description":"Internal error"},"200":{"description":"Correct response","schema":{"originalRef":"#/definitions/sli.api.Vlbcheck","$ref":"#/definitions/sli.api.Vlbcheck"},"responseSchema":{"originalRef":"#/definitions/sli.api.Vlbcheck","$ref":"#/definitions/sli.api.Vlbcheck"}},"201":{"description":"No response"}}}}},"definitions":{"sli.api.ExecuteGraph":{"type":"object","properties":{"output":{"originalRef":"#/definitions/sli.api.ResponseFields","$ref":"#/definitions/sli.api.ResponseFields"}}},"sli.api.Healthcheck":{"type":"object","properties":{"output":{"originalRef":"#/definitions/sli.api.ResponseFields","$ref":"#/definitions/sli.api.ResponseFields"}}},"sli.api.ModeEnumeration":{"type":"string","enum":["sync","async"]},"sli.api.ParameterSetting":{"type":"object","properties":{"string-value":{"type":"string"},"boolean-value":{"type":"boolean"},"parameter-name":{"type":"string","description":"Parameter name"},"int-value":{"type":"integer","format":"int32"}}},"sli.api.ResponseFields":{"type":"object","properties":{"response-code":{"type":"string"},"response-message":{"type":"string"},"context-memory-json":{"type":"string"},"ack-final-indicator":{"type":"string"}}},"sli.api.TestResults":{"type":"object","properties":{"test-result":{"type":"array","items":{"originalRef":"#/definitions/sli.api.testresults.TestResult","$ref":"#/definitions/sli.api.testresults.TestResult"}}}},"sli.api.Vlbcheck":{"type":"object","properties":{"output":{"originalRef":"#/definitions/sli.api.ResponseFields","$ref":"#/definitions/sli.api.ResponseFields"}}},"sli.api.executegraph.Input":{"type":"object","properties":{"mode":{"originalRef":"#/definitions/sli.api.ModeEnumeration","$ref":"#/definitions/sli.api.ModeEnumeration"},"module-name":{"type":"string"},"sli-parameter":{"type":"array","items":{"originalRef":"#/definitions/sli.api.ParameterSetting","$ref":"#/definitions/sli.api.ParameterSetting"}},"rpc-name":{"type":"string"}}},"sli.api.testresults.TestResult":{"type":"object","properties":{"results":{"type":"array","items":{"type":"string"}},"test-identifier":{"type":"string"}}}}}
\ No newline at end of file
---
swagger: "2.0"
info:
- description: "This module contains a collection of generally useful derived\nYANG\
- \ data types for Internet addresses and related things.\n\nCopyright (c) 2013\
- \ IETF Trust and the persons identified as\nauthors of the code. All rights reserved.\n\
- \nRedistribution and use in source and binary forms, with or\nwithout modification,\
+ description: "Defines API to service logic interpreter,This module contains a collection\
+ \ of generally useful derived\nYANG data types.\n\nCopyright (c) 2013 IETF Trust\
+ \ and the persons identified as\nauthors of the code. All rights reserved.\n\n\
+ Redistribution and use in source and binary forms, with or\nwithout modification,\
\ is permitted pursuant to, and subject\nto the license terms contained in, the\
\ Simplified BSD License\nset forth in Section 4.c of the IETF Trust's Legal Provisions\n\
Relating to IETF Documents\n(http://trustee.ietf.org/license-info).\n\nThis version\
\ of this YANG module is part of RFC 6991; see\nthe RFC itself for full legal\
- \ notices.,Defines API to service logic interpreter,This module contains a collection\
- \ of generally useful derived\nYANG data types.\n\nCopyright (c) 2013 IETF Trust\
- \ and the persons identified as\nauthors of the code. All rights reserved.\n\n\
- Redistribution and use in source and binary forms, with or\nwithout modification,\
+ \ notices.,This module contains a collection of generally useful derived\nYANG\
+ \ data types for Internet addresses and related things.\n\nCopyright (c) 2013\
+ \ IETF Trust and the persons identified as\nauthors of the code. All rights reserved.\n\
+ \nRedistribution and use in source and binary forms, with or\nwithout modification,\
\ is permitted pursuant to, and subject\nto the license terms contained in, the\
\ Simplified BSD License\nset forth in Section 4.c of the IETF Trust's Legal Provisions\n\
Relating to IETF Documents\n(http://trustee.ietf.org/license-info).\n\nThis version\
\ of this YANG module is part of RFC 6991; see\nthe RFC itself for full legal\
\ notices."
version: "1.2.0-SNAPSHOT"
- title: "ietf-inet-types,SLI-API,ietf-yang-types API"
+ title: "SLI-API,ietf-yang-types,ietf-inet-types API"
consumes:
- "application/json"
- "application/xml"
description: "Internal error"
200:
description: "sli.api.TestResults"
- responseSchema:
+ schema:
originalRef: "#/definitions/sli.api.TestResults"
$ref: "#/definitions/sli.api.TestResults"
- schema:
+ responseSchema:
originalRef: "#/definitions/sli.api.TestResults"
$ref: "#/definitions/sli.api.TestResults"
post:
description: "Internal error"
200:
description: "sli.api.testresults.TestResult"
- responseSchema:
+ schema:
originalRef: "#/definitions/sli.api.testresults.TestResult"
$ref: "#/definitions/sli.api.testresults.TestResult"
- schema:
+ responseSchema:
originalRef: "#/definitions/sli.api.testresults.TestResult"
$ref: "#/definitions/sli.api.testresults.TestResult"
post:
description: "Internal error"
200:
description: "sli.api.TestResults"
- responseSchema:
+ schema:
originalRef: "#/definitions/sli.api.TestResults"
$ref: "#/definitions/sli.api.TestResults"
- schema:
+ responseSchema:
originalRef: "#/definitions/sli.api.TestResults"
$ref: "#/definitions/sli.api.TestResults"
/operational/SLI-API:test-results/SLI-API:test-result/{test-identifier}/:
description: "Internal error"
200:
description: "sli.api.testresults.TestResult"
- responseSchema:
+ schema:
originalRef: "#/definitions/sli.api.testresults.TestResult"
$ref: "#/definitions/sli.api.testresults.TestResult"
- schema:
+ responseSchema:
originalRef: "#/definitions/sli.api.testresults.TestResult"
$ref: "#/definitions/sli.api.testresults.TestResult"
/operations/SLI-API:execute-graph/:
description: "Internal error"
200:
description: "Correct response"
- responseSchema:
+ schema:
originalRef: "#/definitions/sli.api.ExecuteGraph"
$ref: "#/definitions/sli.api.ExecuteGraph"
- schema:
+ responseSchema:
originalRef: "#/definitions/sli.api.ExecuteGraph"
$ref: "#/definitions/sli.api.ExecuteGraph"
201:
description: "Internal error"
200:
description: "Correct response"
- responseSchema:
+ schema:
originalRef: "#/definitions/sli.api.Healthcheck"
$ref: "#/definitions/sli.api.Healthcheck"
- schema:
+ responseSchema:
originalRef: "#/definitions/sli.api.Healthcheck"
$ref: "#/definitions/sli.api.Healthcheck"
201:
description: "Internal error"
200:
description: "Correct response"
- responseSchema:
+ schema:
originalRef: "#/definitions/sli.api.Vlbcheck"
$ref: "#/definitions/sli.api.Vlbcheck"
- schema:
+ responseSchema:
originalRef: "#/definitions/sli.api.Vlbcheck"
$ref: "#/definitions/sli.api.Vlbcheck"
201:
<scope>test</scope>
</dependency>
</dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <environmentVariables>
+ <MYSQL_USER>dummyUser</MYSQL_USER>
+ <MYSQL_PASSWORD>dummyPassword</MYSQL_PASSWORD>
+ <MYSQL_DATABASE>dummyDatabase</MYSQL_DATABASE>
+ </environmentVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
import org.onap.ccsdk.sli.core.sli.provider.base.SwitchNodeExecutor;
import org.onap.ccsdk.sli.core.sli.provider.base.UpdateNodeExecutor;
import org.onap.ccsdk.sli.core.sli.provider.base.WhileNodeExecutor;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
import org.opendaylight.mdsal.binding.api.NotificationPublishService;
import org.opendaylight.mdsal.binding.api.RpcProviderService;
import org.opendaylight.mdsal.dom.api.DOMDataBroker;
// Load svclogic.properties and get a SvcLogicStore
InputStream propStr = TestSliapiProvider.class.getResourceAsStream("/svclogic.properties");
- Properties svcprops = new Properties();
+ Properties svcprops = new EnvProperties();
svcprops.load(propStr);
SvcLogicStore store = SvcLogicStoreFactory.getSvcLogicStore(svcprops);
###
org.onap.ccsdk.sli.dbtype = jdbc
-org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:sdnctl;create=true
+org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:${MYSQL_DATABASE};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
+org.onap.ccsdk.sli.jdbc.database = ${MYSQL_DATABASE}
+org.onap.ccsdk.sli.jdbc.user = ${MYSQL_USER}
+org.onap.ccsdk.sli.jdbc.password = ${MYSQL_PASSWORD}
<scope>test</scope>
</dependency>
</dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <environmentVariables>
+ <MYSQL_USER>dummyUser</MYSQL_USER>
+ <MYSQL_PASSWORD>dummyPassword</MYSQL_PASSWORD>
+ <MYSQL_DATABASE>dummyDatabase</MYSQL_DATABASE>
+ </environmentVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
--- /dev/null
+package org.onap.ccsdk.sli.core.utils.common;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.util.Enumeration;
+import java.util.Properties;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class EnvProperties extends Properties {
+
+ @Override
+ public synchronized void load(Reader reader) throws IOException {
+ super.load(reader);
+ resolveAllValues();
+ }
+
+ @Override
+ public synchronized void load(InputStream inStream) throws IOException {
+ super.load(inStream);
+ resolveAllValues();
+ }
+
+ @Override
+ public synchronized Object setProperty(String key, String value) {
+ return super.setProperty(key, EnvProperties.resolveValue(value));
+ }
+
+ private void resolveAllValues() {
+ Enumeration<?> propNames = propertyNames();
+
+ while (propNames.hasMoreElements()) {
+ String propName = (String) propNames.nextElement();
+ super.setProperty(propName, EnvProperties.resolveValue(getProperty(propName)));
+ }
+
+ }
+
+ public static String resolveValue(String value) {
+ if (value == null) {
+ return null;
+ }
+
+ Pattern p = Pattern.compile("\\$\\{(\\w+)((?:\\:\\-)([^\\}]*))?\\}");
+ Matcher m = p.matcher(value);
+
+ StringBuffer sb = new StringBuffer();
+ while (m.find()) {
+ String envVarName = null == m.group(1) ? m.group(2) : m.group(1);
+ String envVarDefault = null == m.group(3) ? "" : m.group(3);
+ String envVarValue = System.getenv(envVarName);
+
+ m.appendReplacement(sb,
+ null == envVarValue ? Matcher.quoteReplacement(envVarDefault) : Matcher.quoteReplacement(envVarValue));
+ }
+ m.appendTail(sb);
+ return sb.toString();
+
+ }
+}
--- /dev/null
+package org.onap.ccsdk.sli.core.utils.common;
+
+import static org.junit.Assert.*;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.Properties;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class EnvPropertiesTest {
+
+ @Test
+ public void loadStreamTest() throws IOException {
+ InputStream testStr = getClass().getResourceAsStream("/svclogic.properties");
+
+ Properties props = new EnvProperties();
+ props.load(testStr);
+
+ assertEquals("jdbc", props.getProperty("org.onap.ccsdk.sli.dbtype"));
+ String dbUrl = "jdbc:derby:memory:"+System.getenv("MYSQL_DATABASE")+";create=true";
+ assertEquals(dbUrl, props.getProperty("org.onap.ccsdk.sli.jdbc.url"));
+ assertEquals("org.apache.derby.jdbc.EmbeddedDriver", props.getProperty("org.onap.ccsdk.sli.jdbc.driver"));
+ assertEquals(System.getenv("MYSQL_DATABASE"), props.getProperty("org.onap.ccsdk.sli.jdbc.database"));
+ assertEquals(System.getenv("MYSQL_USER"), props.getProperty("org.onap.ccsdk.sli.jdbc.user") );
+ assertEquals(System.getenv("MYSQL_PASSWORD"), props.getProperty("org.onap.ccsdk.sli.jdbc.password"));
+ }
+
+ @Test
+ public void loadReaderTest() throws IOException {
+ InputStream testStr = getClass().getResourceAsStream("/svclogic.properties");
+ BufferedReader testReader = new BufferedReader(new InputStreamReader(testStr));
+
+ Properties props = new EnvProperties();
+ props.load(testReader);
+
+ assertEquals("jdbc", props.getProperty("org.onap.ccsdk.sli.dbtype"));
+ String dbUrl = "jdbc:derby:memory:"+System.getenv("MYSQL_DATABASE")+";create=true";
+ assertEquals(dbUrl, props.getProperty("org.onap.ccsdk.sli.jdbc.url"));
+ assertEquals("org.apache.derby.jdbc.EmbeddedDriver", props.getProperty("org.onap.ccsdk.sli.jdbc.driver"));
+ assertEquals(System.getenv("MYSQL_DATABASE"), props.getProperty("org.onap.ccsdk.sli.jdbc.database"));
+ assertEquals(System.getenv("MYSQL_USER"), props.getProperty("org.onap.ccsdk.sli.jdbc.user"));
+ assertEquals(System.getenv("MYSQL_PASSWORD"), props.getProperty("org.onap.ccsdk.sli.jdbc.password"));
+ }
+
+ @Test
+ public void setPropertyTest() {
+ Properties props = new EnvProperties();
+
+ props.setProperty("path", "${PATH}");
+ props.setProperty("dummy", "${UNSET_DUMMY:-dummyvalue}");
+ assertEquals(System.getenv("PATH"), props.getProperty("path"));
+ assertEquals("dummyvalue", props.getProperty("dummy"));
+ }
+
+}
--- /dev/null
+###
+# ============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:${MYSQL_DATABASE};create=true
+org.onap.ccsdk.sli.jdbc.driver=${MYSQL_DRIVER:-org.apache.derby.jdbc.EmbeddedDriver}
+org.onap.ccsdk.sli.jdbc.database = ${MYSQL_DATABASE}
+org.onap.ccsdk.sli.jdbc.user = ${MYSQL_USER}
+org.onap.ccsdk.sli.jdbc.password = ${MYSQL_PASSWORD}
import java.util.zip.ZipOutputStream;
import javax.annotation.Nonnull;
import org.eclipse.jdt.annotation.NonNull;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.DataTreeChangeListener;
import org.opendaylight.mdsal.binding.api.RpcProviderService;
private void loadProperties() {
LOG.info("Loading properties from " + PROPERTIES_FILE);
if(properties == null)
- properties = new Properties();
+ properties = new EnvProperties();
File propertiesFile = new File(PROPERTIES_FILE);
if(!propertiesFile.exists()) {
LOG.warn("Properties file (" + PROPERTIES_FILE + ") not found. Using default properties.");
import org.opendaylight.yang.gen.v1.org.onap.ccsdk.sli.northbound.daeximoffsitebackup.rev180926.RetrieveDataOutputBuilder;
import org.onap.ccsdk.sli.core.sli.provider.MdsalHelper;
-
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public static void loadProperties() {
File file = new File(PROPERTIES_FILE);
- Properties properties = new Properties();
+ Properties properties = new EnvProperties();
InputStream input = null;
if(file.isFile() && file.canRead()) {
try {
# Example properties file
daeximDirectory=/opt/opendaylight/current/daexim/
-credentials=admin:enc:YWRtaW4xMjM=
+credentials=${ODL_USER}:${ODL_PASSWORD}
nexusUrl=http://localhost:8081/nexus/content/repositories/
podName=UNKNOWN_ODL
file.operational=odl_backup_operational.json
file.models=odl_backup_models.json
-file.config=odl_backup_config.json
\ No newline at end of file
+file.config=odl_backup_config.json
# ============LICENSE_END=========================================================
daeximDirectory=/opt/opendaylight/current/daexim/
-credentials=admin:admin123
+credentials=${ODL_USER}:${ODL_PASSWORD}
nexusUrl=http://localhost:8081/nexus/content/repositories/
podName=UNKNOWN_ODL
file.operational=odl_backup_operational.json
file.models=odl_backup_models.json
-file.config=odl_backup_config.json
\ No newline at end of file
+file.config=odl_backup_config.json
</execution>
</executions>
</plugin>
-
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <environmentVariables>
+ <DMAAP_USER>test</DMAAP_USER>
+ <DMAAP_PASSWORD>test</DMAAP_PASSWORD>
+ <DMAAP_AUTHKEY>ABC123</DMAAP_AUTHKEY>
+ <ODL_USER>admin</ODL_USER>
+ <ODL_PASSWORD>admin</ODL_PASSWORD>
+ </environmentVariables>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
import java.util.LinkedList;
import java.util.List;
import java.util.Properties;
+
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public static void main(String[] args) {
- Properties properties = new Properties();
+ Properties properties = new EnvProperties(); // Use EnvProperties to resolve env variables in values
String propFileName = DMAAP_LISTENER_PROPERTIES;
String propPath = null;
String propDir = System.getProperty(SDNC_CONFIG_DIR);
import org.junit.Before;
import org.junit.Test;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Test
public void test() {
- Properties properties = new Properties();
+ Properties properties = new EnvProperties();
String propFileName = DMAAP_LISTENER_PROPERTIES;
String propPath = null;
String propDir = DMAAP_LISTENER_PROPERTIES_DIR;
SubContextPath =/
Protocol =http
MethodType =GET
-username =test
-password =test
+username =${DMAAP_USER}
+password =${DMAAP_PASSWORD}
contenttype =application/json
-authKey=ABC123
+authKey=${DMAAP_AUTHKEY}
authDate=2016-05-10T13:13:50-0700
host=localhost:3904
topic=ccsdk-topic
AFT_DME2_EP_READ_TIMEOUT_MS=50000
sessionstickinessrequired=NO
DME2preferredRouterFilePath=src/test/resources/dmaap-listener.preferredRoute.txt
-sdnc.odl.user=admin
-sdnc.odl.password=admin
+sdnc.odl.user=${ODL_USER}
+sdnc.odl.password=${ODL_PASSWORD}
sdnc.odl.url-base=http://localhost:8282/restconf/operations
SubContextPath =/
Protocol =http
MethodType =GET
-username =admin
-password =admin
+username =${DMAAP_USER}
+password =${DMAAP_PASSWORD}
contenttype =application/json
-authKey=fs20cKwalJ6ry4kX:7Hqm6BDZK47IKxGRkOPFk33qMYs=
+authKey=${DMAAP_AUTHKEY}
authDate=2019-04-09T04:28:40-05:00
host=message-router.onap:3904
topic=A1-P
AFT_DME2_EP_READ_TIMEOUT_MS=50000
sessionstickinessrequired=NO
DME2preferredRouterFilePath=/opt/onap/sdnc/data/properties/dmaap-listener.preferredRoute.txt
-sdnc.odl.user=admin
-sdnc.odl.password=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U
+sdnc.odl.user=${ODL_USER}
+sdnc.odl.password=${ODL_PASSWORD}
sdnc.odl.url-base=http://sdnc.onap:8282/restconf/operations
SubContextPath =/
Protocol =http
MethodType =GET
-username =admin
-password =admin
+username =${DMAAP_USER}
+password =${DMAAP_PASSWORD}
contenttype =application/json
-authKey=fs20cKwalJ6ry4kX:7Hqm6BDZK47IKxGRkOPFk33qMYs=
+authKey=${DMAAP_AUTHKEY}
authDate=2019-04-09T04:28:40-05:00
host=message-router.onap:3904
topic=CM-NOTIFICATION
AFT_DME2_EP_READ_TIMEOUT_MS=50000
sessionstickinessrequired=NO
DME2preferredRouterFilePath=/opt/onap/sdnc/data/properties/dmaap-listener.preferredRoute.txt
-sdnc.odl.user=admin
-sdnc.odl.password=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U
+sdnc.odl.user=${ODL_USER}
+sdnc.odl.password=${ODL_PASSWORD}
sdnc.odl.url-base=http://sdnc.onap:8282/restconf/operations
SubContextPath =/
Protocol =https
MethodType =GET
-username =test
-password =test
+username =${DMAAP_USER}
+password =${DMAAP_PASSWORD}
contenttype =application/json
-authKey=ABC123
+authKey=${DMAAP_AUTHKEY}
authDate=2016-05-10T13:13:50-0700
host=localhost:3904
topic=AAI-EVENT
AFT_DME2_EP_READ_TIMEOUT_MS=50000
sessionstickinessrequired=NO
DME2preferredRouterFilePath=src/test/resources/dmaap-listener.preferredRoute.txt
-sdnc.odl.user=admin
-sdnc.odl.password=admin
+sdnc.odl.user=${ODL_USER}
+sdnc.odl.password=${ODL_PASSWORD}
sdnc.odl.url-base=http://localhost:8181/restconf/operations
\ No newline at end of file
SubContextPath =/
Protocol =https
MethodType =GET
-username =test
-password =test
+username =${DMAAP_USER}
+password =${DMAAP_PASSWORD}
contenttype =application/json
-authKey=ABC123
+authKey=${DMAAP_AUTHKEY}
authDate=2016-05-10T13:13:50-0700
host=localhost:3904
topic=AAI-EVENT
AFT_DME2_EP_READ_TIMEOUT_MS=50000
sessionstickinessrequired=NO
DME2preferredRouterFilePath=src/test/resources/dmaap-listener.preferredRoute.txt
-sdnc.odl.user=admin
-sdnc.odl.password=admin
-sdnc.odl.url-base=http://localhost:8181/restconf/operations
\ No newline at end of file
+sdnc.odl.user=${ODL_USER}
+sdnc.odl.password=${ODL_PASSWORD}
+sdnc.odl.url-base=http://localhost:8181/restconf/operations
SubContextPath =/
Protocol =https
MethodType =GET
-username =test
-password =test
+username =${DMAAP_USER}
+password =${DMAAP_PASSWORD}
contenttype =application/json
-authKey=ABC123
+authKey=${DMAAP_AUTHKEY}
authDate=2016-05-10T13:13:50-0700
host=localhost:3904
topic=AAI-EVENT
AFT_DME2_EP_READ_TIMEOUT_MS=50000
sessionstickinessrequired=NO
DME2preferredRouterFilePath=src/test/resources/dmaap-listener.preferredRoute.txt
-sdnc.odl.user=admin
-sdnc.odl.password=admin
-sdnc.odl.url-base=http://localhost:8181/restconf/operations
\ No newline at end of file
+sdnc.odl.user=${ODL_USER}
+sdnc.odl.password=${ODL_PASSWORD}
+sdnc.odl.url-base=http://localhost:8181/restconf/operations
<scope>test</scope>
</dependency>
</dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <environmentVariables>
+ <MYSQL_USER>dummyUser</MYSQL_USER>
+ <MYSQL_PASSWORD>dummyPassword</MYSQL_PASSWORD>
+ <MYSQL_DATABASE>dummyDatabase</MYSQL_DATABASE>
+ </environmentVariables>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <configuration>
+ <environmentVariables>
+ <MYSQL_USER>dummyUser</MYSQL_USER>
+ <MYSQL_PASSWORD>dummyPassword</MYSQL_PASSWORD>
+ <MYSQL_DATABASE>dummyDatabase</MYSQL_DATABASE>
+ </environmentVariables>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
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.onap.ccsdk.sli.core.utils.common.EnvProperties;
import org.opendaylight.mdsal.binding.api.NotificationPublishService;
import org.opendaylight.mdsal.binding.api.RpcProviderService;
import org.opendaylight.mdsal.dom.api.DOMDataBroker;
// Load svclogic.properties and get a SvcLogicStore
InputStream propStr = TestLcmProvider.class.getResourceAsStream("/svclogic.properties");
- Properties svcprops = new Properties();
+ Properties svcprops = new EnvProperties();
svcprops.load(propStr);
SvcLogicStore store = SvcLogicStoreFactory.getSvcLogicStore(svcprops);
###
org.onap.ccsdk.sli.dbtype = jdbc
-org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:sdnctl;create=true
+org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:${MYSQL_DATABASE};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
+org.onap.ccsdk.sli.jdbc.database = ${MYSQL_DATABASE}
+org.onap.ccsdk.sli.jdbc.user = ${MYSQL_USER}
+org.onap.ccsdk.sli.jdbc.password = ${MYSQL_PASSWORD}
import java.util.List;
import java.util.Properties;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
import org.onap.sdc.api.consumer.IConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+ propFile);
}
- Properties props = new Properties();
+ Properties props = new EnvProperties();
props.load(new FileInputStream(propFile));
asdcAddress = props.getProperty("org.onap.ccsdk.sli.northbound.uebclient.asdc-address");
org.onap.ccsdk.sli.northbound.uebclient.consumer-group=ccsdk1
org.onap.ccsdk.sli.northbound.uebclient.consumer-id=localhost_ccsdk1
org.onap.ccsdk.sli.northbound.uebclient.environment-name=UNITTEST
-org.onap.ccsdk.sli.northbound.uebclient.password=123456
-org.onap.ccsdk.sli.northbound.uebclient.user=test
-org.onap.ccsdk.sli.northbound.uebclient.sdnc-user=test
-org.onap.ccsdk.sli.northbound.uebclient.sdnc-passwd=test
+org.onap.ccsdk.sli.northbound.uebclient.password=${ASDC_PASSWORD}
+org.onap.ccsdk.sli.northbound.uebclient.user=${ASDC_USER}
+org.onap.ccsdk.sli.northbound.uebclient.sdnc-user=${ODL_USER}
+org.onap.ccsdk.sli.northbound.uebclient.sdnc-passwd=${ODL_PASSWORD}
org.onap.ccsdk.sli.northbound.uebclient.asdc-api-base-url=http://localhost:8282/restconf/operations/
org.onap.ccsdk.sli.northbound.uebclient.asdc-api-namespace=org:onap:ccsdk
org.onap.ccsdk.sli.northbound.uebclient.spool.incoming=src/test/resources/incoming
</instructions>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <environmentVariables>
+ <ODL_USER>admin</ODL_USER>
+ <ODL_PASSWORD>admin</ODL_PASSWORD>
+ </environmentVariables>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <configuration>
+ <environmentVariables>
+ <ODL_USER>admin</ODL_USER>
+ <ODL_PASSWORD>admin</ODL_PASSWORD>
+ </environmentVariables>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
import org.json.JSONArray;
import org.json.JSONObject;
import org.onap.ccsdk.sli.core.dblib.DbLibService;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
import org.onap.ccsdk.sli.plugins.grtoolkit.connection.ConnectionManager;
import org.onap.ccsdk.sli.plugins.grtoolkit.connection.ConnectionResponse;
import org.onap.ccsdk.sli.plugins.grtoolkit.data.AdminHealth;
*/
private void setProperties() {
log.info("Loading properties from {}", PROPERTIES_FILE);
- properties = new Properties();
+ properties = new EnvProperties();
File propertiesFile = new File(PROPERTIES_FILE);
if(!propertiesFile.exists()) {
log.warn("setProperties(): Properties file not found.");
adm.healthcheck=/healthcheck
adm.port.http=8181
adm.port.ssl=8443
-controller.credentials=admin:admin
+controller.credentials=${ODL_USER}:${ODL_PASSWORD}
controller.useSsl=true
controller.port.http=8181
controller.port.ssl=8443
adm.healthcheck=/adm/healthcheck
adm.port.http=9999
adm.port.ssl=19999
-controller.credentials=admin:admin
+controller.credentials=${ODL_USER}:${ODL_PASSWORD}
controller.useSsl=false
controller.port.http=9999
controller.port.ssl=19999
adm.healthcheck=/adm/healthcheck
adm.port.http=9999
adm.port.ssl=19999
-controller.credentials=admin:admin
+controller.credentials=${ODL_USER}:${ODL_PASSWORD}
controller.useSsl=false
controller.port.http=9999
controller.port.ssl=19999
adm.healthcheck=/adm/healthcheck
adm.port.http=9999
adm.port.ssl=19999
-controller.credentials=admin:admin
+controller.credentials=${ODL_USER}:${ODK_PASSWORD}
controller.useSsl=false
controller.port.http=9999
controller.port.ssl=19999
adm.healthcheck=/adm/healthcheck
adm.port.http=9999
adm.port.ssl=19999
-controller.credentials=admin:admin
+controller.credentials=${ODL_USER}:${ODL_PASSWORD}
controller.useSsl=false
controller.port.http=9999
controller.port.ssl=19999
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public void readProperties(Map<String, String> paramMap, SvcLogicContext ctx) throws SvcLogicException {
Parameters param = getParameters(paramMap);
- Properties prop = new Properties();
+ Properties prop = new EnvProperties();
try {
File file = new File(param.fileName);
try (InputStream in = new FileInputStream(file)) {
String name = (String) key;
String value = prop.getProperty(name);
if (value != null && value.trim().length() > 0) {
- ctx.setAttribute(pfx + name, getObfuscatedVal(value.trim()));
+ ctx.setAttribute(pfx + name, EnvProperties.resolveValue(value.trim()));
log.info("+++ " + pfx + name + ": [" + maskPassword(pfx + name, value) + "]");
}
}
}
if (mm != null) {
for (Map.Entry<String, String> entry : mm.entrySet()) {
- ctx.setAttribute(pfx + entry.getKey(), getObfuscatedVal(entry.getValue()));
+ ctx.setAttribute(pfx + entry.getKey(), EnvProperties.resolveValue(entry.getValue()));
log.info("+++ " + pfx + entry.getKey() + ": ["
+ maskPassword(pfx + entry.getKey(), entry.getValue()) + "]");
}
String name = (String) key;
String value = prop.getProperty(name);
if (value != null && value.trim().length() > 0) {
- ctx.setAttribute(pfx + name, getObfuscatedVal(value.trim()));
+ ctx.setAttribute(pfx + name, EnvProperties.resolveValue(value.trim()));
log.info("+++ " + pfx + name + ": [" + maskPassword(pfx + name, value) + "]");
}
}
}
}
- /* Unobfuscate param value */
+ /* Unobfuscate param value
+ * No longer needed - use EnvProperties.resolveValue instead
private static String getObfuscatedVal(String paramValue) {
String resValue = paramValue;
if (paramValue != null && paramValue.startsWith("${") && paramValue.endsWith("}"))
}
return resValue;
}
+ */
/*
* Getting extension has to do the following "" --> "" "name" --> "" "name.txt" --> "txt"
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
import org.onap.logging.filter.base.HttpURLConnectionMetricUtil;
import org.onap.logging.filter.base.MetricLogClientFilter;
import org.onap.logging.filter.base.ONAPComponents;
}
try (FileInputStream in = new FileInputStream(configDir + "/" + UEB_PROPERTIES_FILE_NAME)) {
- Properties props = new Properties();
+ Properties props = new EnvProperties();
props.load(in);
uebServers = props.getProperty("servers");
log.info("UEB support enabled");