Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

I recently plan to write a GTM wideip Network Map, Generate a json file

xuwen
MVP
MVP

GTM type A and AAAA wideip generate a json file, like LTM NetworkMap

At present, use python f5-sdk, only type A wideip has been written. GTM works in Common partition testing. The configuration format generated by AS3 has not been test and adapted, because its config seems to work in /partition/folder/config, unlike /Common/config

{
    "wideips": [
        {
            "enabled": true,
            "name": "pay.bestpay-gtm.189.cn",
            "partition": "Common",
            "wideip_type": "A",
            "poolLbMode": "round-robin",
            "persistence": "disabled",
            "pools": [
                {
                    "name": "gslb_pool_bestpay_ctc_v4",
                    "partition": "Common",
                    "order": 0,
                    "ratio": 1,
                    "loadBalancingMode": "round-robin",
                    "alternateMode": "none",
                    "fallbackMode": "none",
                    "fallbackIp": "any",
                    "Members": [
                        {
                            "Member": "/Common/vs_ctc_97_22",
                            "Member Order": 0,
                            "Member Address": "58.213.97.22",
                            "Service Port": "80",
                            "Translation Address": "none",
                            "Translation Service Port": 0
                        },
                        {
                            "Member": "/Common/vs_ctc_97_23",
                            "Member Order": 1,
                            "Member Address": "58.213.97.23",
                            "Service Port": "80",
                            "Translation Address": "none",
                            "Translation Service Port": 0
                        }
                    ]
                }
            ]
        },
        {
            "enabled": true,
            "name": "www.163.com",
            "partition": "Common",
            "wideip_type": "A",
            "poolLbMode": "round-robin",
            "persistence": "disabled",
            "pools": [
                {
                    "name": "gslb_pool_bestpay_ctc_v4",
                    "partition": "Common",
                    "order": 0,
                    "ratio": 1,
                    "loadBalancingMode": "round-robin",
                    "alternateMode": "none",
                    "fallbackMode": "none",
                    "fallbackIp": "any",
                    "Members": [
                        {
                            "Member": "/Common/vs_ctc_97_22",
                            "Member Order": 0,
                            "Member Address": "58.213.97.22",
                            "Service Port": "80",
                            "Translation Address": "none",
                            "Translation Service Port": 0
                        },
                        {
                            "Member": "/Common/vs_ctc_97_23",
                            "Member Order": 1,
                            "Member Address": "58.213.97.23",
                            "Service Port": "80",
                            "Translation Address": "none",
                            "Translation Service Port": 0
                        }
                    ]
                }
            ]
        },
        {
            "disabled": true,
            "name": "www.as3.com",
            "partition": "Common",
            "wideip_type": "A",
            "poolLbMode": "round-robin",
            "persistence": "disabled"
        },
        {
            "aliases": [
                "mapi.bestpay.com.cn"
            ],
            "iRules": [
                "/Common/edns_wideip_test"
            ],
            "enabled": true,
            "name": "www.bestpay.com.cn",
            "partition": "Common",
            "wideip_type": "A",
            "poolLbMode": "topology",
            "persistence": "disabled",
            "pools": [
                {
                    "name": "gslb_pool_bestpay_cmcc_v4",
                    "partition": "Common",
                    "order": 2,
                    "ratio": 1,
                    "loadBalancingMode": "round-robin",
                    "alternateMode": "none",
                    "fallbackMode": "none",
                    "fallbackIp": "any",
                    "Members": [
                        {
                            "Member": "/Common/vs_cmcc_99_22",
                            "Member Order": 0,
                            "Member Address": "58.213.99.22",
                            "Service Port": "80",
                            "Translation Address": "none",
                            "Translation Service Port": 0
                        },
                        {
                            "Member": "/Common/vs_cmcc_99_23",
                            "Member Order": 1,
                            "Member Address": "58.213.99.23",
                            "Service Port": "80",
                            "Translation Address": "none",
                            "Translation Service Port": 0
                        }
                    ]
                },
                {
                    "name": "gslb_pool_bestpay_ctc_v4",
                    "partition": "Common",
                    "order": 0,
                    "ratio": 1,
                    "loadBalancingMode": "round-robin",
                    "alternateMode": "none",
                    "fallbackMode": "none",
                    "fallbackIp": "any",
                    "Members": [
                        {
                            "Member": "/Common/vs_ctc_97_22",
                            "Member Order": 0,
                            "Member Address": "58.213.97.22",
                            "Service Port": "80",
                            "Translation Address": "none",
                            "Translation Service Port": 0
                        },
                        {
                            "Member": "/Common/vs_ctc_97_23",
                            "Member Order": 1,
                            "Member Address": "58.213.97.23",
                            "Service Port": "80",
                            "Translation Address": "none",
                            "Translation Service Port": 0
                        }
                    ]
                },
                {
                    "name": "gslb_pool_bestpay_cuc_v4",
                    "partition": "Common",
                    "order": 1,
                    "ratio": 1,
                    "loadBalancingMode": "round-robin",
                    "alternateMode": "none",
                    "fallbackMode": "none",
                    "fallbackIp": "any",
                    "Members": [
                        {
                            "Member": "/Common/vs_ctc_98_22",
                            "Member Order": 0,
                            "Member Address": "58.213.98.22",
                            "Service Port": "80",
                            "Translation Address": "none",
                            "Translation Service Port": 0
                        },
                        {
                            "Member": "/Common/vs_ctc_98_23",
                            "Member Order": 1,
                            "Member Address": "58.213.98.23",
                            "Service Port": "80",
                            "Translation Address": "none",
                            "Translation Service Port": 0
                        }
                    ]
                }
            ]
        },
        {
            "enabled": true,
            "name": "www.gslb.xuwen.com",
            "partition": "Common",
            "wideip_type": "A",
            "poolLbMode": "topology",
            "persistence": "disabled",
            "pools": [
                {
                    "name": "gslb_pool_ctc_v4",
                    "partition": "Common",
                    "order": 0,
                    "ratio": 1,
                    "loadBalancingMode": "global-availability",
                    "alternateMode": "none",
                    "fallbackMode": "return-to-dns",
                    "fallbackIp": "any",
                    "Members": [
                        {
                            "Member": "/Common/vs_ctc",
                            "Member Order": 0,
                            "Member Address": "58.213.97.84",
                            "Service Port": "80",
                            "Translation Address": "none",
                            "Translation Service Port": 0
                        },
                        {
                            "Member": "/Common/vs_cuc",
                            "Member Order": 1,
                            "Member Address": "58.240.114.130",
                            "Service Port": "80",
                            "Translation Address": "none",
                            "Translation Service Port": 0
                        }
                    ]
                }
            ]
        }
    ]
}

 

5 REPLIES 5

xuwen
MVP
MVP

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
                        }
                    ]
                }
            ]
        }
    ]
}

 

JRahm
Community Manager
Community Manager

I know we are no longer doing external development on the sdk, but let me ask someone internal to see if there is a way without development to accomplish what you're looking for.

Thanks for your reply. BIGIP's built-in Statistics>>Dashbord>>DNS>>Wide IPs, shows that when the wideip goes to gtm pool members, the pool member name is displayed, but the pool members address and service port are not displayed.

Now, i can  use python f5 sdk to obtain the json of the type A and AAAA data of the GTM wideip. It supports retrieving the AS3 published wideip. However, to achieve tree like visual display like AppViewX, i must learn some front-end programming languages such as Vue.js to do html visual display

JRahm
Community Manager
Community Manager

ah..so the data collection part is fine now and you are just sharing the success on that front, but the challenge going forward is using the data to visualize it?

@Patrik_Jonsson and @TimRiker wrote a front-end for stats for LTM, not sure they have GTM support or aspirations, but maybe their work can inspire yours?

https://community.f5.com/t5/codeshare/big-ip-report/ta-p/285134

 

We do not support GTM (yet). It's been requested many times though. Might be something for 2023. 🙂