Skip to main content
此產品有較新版本可以使用。
本繁體中文版使用機器翻譯,譯文僅供參考,若與英文版本牴觸,應以英文版本為準。

安裝 Trident Protect CLI 外掛程式

您可以使用 Trident Protect 命令列外掛程式( Trident tridentctl 實用程式的擴充功能)來建立和與 Trident Protect 自訂資源( CR )進行互動。

安裝 Trident Protect CLI 外掛程式

在使用命令列實用程式之前,需要將其安裝到用於存取叢集的電腦上。請根據您的電腦使用的是 x64 還是 ARM CPU,依照以下步驟操作。

下載適用於 Linux AMD64 CPU 的外掛程式
步驟
  1. 下載 Trident Protect CLI 外掛程式:

    curl -L -o tridentctl-protect https://github.com/NetApp/tridentctl-protect/releases/download/25.10.0/tridentctl-protect-linux-amd64
下載適用於 Linux ARM64 CPU 的外掛程式
步驟
  1. 下載 Trident Protect CLI 外掛程式:

    curl -L -o tridentctl-protect https://github.com/NetApp/tridentctl-protect/releases/download/25.10.0/tridentctl-protect-linux-arm64
下載適用於 Mac AMD64 CPU 的外掛程式
步驟
  1. 下載 Trident Protect CLI 外掛程式:

    curl -L -o tridentctl-protect https://github.com/NetApp/tridentctl-protect/releases/download/25.10.0/tridentctl-protect-macos-amd64
下載適用於 Mac ARM64 CPU 的外掛程式
步驟
  1. 下載 Trident Protect CLI 外掛程式:

    curl -L -o tridentctl-protect https://github.com/NetApp/tridentctl-protect/releases/download/25.10.0/tridentctl-protect-macos-arm64
  1. 啟用外掛程式二進位檔案的執行權限:

    chmod +x tridentctl-protect
  2. 將插件二進位檔案複製到 PATH 環境變數中定義的某個位置。例如, /usr/bin/usr/local/bin(您可能需要管理員權限):

    cp ./tridentctl-protect /usr/local/bin/
  3. 您也可以選擇將插件二進位檔案複製到您主目錄下的某個位置。在這種情況下,建議確保該位置已新增至您的 PATH 環境變數:

    cp ./tridentctl-protect ~/bin/
註 將外掛程式複製到 PATH 變數中的某個位置,即可透過鍵入 tridentctl-protecttridentctl protect 從任何位置使用該外掛程式。

查看 Trident CLI 外掛程式說明

您可以使用內建的外掛程式說明功能,以取得外掛程式功能的詳細說明:

步驟
  1. 使用說明功能檢視使用指南:

    tridentctl-protect help

啟用命令自動完成

安裝 Trident Protect CLI 外掛程式後、您可以為某些命令啟用自動完成功能。

為 Bash shell 啟用自動完成功能
步驟
  1. 建立完成指令碼:

    tridentctl-protect completion bash > tridentctl-completion.bash
  2. 在您的使用者目錄下建立一個新目錄,用於存放腳本:

    mkdir -p ~/.bash/completions
  3. 將下載的腳本移至 ~/.bash/completions 目錄:

    mv tridentctl-completion.bash ~/.bash/completions/
  4. 將以下行新增至您主目錄中的 ~/.bashrc 檔案:

    source ~/.bash/completions/tridentctl-completion.bash
為 Z shell 啟用自動完成
步驟
  1. 建立完成指令碼:

    tridentctl-protect completion zsh > tridentctl-completion.zsh
  2. 在您的使用者目錄下建立一個新目錄,用於存放腳本:

    mkdir -p ~/.zsh/completions
  3. 將下載的腳本移至 ~/.zsh/completions 目錄:

    mv tridentctl-completion.zsh ~/.zsh/completions/
  4. 將以下行新增至您主目錄中的 ~/.zprofile 檔案:

    source ~/.zsh/completions/tridentctl-completion.zsh
結果

下次登入 shell 時、您可以使用 tridentctl-protect 外掛程式進行命令自動完成。