feat: implement smoketest and extend host provisioning with template linking
- Add runSmoketest mutation to automate end-to-end verification. - Add SmoketestExecutor and HostDeleter to support automated testing and cleanup. - Extend createHost and importHosts to allow linking templates by name or ID. - Update docs/howtos/cookbook.md with new recipe steps and AI/MCP guidance. - Update .junie/guidelines.md with new verification and deployment standards. - Add src/test/template_link.test.ts and update existing tests to cover new functionality. - Regenerate GraphQL types to match schema updates.
This commit is contained in:
parent
b56255ffaa
commit
67357d0bc3
20 changed files with 690 additions and 50 deletions
|
|
@ -1,5 +1,5 @@
|
|||
mutation CreateHost($host: String!, $hostgroupids: [Int!]!, $templateids: [Int!]!) {
|
||||
createHost(host: $host, hostgroupids: $hostgroupids, templateids: $templateids) {
|
||||
mutation CreateHost($host: String!, $hostgroupids: [Int!]!, $templateids: [Int], $templateNames: [String]) {
|
||||
createHost(host: $host, hostgroupids: $hostgroupids, templateids: $templateids, templateNames: $templateNames) {
|
||||
hostids
|
||||
error {
|
||||
message
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
mutation CreateVerificationHost($deviceKey: String!, $deviceType: String!, $groupNames: [String!]!) {
|
||||
mutation CreateVerificationHost($deviceKey: String!, $deviceType: String!, $groupNames: [String!]!, $templateNames: [String]) {
|
||||
importHosts(hosts: [{
|
||||
deviceKey: $deviceKey,
|
||||
deviceType: $deviceType,
|
||||
groupNames: $groupNames
|
||||
groupNames: $groupNames,
|
||||
templateNames: $templateNames
|
||||
}]) {
|
||||
hostid
|
||||
message
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
# Import multiple hosts/devices into Zabbix.
|
||||
# This is a powerful tool for bulk provisioning of hosts using their names and types.
|
||||
# It supports linking templates by ID (templateids) or by name (templateNames).
|
||||
mutation ImportHosts($hosts: [CreateHost!]!) {
|
||||
importHosts(hosts: $hosts) {
|
||||
hostid
|
||||
|
|
|
|||
14
mcp/operations/runSmoketest.graphql
Normal file
14
mcp/operations/runSmoketest.graphql
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# Run a complete smoketest: creates a template, host group, and host,
|
||||
# verifies their creation and linkage, and then cleans up everything.
|
||||
# Variables: hostName, templateName, groupName
|
||||
mutation RunSmoketest($hostName: String!, $templateName: String!, $groupName: String!) {
|
||||
runSmoketest(hostName: $hostName, templateName: $templateName, groupName: $groupName) {
|
||||
success
|
||||
message
|
||||
steps {
|
||||
name
|
||||
success
|
||||
message
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue