當前位置: 首頁>>代碼示例>>Python>>正文


Python GuiOps.set_scaling_group_capacity方法代碼示例

本文整理匯總了Python中guiops.guiops.GuiOps.set_scaling_group_capacity方法的典型用法代碼示例。如果您正苦於以下問題:Python GuiOps.set_scaling_group_capacity方法的具體用法?Python GuiOps.set_scaling_group_capacity怎麽用?Python GuiOps.set_scaling_group_capacity使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在guiops.guiops.GuiOps的用法示例。


在下文中一共展示了GuiOps.set_scaling_group_capacity方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: AutoScalingOperationsSequence

# 需要導入模塊: from guiops.guiops import GuiOps [as 別名]
# 或者: from guiops.guiops.GuiOps import set_scaling_group_capacity [as 別名]
class AutoScalingOperationsSequence(GuiOps):
    def __init__(self):
        parser = Option_parser()
        self.console_url = parser.parse_options()['console_url']
        self.webdriver_url = parser.parse_options()['web_driver']
        self.account = parser.parse_options()['account']
        self.user = parser.parse_options()['user_name']
        self.password = parser.parse_options()['password']
        self.sauce = parser.parse_options()['sauce']
        self.browser = parser.parse_options()['browser']
        self.version = parser.parse_options()['version']
        self.platform = parser.parse_options()['platform']
        self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce,
                             browser=self.browser, version=self.version, platform=self.platform)
        logging.basicConfig(format='%(asctime)s %(message)s')
        self.tester.zoom_out()

    def asg_ops_test(self):
        self.tester.login(self.account, self.user, self.password)
        launchconfig1_name = self.id_generator() + "-launch-config"
        scalinggroup1_name = self.id_generator() + "-auto-scaling-group"
        self.tester.create_launch_config_and_asg_from_lc_lp(lc_name=launchconfig1_name, asg_name=scalinggroup1_name,
                                                            max_capacity=2, desired_capacity=1, min_cpapacity=0)
        self.tester.delete_asg_from_lp(scalinggroup1_name)
        scalinggroup2_name = self.id_generator() + "-auto-scaling-group"
        self.tester.create_asg_from_asg_lp(launch_config_name=launchconfig1_name, asg_name=scalinggroup2_name)
        self.tester.delete_asg_from_lp(scalinggroup2_name)
        self.tester.delete_launch_config_from_lp(launchconfig1_name)
        launchconfig2_name = self.id_generator() + "-launch-config"
        self.tester.create_launch_config_from_lc_lp(launchconfig2_name)
        self.tester.create_asg_from_dashboard(launch_config_name=launchconfig2_name, asg_name=scalinggroup2_name,
                                              min_capacity=1, desired_capacity=1, max_capacity=1)
        self.tester.verify_scaling_history(scalinggroup2_name)
        self.tester.set_scaling_group_capacity(scalinggroup2_name, 0, 0, 1)
        self.tester.delete_asg_from_lp(scalinggroup2_name)
        self.tester.delete_launch_config_from_lp(launchconfig2_name)
        self.test_scaling_group_monitoring_page_with_monitoring_enabled()
        self.tester.logout()
        self.tester.exit_browser()

    def test_scaling_group_monitoring_page_with_monitoring_enabled(self):
        """Scaling group monitoring page should display charts when metrics collection is enabled and
           its launch config has monitoring enabled"""
        launchconfig3_name = self.id_generator() + "-launch-config"
        scalinggroup3_name = self.id_generator() + "-auto-scaling-group"
        self.tester.create_launch_config_and_asg_from_lc_lp(
                lc_name=launchconfig3_name, asg_name=scalinggroup3_name, enable_monitoring=True)
        self.tester.enable_metrics_collection_for_auto_scaling_group(scalinggroup3_name)
        self.tester.verify_charts_on_scaling_group_monitoring_page(scalinggroup3_name)
        self.tester.delete_asg_from_lp(scalinggroup3_name)
        self.tester.delete_launch_config_from_lp(launchconfig3_name)
開發者ID:,項目名稱:,代碼行數:53,代碼來源:

示例2: ASG_operations_sequence

# 需要導入模塊: from guiops.guiops import GuiOps [as 別名]
# 或者: from guiops.guiops.GuiOps import set_scaling_group_capacity [as 別名]
class ASG_operations_sequence(GuiOps):


    def __init__(self):
        parser = Option_parser()
        self.console_url = parser.parse_options()['console_url']
        self.webdriver_url = parser.parse_options()['web_driver']
        self.account = parser.parse_options()['account']
        self.user = parser.parse_options()['user_name']
        self.password = parser.parse_options()['password']
        self.sauce = parser.parse_options()['sauce']
        self.browser = parser.parse_options()['browser']
        self.version = parser.parse_options()['version']
        self.platform = parser.parse_options()['platform']
        self.tester = GuiOps(console_url=self.console_url, webdriver_url=self.webdriver_url, sauce=self.sauce, browser=self.browser, version=self.version, platform=self.platform)
        logging.basicConfig(format='%(asctime)s %(message)s')


    def asg_ops_test(self):
        self.tester.login(self.account, self.user, self.password)
        LaunchConfig1_name = self.id_generator()+"-launch-config"
        ASG1_name = self.id_generator()+"-auto-scaling-group"
        self.tester.create_launch_config_and_asg_from_lc_lp(lc_name=LaunchConfig1_name, asg_name=ASG1_name)
        self.tester.delete_asg_from_lp(ASG1_name)
        ASG2_name = self.id_generator()+"-auto-scaling-group"
        self.tester.create_asg_from_asg_lp(launch_config_name=LaunchConfig1_name, asg_name=ASG2_name)
        self.tester.delete_asg_from_lp(ASG2_name)
        self.tester.delete_launch_config_from_lp(LaunchConfig1_name)
        LaunchConfig2_name = self.id_generator()+"-launch-config"
        self.tester.create_launch_config_from_lc_lp(LaunchConfig2_name)
        self.tester.create_asg_from_dashboard(launch_config_name=LaunchConfig2_name, asg_name=ASG2_name, min_capacity=1, desired_capacity=1, max_capacity=1)
        self.tester.verify_scaling_history(ASG2_name)
        self.tester.set_scaling_group_capacity(ASG2_name, 0, 0, 1)
        self.tester.delete_asg_from_lp(ASG2_name)
        self.tester.delete_launch_config_from_lp(LaunchConfig2_name)
        self.tester.logout()
        self.tester.exit_browser()
開發者ID:suwaji,項目名稱:eucaconsole,代碼行數:39,代碼來源:autoscaling.py


注:本文中的guiops.guiops.GuiOps.set_scaling_group_capacity方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。