summaryrefslogtreecommitdiffstats
path: root/adaptors
diff options
context:
space:
mode:
Diffstat (limited to 'adaptors')
-rwxr-xr-xadaptors/aai-service/provider/src/main/resources/aaiclient.properties4
-rwxr-xr-xadaptors/aai-service/provider/src/test/resources/aaiclient.properties4
-rw-r--r--adaptors/mdsal-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/ConfigResource.java28
-rw-r--r--adaptors/mdsal-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/OperationalResource.java11
4 files changed, 35 insertions, 12 deletions
diff --git a/adaptors/aai-service/provider/src/main/resources/aaiclient.properties b/adaptors/aai-service/provider/src/main/resources/aaiclient.properties
index 295e00198..8f805a19d 100755
--- a/adaptors/aai-service/provider/src/main/resources/aaiclient.properties
+++ b/adaptors/aai-service/provider/src/main/resources/aaiclient.properties
@@ -54,8 +54,8 @@ org.onap.ccsdk.sli.adaptors.aai.update=/aai/v25/actions/update
# UBB Notify
org.onap.ccsdk.sli.adaptors.aai.path.notify=/aai/v25/actions/notify
-org.onap.ccsdk.sli.adaptors.aai.notify.selflink.fqdn=<%= @ubbUri %>/restconf/config/L3SDN-API:services/layer3-service-list/{service-instance-id}
-org.onap.ccsdk.sli.adaptors.aai.notify.selflink.avpn=<%= @ubbUri %>/restconf/config/L3AVPN-EVC-API:services/service-list/{service-instance-id}/service-data/avpn-logicalchannel-information
+org.onap.ccsdk.sli.adaptors.aai.notify.selflink.fqdn=<%= @ubbUri %>/rests/data/L3SDN-API:services/layer3-service-list?{service-instance-id}?content=config
+org.onap.ccsdk.sli.adaptors.aai.notify.selflink.avpn=<%= @ubbUri %>/rests/data/L3AVPN-EVC-API:services/service-list={service-instance-id}/service-data/avpn-logicalchannel-information?content=config
# VNF IMAGES
org.onap.ccsdk.sli.adaptors.aai.path.vnf.image.query=/aai/v25/service-design-and-creation/vnf-images/vnf-image?application={application_model}&application-vendor={application_vendor}
diff --git a/adaptors/aai-service/provider/src/test/resources/aaiclient.properties b/adaptors/aai-service/provider/src/test/resources/aaiclient.properties
index 2d773e773..af0e76de9 100755
--- a/adaptors/aai-service/provider/src/test/resources/aaiclient.properties
+++ b/adaptors/aai-service/provider/src/test/resources/aaiclient.properties
@@ -54,8 +54,8 @@ org.onap.ccsdk.sli.adaptors.aai.update=/aai/v25/actions/update
# UBB Notify
org.onap.ccsdk.sli.adaptors.aai.path.notify=/aai/v25/actions/notify
-org.onap.ccsdk.sli.adaptors.aai.notify.selflink.fqdn=<%= @ubbUri %>/restconf/config/L3SDN-API:services/layer3-service-list/{service-instance-id}
-org.onap.ccsdk.sli.adaptors.aai.notify.selflink.avpn=<%= @ubbUri %>/restconf/config/L3AVPN-EVC-API:services/service-list/{service-instance-id}/service-data/avpn-logicalchannel-information
+org.onap.ccsdk.sli.adaptors.aai.notify.selflink.fqdn=<%= @ubbUri %>/rests/data/L3SDN-API:services/layer3-service-list={service-instance-id}?content=config
+org.onap.ccsdk.sli.adaptors.aai.notify.selflink.avpn=<%= @ubbUri %>/rests/data/L3AVPN-EVC-API:services/service-list={service-instance-id}/service-data/avpn-logicalchannel-information?content=config
# P-Interfaces
org.onap.ccsdk.sli.adaptors.aai.path.pserver.pinterfaces=/aai/v25/cloud-infrastructure/pservers/pserver/{hostname}/p-interfaces
diff --git a/adaptors/mdsal-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/ConfigResource.java b/adaptors/mdsal-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/ConfigResource.java
index e2e9bc230..402c334dc 100644
--- a/adaptors/mdsal-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/ConfigResource.java
+++ b/adaptors/mdsal-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/ConfigResource.java
@@ -37,6 +37,7 @@ public class ConfigResource implements SvcLogicResource {
private static final Logger LOG = LoggerFactory.getLogger(ConfigResource.class);
private RestService restService;
+ private String useRfc8040 = "true";
public ConfigResource(MdsalResourcePropertiesProvider propProvider) {
LOG.info("Loading ConfigResource using property provider");
@@ -47,6 +48,7 @@ public class ConfigResource implements SvcLogicResource {
String sdncHost = props.getProperty("org.onap.ccsdk.sli.adaptors.resource.mdsal.sdnc-host", "localhost");
String sdncProtocol = props.getProperty("org.onap.ccsdk.sli.adaptors.resource.mdsal.sdnc-protocol", "https");
String sdncPort = props.getProperty("org.onap.ccsdk.sli.adaptors.resource.mdsal.sdnc-port", "8443");
+ useRfc8040 = props.getProperty("org.onap.ccsdk.sli.adaptors.resource.mdsal.use-rfc8040", "true");
restService = new RestService(sdncProtocol, sdncHost, sdncPort, sdncUser, sdncPasswd, "XML", "XML");
}
@@ -77,15 +79,33 @@ public class ConfigResource implements SvcLogicResource {
String orderBy, SvcLogicContext ctx) throws SvcLogicException {
String module = resource;
StringBuffer restQuery = new StringBuffer();
+ String queryPrefix;
+ String querySuffix;
+ String keySeparator;
+
+
+ if (this.useRfc8040.equals("true")) {
+ queryPrefix = "rests/data/";
+ querySuffix = "?content=config";
+ keySeparator = "=";
+ } else {
+ queryPrefix = "restconf/config";
+ querySuffix = "";
+ keySeparator = "/";
+ }
String[] keyParts = key.split("/");
for (String keyPart : keyParts) {
- if (restQuery.length() > 0) {
- restQuery.append("/");
- }
+
if (keyPart.startsWith("$")) {
+ // This is a variable, so the previous item must have been a list. Add an equals
+ // sign instead of a /
+ restQuery.append(keySeparator);
restQuery.append(ctx.resolve(keyPart.substring(1)));
} else {
+ if (restQuery.length() > 0) {
+ restQuery.append("/");
+ }
restQuery.append(keyPart);
}
}
@@ -96,7 +116,7 @@ public class ConfigResource implements SvcLogicResource {
restQueryStr = restQueryStr.substring(1, restQueryStr.length()-1);
}
- String urlString = "restconf/config/" + module + ":" + restQueryStr;
+ String urlString = queryPrefix + module + ":" + restQueryStr + querySuffix;
LOG.info("Querying resource: " + resource + ". At URL: " + urlString);
Document results = restService.get(urlString);
diff --git a/adaptors/mdsal-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/OperationalResource.java b/adaptors/mdsal-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/OperationalResource.java
index 320878126..9fba0a972 100644
--- a/adaptors/mdsal-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/OperationalResource.java
+++ b/adaptors/mdsal-resource/provider/src/main/java/org/onap/ccsdk/sli/adaptors/resource/mdsal/OperationalResource.java
@@ -75,12 +75,15 @@ public class OperationalResource implements SvcLogicResource {
String[] keyParts = key.split("/");
for (String keyPart : keyParts) {
- if (restQuery.length() > 0) {
- restQuery.append("/");
- }
if (keyPart.startsWith("$")) {
+ // This is a variable, so infer that previous part was a list name. Insert = instead of /
+ restQuery.append("=?");
restQuery.append(ctx.resolve(keyPart.substring(1)));
} else {
+
+ if (restQuery.length() > 0) {
+ restQuery.append("/");
+ }
restQuery.append(keyPart);
}
}
@@ -91,7 +94,7 @@ public class OperationalResource implements SvcLogicResource {
restQueryStr = restQueryStr.substring(1, restQueryStr.length() - 1);
}
- String urlString = "restconf/operational/" + module + ":" + restQueryStr;
+ String urlString = "rests/data/" + module + ":" + restQueryStr+"?content=nonconfig";
LOG.info("Querying resource: " + resource + ". At URL: " + urlString);
Document results = restService.get(urlString);