Skip to Content
Technical Articles

Introducing the CPI CLI (Command Line Interface) V0.0.1

A few weeks ago I set myself the challenge of learning Python and, as I am firmly convinced that the best way to learn is by doing, I started a side project to create a command line interface for CPI.

I don’t have anything against UI5 or Fiori, but sometimes I think it’s not the best UI for handling systems like CPI. (Maybe I have spent too much time working on PO). Very simple activities take a lot of clicks and scrolls. It is not possible to export lists or take general snapshots of contents, nor is there a simple way to mechanize processes. Eclipse was somewhat compliant with this, but as we know, it is going out of use.

On the other hand, a command line interface is very different as it has no visual effects, nor the “wow” effect, however it can be very efficient and can be complemented with many other powerful programs that are able to interact with the STDIN and STDOUT (such us “grep” and “more”). It also lets you write small scripts that allow you to mechanize processes or execute them “en masse”.

Regarding my adventure learning Python, I’ve learned a lot along the way, but I don’t go from being a novice. This is why I still don’t want to release the code to the community as I still want to incorporate some points and polish my skills before doing so. However, I want to share with the community the first alpha version of this interface.

You can download it for windows and linux from here: http://bit.ly/CPI-CLI-001

  • Windows (Unsigned Installer -> Warning of “Unknown publisher”)
  • Windows (Portable)
  • Linux (OpenSuse)

Please, remember this is only for demos and a alpha release. In other words, use it at your own risk. The CLI is prompt to errors and nasty things like “odata injection” (if that’s a thing) are not controlled.

This first version, only has some very simple features:
– Login / Logout
– List of nodes
– Listing and filtering of messages
– List of contents (Iflows, Odata Services, Value Mappings)
– Content download

In the roadmap I have:
– List of credentials (and perhaps their content)
– Download of: tail logs, http and node traces
– iFlow parameter Maintenance
– Backup and Snapshots of integration contents
– Push and Commits to GIT repositories
– I accept suggestions!

Your constructive feedback would be very welcome. Feel free to reach out if you have any questions or ideas to implement.

 

Ariel Bravo Ayala

 

Basic examples

 

Help: (You can use the –help in all the commands)

cpi --help

 

Command “login”:

cpi login -u ariel.bravo@xxxxxxxx -h yyyyy-tmn.hci.zzz.hana.ondemand.com

 

Command “list”

  • List first 10 error messages:
cpi list messages -e -top 10

 

  • List messages from the 2019-01-23 15:15 to the 2019-01-23 15:25
cpi list messages -f 2019-01-23T15:15:00 -t 2019-01-23T15:30:00

 

  • List all the integration content
cpi list content

Command “download”

  • Download an iFlow
cpi download -id <SymbolicNameOfTheArtefact>

 

 

8 Comments
You must be Logged on to comment or reply to a post.
  • Hi Ariel,

    First of all many thanks for sharing such a useful tool. Cannot wait for next version!!!

    However, when i try to login using CLI to my CPI account i get error as in following snapshot. I use both Email as well as P ID to login. This P ID is already being tested by me in browser session and has sufficient roles and privileges but using CLI it throws an error.

    cpi login -u XXXXX.XXXXX@gmx.de -h d0442-tmn.hci.eu1.hana.ondemand.com
    or
    cpi login -u P2000XXXXXX -h d0442-tmn.hci.eu1.hana.ondemand.com

    Snapshot:

    Do you know what could be the reason?

    Thanks

    Saurabh

     

    • Hi Saurabh,

      Thanks for your words, I’ll keep you posted with the updates.

      The CLI uses two approaches: calls to the Odata API, and mimic the eclipse tool. My user has very powerful roles, so I did not test the required roles.

      Could you please check these things?

      • Verify that you can access the system with the eclipse tool
      • Verify if you have these roles:
        • IntegrationOperationServer.developer
        • IntegrationOperationServer.read
      • Send me a list of your roles so I can understand what are the specific requirements and document accordingly

      Thanks,

      Ariel