Isilon: Using the OneFS API with NFS Exports

摘要: This article provides sample code that shows how to use the curl tool to access the OneFS API to manage NFS exports.

本文适用于 本文不适用于 本文并非针对某种特定的产品。 本文并非包含所有产品版本。

症状

N/A

原因

N/A

解决方案

NOTE: This topic is part of the Isilon SDK Info Hub

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.

 

NFS Exports

In the following examples, requests are sent to the OneFS API to list, create, update, and delete NFS exports on the system.

  • The --insecure (-k) argument allows connection through SSL without certificates.
  • The --verbose (-v) argument displays the full headers of the HTTP request and response.
  • The --basic argument specifies basic authentication. The following sample code shows how to access the OneFS

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.

 

List all NFS exports (GET)

Example commands:

curl https://1.2.3.4:8080/platform/1/protocols/nfs/exports --insecure --basic --user user1:password1 --verbose

 

List all NFS exports with reader-friendly indenting by piping the response body through the Python json tool module.

curl https://1.2.3.4:8080/platform/1/protocols/nfs/exports --insecure --basic --user user1:password1 | python -m json.tool

 

Create a new export (POST)

curl https://1.2.3.4:8080/platform/1/protocols/nfs/exports -k -u user1:password1 -v --data '{"paths": ["/ifs/example_path"]}'

 

Modify an export (PUT)

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."}'

 

Delete an export (DELETE)

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
文章属性
文章编号: 000129386
文章类型: Solution
上次修改时间: 23 2月 2024
版本:  5
从其他戴尔用户那里查找问题的答案
支持服务
检查您的设备是否在支持服务涵盖的范围内。