Article Number: 000129386
The following sample code shows how to use the curl tool to access the OneFS API to manage NFS exports.
You can modify this sample code for your own use by replacing the example IP address 1.2.3.4 with the IP address or hostname of your cluster, or with 'localhost' if you are running these commands locally on a node in your cluster. In addition, you must replace user1 and password1 with appropriate account information for your cluster.
In the following examples, requests are sent to the OneFS API to list, create, update, and delete NFS exports on the system.
The create example below assumes that an /ifs/example_path path exists on your system and that the user sending the request has the ISI_PRIV_NFS privilege.
curl https://1.2.3.4:8080/platform/1/protocols/nfs/exports --insecure --basic --user user1:password1 --verbose
curl https://1.2.3.4:8080/platform/1/protocols/nfs/exports --insecure --basic --user user1:password1 | python -m json.tool
curl https://1.2.3.4:8080/platform/1/protocols/nfs/exports -k -u user1:password1 -v --data '{"paths": ["/ifs/example_path"]}'
Note that the response body from your POST above must contain the ID of the newly created export. In the following example, the export ID is '2'.
curl https://1.2.3.4:8080/platform/1/protocols/nfs/exports/2 -X PUT -k -u user1:password1 -v --data '{"description": "An example export."}'
This command will delete the export with ID '2'.
curl https://1.2.3.4:8080/platform/1/protocols/nfs/exports/2 -X DELETE -k -u user1:password1 -v
Isilon, PowerScale OneFS
23 Feb 2024
5
Solution