opendaylight - 在 Opendaylight 中安装自定义功能或模块?
问题描述
我最近创建了一个基本的 HelloWorld ODL 模块,正如step out here一样,我能够让它工作。即,我可以针对它运行安静的 POST 命令并得到我的“你好”回复。
{
"output": {
"greeting": "Hello Andrew"
}
}
现在,我想做的是将此模块安装到从集成发行版 repos编译的实际 ODL 中。
我遵循的步骤是:
成功创建 HelloWorld ODL 模块并从 HelloWorld karaf 子文件夹中运行 karaf
知道
mvn install
针对 Hello 项目会将此模块发布到我的本地.m2/repository/org/opendaylight/hello
存储库中,我继续进行实际的 ODL 集成/发行版在 ODL 的
features/repos/index/pom.xml
文件中,我添加了以下配置文件:<profile> <id>hello</id> <activation> <activeByDefault>true</activeByDefault> </activation> <dependencies> <dependency> <groupId>org.opendaylight.hello</groupId> <artifactId>features-hello</artifactId> <classifier>features</classifier> <version>1.0-SNAPSHOT</version> <type>xml</type> </dependency> </dependencies> </profile>
然后我
mvn install
在 ODL 上成功运行,并且在该配置文件上没有错误。(注意:如果我在该配置文件部分输入任何内容,mvn install
将会失败)
- 我在我的应用程序中对 ODL v0.11.0 和 Sodium 1.2.0 做了所有事情,所以我确信版本是正确的。
一切都说了又做了,ODL karaf 确实启动了,我可以对它运行 rest 命令……但是,纯粹针对 HelloWorld 模块工作的相同 POST 命令在集成发行版 ODL 中不起作用。相反,我收到此错误消息:
{
"errors": {
"error": [
{
"error-type": "protocol",
"error-tag": "unknown-element",
"error-message": "The module named 'hello' does not exist."
}
]
}
}
在某些方面,这个问题是对我之前的问题的扩展:完整 OpenDaylight 集成分发包的源代码。所以在这里把它们联系在一起。
更新:我在这里创建了一个与此问题相反的问题:Procedure to add features to OpenDaylight application。
笔记:
- 在该
feature:list
部分中,我没有看到 Hello 列出
解决方案
ODL Integration 发行版默认不安装任何 karaf 功能,因此一旦您开始发行版,请检查您的项目功能是否已安装(例如 feature:list -i)。如果不是,只需安装它(例如 feature:install )。
推荐阅读
- python - Python:scipy.optimize,bisection 可以使用返回多个值的函数 f 吗?
- android - Android XML 规范标准?
- r - 我如何使用函数模拟 R 中的数据集
- c++ - Unorder_map 与 struct 更大的字段大小
- python - 使用 Flask 和 SQLite,在 Web 应用程序之外访问数据库
- powerbi - Power BI 将 HH:MM:SS 格式和十进制持续时间格式转换为 MM:SS 格式
- php - Laravel 与原始查询的返回关系
- python - 如果没有路径,NetworkX 在 single_source_dijkstra_path_length 中返回什么
- powerbi-desktop - 问:Power BI,有 2 列的表被两个不同的切片器过滤
- sql - 带有 union all 的存储过程循环