華為云計算 云知識 查詢客戶端列表ListAgent
查詢客戶端列表ListAgent

 

功能介紹

查詢客戶端列表

調試

您可以在API Explorer中調試該接口,支持自動認證鑒權。API Explorer可以自動生成SDK代碼示例,并提供SDK代碼示例調試功能。

URI

GET /v3/{project_id}/agents

表1 路徑參數

參數

是否必選

參數類型

描述

project_id

String

項目ID

表2 Query參數

參數

是否必選

參數類型

描述

agent_id

String

客戶端ID

limit

String

每頁顯示條目數,正整數

最小長度:1

最大長度:1000

offset

Integer

偏移值,正整數

status

String

狀態(tài)

請求參數

表3 請求Header參數

參數

是否必選

參數類型

描述

X-Auth-Token

String

用戶Token。 通過調用 IAM 服務獲取用戶Token接口獲?。憫㈩^中X-Subject-Token的值)。

響應參數

狀態(tài)碼: 200

表4 響應Body參數

參數

參數類型

描述

agents

Array of Agent objects

客戶端實例列表

count

Integer

客戶端個數

limit

Integer

每頁顯示的條目數量

offset

Integer

偏移量,表示從此偏移量開始查詢

表5 Agent

參數

參數類型

描述

created_at

String

客戶端創(chuàng)建時間

updated_at

String

客戶端更新時間

agent_id

String

客戶端ID

agent_version

String

客戶端版本號

agent_type

String

客戶端類型

host_name

String

客戶端所在的主機名

host_nickname

String

客戶端所在的主機昵稱

host_ip

String

客戶端所在主機的IP

host_os

String

客戶端主機所在的操作系統(tǒng)

status

String

客戶端狀態(tài)

last_active_time

String

客戶端上次激活時間

paths

Array of Path objects

客戶端的備份路徑

表6 Path

參數

參數類型

描述

id

String

路徑ID

status

String

路徑狀態(tài),有available和remove兩種狀態(tài)

agent_id

String

該路徑所屬于的客戶端ID

dir_path

String

路徑詳情

請求示例

GET  https://{endpoint}/v3/{project_id}/agents

響應示例

狀態(tài)碼: 200

OK

{
  "count" : 2,
  "limit" : 1000,
  "offset" : 0,
  "agents" : [ {
    "created_at" : "2022-01-30T09:28:09.334153",
    "updated_at" : null,
    "agent_id" : "489654f2-363b-4ebf-966a-bdf079d97114",
    "host_name" : "eBackup",
    "host_ip" : "18.9.158.36",
    "status" : "normal",
    "last_active_time" : "2022-01-30T09:28:08.959908",
    "paths" : null
  }, {
    "created_at" : "2022-01-14T06:47:17.524133",
    "updated_at" : "2022-01-28T05:01:32.738510",
    "agent_id" : "fb711278-e872-4224-b442-8dafc36a543d",
    "host_name" : "ecs-00001",
    "host_ip" : "10.10.0.1",
    "status" : "normal",
    "last_active_time" : "2022-01-28T05:01:32.000000",
    "paths" : [ {
      "id" : "6c3d1ed6-b7d7-4e27-94ee-321431e84c5c",
      "dir_path" : "/home/hcp",
      "status" : "available",
      "agent_id" : "fb711278-e872-4224-b442-8dafc36a543d"
    }, {
      "id" : "e2af0fdd-9644-4db8-986e-5a6a2395c390",
      "dir_path" : "/opt/workspace",
      "status" : "available",
      "agent_id" : "fb711278-e872-4224-b442-8dafc36a543d"
    } ]
  } ]
}

狀態(tài)碼

狀態(tài)碼

描述

200

OK

錯誤碼

請參見錯誤碼。