获取网络清单项
此方法返回网络清单项。
服务
此方法要求您将
{服务}
名称置于API URL中。允许的服务包括:
-
计算机,对应“计算机与虚拟机” -
虚拟机,对应“虚拟机”
例如,针对
虚拟机
服务的请求URL为:
https://YOUR-HOSTNAME/api/v1.0/jsonrpc/network/virtualmachines
details成员
部分网络清单项包含一个
details
成员。该成员公开了关于项目的更多信息。具体信息取决于项目类型。
|
项目类型 |
详情 |
|---|---|
|
|
|
示例
请求 :
{
"params": {
"parentId": "5c373e1a1da1974a678b456d",
"perPage": 100,
"filters": {
"type": {
"groups": true
},
"depth": {
"allItemsRecursively": true
}
}
},
"jsonrpc": "2.0",
"method": "getNetworkInventoryItems",
"id": "tracking"
}
响应 :
{
"id": "103d7b05-ec02-481b-9ed6-c07b97de2b7a",
"jsonrpc": "2.0",
"result": {
"page": 2,
"pagesCount": 11,
"perPage": 1,
"total": 11,
"items": [
{
"id": "21a295eeb1a43d8b497b24b7",
"name": "计算机",
"type": 5,
"parentId": "21a295eeb1a43d8b497b24b7",
"companyId": "21a295eeb1a43d8b497b24b7",
"details": {
"label": "终端2",
"fqdn": "endpoint2.local",
"groupId": "5a5f4d36b1a43d5f097b23bb",
"isManaged": true,
"machineType": 2,
"operatingSystemVersion": "Windows Server",
"ip": "60.40.10.220",
"macs": [
"324935237346"
],
"modules": {
"advancedThreatControl": false,
"antimalware": true,
"contentControl": false,
"deviceControl": false,
"firewall": false,
"powerUser": false,
"networkAttackDefense": false
},
"ssid": ""
}
}
]
}
}
参数
|
参数 |
类型 |
可选性 |
描述 |
|---|---|---|---|
|
|
字符串 |
是 |
目标公司或组的ID。若未指定,则返回与API密钥关联公司目标下的条目。 |
|
|
对象 |
是 |
查询端点列表时使用的筛选条件。关于可用筛选条件及其使用方法,请参阅 可用筛选条件 . |
|
|
数值 |
是 |
视图类型ID。各虚拟化平台以特定视图展示清单。VMWare集成中的可用选项为:
Citrix XenServer集成中的可用选项为:
|
|
|
数值 |
是 |
结果页码。默认页码为1。 |
|
|
数值 |
是 |
每页返回的条目数量。上限为每页100条。默认值:每页30条。 |
可用筛选器
|
章节 |
子章节 |
筛选选项 |
|---|---|---|
|
|
|
|
|
|
管理 |
|
|
|
|
|
|
|
|
|
重要提示
部分过滤器需激活特定许可证,否则将被忽略,导致API返回结果不准确。
字段
name
支持部分匹配。
该过滤器返回名称完全匹配或以指定值开头的条目。若需将指定值作为后缀,请使用星号符号(*)。
例如:
若
name
设为
computer
,则API返回所有名称以
computer
.
若
name
设为
*puter
,则API返回名称中包含
puter
的所有条目列表。
返回值
此方法返回包含网络条目信息的对象。返回对象包含:
-
page- 当前页码 -
pagesCount- 总页数 -
perPage- 每页返回的项目总数 -
total- 项目总数 -
items- 包含项目列表的数组。列表中的每个条目包含以下字段:-
id,网络项目的ID, -
name,网络项目的名称, -
parentId,父容器的ID, -
type,网络项目的类型:1- 公司,2- 根容器(公司和网络容器),3- 公司文件夹,4- 组,5- 计算机,6- 虚拟机,7- EC2实例,14- 容器组,15- 容器主机文件夹,16- 容器. -
详情,关于该项目的更多信息。此字段适用于1- 公司,5- 计算机,6- 虚拟机,7- EC2实例及16- 容器。有关详情成员内容的详细信息,请参阅 详情成员 .
-
详情成员
部分网络清单项目包含一个
详情
成员。该成员会公开关于该项目的更多信息,具体信息取决于项目类型。
|
项目类型 |
详情 |
|---|---|
|
|
|
示例
请求 :
{
"params": {
"parentId": "5c373e1a1da1974a678b456d",
"perPage": 100,
"filters": {
"type": {
"groups": true
},
"depth": {
"allItemsRecursively": true
}
}
},
"jsonrpc": "2.0",
"method": "getNetworkInventoryItems",
"id": "tracking"
}
响应 :
{
"id":"103d7b05-ec02-481b-9ed6-c07b97de2b7a",
"jsonrpc":"2.0",
"result": {
page: 2,
pagesCount: 11,
perPage: 1,
total: 11
items[
{
"id" : "21a295eeb1a43d8b497b24b7",
"name" : "计算机",
"type" : 5,
"parentId": "21a295eeb1a43d8b497b24b7",
"companyId": "21a295eeb1a43d8b497b24b7",
"details" : {
"label" : "终端2",
"fqdn": "endpoint2.local",
"groupId": "5a5f4d36b1a43d5f097b23bb",
"isManaged": true,
"machineType": 2,
"operatingSystemVersion": "Windows Server",
"ip": "60.40.10.220",
"macs": [
"324935237346"
],
"modules": {
"advancedThreatControl": False,
"antimalware": True,
"contentControl": False,
"deviceControl": False,
"firewall": False,
"powerUser": False,
"networkAttackDefense": False
},
"ssid": "",
}
}
]
}
}