zabbix-graphql-api/docs/queries/from_zabbix_docs/createHost.graphql
Andreas Hilbig b56255ffaa feat: add Zabbix 7.4 documentation samples and importHostGroups MCP tool
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.
2026-01-31 10:52:56 +01:00

23 lines
422 B
GraphQL

# Source: https://www.zabbix.com/documentation/7.4/en/manual/api/reference/host/create
### Query
```graphql
mutation CreateHost($host: String!, $hostgroupids: [Int!]!, $templateids: [Int!]!) {
createHost(
host: $host,
hostgroupids: $hostgroupids,
templateids: $templateids
) {
hostids
}
}
```
### Variables
```json
{
"host": "Linux server",
"hostgroupids": [50],
"templateids": [20045]
}
```