gpt4 book ai didi

spring-cloud-config - 我可以从 Spring Cloud Config Server 获取单个属性值吗?

转载 作者:行者123 更新时间:2023-12-04 20:31:15 25 4
gpt4 key购买 nike

我想得到 单个属性值 来自带有 的 Spring Cloud Config Server wget/curl 从命令行调用 .

单个值,否则我必须从响应中解析它们,我想要 保持 bash 脚本尽可能简单 .

Spring Cloud Config Server 的文档说明了 REST API 的可能性如下

/{application}/{profile}[/{label}]
/{application}-{profile}.yml
/{label}/{application}-{profile}.yml
/{application}-{profile}.properties
/{label}/{application}-{profile}.properties

有没有 获取单个值的技巧 ?我搜索了很多,但一无所获。看起来并不是一个巨大的需求。

或者我可以 扩展 EnvironmentController 配置服务器来实现这个功能?我没有找到任何关于扩展配置服务器的 REST API 的资源。

谢谢你的帮助

最佳答案

回答我自己的问题:Spring Config Server has some kind 模板机制 .有了这个你可以基本上随心所欲 .

在文档中这不是很明显,因为它被称为 Serving Plain Text :
http://cloud.spring.io/spring-cloud-static/spring-cloud-config/1.3.4.RELEASE/single/spring-cloud-config.html#_serving_plain_text

甚至文档中的示例也不是纯文本,而是结构化的配置格式。

关于spring-cloud-config - 我可以从 Spring Cloud Config Server 获取单个属性值吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45984633/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com