Code Monkey home page Code Monkey logo

datapower-xml-shell's People

Contributors

fmoraes74 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

datapower-xml-shell's Issues

Secure Backup and Restore

Q: Another thought for you... secure backup/restore :)

A: As for any function not implemented (and there are a ton), it is an open source project, so submissions are welcome! Ideally I'd like to see a general way of writing all actions and all config, one that's not sensitive to the version of firmware on the appliance. I've not figured out how that should work. So, for now, we're stuck with adding actions one at a time.

Nevertheless, let's gather it here, at least we can see what's most popular.

Deal better with non-shell-normalized class and object names

Q:
Is there a way to get a list of all config objects that doesn't rename them? We use dashes and underscores in object names often and the output from dpxmlsh_get_config_list renames the objects so that its output cannot be used as input. A recent use case was to disable SSL3 in all Crypto Profiles. There's no good way to get a list of these with the tool. I ended up doing a dpxmlsh_ls, grepping for .cfg files, doing a dpxmlsh_get_file on those, and then grepping for CryptoProfile just to get the names of all the CryptoProfiles. If dpxmlsh_get_config_list had not renamed objects (or at least done so in a reconstructable fashion), I would have been able to use that output.

A: As for how to get a list of class+object names that are not normalized for shell, try something like this:
dpxmlsh_soma_get_config | xmlstarlet sel --text -N dp="http://www.datapower.com/schemas/management" --template --match '//dp:config/*' --value-of 'name(.)' -o "::" --value-of '@name' --nl

Discussion:
https://www.ibm.com/developerworks/community/forums/html/topic?id=567faa76-38df-4e41-965f-6e5dac275154#78adf768-4dc3-4858-aa62-8325a0df6542

Use against groups of appliances

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.