我有 6 个子网,我想从中过滤 3 个子网匹配子字符串internal
并在 rds 中使用。
标签名称有内部词,并希望以此为基础进行过滤。
有人可以帮我吗?
data "aws_vpc" "vpc_nonprod-sctransportationops-vpc" {
tags {
Name = "vpc_nonprod-sctransportationops-vpc"
}
}
data "aws_subnet_ids" "all" {
vpc_id = "${data.aws_vpc.vpc_nonprod-sctransportationops-vpc.id}"
}
output "aws_subnet_ids" {
value = "${data.aws_subnet_ids.all.ids}"
}
# 6 subnets
# Now look up details for each subnet
data "aws_subnet" "filtered_subnets" {
count = "${length(data.aws_subnet_ids.all.ids)}"
id = "${data.aws_subnet_ids.all.ids[count.index]}"
filter {
name = "tag:Name"
values = ["*internal*"]
}
}
Run Code Online (Sandbox Code Playgroud)
一些标签名称有internal
子串
需要获取标签名称具有内部子字符串的所有子网ID
values = ["*"]
6
但是,返回IDvalues = ["any …
我必须从 swagger 上传 MultipartFile 类型的多个文件来测试我的 api。邮递员确实允许上传,但是,同样的事情在 swagger 中不起作用。
多部分文件列表的代码:
@ApiParam(name = "file", value = "Select the file to Upload", required = true, allowMultiple=true)
@RequestPart(value = "file", required = true) List<MultipartFile> file
Run Code Online (Sandbox Code Playgroud)
用于多部分文件列表的工作 curl 命令:
curl -X POST "http://localhost:8080/test" -H "accept: */*" -H "Content-Type: multipart/form-data" -F "file=@example1.pdf;application/pdf;" -F "file=@example2.pdf;application/pdf;" -F "jsonString={}"
Run Code Online (Sandbox Code Playgroud)
单个多部分文件也可以像这样在 swagger 中工作:
@ApiParam(name = "file", value = "Select the file to Upload", required = true, allowMultiple=true)
@RequestPart(value = "file", required = true) MultipartFile file
Run Code Online (Sandbox Code Playgroud)
依赖:
<!-- swagger -->
<dependency> …
Run Code Online (Sandbox Code Playgroud) 我有一张地图清单。该映射包含字符串作为键和对象作为值。最可能的值也为字符串。我想按一个值分组,以便将一组值作为键,将另一组唯一值作为列表。实际上,地图列表是沙发基准选择数据。
例如:
[{"id":"1", "status":"pending"},{"id":"2", "status":"download"},{"id":"3", "status":"pending"},{"id":"4", "status":"pending"}, {"id":"5", "status":"ready"},{"id":"6", "status":"download"}] => {"pending":["1","3","4"], "download":["2","6"], "ready":["5"]}
Run Code Online (Sandbox Code Playgroud) java-8 ×1
java-stream ×1
spring-boot ×1
springfox ×1
swagger-2.0 ×1
swagger-ui ×1
terraform ×1