Forum Discussion

Ben_Novak's avatar
Ben_Novak
Icon for Employee rankEmployee
Oct 15, 2018

Create two mgmt routes via api

For simplicity, I'm using curl, but eventually programming with python.

 

I'm trying to create two a mgmt route via the api. Eventually doing multiple with a single call.

 

I have the following:

 

curl -sk -u admin:admin -X PUT -H 'Content-Type:application/json' -d '{'name': 'routename1', 'network': '10.0.0.1/32', 'gateway': '192.168.255.1'}' https://192.168.55.4/mgmt/tm/sys/management-route

 

This is the response I'm getting. I know it's formatting, just now sure what else it needs

 

{"code":400,"message":"Found invalid JSON body in the request.","errorStack":[],"apiError":1}

 

This is what I put together for creating two at once.

 

curl -sk -u admin:admin -X PUT -H 'Content-Type:application/json' -d '{'kind': 'tm:sys:management-route:management-routecollectionstate', 'items': [{'name': 'curl1', 'network': '10.0.0.1/32', 'gateway': '192.168.255.1'}{'name': 'curl2', 'network': '20.0.0.2/32', 'gateway': '192.168.55.1'}]}' https://192.168.55.4/mgmt/tm/sys/management-route

 

Anyone have a successful curl command for creating a mgmt route?

 

No RepliesBe the first to reply