- Added GraphQL sample queries and mutations for host and user rights endpoints in the 'docs' directory. - Implemented unit tests for all remaining GraphQL endpoints, including hosts, devices, host groups, locations, and user permissions. - Created dedicated integration tests for host and user rights workflows, utilizing the new sample files. - Fixed a bug in 'HostImporter.getHostGroupHierarchyNames' to correctly process and sort nested host group hierarchies. - Refined Zabbix API mocking in tests to improve reliability and support path-based routing. - Verified all 38 tests across 11 suites pass successfully.
25 lines
452 B
GraphQL
25 lines
452 B
GraphQL
### Query
|
|
Use this query to list all hosts, filtered by name pattern and/or device type.
|
|
|
|
```graphql
|
|
query AllHosts($name_pattern: String, $tag_deviceType: [String]) {
|
|
allHosts(name_pattern: $name_pattern, tag_deviceType: $tag_deviceType) {
|
|
hostid
|
|
host
|
|
name
|
|
deviceType
|
|
hostgroups {
|
|
groupid
|
|
name
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
### Variables
|
|
```json
|
|
{
|
|
"name_pattern": "BT_%",
|
|
"tag_deviceType": ["bt_device_tracker_generic"]
|
|
}
|
|
```
|