当前位置: 首页>>代码示例>>Python>>正文


Python autoscaling.AutoScalingGroup类代码示例

本文整理汇总了Python中troposphere.autoscaling.AutoScalingGroup的典型用法代码示例。如果您正苦于以下问题:Python AutoScalingGroup类的具体用法?Python AutoScalingGroup怎么用?Python AutoScalingGroup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了AutoScalingGroup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_none

 def test_none(self):
     group = AutoScalingGroup(
         'mygroup',
         MaxSize="1",
         MinSize="1",
     )
     with self.assertRaises(ValueError):
         self.assertTrue(group.validate())
开发者ID:Arvoreen,项目名称:troposphere,代码行数:8,代码来源:test_asg.py

示例2: test_instanceid

 def test_instanceid(self):
     group = AutoScalingGroup(
         'mygroup',
         InstanceId="i-1234",
         MaxSize="1",
         MinSize="1",
     )
     self.assertTrue(group.validate())
开发者ID:DualSpark,项目名称:troposphere,代码行数:8,代码来源:test_asg.py

示例3: test_launchconfigurationname

 def test_launchconfigurationname(self):
     group = AutoScalingGroup(
         'mygroup',
         LaunchConfigurationName="I'm a test",
         MaxSize="1",
         MinSize="1",
     )
     self.assertTrue(group.validate())
开发者ID:DualSpark,项目名称:troposphere,代码行数:8,代码来源:test_asg.py

示例4: test_launchconfigurationname

 def test_launchconfigurationname(self):
     group = AutoScalingGroup(
         "mygroup",
         AvailabilityZones=["eu-west-1a", "eu-west-1b"],
         LaunchConfigurationName="I'm a test",
         MaxSize="1",
         MinSize="1",
     )
     self.assertTrue(group.validate())
开发者ID:cloudtools,项目名称:troposphere,代码行数:9,代码来源:test_asg.py

示例5: test_instanceid

 def test_instanceid(self):
     group = AutoScalingGroup(
         'mygroup',
         AvailabilityZones=['eu-west-1a', 'eu-west-1b'],
         InstanceId="i-1234",
         MaxSize="1",
         MinSize="1",
     )
     self.assertTrue(group.validate())
开发者ID:Arvoreen,项目名称:troposphere,代码行数:9,代码来源:test_asg.py

示例6: test_exclusive

 def test_exclusive(self):
     group = AutoScalingGroup(
         'mygroup',
         InstanceId="i-1234",
         LaunchConfigurationName="I'm a test",
         MaxSize="1",
         MinSize="1",
     )
     with self.assertRaises(ValueError):
         self.assertTrue(group.validate())
开发者ID:Arvoreen,项目名称:troposphere,代码行数:10,代码来源:test_asg.py

示例7: test_AutoScalingRollingUpdate_all_defaults

 def test_AutoScalingRollingUpdate_all_defaults(self):
     group = AutoScalingGroup(
         'mygroup',
         AvailabilityZones=['eu-west-1a', 'eu-west-1b'],
         LaunchConfigurationName="I'm a test",
         MaxSize="1",
         MinSize="1",
         UpdatePolicy=UpdatePolicy(
             AutoScalingRollingUpdate=AutoScalingRollingUpdate())
     )
     self.assertTrue(group.validate())
开发者ID:Arvoreen,项目名称:troposphere,代码行数:11,代码来源:test_asg.py

示例8: test_working

 def test_working(self):
     group = AutoScalingGroup('mygroup',
         LaunchConfigurationName="I'm a test",
         MaxSize="4",
         MinSize="2",
         UpdatePolicy=UpdatePolicy('AutoScalingRollingUpdate',
             PauseTime='PT1M5S',
             MinInstancesInService='2',
             MaxBatchSize='1',
         )
     )
     self.assertTrue(group.validate())
开发者ID:fishdaemon,项目名称:troposphere,代码行数:12,代码来源:test_basic.py

示例9: test_mininstances

 def test_mininstances(self):
     group = AutoScalingGroup('mygroup',
         LaunchConfigurationName="I'm a test",
         MaxSize="1",
         MinSize="1",
         UpdatePolicy=UpdatePolicy('AutoScalingRollingUpdate',
             PauseTime='PT1M5S',
             MinInstancesInService='1',
             MaxBatchSize='1',
         )
     )
     with self.assertRaises(ValueError):
         self.assertTrue(group.validate())
开发者ID:fishdaemon,项目名称:troposphere,代码行数:13,代码来源:test_basic.py

