Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI for apiman to allow scripting/control/configuration from command line #321

Closed
outofcoffee opened this issue Jan 11, 2016 · 10 comments
Closed

Comments

@outofcoffee
Copy link
Collaborator

Hi @EricWittmann @msavy,

I've been working on a CLI for apiman, so you can do things like this

Create a new service:

$ ./apiman service create \
        --server http://localhost:8080/apiman \
        --name example \
        --endpoint http://example.com \
        --initialVersion 1.0 \
        --publicService \
        --orgName test

Add a gateway:

$ ./apiman gateway create \
        --server http://localhost:8080/apiman \
        --name test-gw \
        --endpoint http://localhost:1234 \
        --username apimanager \
        --password "apiman123!" \
        --type REST

You can find the project at https://github.com/outofcoffee/apiman-cli

It uses the management API documented at http://www.apiman.io/latest/api-manager-restdocs.html to perform common operations such as:

Manage Gateways:

apiman gateway test [args...]
apiman gateway show [args...]
apiman gateway create [args...]
apiman gateway list [args...]

Manage Plugins:

apiman plugin show [args...]
apiman plugin create [args...]
apiman plugin list [args...]

Manage Organisations:

apiman org show [args...]
apiman org create [args...]

Manage Services:

apiman service create [args...]
apiman service policy [add|remove] [args...]
apiman service publish [args...]

Would you be interested in adopting this as part of the main project at some point?

Pete

@msavy
Copy link
Member

msavy commented Jan 11, 2016

Wow, this is some great work. I really like the command layout, it's very logical.

This could be great for writing blogs and tutorials, too!

Any idea of which license you're going to release it under?

As an side, that args4j library looks great - reminds me of Ruby's Trollop. I will definitely use it in future.

@outofcoffee
Copy link
Collaborator Author

Thanks @msavy - intending it to be Apache 2.0. Would that work for you?

Agreed that args4j is awsome - it's from Kohsuke Kawaguchi of Jenkins fame :)

@EricWittmann
Copy link
Member

Yeah we'd love to have this as part of apiman!

One thing I should note, however, is that as of 1.2.x (the current master), we have renamed Service and Application. They are now referred to as "API" and "Client App", respectively. The management APIs have changed accordingly. So it might be useful (depending on what version of apiman you would like the CLI to initially target) to reflect the new names sooner rather than later. I know it can be a pain to do that after the fact (trust me :)).

@EricWittmann
Copy link
Member

Also note: apache 2.0 is the ideal license.

@outofcoffee
Copy link
Collaborator Author

Hi @EricWittmann thanks for the heads-up about the change. I'll update the naming and URLs now and support the 1.1.9 URLs with a --serverVersion flag or similar.

@EricWittmann
Copy link
Member

That'd be great!

As for getting this CLI project contributed to apiman - how about we create an apiman/apiman-cli repository? Perhaps we can even move the repo you already have into the apiman github org. Then you can fork it and keep trucking.

Thoughts?

@outofcoffee
Copy link
Collaborator Author

Probably best to move the current repo into the apiman github org.

I've added the license and updated file headers.

Dual support for 1.1.9 and 1.2.x is now in as well, using a flag.

@EricWittmann
Copy link
Member

Awesome - I have sent you an invite to a new apiman team which will eventually allow you to transfer the repo into the apiman github org. Hopefully. :)

@EricWittmann
Copy link
Member

Whenever you have some time to do the transfer, hop onto our IRC channel and track me down (ewittman):

http://www.apiman.io/latest/chat.html

I can set your permissions appropriately, we can do the transfer, and then I can flip them back. :) (no offense!)

@outofcoffee
Copy link
Collaborator Author

The project has now been transferred to https://github.com/apiman/apiman-cli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants