Forum Discussion
I recently plan to write a GTM wideip Network Map, Generate a json file
Python f5-sdk send a GET request to GTM in the form of ~partition~name, but the format of the GET request for the AS3 published wideip should be ~partition~Application~name, so when retrieving the AS3 published wideip, the URL constructed will report HTTP 404. After reading the error source code icontrol\session.py There is a function def _ validate_ name_ partition_ Subpath (element):
def _validate_name_partition_subpath(element):
# '/' and '~' are illegal characters in most cases, however there are
# few exceptions (GTM Regions endpoint being one of them where the
# validation of name should not apply.
"""
if '~' in element:
error_message =\
"instance names and partitions cannot contain '~', but it's: %s"\
% element
raise InvalidInstanceNameOrFolder(error_message)
"""
the determination of whether the name carries the character ~ will cause the structure of AS3 name=i.subPath + '~' + i.name doesn't work.
so delete the judgment of ~ will generate a GTM Wideip NetworkMap json
{
"wideips": [
{
"enabled": true,
"name": "www.gslb.bank.com",
"partition": "Common",
"wideip_type": "A",
"poolLbMode": "round-robin",
"persistence": "disabled",
"lastResortPool": "",
"fullPath": "/Common/www.gslb.bank.com",
"pools": [
{
"name": "gslb_pool_test",
"partition": "Common",
"order": 0,
"ratio": 1,
"fullPath": "/Common/gslb_pool_test",
"loadBalancingMode": "round-robin",
"alternateMode": "round-robin",
"fallbackMode": "return-to-dns",
"fallbackIp": "any",
"Members": [
{
"Member": "/Common/vs_sideband",
"Member Order": 0,
"Member Address": "200.1.1.200",
"Service Port": "80",
"Translation Address": "none",
"Translation Service Port": 0
}
]
}
]
},
{
"aliases": [
"another.example*"
],
"enabled": true,
"subPath": "Application",
"name": "example.edu",
"partition": "Example_Tenant",
"wideip_type": "A",
"poolLbMode": "ratio",
"persistence": "disabled",
"lastResortPool": "",
"fullPath": "/Example_Tenant/Application/example.edu",
"pools": [
{
"name": "testPool",
"partition": "Example_Tenant",
"order": 0,
"ratio": 1,
"subPath": "Application",
"fullPath": "/Example_Tenant/Application/testPool",
"loadBalancingMode": "round-robin",
"alternateMode": "round-robin",
"fallbackMode": "return-to-dns",
"fallbackIp": "any",
"Members": []
}
]
},
{
"enabled": true,
"subPath": "Application",
"name": "example.as3.io",
"partition": "example2Tenant",
"wideip_type": "A",
"poolLbMode": "ratio",
"persistence": "disabled",
"lastResortPool": "",
"fullPath": "/example2Tenant/Application/example.as3.io",
"pools": [
{
"name": "testPoolA",
"partition": "example2Tenant",
"order": 0,
"ratio": 1,
"subPath": "Application",
"fullPath": "/example2Tenant/Application/testPoolA",
"loadBalancingMode": "round-robin",
"alternateMode": "round-robin",
"fallbackMode": "return-to-dns",
"fallbackIp": "any",
"Members": [
{
"Member": "0",
"Member Order": 0,
"Member Address": "2.2.3.8",
"Service Port": "5050",
"Translation Address": "none",
"Translation Service Port": 0
},
{
"Member": "2",
"Member Order": 1,
"Member Address": "2.2.3.9",
"Service Port": "5050",
"Translation Address": "none",
"Translation Service Port": 0
}
]
}
]
},
{
"enabled": true,
"subPath": "Application",
"name": "example.edu",
"partition": "example2Tenant",
"wideip_type": "AAAA",
"poolLbMode": "ratio",
"persistence": "disabled",
"lastResortPool": "",
"fullPath": "/example2Tenant/Application/example.edu",
"pools": [
{
"name": "testPoolAAAA",
"partition": "example2Tenant",
"order": 0,
"ratio": 1,
"subPath": "Application",
"fullPath": "/example2Tenant/Application/testPoolAAAA",
"loadBalancingMode": "round-robin",
"alternateMode": "round-robin",
"fallbackMode": "return-to-dns",
"fallbackIp": "any",
"Members": [
{
"Member": "1",
"Member Order": 0,
"Member Address": "2001:db8:85a3::8a2e:370:7334",
"Service Port": "5051",
"Translation Address": "none",
"Translation Service Port": 0
},
{
"Member": "3",
"Member Order": 1,
"Member Address": "2001:db8:85a3::8a2e:370:1337",
"Service Port": "5052",
"Translation Address": "none",
"Translation Service Port": 0
}
]
}
]
}
]
}
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com