【发布时间】:2014-11-29 09:57:41
【问题描述】:
{
"vers": 0.01,
"config": {
"rate": "perhr",
"valueColumns": [
"vCPU",
"ECU",
"memoryGiB",
"storageGB",
"linux"
],
"currencies": [
"USD"
],
"regions": [
{
"region": "us-east",
"instanceTypes": [
{
"type": "generalCurrentGen",
"sizes": [
{
"size": "t2.micro",
"vCPU": "1",
"ECU": "variable",
"memoryGiB": "1",
"storageGB": "ebsonly",
"valueColumns": [
{
"name": "linux",
"prices": {
"USD": "0.013"
}
}
]
},
{
"size": "t2.small",
"vCPU": "1",
"ECU": "variable",
"memoryGiB": "2",
"storageGB": "ebsonly",
"valueColumns": [
{
"name": "linux",
"prices": {
"USD": "0.026"
}
}
]
}
]
}
]
}
]
}
}
嗨,我想阅读这个 json 文件。我尝试了谷歌的各种方法,但在valuesColumns 得到了一个空值。我必须阅读 sizes 数组并且必须放入列表中。
【问题讨论】:
-
只是我会看看这个。谢谢@Ivan
-
您需要更具体。到目前为止,您尝试了什么?您究竟想从“valuesColumns”中获得什么?
-
实际上我需要获取大小、vcpu、ecu 等值。我无法解析 json 的内部数组。 @JaredRummler