Skip to main content
  • Place orders quickly and easily
  • View orders and track your shipping status
  • Enjoy members-only rewards and discounts
  • Create and access a list of your products
  • Manage your Dell EMC sites, products, and product-level contacts using Company Administration.

Isilon:使用 OneFS API 與 NFS 匯出

Summary: 本文提供範例代碼,說明如何使用 curl 工具存取 OneFS API 以管理 NFS 匯出。

This article may have been automatically translated. If you have any feedback regarding its quality, please let us know using the form at the bottom of this page.

Article Content


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 --不安全 --基本 --用戶使用者 1:密碼 1 |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):「匯出範例。」}'

 

刪除匯出 (刪除)

此命令會刪除 ID 為「2」的匯出項目。

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

Article Properties


Affected Product

Isilon, PowerScale OneFS

Last Published Date

23 Feb 2024

Version

5

Article Type

Solution