Would you rather choose APIMCLI or APICTL?

Wasura Wattearachchi
API Integration Essentials
8 min readDec 31, 2020

--

It’s New Year’s Eve guys! Who is ready to play a game?

Let’s play,

Don’t worry if this is your first time playing “Would you rather?”. Go through the link here and get an idea. Are you ready, folks? Let me ask the first question.

Would you rather have a rewind button or a fast forward button in your life?

To answer this question you must have a purpose. If you want to have a rewind button, it means you like to visit your past. But, if you want to have a fast forward button it means that have a need to visit your future soon. Both of these will have pros and cons. For example, by visiting your past you can correct your mistakes, but sometimes it might be painful to see sad memories after all. By visiting your future, you can know what kind of a future you will have and get ready. But what if it is painful? Think well and answer this question. Don’t worry, I don’t need to hear your answer.

Let me ask you some other techy questions,

Would you rather watch TV all the time or not watch TV at all?

Would you rather have slow but unlimited internet or paid but limited internet?

Would you rather have free internet for life or free food?

Would you rather choose APIMCLI or APICTL?

Wait! The last question is related to WSO2, is it? Can you decide the answer? Don’t worry if you are puzzled. Let me help you to figure it out.

Would you rather choose APIMCLI or APICTL?

This or that? APIMCLI or APICTL?

Most of the WSO2 product users are asking questions when deciding what to choose when selecting a product for a particular purpose. When it comes to performing CI/CD with WSO2 API Manager most people are wondering whether APIMCLI or APICTL suits their needs. Simply we can say, “You can choose either”, but there is a hidden meaning in this.

You need to consider the below requirements when you are choosing APIMCLI or APICTL.

  1. Compatibility
  2. Ease of use
  3. Features

Let’s continue our game, shall we? Oh before that make sure to remember, that I will be referring to APIMCLI 2.x as APIMCLI in this article. Even though there are other APIMCLI releases such as 1.0.x and 1.1.x, the most popular APIMCLI release is the 2.x release.

Would you rather choose APIMCLI or APICTL based on the “compatibility with WSO2 API Manager”?

APIMCLI stands for API Manager Command Line Interface. APIMCLI is only compatible with the WSO2 API Manager 2.6.0. If you are a person who is using WSO2 API Manager 2.6.0, you need to use APIMCLI instead of APICTL. APIMCLI started from APIMCLI 2.0.0, but several patch releases have been done such as APIMCLI 2.0.1 to 2.0.11 (currently the latest one is APIMCLI 2.0.11) with improvements and bug fixes. It is recommended to always use the latest patch release of APIMCLI which can be downloaded from here.

If you are a person who is using WSO2 API Manager 2.6.0, then you need to use APIMCLI.

APICTL stands for API Controller. APICTL is only compatible with WSO2 API Manager 3.x releases onwards, but not for WSO2 API Manager 2.6.0. But make sure to remember that not all APICTL versions are compatible with every WSO2 API Manager 3.x release. There is a mapping between APICTL and API Manager. Don’t worry, it’s really easy to remember.

Similarly as mentioned for APIMCLI, APICTL also has corresponding patch releases. For example, if you take APICTL 3.1.x, the latest patch release is APICTL 3.1.4. It is recommended to always use the latest patch release of the corresponding APICTL version according to the above table, which can be downloaded from here.

If you are a person who is using WSO2 API Manager 3.x, then you need to use the corresponding APICTL release according to the above table.

Would you rather choose APIMCLI or APICTL based on the “ease of use”?

Who might be easy to set up?

If you are familiar with setting up APIMCLI and APICTL, you can decide the answer quickly. You can download any of the tooling releases from the link below.

Irrespective of whether it is an APIMCLI release or an APICTL release, you need to download the correct package compatible with your operating system. You can refer to the official documentation to learn how to set up APIMCLI or APICTL (3.0.x, 3.1.x or 3.2.x). Since this is not a “How to?” tutorial, I am not going to explain the setting up process in detail.

But, I would like to highlight the significance of APICTL here, than APIMCLI. If you are setting up APIMCLI, you need to download the latest import/export war file from the documentation. (Currently, it is api-import-export-2.6.0-v17.war ). Then you need to copy it to to the <API-M_2.6_HOME>/repository/deployment/server/webapps folder. But, if you are using APICTL, you do not need to worry about this. There is no “.war” file needed because from API Manager 3.0.0 onwards, the support is there by default inside the server. You just need to have the tool which you can download from here.

Who is more friendly?

Let’s be friends

Both APIMCLI and APICTL are command-line tools. So the interaction between you and the tool mainly happens by executing “commands”. Commands are the element which bridges the gap between a user and the CLI tool. Hence, let me show you an example of “How the commands have been evolved with time?”.

The below table shows the add-env command which can be used to add an environment using the tool.

Evolution of add-env command

Read the below tips to identify the most user-friendly add-env command from the above.

  • You can see that the --name flag of APIMCLI has been changed to --environment in APICTL, to give more meaning to the user.
  • The number of flags has been reduced by one when moving from APIMCLI to APICTL.
  • With each release, the number of required flags has been reduced.
  • In APICTL 3.1.x, you need to have both the --environment and --token flags with either of the other flag combinations as shown in the table.
  • In APICTL 3.2.x, you need to have only the --environment flag with either of the other flag combinations as shown in the table. Furthermore, you can optionally specify the --token flag as well with either of the two combinations if you want.

Now let me ask you a question,

Would you rather choose APIMCLI or APICTL based on the “friendliness of the add-env command”?

I know you can decide the answer now.

The below table shows another two (2) commands. I hope you can try to analyze the evolution of those commands as well.

Evolution of remove-env and export-api commands

Hooray!!! By analyzing the “easiness to set up” and the “friendliness of the commands” I think you can decide the answer to the below question now.

Would you rather choose APIMCLI or APICTL based on the “ease of use”?

Let’s move on to the next question.

Would you rather choose APIMCLI or APICTL based on the “features”?

It would be easy if you can look at a summary of all the main features in APIMCLI and APICTL releases, right? I have eased that task for you. The below table lists the main features of each release related to commands (There are other improvements and internal code changes as well to support a wide range of tasks, but those are not listed here). The features which are in bold letters are the ones that have been introduced newly in each release.

Feature summary of APIMCLI and APICTL

Apart from the above-listed features, the “Role to perform APIMCLI/APICTL tasks” has been simplified with time. You can read about it in the below article.

Perfect!!! By analyzing the “features” I think you can decide the answer to the below question now.

Would you rather choose APIMCLI or APICTL based on the “features”?

Are we clear?

I hope you have the answer to the question which we started this discussion at the beginning of this article.

Would you rather choose APIMCLI or APICTL?

Do you want to know my answer to the above question? Try to guess it with the below hints.

We can say that APIMCLI is the mother of APICTL.

For a mother is the only person on earth who can divide her love among 10 children and each child still have all her love.

Of course, it's true, APICTL has all the features of APIMCLI. But APICTL has some improvements as well when considering specially the ease of use and features. But if you are using WSO2 API Manager 2.6.0, you know what to choose, right? Also, I think you know what to choose if you are using WSO2 API Manager 3.x version.

But if you are a new person to this, new to WSO2 API Manager and APIMCLI/APICTL, go for the latest improved one. You can gain many more advantages from that.

Also, who knows the future? So better be ready by updating your present to the latest.

Hope you have enjoyed this game! Try to play “Would you rather?” with your loved ones during this holiday season.

Merry Christmas and Happy New Year to all of you!

Stay safe everyone! Goodbye until the next time…

References

--

--