本文整理汇总了Python中boto.ec2.cloudwatch.CloudWatchConnection.build_dimension_param方法的典型用法代码示例。如果您正苦于以下问题:Python CloudWatchConnection.build_dimension_param方法的具体用法?Python CloudWatchConnection.build_dimension_param怎么用?Python CloudWatchConnection.build_dimension_param使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boto.ec2.cloudwatch.CloudWatchConnection
的用法示例。
在下文中一共展示了CloudWatchConnection.build_dimension_param方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_build_get_params_multiple_parameter_dimension1
# 需要导入模块: from boto.ec2.cloudwatch import CloudWatchConnection [as 别名]
# 或者: from boto.ec2.cloudwatch.CloudWatchConnection import build_dimension_param [as 别名]
def test_build_get_params_multiple_parameter_dimension1(self):
self.maxDiff = None
c = CloudWatchConnection()
params = {}
dimensions = OrderedDict((("D1", "V"), ("D2", "W")))
c.build_dimension_param(dimensions, params)
expected_params = {
'Dimensions.member.1.Name': 'D1',
'Dimensions.member.1.Value': 'V',
'Dimensions.member.2.Name': 'D2',
'Dimensions.member.2.Value': 'W',
}
self.assertEqual(params, expected_params)
示例2: test_build_get_params_multiple_parameter_dimension2
# 需要导入模块: from boto.ec2.cloudwatch import CloudWatchConnection [as 别名]
# 或者: from boto.ec2.cloudwatch.CloudWatchConnection import build_dimension_param [as 别名]
def test_build_get_params_multiple_parameter_dimension2(self):
from collections import OrderedDict
self.maxDiff = None
c = CloudWatchConnection()
params = {}
dimensions = OrderedDict((("D1", ["V1", "V2"]), ("D2", "W"), ("D3", None)))
c.build_dimension_param(dimensions, params)
expected_params = {
'Dimensions.member.1.Name': 'D1',
'Dimensions.member.1.Value': 'V1',
'Dimensions.member.2.Name': 'D1',
'Dimensions.member.2.Value': 'V2',
'Dimensions.member.3.Name': 'D2',
'Dimensions.member.3.Value': 'W',
'Dimensions.member.4.Name': 'D3',
}
self.assertEqual(params, expected_params)