To use mgmt_cli to interact with the Gaia API, you need to use the --context option, like so:
[Expert@DallasticXL-s01-01:0]# sessionCookie=$(mktemp)
[Expert@DallasticXL-s01-01:0]# mgmt_cli -f json --context gaia_api login user admin password '1qaz!QAZ' >"${sessionCookie}"
[Expert@DallasticXL-s01-01:0]# mgmt_cli -f json -s "${sessionCookie}" show routes
{
"from": 1,
"member-id": "1_1",
"objects": [
{
"active-age": 6549591,
"address": "0.0.0.0",
"age": 6549591,
"mask-length": 0,
"next-hop": {
"gateways": [
{
"address": "10.0.1.1",
"interface": "wrp0"
}
]
},
"protocol": "Static"
},
{
"address": "10.0.1.0",
"mask-length": 24,
"next-hop": {
"interface": "wrp0"
},
"protocol": "Connected"
},
{
"address": "127.0.0.0",
"mask-length": 8,
"next-hop": {
"interface": "lo"
},
"protocol": "Connected"
},
{
"address": "192.0.2.0",
"mask-length": 24,
"next-hop": {
"interface": "Sync"
},
"protocol": "Connected"
}
],
"to": 4,
"total": 4,
"virtual-system-id": 0
}