本文整理汇总了Python中disco_aws_automation.DiscoAWS.create_scaling_schedule方法的典型用法代码示例。如果您正苦于以下问题:Python DiscoAWS.create_scaling_schedule方法的具体用法?Python DiscoAWS.create_scaling_schedule怎么用?Python DiscoAWS.create_scaling_schedule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类disco_aws_automation.DiscoAWS
的用法示例。
在下文中一共展示了DiscoAWS.create_scaling_schedule方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_create_scaling_schedule_no_sched
# 需要导入模块: from disco_aws_automation import DiscoAWS [as 别名]
# 或者: from disco_aws_automation.DiscoAWS import create_scaling_schedule [as 别名]
def test_create_scaling_schedule_no_sched(self, mock_config, **kwargs):
"""test create_scaling_schedule with only desired schedule"""
aws = DiscoAWS(config=mock_config, environment_name=TEST_ENV_NAME, discogroup=MagicMock())
aws.create_scaling_schedule("1", "2", "5", hostclass="mhcboo")
aws.discogroup.assert_has_calls([
call.delete_all_recurring_group_actions(hostclass='mhcboo', group_name=None)
])
示例2: test_create_scaling_schedule_only_desired
# 需要导入模块: from disco_aws_automation import DiscoAWS [as 别名]
# 或者: from disco_aws_automation.DiscoAWS import create_scaling_schedule [as 别名]
def test_create_scaling_schedule_only_desired(self, mock_config, **kwargs):
"""test create_scaling_schedule with only desired schedule"""
aws = DiscoAWS(config=mock_config, environment_name=TEST_ENV_NAME, discogroup=MagicMock())
aws.create_scaling_schedule("1", "[email protected] 0 * * *:[email protected] 0 * * *", "5", hostclass="mhcboo")
aws.discogroup.assert_has_calls([
call.delete_all_recurring_group_actions(hostclass='mhcboo', group_name=None),
call.create_recurring_group_action('1 0 * * *', hostclass='mhcboo', group_name=None,
min_size=None, desired_capacity=2, max_size=None),
call.create_recurring_group_action('6 0 * * *', hostclass='mhcboo', group_name=None,
min_size=None, desired_capacity=3, max_size=None)
], any_order=True)
示例3: test_create_scaling_schedule_overlapping
# 需要导入模块: from disco_aws_automation import DiscoAWS [as 别名]
# 或者: from disco_aws_automation.DiscoAWS import create_scaling_schedule [as 别名]
def test_create_scaling_schedule_overlapping(self, mock_config, **kwargs):
"""test create_scaling_schedule with only desired schedule"""
aws = DiscoAWS(config=mock_config, environment_name=TEST_ENV_NAME)
aws.autoscale = MagicMock()
aws.create_scaling_schedule("mhcboo",
"[email protected] 0 * * *:[email protected] 0 * * *",
"[email protected] 0 * * *:[email protected] 0 * * *",
"[email protected] 0 * * *:[email protected] 0 * * *")
aws.autoscale.assert_has_calls([
call.delete_all_recurring_group_actions('mhcboo'),
call.create_recurring_group_action('mhcboo', '1 0 * * *',
min_size=1, desired_capacity=2, max_size=6),
call.create_recurring_group_action('mhcboo', '6 0 * * *',
min_size=2, desired_capacity=3, max_size=9)
], any_order=True)
示例4: test_create_scaling_schedule_no_sched
# 需要导入模块: from disco_aws_automation import DiscoAWS [as 别名]
# 或者: from disco_aws_automation.DiscoAWS import create_scaling_schedule [as 别名]
def test_create_scaling_schedule_no_sched(self, mock_config, **kwargs):
"""test create_scaling_schedule with only desired schedule"""
aws = DiscoAWS(config=mock_config, environment_name=TEST_ENV_NAME)
aws.autoscale = MagicMock()
aws.create_scaling_schedule("mhcboo", "1", "2", "5")
aws.autoscale.assert_has_calls([call.delete_all_recurring_group_actions('mhcboo')])