API Connect

 View Only

Using the apicops CLI to execute command inside the pods

By Saber Hamidi posted Wed January 24, 2024 10:10 AM



This blog post provides instructions on how to execute internal scripts and other commands within our pods using the apicops CLI exec command. When addressing customer PMRs raised for IBM API Connect, we consistently ask customers to run commands inside our pods for debugging purposes or implementing workarounds. This necessity led us to develop the exec command within our apicops CLI, facilitating the easy execution of various commands within our pods. It is essential to note that executing arbitrary commands within our pods may result in serious issues. We strongly advise using this functionality only if you are familiar with the process or consulting with our support team for guidance. These instructions specifically apply to IBM API Connect V10, and you can download the latest release of the apicops CLI from here


The apicops exec command was aimed at portal pods but it can be used to execute commands on other pods too. 

The only required Option is -C which takes the inner command to be executed inside the pod. For example apicops exec -C "status". The other flags are optional and by default, the CLI will target one of the portal-www pod admin container in the current default namespace. However, if you want to target other pods or namespaces you can specify. 

Example: Resetting the upgrade attempts in case of any site upgrade failure

apicops exec -C "reset_upgrade_attempts"