示例10: test_size_if

 def test_size_if(self):
     group = AutoScalingGroup(
         "mygroup",
         AvailabilityZones=["eu-west-1a", "eu-west-1b"],
         LaunchConfigurationName="I'm a test",
         MaxSize=If("isstage", "1", "5"),
         MinSize="1",
         UpdatePolicy=UpdatePolicy(
             AutoScalingRollingUpdate=AutoScalingRollingUpdate(
                 PauseTime="PT5M", MinInstancesInService="1", MaxBatchSize="1", WaitOnResourceSignals=True
             )
         ),
     )
     self.assertTrue(group.validate())
开发者ID:cloudtools,项目名称:troposphere,代码行数:14,代码来源:test_asg.py

示例11: test_helperfn_as_updatepolicy

 def test_helperfn_as_updatepolicy(self):
     update_policy = UpdatePolicy(
         AutoScalingRollingUpdate=AutoScalingRollingUpdate(
             PauseTime="PT5M", MinInstancesInService="1", MaxBatchSize="1", WaitOnResourceSignals=True
         )
     )
     group = AutoScalingGroup(
         "mygroup",
         AvailabilityZones=["eu-west-1a", "eu-west-1b"],
         LaunchConfigurationName="I'm a test",
         MaxSize=If("isstage", "1", "5"),
         MinSize="1",
         UpdatePolicy=If("UseUpdatePolicy", update_policy, Ref("AWS::NoValue")),
     )
     self.assertTrue(group.validate())
开发者ID:cloudtools,项目名称:troposphere,代码行数:15,代码来源:test_asg.py

示例12: test_mininstances_mininstancesinservice_is_ref

 def test_mininstances_mininstancesinservice_is_ref(self):
     paramMinInstancesInService = Parameter(
         "ParamMinInstancesInService",
         Type="String"
     )
     group = AutoScalingGroup(
         'mygroup',
         LaunchConfigurationName="I'm a test",
         MaxSize="4",
         MinSize="2",
         UpdatePolicy=UpdatePolicy(
             'AutoScalingRollingUpdate',
             PauseTime='PT1M5S',
             MinInstancesInService=Ref(paramMinInstancesInService),
             MaxBatchSize="2",
         )
     )
     self.assertTrue(group.validate())
开发者ID:EITC-IRPD,项目名称:troposphere,代码行数:18,代码来源:test_basic.py

示例13: test_AutoScalingRollingUpdate_validation

    def test_AutoScalingRollingUpdate_validation(self):
        update_policy = UpdatePolicy(
            AutoScalingRollingUpdate=AutoScalingRollingUpdate(
                MinInstancesInService="2",
                MaxBatchSize='1'
            )
        )
        group = AutoScalingGroup(
            'mygroup',
            AvailabilityZones=['eu-west-1a', 'eu-west-1b'],
            LaunchConfigurationName="I'm a test",
            MaxSize="2",
            MinSize="1",
            UpdatePolicy=update_policy
        )

        with self.assertRaises(ValueError):
            self.assertTrue(group.validate())
开发者ID:Arvoreen,项目名称:troposphere,代码行数:18,代码来源:test_asg.py

示例14: test_mininstances_maxsize_is_ref

 def test_mininstances_maxsize_is_ref(self):
     paramMaxSize = Parameter(
         "ParamMaxSize",
         Type="String"
     )
     group = AutoScalingGroup(
         'mygroup',
         AvailabilityZones=['eu-west-1a', 'eu-west-1b'],
         LaunchConfigurationName="I'm a test",
         MaxSize=Ref(paramMaxSize),
         MinSize="2",
         UpdatePolicy=UpdatePolicy(
             AutoScalingRollingUpdate=AutoScalingRollingUpdate(
                 PauseTime='PT1M5S',
                 MinInstancesInService='2',
                 MaxBatchSize="1"
             )
         )
     )
     self.assertTrue(group.validate())
开发者ID:bpholt,项目名称:troposphere,代码行数:20,代码来源:test_policies.py

示例15: test_instanceid

 def test_instanceid(self):
     group = AutoScalingGroup(
         "mygroup", AvailabilityZones=["eu-west-1a", "eu-west-1b"], InstanceId="i-1234", MaxSize="1", MinSize="1"
     )
     self.assertTrue(group.validate())
开发者ID:cloudtools,项目名称:troposphere,代码行数:5,代码来源:test_asg.py


注:本文中的troposphere.autoscaling.AutoScalingGroup类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。