本文整理汇总了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
)
示例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)
示例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
)