Isilon:使用 OneFS API 和 NFS 导出

Summary: 本文提供的示例代码演示如何使用 curl 工具访问 OneFS API 以管理 NFS 导出。

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Symptoms

N/A

Cause

N/A

Resolution

提醒:本主题是 Isilon SDK 信息中心的一部分

以下示例代码显示了如何使用 curl 工具访问 OneFS API 以管理 NFS 导出。

您可以通过将示例 IP 地址 1.2.3.4 替换为集群的 IP 地址或主机名来修改此示例代码供自己使用,或者如果您正在集群中的节点上本地运行这些命令,则可以替换为“localhost”。此外,您必须将 user1 和 password1 替换为群集的相应帐户信息。

 

NFS 导出

在以下示例中,将向 OneFS API 发送请求,以列出、创建、更新和删除系统上的 NFS 导出。

  • --insecure (-k) 参数允许通过 SSL 进行连接,而无需证书。
  • --verbose (-v) 参数显示 HTTP 请求和响应的完整标头。
  • --basic 参数指定基本身份验证。以下示例代码演示如何访问 OneFS

下面的创建示例假定系统上存在 /ifs/example_path 路径,并且发送请求的用户具有ISI_PRIV_NFS权限。

 

列出所有 NFS 导出 (GET)

命令示例:

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

 

通过 Python json 工具模块对响应正文进行管道连接,列出所有具有便于阅读者缩进的 NFS 导出。

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

 

创建新导出 (POST)

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

 

修改导出 (PUT)

请注意,上面 POST 的响应正文必须包含新创建的导出的 ID。在以下示例中,导出 ID 为“2”。

curl https://1.2.3.4:8080/platform/1/protocols/nfs/exports/2 -X PUT -k -u user1:password1 -v --data '{“description”:“导出示例。”

 

删除导出 (DELETE)

此命令将删除 ID 为“2”的导出。

curl https://1.2.3.4:8080/platform/1/protocols/nfs/exports/2 -X DELETE -k -u user1:password1 -v

Affected Products

Isilon, PowerScale OneFS
Article Properties
Article Number: 000129386
Article Type: Solution
Last Modified: 23 Feb 2024
Version:  5
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.