You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Q: have you ever considered adding the ability to create appliance groups? I almost never do things to a single appliance. I generally want to make the exact same change to a group of appliances. The end result is that every script I have ends up with a top level loop to iterate through the appliances.
A:
As for the loop, can you describe more about how it should work? I've thought about it, but never come up with an approach I liked better than multiple calls to init. For instance, do we want to join tables? how? How does import work? etc. Should it be for every command (specified on init), or for each command (flags on each command, ewww).
To do what you describe, you could do a little shell function, something like this:
function dploop ()
{
shift
local dp=""
for dp in $DPS
do
echo "=== $dp ==="
dpxmlsh_init -h $dp
"$@"
done
}
then you can do something like:
DPS="dp1 dp2 dp3"
dploop dpxmlsh_get_status_list Version
and you should get all the version for each.
Follow-up Q:
Perhaps you could do a different type of init, maybe dpxmlsh_group_init where you specify multiple hosts? Then each command issued after that init and before the next would be executed to each. The more I think about it, it actually sounds kinda clunky. Maybe its best I just implement a cleaner looping method.
Follow-up A:
We can think about how looping might work. Some good examples are dsh and pssh might be reasonable models, I think you're coming to the same conclusion as I that it might be a little clunky.
Q: have you ever considered adding the ability to create appliance groups? I almost never do things to a single appliance. I generally want to make the exact same change to a group of appliances. The end result is that every script I have ends up with a top level loop to iterate through the appliances.
A:
As for the loop, can you describe more about how it should work? I've thought about it, but never come up with an approach I liked better than multiple calls to init. For instance, do we want to join tables? how? How does import work? etc. Should it be for every command (specified on init), or for each command (flags on each command, ewww).
To do what you describe, you could do a little shell function, something like this:
function dploop ()
{
shift
local dp=""
for dp in $DPS
do
echo "=== $dp ==="
dpxmlsh_init -h $dp
"$@"
done
}
then you can do something like:
DPS="dp1 dp2 dp3"
dploop dpxmlsh_get_status_list Version
and you should get all the version for each.
Follow-up Q:
Perhaps you could do a different type of init, maybe dpxmlsh_group_init where you specify multiple hosts? Then each command issued after that init and before the next would be executed to each. The more I think about it, it actually sounds kinda clunky. Maybe its best I just implement a cleaner looping method.
Follow-up A:
We can think about how looping might work. Some good examples are dsh and pssh might be reasonable models, I think you're coming to the same conclusion as I that it might be a little clunky.
Link:
https://www.ibm.com/developerworks/community/forums/html/topic?id=567faa76-38df-4e41-965f-6e5dac275154#78adf768-4dc3-4858-aa62-8325a0df6542
The text was updated successfully, but these errors were encountered: