Forum Discussion
Landono
Nimbostratus
May 05, 2015Modifying Pool Members through REST API
I'm currently modifying our script that we use to manage our LTM boxes, specifically the part that modifies and creates nodes and pools. Historically we've had the script run a variety of SSH command...
nitass
Employee
May 08, 2015I was wondering if it were possible to send an array of members as opposed to adding one at a time.
i might be wrong but i think we have to send to pool url (instead of members url); however, as you know, it will overwrite the members list.
[root@ve11c:Active:In Sync] images curl -sk -u admin:admin https://localhost/mgmt/tm/ltm/pool/foo/members | /var/tmp/jq .
{
"kind": "tm:ltm:pool:members:memberscollectionstate",
"selfLink": "https://localhost/mgmt/tm/ltm/pool/foo/members?ver=11.6.0",
"items": [
{
"kind": "tm:ltm:pool:members:membersstate",
"name": "200.200.200.101:80",
"partition": "Common",
"fullPath": "/Common/200.200.200.101:80",
"generation": 9,
"selfLink": "https://localhost/mgmt/tm/ltm/pool/foo/members/~Common~200.200.200.101:80?ver=11.6.0",
"address": "200.200.200.101",
"connectionLimit": 0,
"dynamicRatio": 1,
"ephemeral": "false",
"fqdn": {
"autopopulate": "disabled"
},
"inheritProfile": "enabled",
"logging": "disabled",
"monitor": "default",
"priorityGroup": 0,
"rateLimit": "disabled",
"ratio": 1,
"session": "user-enabled",
"state": "unchecked"
}
]
}
[root@ve11c:Active:In Sync] images curl -sk -u admin:admin https://localhost/mgmt/tm/ltm/pool/foo -H "Content-Type: application/json" -X PUT -d '{"members":[{"name":"200.200.200.111:80"},{"name":"200.200.200.102:80"}]}' | /var/tmp/jq .
{
"kind": "tm:ltm:pool:poolstate",
"name": "foo",
"fullPath": "foo",
"generation": 10,
"selfLink": "https://localhost/mgmt/tm/ltm/pool/foo?ver=11.6.0",
"allowNat": "yes",
"allowSnat": "yes",
"ignorePersistedWeight": "disabled",
"ipTosToClient": "pass-through",
"ipTosToServer": "pass-through",
"linkQosToClient": "pass-through",
"linkQosToServer": "pass-through",
"loadBalancingMode": "round-robin",
"minActiveMembers": 0,
"minUpMembers": 0,
"minUpMembersAction": "failover",
"minUpMembersChecking": "disabled",
"queueDepthLimit": 0,
"queueOnConnectionLimit": "disabled",
"queueTimeLimit": 0,
"reselectTries": 0,
"serviceDownAction": "none",
"slowRampTime": 10,
"membersReference": {
"link": "https://localhost/mgmt/tm/ltm/pool/~Common~foo/members?ver=11.6.0",
"isSubcollection": true
}
}
[root@ve11c:Active:Not All Devices Synced] images curl -sk -u admin:admin https://localhost/mgmt/tm/ltm/pool/foo/members | /var/tmp/jq .
{
"kind": "tm:ltm:pool:members:memberscollectionstate",
"selfLink": "https://localhost/mgmt/tm/ltm/pool/foo/members?ver=11.6.0",
"items": [
{
"kind": "tm:ltm:pool:members:membersstate",
"name": "200.200.200.102:80",
"partition": "Common",
"fullPath": "/Common/200.200.200.102:80",
"generation": 10,
"selfLink": "https://localhost/mgmt/tm/ltm/pool/foo/members/~Common~200.200.200.102:80?ver=11.6.0",
"address": "200.200.200.102",
"connectionLimit": 0,
"dynamicRatio": 1,
"ephemeral": "false",
"fqdn": {
"autopopulate": "disabled"
},
"inheritProfile": "enabled",
"logging": "disabled",
"monitor": "default",
"priorityGroup": 0,
"rateLimit": "disabled",
"ratio": 1,
"session": "user-enabled",
"state": "unchecked"
},
{
"kind": "tm:ltm:pool:members:membersstate",
"name": "200.200.200.111:80",
"partition": "Common",
"fullPath": "/Common/200.200.200.111:80",
"generation": 10,
"selfLink": "https://localhost/mgmt/tm/ltm/pool/foo/members/~Common~200.200.200.111:80?ver=11.6.0",
"address": "200.200.200.111",
"connectionLimit": 0,
"dynamicRatio": 1,
"ephemeral": "false",
"fqdn": {
"autopopulate": "disabled"
},
"inheritProfile": "enabled",
"logging": "disabled",
"monitor": "default",
"priorityGroup": 0,
"rateLimit": "disabled",
"ratio": 1,
"session": "user-enabled",
"state": "unchecked"
}
]
}
[root@ve11c:Active:In Sync] images tmsh list ltm pool foo
ltm pool foo {
members {
200.200.200.102:80 {
address 200.200.200.102
}
200.200.200.111:80 {
address 200.200.200.111
}
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects