檢視次數:

列出所有代理

clish agent show
Purpose:顯示所有已註冊代理的列表或特定代理的詳細資訊 列出所有代理 clish agent show
Agent Name  Hostname  State       Attrs             Version
----------  --------  ----------  ----------------  -------
demo-1      -         running     C:Y K:OK H:✓      v1.0.0
demo-2      -         onboarding  C:N K:MISS H:✓    v1.0.0
page 1/1
Attributes Explanation:
  • C: 連線狀態 (Y=已連線, N=未連線, ?=未知)
  • K: 憑證狀態 (OK=已配置, MISS=缺失/無效, ?=未知)
  • H: 健康狀態 (✓=正常, ✗=不正常, ?=未知)
Show specific agent details:
clish agent show --instance <agent-name>
Example
clish agent show --instance demo-1
Example Output
Agent Name       : demo-1
Agent ID         : f461e289-c396-4f5b-8119-bea0a697d513
Device Hostname  : -
State            : running
Health           : healthy
ONTAP Connected  : connected
Credential       : configured
Log Level        : info
Quarantine       : disabled
Agent Version    : v1.0.0
Last Seen        : -
Reason           : -
Available Flags
  • --instance <name>:顯示特定代理的詳細資訊
  • --page <number>:代理列表的頁碼(預設:1)

建立代理實例

clish agent create
Purpose:建立新的代理程式實例
clish agent create --name <agent-name>
Example
clish agent create --name demo-3
Example Output
Agent 'demo03' created successfully with ID: f461e289-c396-4f5b-8119-bea0a697d513
Requirements
  • 代理名稱必須符合模式:^[a-zA-Z0-9_-]{1,20}$。這表示它必須少於20個字元,且只能包含字母、數字及以下特殊字元:^[]-_{}$
  • 名稱必須在所有代理中保持唯一

建立入門憑證

clish agent onboarding-token issue
Purpose:生成用於代理註冊的入門令牌
clish agent onboarding-token issue --instance <agent-name>
Example
clish agent onboarding-token issue --instance demo-1
Example Output
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fweJf36POk6yJV_adQssw5c
Usage Notes
  • 代理初始連線需要權杖
  • 憑證的有效期限有限
  • 代理必須使用此權杖來建立 WebSocket 連線

更新 ONTAP SVM 憑證

clish agent credential modify
Purpose:更新代理的ONTAP SVM憑證
clish agent credential modify --instance <agent-name>
Example
clish agent credential modify --instance demo-1
# Interactive prompts: 
# username: admin 
# password: [hidden input]
Example Output
Credentials updated successfully
Security Notes
  • 輸入密碼時將隱藏顯示
  • 憑證儲存在 Kubernetes Secrets 中
  • 僅影響指定的代理程式實例

顯示代理日誌級別

clish agent loglevel show
Purpose:顯示代理的當前日誌級別
clish agent loglevel show --instance <agent-name>
Example
clish agent loglevel show --instance demo-1
Example Output
Log Level for demo-1 : info

修改代理日誌級別

clish agent loglevel modify
Purpose:更改代理的日誌級別
clish agent loglevel modify --instance <agent-name> --loglevel <level>
Example
clish agent loglevel modify --instance demo-1 --loglevel debug
Example Output
Log level for demo-1 set to debug
Available Log Levels
  • info:標準操作記錄
  • warning: 僅限警告和錯誤訊息
  • error:僅限錯誤訊息

顯示隔離設定

clish agent quarantine show
Purpose:顯示代理的隔離設定
clish agent quarantine show --instance <agent-name>
Example
clish agent quarantine show --instance demo-1
Example Output
Quarantine for demo-1 : disabled

修改隔離功能

clish agent quarantine modify
Purpose:啟用或關閉代理的隔離功能
clish agent quarantine modify --instance <agent-name> --enabled <true|false>
範例
# Enable quarantine
clish agent quarantine modify --instance demo-1 --enabled true

# Disable quarantine  
clish agent quarantine modify --instance demo-1 --enabled false
Example Output
Quarantine for demo-1 set to enabled