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


Python DiscoAWS.get_meta_network_by_name方法代码示例

本文整理汇总了Python中disco_aws_automation.DiscoAWS.get_meta_network_by_name方法的典型用法代码示例。如果您正苦于以下问题:Python DiscoAWS.get_meta_network_by_name方法的具体用法?Python DiscoAWS.get_meta_network_by_name怎么用?Python DiscoAWS.get_meta_network_by_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在disco_aws_automation.DiscoAWS的用法示例。


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

示例1: test_update_elb_all_defaults

# 需要导入模块: from disco_aws_automation import DiscoAWS [as 别名]
# 或者: from disco_aws_automation.DiscoAWS import get_meta_network_by_name [as 别名]
    def test_update_elb_all_defaults(self, mock_config, **kwargs):
        """
        update_elb calls get_or_create_elb with default port and protocol values if all are missing
        """
        aws = DiscoAWS(config=self._get_elb_config(), environment_name=TEST_ENV_NAME, elb=MagicMock())
        aws.elb.get_or_create_elb = MagicMock(return_value=MagicMock())
        aws.get_meta_network_by_name = _get_meta_network_mock()
        aws.elb.delete_elb = MagicMock()

        aws.update_elb("mhcelb", update_autoscaling=False)

        aws.elb.delete_elb.assert_not_called()
        aws.elb.get_or_create_elb.assert_called_once_with(
            'mhcelb',
            health_check_url='/foo',
            hosted_zone_name='example.com',
            port_config=DiscoELBPortConfig(
                [
                    DiscoELBPortMapping(80, 'HTTP', 80, 'HTTP'),
                ]
            ),
            security_groups=['sg-1234abcd'], elb_public=False,
            sticky_app_cookie=None, subnets=['s-1234abcd', 's-1234abcd', 's-1234abcd'],
            elb_dns_alias=None,
            connection_draining_timeout=300, idle_timeout=300, testing=False,
            tags={
                'environment': 'unittestenv',
                'hostclass': 'mhcelb',
                'is_testing': '0',
                'productline': 'mock_productline'
            },
            cross_zone_load_balancing=True,
            cert_name=None
        )
开发者ID:amplifylitco,项目名称:asiaq,代码行数:36,代码来源:test_disco_aws.py

示例2: test_update_elb_create

# 需要导入模块: from disco_aws_automation import DiscoAWS [as 别名]
# 或者: from disco_aws_automation.DiscoAWS import get_meta_network_by_name [as 别名]
    def test_update_elb_create(self, mock_config, **kwargs):
        '''DiscoELB called to update or create ELB when one is configured'''
        aws = DiscoAWS(config=self._get_elb_config(), environment_name=TEST_ENV_NAME)
        aws.elb.get_or_create_elb = MagicMock(return_value=MagicMock())
        aws.get_meta_network_by_name = _get_meta_network_mock()
        aws.elb.delete_elb = MagicMock()

        aws.update_elb("mhcelb", update_autoscaling=False)

        aws.elb.delete_elb.assert_not_called()
        aws.elb.get_or_create_elb.assert_called_once_with(
            'mhcelb', elb_port=80, health_check_url='/foo',
            hosted_zone_name='example.com', instance_port=80,
            elb_protocol='HTTP', instance_protocol='HTTP',
            security_groups=['sg-1234abcd'], elb_public=False,
            sticky_app_cookie=None, subnets=['s-1234abcd', 's-1234abcd', 's-1234abcd'],
            connection_draining_timeout=300, idle_timeout=300)
开发者ID:Angakkuit,项目名称:asiaq-aws,代码行数:19,代码来源:test_disco_aws.py

示例3: test_update_elb_mismatch

# 需要导入模块: from disco_aws_automation import DiscoAWS [as 别名]
# 或者: from disco_aws_automation.DiscoAWS import get_meta_network_by_name [as 别名]
    def test_update_elb_mismatch(self, mock_config, **kwargs):
        """
        update_elb sets instance=ELB when given mismatched numbers of instance and ELB ports
        """
        overrides = {
            'elb_instance_port': '80, 9001',
            'elb_instance_protocol': 'HTTP, HTTP',
            'elb_port': '443, 80, 9002',
            'elb_protocol': 'HTTPS, HTTP, HTTP'
        }
        aws = DiscoAWS(
            config=self._get_elb_config(overrides),
            environment_name=TEST_ENV_NAME,
            elb=MagicMock()
        )
        aws.elb.get_or_create_elb = MagicMock(return_value=MagicMock())
        aws.get_meta_network_by_name = _get_meta_network_mock()
        aws.elb.delete_elb = MagicMock()
        aws.update_elb("mhcelb", update_autoscaling=False)

        aws.elb.delete_elb.assert_not_called()
        aws.elb.get_or_create_elb.assert_called_once_with(
            'mhcelb',
            health_check_url='/foo',
            hosted_zone_name='example.com',
            port_config=DiscoELBPortConfig(
                [
                    DiscoELBPortMapping(80, 'HTTP', 443, 'HTTPS'),
                    DiscoELBPortMapping(9001, 'HTTP', 80, 'HTTP'),
                    DiscoELBPortMapping(9002, 'HTTP', 9002, 'HTTP')
                ]
            ),
            security_groups=['sg-1234abcd'], elb_public=False,
            sticky_app_cookie=None, subnets=['s-1234abcd', 's-1234abcd', 's-1234abcd'],
            elb_dns_alias=None,
            connection_draining_timeout=300, idle_timeout=300, testing=False,
            tags={
                'environment': 'unittestenv',
                'hostclass': 'mhcelb',
                'is_testing': '0',
                'productline': 'mock_productline'
            },
            cross_zone_load_balancing=True,
            cert_name=None
        )
开发者ID:amplifylitco,项目名称:asiaq,代码行数:47,代码来源:test_disco_aws.py


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