技能要求:
Kotlin,ElasticSearch,Java
经验要求:
5-10年经验
工作描述:
项目编号:【19934】
https://github.com/opensearch-project/alerting 这个链接是工程所在
https://github.com/opensearch-project/alerting/pull/434 这个需求在github上的PR 里面有所有这个需求的面熟以及我在主线分支的基础上对这个需求到目前为止所做出的改动
工程是开源工程在github上,需求是在这个工程里添加对用户在更新设置action时添加限制 并且在用户更新设置前就发出验证。
前半部分对action添加限制我已经完成。但是后半部分的验证功能还剩最后一小部分没有完成。没完成的部分在附件的截图里。截图里所注释的部分就是需要完成的部分。并且有技术人员给出大概方法,大概原理是:
我们需要一种方法来传递client对象,以便我们可以调用 OpenSearch 来检索所有监视器以获取该信息,例如,这是一个调用 getDestinations API 来获取destination的小例子。我们需要类似的东西来获取所有显示器。在这里,这需要客户端对象来获取数据。例子:
suspend fun getDestination(client: Client, destinationId: String): Destination? {
val table = Table(
"asc",
"destination.name.keyword",
null,
1,
0,
null
)
val getDestinationsRequest = GetDestinationsRequest(
destinationId,
0L,
null,
table,
"ALL"
)
val getDestinationsResponse: GetDestinationsResponse = client.suspendUntil {
client.execute(GetDestinationsAction.INSTANCE, getDestinationsRequest, it)
}
return getDestinationsResponse.destinations.firstOrNull()
}