Encoding API calls in URL format

Oliver Kraitschy oliver at okraits.de
Fri Dec 9 02:37:28 EST 2016


Hello,

no, it isn't possible in a simple way. The API only accepts requests in 
the syntax described in the wiki.

What are you trying to achieve?

If you want to use the API in a more simple way, you have to write a 
wrapper for it.

I did that, you can check it out on github:

https://github.com/TDT-GmbH/python-genieacs

Greetings,
Oliver

Am 08.12.2016 20:10, schrieb noc at gibfibrespeed.net:
> Hello everyone,
> 
> Is it possible to encode API calls into a simple URL format?
> 
> For example, I need to turn curl -i
> 'http://localhost:7557/presets/783d5b024367-DATA' -X DELETE into
> http://something
> 
> or
> 
> curl -i 'http://172.16.5.19:7557/presets/783d5b024367-DATA' \
> -X PUT \
> --data '{ "weight": 1, "precondition":
> "{\"summary.serialNumber\":\"783d5b024367\", \"_tags\":\"fase1\"}",
> "configurations": [ { "type": "value", "name":
> "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.Username",
> "value": "ps4" }, { "type": "value", "name":
> "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.Password",
> "value": "ps4" }, { "type": "value", "name":
> "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.NATEnabled",
> "value": "true" }, { "type": "value", "name":
> "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.X_BROADCOM_COM_FirewallEnabled",
> "value": "true" }, { "type": "value", "name":
> "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.PPPAuthenticationProtocol",
> "value": "AUTO_AUTH" }, { "type": "value", "name":
> "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.X_BROADCOM_COM_IfName",
> "value": "ppp0.0" }, { "type": "value", "name":
> "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.X_BROADCOM_COM_VlanMuxID",
> "value": "200" }, { "type": "value", "name":
> "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.X_BROADCOM_COM_VlanMux8021p",
> "value": "7" }, { "type": "value", "name":
> "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.Enable",
> "value": "true" }, { "type": "value", "name":
> "InternetGatewayDevice.Layer3Forwarding.X_BROADCOM_COM_DefaultConnectionServices",
> "value": "ppp0.0" }, { "type": "value", "name":
> "InternetGatewayDevice.X_BROADCOM_COM_NetworkConfig.DNSServers",
> "value": "8.8.8.8,8.8.4.4" } ] }'
> 
> into http://something
> 
> Is it possible to do it in a simple way?
> 
> Thanks in advance,
> 
> Miguel
> _______________________________________________
> Users mailing list
> Users at lists.genieacs.com
> http://lists.genieacs.com/mailman/listinfo/users



More information about the Users mailing list