integer/array connector.get(object parameters)
该方法允许根据给定的参数检索连接器对象。
此方法仅对“超级管理员”用户类型可用。可以在用户角色设置中撤销调用此方法的权限。 有关更多信息,请参阅用户角色。
(object)
定义所需输出的参数。
该方法支持以下参数。
参数 | 类型 | 描述 |
---|---|---|
connectorids | ID/数组 | 仅返回具有给定ID的连接器。 |
selectTags | 查询 | 返回一个tags 属性,包含连接器标签过滤器。支持 计数 。 |
sortfield | 字符串/数组 | 根据给定属性对结果进行排序。 可能的值: connectorid ,name ,data_type ,status 。 |
countOutput | 布尔值 | 这些参数在参考说明中进行了描述。 |
excludeSearch | 布尔值 | |
filter | 对象 | |
limit | 整数 | |
output | 查询 | |
preservekeys | 布尔值 | |
search | 对象 | |
searchByAny | 布尔值 | |
searchWildcardsEnabled | 布尔值 | |
sortorder | 字符串/数组 | |
startSearch | 布尔值 |
(integer/array)
返回以下之一:
countOutput
参数,则返回检索到的对象数量。检索有关所有连接器及其属性的所有数据。
请求:
{
"jsonrpc": "2.0",
"method": "connector.get",
"params": {
"output": "extend",
"selectTags": ["tag", "operator", "value"],
"preservekeys": true
},
"id": 1
}
Response:
{
"jsonrpc": "2.0",
"result": [
{
"connectorid": "1",
"name": "Export of item values",
"protocol": "0",
"data_type": "0",
"url": "{$DATA_EXPORT_VALUES_URL}",
"item_value_type": "31",
"authtype": "4",
"username": "{$DATA_EXPORT_VALUES_USERNAME}",
"password": "{$DATA_EXPORT_VALUES_PASSWORD}",
"token": "",
"max_records": "0",
"max_senders": "4",
"max_attempts": "2",
"attempt_interval": "10s",
"timeout": "10s",
"http_proxy": "{$DATA_EXPORT_VALUES_PROXY}",
"verify_peer": "1",
"verify_host": "1",
"ssl_cert_file": "{$DATA_EXPORT_VALUES_SSL_CERT_FILE}",
"ssl_key_file": "{$DATA_EXPORT_VALUES_SSL_KEY_FILE}",
"ssl_key_password": "",
"description": "",
"status": "1",
"tags_evaltype": "0",
"tags": [
{
"tag": "component",
"operator": "0",
"value": "memory"
}
]
},
{
"connectorid": "2",
"name": "Export of events",
"protocol": "0",
"data_type": "1",
"url": "{$DATA_EXPORT_EVENTS_URL}",
"item_value_type": "31",
"authtype": "5",
"username": "",
"password": "",
"token": "{$DATA_EXPORT_EVENTS_BEARER_TOKEN}",
"max_records": "0",
"max_senders": "2",
"max_attempts": "1",
"attempt_interval": "5s",
"timeout": "5s",
"http_proxy": "",
"verify_peer": "1",
"verify_host": "1",
"ssl_cert_file": "",
"ssl_key_file": "",
"ssl_key_password": "",
"description": "",
"status": "1",
"tags_evaltype": "0",
"tags": [
{
"tag": "scope",
"operator": "0",
"value": "performance"
}
]
}
],
"id": 1
}
CConnector:get() 在 *ui/include/classes/api/services/CConnector.php文件中。