This commit introduces a comprehensive set of GraphQL query and mutation samples based on the official Zabbix 7.4 API documentation, along with testing and automation improvements. Changes: - Documentation: - Added 21 GraphQL sample files in docs/queries/from_zabbix_docs/ covering various Zabbix API operations. - Updated docs/howtos/cookbook.md with a new recipe for executing these documentation samples. - AI & MCP: - Added mcp/operations/importHostGroups.graphql to enable host group import via MCP tools. - Testing: - Added src/test/zabbix_docs_samples.test.ts to automatically validate all documentation samples against the GraphQL schema.
45 lines
728 B
GraphQL
45 lines
728 B
GraphQL
# Source: https://www.zabbix.com/documentation/7.4/en/manual/api/reference/usergroup/create
|
|
|
|
### Query
|
|
```graphql
|
|
mutation ImportUserRights($input: UserRightsInput!, $dryRun: Boolean!) {
|
|
importUserRights(input: $input, dryRun: $dryRun) {
|
|
userGroups {
|
|
id
|
|
name
|
|
message
|
|
}
|
|
userRoles {
|
|
id
|
|
name
|
|
message
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
### Variables
|
|
```json
|
|
{
|
|
"dryRun": true,
|
|
"input": {
|
|
"userGroups": [
|
|
{
|
|
"name": "New User Group",
|
|
"hostgroup_rights": [
|
|
{
|
|
"name": "Zabbix servers",
|
|
"permission": "READ"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"userRoles": [
|
|
{
|
|
"name": "New Role",
|
|
"type": 1
|
|
}
|
|
]
|
|
}
|
|
}
|
|
```
|