You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried to implement TAPI RESTCONF NBI using TAPI model(onos/models/tapi) using DynamicConfigurationSubsystem. With the help of l3vpn and openroadm sample app, I made sample code below:
package org.onosproject.tapi.service;
import com.google.common.collect.ImmutableMap;
import org.apache.felix.scr.annotations.Component;
import org.onosproject.yang.AbstractYangModelRegistrator;
import org.onosproject.yang.gen.v1.tapicommon.rev20170531.TapiCommon;
import org.onosproject.yang.gen.v1.tapiconnectivity.rev20170531.TapiConnectivity;
import org.onosproject.yang.gen.v1.tapipathcomputation.rev20170531.TapiPathComputation;
import org.onosproject.yang.gen.v1.tapitopology.rev20170531.TapiTopology;
import org.onosproject.yang.model.DefaultYangModuleId;
import org.onosproject.yang.model.YangModuleId;
import org.onosproject.yang.runtime.AppModuleInfo;
import org.onosproject.yang.runtime.DefaultAppModuleInfo;
import java.util.HashMap;
import java.util.Map;
/**
* Component to register the OpenConfig service model and its dependencies.
*/
@Component(immediate = true)
public class TapiServiceModelRegistrator extends AbstractYangModelRegistrator {
public TapiServiceModelRegistrator() {
super(TapiConnectivity.class, getAppInfo());
}
private static Map<YangModuleId, AppModuleInfo> getAppInfo() {
Map<YangModuleId, AppModuleInfo> appInfo = new HashMap<>();
appInfo.put(new DefaultYangModuleId("tapi-connectivity", "2017-05-31"),
new DefaultAppModuleInfo(TapiConnectivity.class, null));
// Dependencies for tapi-connectivity
appInfo.put(new DefaultYangModuleId("tapi-common", "2017-05-31"),
new DefaultAppModuleInfo(TapiCommon.class, null));
appInfo.put(new DefaultYangModuleId("tapi-topology", "2017-05-31"),
new DefaultAppModuleInfo(TapiTopology.class, null));
appInfo.put(new DefaultYangModuleId("tapi-path-computation", "2017-05-31"),
new DefaultAppModuleInfo(TapiPathComputation.class, null));
return ImmutableMap.copyOf(appInfo);
}
}
But it didn't work correctly. When I tried to post
to RESTCONF API, it returned 500 Internal Server Error, and the following error are shown in onos log:
2018-01-16 17:30:18,138 | ERROR | qtp1273768067-39 | RestconfUtils | 175 - org.onosproject.onos-apps-restconf-utils - 1.13.0.SNAPSHOT | convertJsonToDataN
ode failure: Method called for other then data node
2018-01-16 17:30:18,138 | ERROR | qtp1273768067-39 | RestconfWebResource | 177 - org.onosproject.onos-protocols-restconf-server-rpp - 1.13.0.SNAPSHOT | ERROR: h
andlePostRequest: ERROR: JSON cannot be converted to DataNode
Namespace and JSON schema may be correct, because when I tried another config which has wrong namespace or JSON schema RESTCONF API returned different messages( and they indicated right error cause).
I've created OpenConfig RESTCONF API in a same way using DynamicConfigSubsystem, it works fine. So this issue might be unique to TAPI model, I guess.
The text was updated successfully, but these errors were encountered:
I've tried to implement TAPI RESTCONF NBI using TAPI model(onos/models/tapi) using DynamicConfigurationSubsystem. With the help of l3vpn and openroadm sample app, I made sample code below:
But it didn't work correctly. When I tried to post
to RESTCONF API, it returned 500 Internal Server Error, and the following error are shown in onos log:
Namespace and JSON schema may be correct, because when I tried another config which has wrong namespace or JSON schema RESTCONF API returned different messages( and they indicated right error cause).
I've created OpenConfig RESTCONF API in a same way using DynamicConfigSubsystem, it works fine. So this issue might be unique to TAPI model, I guess.
The text was updated successfully, but these errors were encountered: