請執行下列其中一個命令:
單一帳戶和區域
此命令會傳回設定 AWS CLI 工作階段之 AWS 帳戶
和 AWS 區域 的所有變更請求計數。
- Linux & macOS
-
aws ssm get-ops-summary \
--filters Key=AWS:OpsItem.OpsItemType,Values="/aws/changerequests",Type=Equal \
--aggregators AggregatorType=count,AttributeName=Status,TypeName=AWS:OpsItem
- Windows
-
aws ssm get-ops-summary ^
--filters Key=AWS:OpsItem.OpsItemType,Values="/aws/changerequests",Type=Equal ^
--aggregators AggregatorType=count,AttributeName=Status,TypeName=AWS:OpsItem
呼叫會傳回相關資訊,如下所示。
{
"Entities": [
{
"Data": {
"AWS:OpsItem": {
"Content": [
{
"Count": "38",
"Status": "Open"
}
]
}
}
}
]
}
多個帳戶及/或區域
此命令會傳回資源資料同步中 AWS 區域 指定 AWS 帳戶 和的所有變更請求計數。
- Linux & macOS
-
aws ssm get-ops-summary \
--sync-name resource_data_sync_name
\
--filters Key=AWS:OpsItem.OpsItemType,Values="/aws/changerequests",Type=Equal \
--aggregators AggregatorType=count,AttributeName=Status,TypeName=AWS:OpsItem
- Windows
-
aws ssm get-ops-summary ^
--sync-name resource_data_sync_name
^
--filters Key=AWS:OpsItem.OpsItemType,Values="/aws/changerequests",Type=Equal ^
--aggregators AggregatorType=count,AttributeName=Status,TypeName=AWS:OpsItem
呼叫會傳回相關資訊,如下所示。
{
"Entities": [
{
"Data": {
"AWS:OpsItem": {
"Content": [
{
"Count": "43",
"Status": "Open"
},
{
"Count": "2",
"Status": "Resolved"
}
]
}
}
}
]
}
多個帳戶及特定區域
此命令會傳回針對資源資料同步中指定的 AWS 帳戶 的所有變更請求的計數。但是,它只會傳回來自命令中指定的區域的資料
- Linux & macOS
-
aws ssm get-ops-summary \
--sync-name resource_data_sync_name
\
--filters Key=AWS:OpsItem.SourceRegion,Values='Region
',Type=Equal Key=AWS:OpsItem.OpsItemType,Values="/aws/changerequests",Type=Equal \
--aggregators AggregatorType=count,AttributeName=Status,TypeName=AWS:OpsItem
- Windows
-
aws ssm get-ops-summary ^
--sync-name resource_data_sync_name
^
--filters Key=AWS:OpsItem.SourceRegion,Values='Region
',Type=Equal Key=AWS:OpsItem.OpsItemType,Values="/aws/changerequests",Type=Equal ^
--aggregators AggregatorType=count,AttributeName=Status,TypeName=AWS:OpsItem
多個帳戶和區域 (具有按區域分組的輸出)
此命令會傳回資源資料同步中 AWS 區域 指定 AWS 帳戶 和的所有變更請求計數。輸出會顯示每個區域的計數資訊。
- Linux & macOS
-
aws ssm get-ops-summary \
--sync-name resource_data_sync_name
\
--filters Key=AWS:OpsItem.OpsItemType,Values="/aws/changerequests",Type=Equal \
--aggregators '[{"AggregatorType":"count","TypeName":"AWS:OpsItem","AttributeName":"Status","Aggregators":[{"AggregatorType":"count","TypeName":"AWS:OpsItem","AttributeName":"SourceRegion"}]}]'
- Windows
-
aws ssm get-ops-summary ^
--sync-name resource_data_sync_name
^
--filters Key=AWS:OpsItem.OpsItemType,Values="/aws/changerequests",Type=Equal ^
--aggregators '[{"AggregatorType":"count","TypeName":"AWS:OpsItem","AttributeName":"Status","Aggregators":[{"AggregatorType":"count","TypeName":"AWS:OpsItem","AttributeName":"SourceRegion"}]}]'
呼叫會傳回相關資訊,如下所示。
{
"Entities": [
{
"Data": {
"AWS:OpsItem": {
"Content": [
{
"Count": "38",
"SourceRegion": "us-east-1",
"Status": "Open"
},
{
"Count": "4",
"SourceRegion": "us-east-2",
"Status": "Open"
},
{
"Count": "1",
"SourceRegion": "us-west-1",
"Status": "Open"
},
{
"Count": "2",
"SourceRegion": "us-east-2",
"Status": "Resolved"
}
]
}
}
}
]
}
多個帳戶和區域 (具有按區域分組的輸出)
此命令會傳回資源資料同步中 AWS 區域 指定 AWS 帳戶 和的所有變更請求計數。輸出按帳戶和區域分組計數資訊。
- Linux & macOS
-
aws ssm get-ops-summary \
--sync-name resource_data_sync_name
\
--filters Key=AWS:OpsItem.OpsItemType,Values="/aws/changerequests",Type=Equal \
--aggregators '[{"AggregatorType":"count","TypeName":"AWS:OpsItem","AttributeName":"Status","Aggregators":[{"AggregatorType":"count","TypeName":"AWS:OpsItem","AttributeName":"SourceAccountId","Aggregators":[{"AggregatorType":"count","TypeName":"AWS:OpsItem","AttributeName":"SourceRegion"}]}]}]'
- Windows
-
aws ssm get-ops-summary ^
--sync-name resource_data_sync_name
^
--filters Key=AWS:OpsItem.OpsItemType,Values="/aws/changerequests",Type=Equal ^
--aggregators '[{"AggregatorType":"count","TypeName":"AWS:OpsItem","AttributeName":"Status","Aggregators":[{"AggregatorType":"count","TypeName":"AWS:OpsItem","AttributeName":"SourceAccountId","Aggregators":[{"AggregatorType":"count","TypeName":"AWS:OpsItem","AttributeName":"SourceRegion"}]}]}]'
呼叫會傳回相關資訊,如下所示。
{
"Entities": [
{
"Data": {
"AWS:OpsItem": {
"Content": [
{
"Count": "38",
"SourceAccountId": "123456789012",
"SourceRegion": "us-east-1",
"Status": "Open"
},
{
"Count": "4",
"SourceAccountId": "111122223333",
"SourceRegion": "us-east-2",
"Status": "Open"
},
{
"Count": "1",
"SourceAccountId": "111122223333",
"SourceRegion": "us-west-1",
"Status": "Open"
},
{
"Count": "2",
"SourceAccountId": "444455556666",
"SourceRegion": "us-east-2",
"Status": "Resolved"
},
{
"Count": "1",
"SourceAccountId": "222222222222",
"SourceRegion": "us-east-1",
"Status": "Open"
}
]
}
}
}
]
}