- AWS Administration Cookbook
- Lucas Chan Rowan Udell
- 131字
- 2021-07-09 18:18:33
Querying
The CLI tool supports transforming the response from the API with the --query option. This option takes a JMESPath query as a parameter and returns the query result.
JMESPath is a query language for JSON. For more information, visit http://jmespath.org/.
As the query is processed as part of the command, it takes place on the server, not the client. By offloading work to the server, you can reduce the size of the resulting payload and improve response times.
JMESPath can be used to transform the response that you receive:
$ aws ec2 describe-availability-zones \
--output json \
--query 'AvailabilityZones[].ZoneName'
[
"us-east-1a",
"us-east-1c",
"us-east-1d",
"us-east-1e"
]
It can also be used to filter the data that is received:
$ aws ec2 describe-availability-zones
--output json
--query "AvailabilityZones[?ZoneName == 'us-east-1a'].State"
[
"available"
]
推薦閱讀
- 課課通計算機原理
- PostgreSQL 11 Server Side Programming Quick Start Guide
- 現(xiàn)代機械運動控制技術(shù)
- ESP8266 Home Automation Projects
- Pentaho Analytics for MongoDB
- HBase Essentials
- Linux Shell Scripting Cookbook(Third Edition)
- 步步驚“芯”
- 工業(yè)機器人集成應(yīng)用
- 天才與算法:人腦與AI的數(shù)學(xué)思維
- 大數(shù)據(jù)時代的調(diào)查師
- Appcelerator Titanium Smartphone App Development Cookbook(Second Edition)
- 數(shù)據(jù)結(jié)構(gòu)與實訓(xùn)
- 三維動畫制作(3ds max7.0)
- Hands-On Data Analysis with NumPy and pandas