Forum Discussion
[iControl Rest]Is there any way to get the current active device and next active device name of a traffic group
I'm currently running into the same problem. The answer above is not helpful. However, you can get the failover state for each device in each traffic-group by querying /mgmt/tm/cm/traffic-group/stats. Thus, you will get a list of all traffic-group members and their respective state in each traffic-group.
BUT: I'm currently not able to query ONE specific traffic-group. Example: I have a traffic group "TG997-Test1" on two devices. When querying the path mentioned above, I get the following response:
> curl -sk -u admin:xxxxxxxx https://lb1/mgmt/tm/cm/traffic-group/stats | python -mjson.tool
{
"entries": {
...
"https://localhost/mgmt/tm/cm/traffic-group/~Common~TG997-Test1:~Common~lb1/stats": {
"nestedStats": {
"entries": {
"deviceName": {
"description": "/Common/lb1"
},
"failoverState": {
"description": "active"
},
"nextActive": {
"description": "false"
},
"trafficGroup": {
"description": "/Common/TG997-Test1"
}
},
"kind": "tm:cm:traffic-group:traffic-groupstats",
"selfLink": "https://localhost/mgmt/tm/cm/traffic-group/~Common~TG997-Test1:~Common~lb1/stats?ver=11.6.0"
}
},
"https://localhost/mgmt/tm/cm/traffic-group/~Common~TG997-Test1:~Common~lb2/stats": {
"nestedStats": {
"entries": {
"deviceName": {
"description": "/Common/lb2"
},
"failoverState": {
"description": "standby"
},
"nextActive": {
"description": "false"
},
"trafficGroup": {
"description": "/Common/TG997-Test1"
}
},
"kind": "tm:cm:traffic-group:traffic-groupstats",
"selfLink": "https://localhost/mgmt/tm/cm/traffic-group/~Common~TG997-Test1:~Common~lb2/stats?ver=11.6.0"
}
},
},
...
"kind": "tm:cm:traffic-group:traffic-groupcollectionstats",
"selfLink": "https://localhost/mgmt/tm/cm/traffic-group/stats?ver=11.6.0"
}
I see both members and their states in this traffic-groups (all other traffic-groups are also returned, the response above is shortened). But I can neither get the failover state of the members of one particular traffic group...
> curl -sk -u admin:xxxxxxxx https://lb1/mgmt/tm/cm/traffic-group/~Common~TG997-Test1/stats | python -mjson.tool
{
"generation": 0,
"kind": "tm:cm:traffic-group:traffic-groupstats",
"selfLink": "https://localhost/mgmt/tm/cm/traffic-group/~Common~TG997-Test1/stats?ver=11.6.0"
}
(no useful data included)
...nor can I poll one of the entries of the "big list" above directly, although I'm following the exact path as in the respective "selfLink" value:
> curl -sk -u admin:xxxxxxxx https://lb1/mgmt/tm/cm/traffic-group/~Common~TG997-Test1:~Common~lb1/stats | python -mjson.tool
{
"code": 404,
"errorStack": [],
"message": "01020036:3: The requested traffic group (/Common/TG997-Test1:/Common/lb1) was not found."
}
I think the REST API in version 11.6.0 HF6 might not yet be completed at this point. Is there anybody out there who ran into the same issue and found a solutions? Maybe, can anybody test if those queries are working with later versions (12+)? Any hint is welcome. Thanks in advance!
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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