- Implemented GraphQL endpoints for importing, querying, and deleting Zabbix templates and template groups. - Added support for full template data import, including items, preprocessing steps, tags, and linked templates. - Implemented dependent item support by deferred creation logic in the template importer. - Added ability to query templates and template groups with name pattern filtering (supporting Zabbix wildcards). - Implemented batch deletion for templates and template groups by ID or name pattern. - Improved error reporting by including detailed Zabbix API error data in GraphQL responses. - Added comprehensive unit and integration tests covering all new functionality. - Provided GraphQL sample queries and mutations in the 'docs' directory for all new endpoints.
30 lines
493 B
GraphQL
30 lines
493 B
GraphQL
### Mutation
|
|
Use this mutation to delete template groups by their numeric IDs or by a name pattern.
|
|
|
|
```graphql
|
|
mutation DeleteTemplateGroups($groupids: [Int!], $name_pattern: String) {
|
|
deleteTemplateGroups(groupids: $groupids, name_pattern: $name_pattern) {
|
|
id
|
|
message
|
|
error {
|
|
message
|
|
code
|
|
data
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
### Variables (by ID)
|
|
```json
|
|
{
|
|
"groupids": [201]
|
|
}
|
|
```
|
|
|
|
### Variables (by name pattern)
|
|
```json
|
|
{
|
|
"name_pattern": "Templates/Roadwork/%"
|
|
}
|
|
```
|