The commands listed above do not have any output, just responses.
For example if you try to list or get something this will have an output which you can format with the --format options and will show debug information with the --debug parameter.
Try these commands to see the differences:
./apic products:list-all --catalog <CATALOG> --org <PORG> --server <SERVER> --scope catalog
./apic products:list-all --catalog <CATALOG> --org <PORG> --server <SERVER> --scope catalog --debug
./apic products:list-all --catalog <CATALOG> --org <PORG> --server <SERVER> --scope catalog --debug --format json
./apic products:list-all --catalog <CATALOG> --org <PORG> --server <SERVER> --scope catalog --debug --format yaml
The --debug parameter will show the equivalent cURL command being used by the Toolkit including the Bearer Token and API call & headers used.
Original Message:
Sent: Mon February 24, 2025 07:18 PM
From: Dhanraj Uchil
Subject: Moving using APIC CLI to REST API
$ apic create:api --title "tst-api" --name tst-api --version 2.0.0 --basepath /test --target-url https://tst.nc.com --template tst-api.hbs --product "tst-product" --debugCreated tst-api.yaml API definition [tst-api:2.0.0]Created tst-product.yaml product definition [tst-product:1.0.0]$ apic validate tst-product.yaml --debugValidated tst-product.yaml product definition [tst-product:1.0.0]Validated tst-api.yaml API definition [tst-api:2.0.0]Without --debug flag$ apic create:api --title "tst-api" --name tst-api --version 2.0.0 --basepath /test --target-url https://tst.nc.com --template tst-api.hbs --product "tst-product" Created tst-api.yaml API definition [tst-api:2.0.0]Created tst-product.yaml product definition [tst-product:1.0.0]$ apic validate tst-product.yamlValidated tst-product.yaml product definition [tst-product:1.0.0]Validated tst-api.yaml API definition [tst-api:2.0.0]With --format and --debug flag$ apic create:api --title "tst-api" --name tst-api --version 2.0.0 --basepath /test --target-url https://tst.nc.com --template tst-api.hbs --product "tst-product" --format json --debugError: unknown flag: --format
------------------------------
Dhanraj Uchil
Original Message:
Sent: Mon February 24, 2025 06:27 PM
From: Jeroen Willems
Subject: Moving using APIC CLI to REST API
afaik apic create:api & apic validate are commands that run locally in the toolkit (cli), so no rest api's are called here.
can you provide the output for
apic products:publish --scope space tst-product.yaml --server <xxxx> --org <xxxx> --catalog <xxxx> --space <xxxx> --debug
------------------------------
Jeroen Willems
Integration Architect - Managing Partner
Integration Designers
Original Message:
Sent: Mon February 24, 2025 06:00 PM
From: Dhanraj Uchil
Subject: Moving using APIC CLI to REST API
Hi Jeroen,
I have tired the --debug with all commands, the command works fine with no error, but there is not output.
apic create:api --title "tst-api" --name tst-api --version 2.0.0 --basepath /test --target-url <xxxx>--template tst-api.hbs --product "tst-product"
apic validate tst-product.yaml --debug
Also, use `--format json` or `--format yaml` on all CLI commands as you will get far more content back, both when commands are successful and when errors occur.
apic create:api --title "tst-api" --name tst-api --version 2.0.0 --basepath /test --target-url https://tst.bcbsnc.com --template tst-api.hbs --product "tst-product" --format json --debug
Error: unknown flag: --format
I am running these commands in Amazon Linux docker container.
Thanks
Raj
------------------------------
Dhanraj Uchil
Original Message:
Sent: Tue February 11, 2025 07:09 PM
From: Jeroen Willems
Subject: Moving using APIC CLI to REST API
Hi,
--debug works most of the time for us.
can you show the logs from e.g. the command?
apic products:publish --scope space tst-product.yaml --server <xxxx> --org <xxxx> --catalog <xxxx> --space <xxxx> --debug
------------------------------
Jeroen Willems
Integration Architect - Managing Partner
Integration Designers
Original Message:
Sent: Fri February 07, 2025 08:41 PM
From: Dhanraj Uchil
Subject: Moving using APIC CLI to REST API
Hello,
We have been using APIC CLI to configuration applications and planning to move to using REST APIs. We are using on-prem APIC v10.0.5.7, can you point me to documentation for the below commands. I tried using --debug option as per this blog , but did not get the REST API output.
apic create:api --title "tst-api" --name tst-api --version 2.0.0 --basepath /test --target-url <xxxx>--template tst-api.hbs --product "tst-product"
apic validate tst-product.yaml
apic products:publish --scope space tst-product.yaml --server <xxxx> --org <xxxx> --catalog <xxxx> --space <xxxx>
apic apis:get tst-api:2.0.0 --server <xxxx> --org <xxxx> --catalog <xxxx> --scope <xxxx> --space <xxxx>
apic draft-products:create tst-product.yaml --server <xxxx> --org <xxxx>
apic draft-products:update tst-product:2.0.0 tst-product.yaml --server <xxxx> --org <xxxx>
apic subscriptions:create --server <xxxx> --org <xxxx>--catalog <xxxx> --space <xxxx> --consumer-org <xxxx> --app <xxxx> subscription.json
apic logout --server <xxxx>
Thanks
Raj
------------------------------
Dhanraj Uchil
------------------------------