本文整理匯總了Python中c7n.cwe.CloudWatchEvents.match方法的典型用法代碼示例。如果您正苦於以下問題:Python CloudWatchEvents.match方法的具體用法?Python CloudWatchEvents.match怎麽用?Python CloudWatchEvents.match使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類c7n.cwe.CloudWatchEvents
的用法示例。
在下文中一共展示了CloudWatchEvents.match方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_cloud_trail_resource
# 需要導入模塊: from c7n.cwe import CloudWatchEvents [as 別名]
# 或者: from c7n.cwe.CloudWatchEvents import match [as 別名]
def test_cloud_trail_resource(self):
self.assertEqual(
CloudWatchEvents.match(event_data("event-cloud-trail-s3.json")),
{
"source": "s3.amazonaws.com",
"ids": jmespath.compile("detail.requestParameters.bucketName"),
},
)
示例2: test_cloud_trail_resource
# 需要導入模塊: from c7n.cwe import CloudWatchEvents [as 別名]
# 或者: from c7n.cwe.CloudWatchEvents import match [as 別名]
def test_cloud_trail_resource(self):
self.assertEqual(
CloudWatchEvents.match(
event_data('event-cloud-trail-s3.json')),
{'source': 's3.amazonaws.com',
'ids': jmespath.compile('detail.requestParameters.bucketName')})
示例3: test_non_cloud_trail_event
# 需要導入模塊: from c7n.cwe import CloudWatchEvents [as 別名]
# 或者: from c7n.cwe.CloudWatchEvents import match [as 別名]
def test_non_cloud_trail_event(self):
for event in ['event-instance-state.json', 'event-scheduled.json']:
self.assertFalse(CloudWatchEvents.match(event_data(event)))