下面的包安装在我的Visual解决方案的项目中:
Amazon.Extensions.Configuration.SystemsManager" Version="4.0.0"
Amazon.Lambda.APIGatewayEvents" Version="2.5.0"
Amazon.Lambda.Core" Version="2.1.0"
Amazon.Lambda.Serialization.SystemTextJson" Version="2.3.0"
AWSSDK.S3" Version="3.7.9.21"
AWSSDK.SecretsManager" Version="3.7.2.65"
AWSSDK.SecretsManager.Caching" Version="1.0.4"
Microsoft.Extensions.Configuration.EnvironmentVariables" Version="3.1.27"
Microsoft.Extensions.Configuration.FileExtensions" Version="3.1.27"
Microsoft.Extensions.Configuration.Json" Version="3.1.27"
Microsoft.Extensions.DependencyInjection" Version="3.1.27"
Microsoft.Extensions.Logging" Version="3.1.27"
Microsoft.Extensions.Logging.Console" Version="3.1.27"
starkbank-ecdsa" Version="1.3.3"
Swashbuckle.AspNetCore" Version="6.3.0" 假设我的AWS云帐户具有以下参数:
/圣经/旧约/律法/创世纪/第1章/圣经/旧约/创世纪/第2章/圣经/旧约/律法/创世纪/第3章…。。/圣经/旧约/律法/出埃及记/第1章/圣经/旧约/律法/出埃及记/第2章…。。/圣经/新约/福音/马可/第1章/圣经/新约/福音/马可/第2章…。。/圣经/新约/福音/约翰/第1章/bible/NewTestament/Gospel/John/Chapter2 private GetParametersByPathResponse GetMyAppAWSParameters(string path) { GetParametersByPathRequest request = new GetParametersByPathRequest() { Path = path, WithDecryption = false }; return \_ssm.GetParametersByPathAsync(request).Result; }
上述方法适用于与叶节点仅一层的路径(即,
路径=/圣经/旧约/律法/创世纪/
返回的响应参数列表包含:
/圣经/旧约/律法/创世纪/第1章/圣经/旧约/创世纪/第2章/圣经/旧约全书/律法/创世纪/第3章
或
路径=/圣经/新约/福音/约翰/
返回响应参数列表包含:
/圣经/新约/福音/约翰/第1章/圣经/新约/福音/约翰/第2章
但是,如果我在层次结构上提供更短的路径,如下所示:
路径=/圣经/旧约/律法/
或
路径=/圣经/新约全书/
不幸的是,返回响应参数列表为空。
本质上,我试图实现灵活、智能和复杂的代码,无论层次结构级别如何,都可以处理路径。有人能提供密码让我这么做吗?
发布于 2022-07-22 16:07:51
当我把“递归”设置为“真”时,它就有效了。
_ssm.GetParametersByPathAsync(request).Result;}
GetParametersByPathResponse GetMyAppAWSParameters(string path) { GetParametersByPathRequest请求=新GetParametersByPathRequest() { Path = path,递归=真,WithDecryption = false };返回GetParametersByPathRequest }
https://stackoverflow.com/questions/73082095
复制相似问题