use of org.onosproject.yang.model.DefaultYangModuleId in project onos by opennetworkinglab.
the class OpenRoadmServiceModelRegistrator method getAppInfo.
private static Map<YangModuleId, AppModuleInfo> getAppInfo() {
Map<YangModuleId, AppModuleInfo> appInfo = new HashMap<>();
// Dependencies for org-openroadm-service
appInfo.put(new DefaultYangModuleId("ietf-yang-types", "2013-07-15"), new DefaultAppModuleInfo(IetfYangTypes.class, null));
appInfo.put(new DefaultYangModuleId("org-openroadm-routing-constraints", "2016-10-14"), new DefaultAppModuleInfo(OrgOpenroadmRoutingConstraints.class, null));
appInfo.put(new DefaultYangModuleId("org-openroadm-common-types", "2016-10-14"), new DefaultAppModuleInfo(OrgOpenroadmCommonTypes.class, null));
appInfo.put(new DefaultYangModuleId("org-openroadm-resource-types", "2016-10-14"), new DefaultAppModuleInfo(OrgOpenroadmResourceTypes.class, null));
appInfo.put(new DefaultYangModuleId("org-openroadm-common-service-types", "2016-10-14"), new DefaultAppModuleInfo(OrgOpenroadmCommonServiceTypes.class, null));
// Dependencies for org-openroadm-common-service-types
appInfo.put(new DefaultYangModuleId("ietf-inet-types", "2013-07-15"), new DefaultAppModuleInfo(IetfInetTypes.class, null));
appInfo.put(new DefaultYangModuleId("org-openroadm-topology", "2016-10-14"), new DefaultAppModuleInfo(OrgOpenroadmTopology.class, null));
appInfo.put(new DefaultYangModuleId("org-openroadm-topology", "2016-10-14"), new DefaultAppModuleInfo(OrgOpenroadmTopology.class, null));
// Dependency for org-openroadm-topology
appInfo.put(new DefaultYangModuleId("org-openroadm-resource", "2016-10-14"), new DefaultAppModuleInfo(OrgOpenroadmResource.class, null));
appInfo.put(new DefaultYangModuleId("org-openroadm-service", "2016-10-14"), new DefaultAppModuleInfo(OrgOpenroadmService.class, null));
return ImmutableMap.copyOf(appInfo);
}
use of org.onosproject.yang.model.DefaultYangModuleId in project onos by opennetworkinglab.
the class YangWebResource method getModule.
/**
* Returns module registered with YANG runtime with given module
* identifier.
* If the operation is successful, the JSON presentation of the resource
* plus HTTP status code "200 OK" is returned. Otherwise,
* HTTP error status code "400 Bad Request" is returned.
*
* @param n for module name
* @param r for module revision
* @return HTTP response
*/
@GET
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.TEXT_PLAIN)
@Path("/{name}@{revision}")
public String getModule(@PathParam("name") String n, @PathParam("revision") String r) {
modelRegistry = getService(YangModelRegistry.class);
YangModule m = modelRegistry.getModule(new DefaultYangModuleId(n, r));
if (m == null) {
return Response.status(NOT_FOUND).build().toString();
}
String x;
try {
x = IOUtils.toString(m.getYangSource(), StandardCharsets.UTF_8);
} catch (IOException e) {
log.error("ERROR: handleModuleGetRequest", e.getMessage());
log.debug("Exception in handleModuleGetRequest:", e);
return e.getMessage();
}
return x;
}
use of org.onosproject.yang.model.DefaultYangModuleId in project onos by opennetworkinglab.
the class TapiModelRegistrator method getAppInfo.
private static Map<YangModuleId, AppModuleInfo> getAppInfo() {
Map<YangModuleId, AppModuleInfo> appInfo = new HashMap<>();
appInfo.put(new DefaultYangModuleId("tapi-connectivity", "2018-12-10"), new DefaultAppModuleInfo(TapiConnectivity.class, null));
appInfo.put(new DefaultYangModuleId("tapi-common", "2018-12-10"), new DefaultAppModuleInfo(TapiCommon.class, null));
appInfo.put(new DefaultYangModuleId("tapi-topology", "2018-12-10"), new DefaultAppModuleInfo(TapiTopology.class, null));
appInfo.put(new DefaultYangModuleId("tapi-photonic-media", "2018-12-10"), new DefaultAppModuleInfo(TapiPhotonicMedia.class, null));
appInfo.put(new DefaultYangModuleId("tapi-oam", "2018-12-10"), new DefaultAppModuleInfo(TapiOam.class, null));
appInfo.put(new DefaultYangModuleId("tapi-odu", "2018-12-10"), new DefaultAppModuleInfo(TapiOdu.class, null));
appInfo.put(new DefaultYangModuleId("tapi-path-computation", "2018-12-10"), new DefaultAppModuleInfo(TapiPathComputation.class, null));
appInfo.put(new DefaultYangModuleId("tapi-notification", "2018-12-10"), new DefaultAppModuleInfo(TapiNotification.class, null));
appInfo.put(new DefaultYangModuleId("tapi-virtual-network", "2018-12-10"), new DefaultAppModuleInfo(TapiVirtualNetwork.class, null));
appInfo.put(new DefaultYangModuleId("tapi-dsr", "2018-12-10"), new DefaultAppModuleInfo(TapiDsr.class, null));
appInfo.put(new DefaultYangModuleId("tapi-eth", "2018-12-10"), new DefaultAppModuleInfo(TapiEth.class, null));
return ImmutableMap.copyOf(appInfo);
}
use of org.onosproject.yang.model.DefaultYangModuleId in project onos by opennetworkinglab.
the class YangModelRegistrator method getAppInfo.
private static Map<YangModuleId, AppModuleInfo> getAppInfo() {
Map<YangModuleId, AppModuleInfo> appInfo = new HashMap<>();
appInfo.put(new DefaultYangModuleId("ietf-inet-types", "2013-07-15"), new DefaultAppModuleInfo(IetfInetTypes.class, null));
appInfo.put(new DefaultYangModuleId("ietf-yang-types", "2013-07-15"), new DefaultAppModuleInfo(IetfYangTypes.class, null));
List<String> systemFeatures = new ArrayList<>();
systemFeatures.add("local-users");
systemFeatures.add("authentication");
systemFeatures.add("ntp");
appInfo.put(new DefaultYangModuleId("ietf-system", "2014-08-06"), new DefaultAppModuleInfo(IetfSystem.class, systemFeatures));
return ImmutableMap.copyOf(appInfo);
// TODO: Do some other registration tasks...
}
use of org.onosproject.yang.model.DefaultYangModuleId in project onos by opennetworkinglab.
the class CienaWaveserverAiModelRegistrator method getAppInfo.
private static Map<YangModuleId, AppModuleInfo> getAppInfo() {
Map<YangModuleId, AppModuleInfo> appInfo = new HashMap<>();
appInfo.put(new DefaultYangModuleId("ciena-waveserver-system", "2018-01-04"), new DefaultAppModuleInfo(CienaWaveserverSystem.class, null));
appInfo.put(new DefaultYangModuleId("ciena-waveserver-port", "2017-07-31"), new DefaultAppModuleInfo(CienaWaveserverPort.class, null));
return ImmutableMap.copyOf(appInfo);
// TODO: Do some other registration tasks...
}
Aggregations