I've been looking at the API examples showin in https://www.truenas.com/docs/api/rest.html but I don't see any good examples of setting up the environment for the perl/python examples. It would be great if someone had some good examples to learn from. And I've looked at various API threads in the forums, but none of them are any use. I looked at:
Official Python SDK
Swagger codegen of the v2 api
TrueCommand API
API problems
I've tried setting up a python virtualenv and installing modules, but where do I get the 'swagger_client' module from? It's not available in 'pip3 install swagger_client' and it sorta looks like you need to build it yourself, or use the exposed API to build this module? I'd love to see some updated, simple exampls for creating a dataset then adding an NFS share to it.
Of course a discussion of the security implications would also be useful, since I don't want to send my root user password through http connection if I can help it.
And the curl examples are fairly useless too, since it's not explained how to use the API key (which I did generate) to do stuff. And of course exposing the API key is a bad thing as well when using http, so only using https would be better, right?
Please assume I'm a semi-idiot when it comes to python. I've used it, but not alot. So start me with the virtualenv setup and installing the modules needed, then onto the swagger_client modeule setup.
Thanks,
Official Python SDK
Swagger codegen of the v2 api
TrueCommand API
API problems
I've tried setting up a python virtualenv and installing modules, but where do I get the 'swagger_client' module from? It's not available in 'pip3 install swagger_client' and it sorta looks like you need to build it yourself, or use the exposed API to build this module? I'd love to see some updated, simple exampls for creating a dataset then adding an NFS share to it.
Of course a discussion of the security implications would also be useful, since I don't want to send my root user password through http connection if I can help it.
And the curl examples are fairly useless too, since it's not explained how to use the API key (which I did generate) to do stuff. And of course exposing the API key is a bad thing as well when using http, so only using https would be better, right?
Please assume I'm a semi-idiot when it comes to python. I've used it, but not alot. So start me with the virtualenv setup and installing the modules needed, then onto the swagger_client modeule setup.
Thanks,