2 回答
- 最新
- 投票最多
- 评论最多
0
Does this help?
$ aws rds describe-db-snapshots --query "DBSnapshots[*].[DBSnapshotIdentifier,EngineVersion]" --output text
database-1-final-snapshot 13.4
0
To check if the version numbers are identical, you can do a basic string comparison. To check whether one version is higher or lower than another requires a "version sort" on the strings, which looks at the numbers between delimiters like dot or dash, and considers "10" higher than "9" as opposed to the usual alphabetical order.
My code that uses "version sort" is normally in Python or bash. This answer shows how to do it in those languages, e.g. 'sort --version-sort':
For other environments, search for the name of the language or framework and "version sort".
已回答 3 个月前
相关内容
- AWS 官方已更新 3 年前
- AWS 官方已更新 2 年前
- AWS 官方已更新 2 年前
- AWS 官方已更新 3 年前
Hi, this is based on API https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_DBSnapshot.html that you can use in any available SDK if you need to use something else than CLI. See EngineVersion param.
To me, this answer does not address the poster's question, which was about parsing and comparing versions. Instead, this answer only shows how to retrieve the version - which the poster seems to already be able to do.