Using the API Connect operations command line interface
The IBM® API
Connect
v2018 apicops command line interface is targeted at Operations teams. It contains
commands to check the health of the system and some commands to fix specific problems that might be
encountered.
The apicops command line interface is in active development and the latest
version is available to download from
Github.com. All suggestions, feedback, and bug reports are welcome - feel free to raise an
issue in this repository. Please limit the issues to those specific to apicops
itself - issues about API Connect cannot be accepted, they must be raised by using the normal IBM Support route.
apicops is for IBM API
Connect v2018.4.1.6 and
higher, only.Installing
apicops. For more information, see Releases -
APIC Operations CLI. chmod
+x on the downloaded file before you can run it.Requirements
To run apicops, you need to have kubectl, or something that implements the same
CLI as kubectl, such as oc (OpenShift client), installed locally. If you aren't using kubectl, then
set the environment variable APICOPS_K8SCLIENT to the name of the Kubernetes client
binary, such as oc.
If you are using the oc, then v4.1.x or higher is required, even if you are using v3.x of the OpenShift cluster.
Then, set the KUBECONFIG environment variable to point to your kubeconfig file
and apicops picks it up from there.
$ export KUBECONFIG=/home/user/my.kubeconfig
$ apicops
If you are running inside an API Connect OVA file, then run apicops as root,
sudo -i, and it automatically picks up the kubeconfig.
Setting the target namespace
By default, the targeted namespace for the deployment is default. If your
deployment uses an alternative namespace, then you need to set this value in the relevant context of
your kubeconfig file. You can either edit your kubeconfig file, and add the namespace property with
your value. Or, you can set the namespace for the current context by using the following command,
where <namespace> is the value you want to use.
kubectl config set "contexts."`kubectl config current-context`".namespace" <namespace>
You can view all contexts and their configured namespaces with the command:
kubectl config get-contexts
Usage
$ apicops COMMAND
running command...
$ apicops (-v|--version|version)
apicops/0.1.46 linux-x64 node-v10.16.3
$ apicops --help [COMMAND]
USAGE
$ apicops COMMAND
...