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
|
|
@ -11,7 +11,9 @@ type Mutation {
|
|||
"""List of host group IDs to assign the host to."""
|
||||
hostgroupids:[Int!]!,
|
||||
"""List of template IDs to link to the host."""
|
||||
templateids: [Int!]!,
|
||||
templateids: [Int],
|
||||
"""List of template names to link to the host."""
|
||||
templateNames: [String],
|
||||
"""Optional location information for the host inventory."""
|
||||
location: LocationInput
|
||||
): CreateHostResponse
|
||||
|
|
@ -100,6 +102,78 @@ type Mutation {
|
|||
"""Wildcard name pattern for template groups to delete."""
|
||||
name_pattern: String
|
||||
): [DeleteResponse!]
|
||||
|
||||
"""
|
||||
Delete hosts by their IDs or by a name pattern.
|
||||
|
||||
Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
|
||||
"""
|
||||
deleteHosts(
|
||||
"""List of host IDs to delete."""
|
||||
hostids: [Int!],
|
||||
"""Wildcard name pattern for hosts to delete."""
|
||||
name_pattern: String
|
||||
): [DeleteResponse!]
|
||||
|
||||
"""
|
||||
Delete host groups by their IDs or by a name pattern.
|
||||
|
||||
Authentication: Requires `zbx_session` cookie or `zabbix-auth-token` header.
|
||||
"""
|
||||
deleteHostGroups(
|
||||
"""List of host group IDs to delete."""
|
||||
groupids: [Int!],
|
||||
"""Wildcard name pattern for host groups to delete."""
|
||||
name_pattern: String
|
||||
): [DeleteResponse!]
|
||||
|
||||
"""
|
||||
Runs a smoketest: creates a template, links a host, verifies it, and cleans up.
|
||||
"""
|
||||
runSmoketest(
|
||||
"""Technical name for the smoketest host."""
|
||||
hostName: String!,
|
||||
"""Technical name for the smoketest template."""
|
||||
templateName: String!,
|
||||
"""Technical name for the smoketest host group."""
|
||||
groupName: String!
|
||||
): SmoketestResponse!
|
||||
}
|
||||
|
||||
"""
|
||||
Response object for the smoketest operation.
|
||||
"""
|
||||
type SmoketestResponse {
|
||||
"""
|
||||
True if all steps of the smoketest succeeded.
|
||||
"""
|
||||
success: Boolean!
|
||||
"""
|
||||
Overall status message.
|
||||
"""
|
||||
message: String
|
||||
"""
|
||||
Detailed results for each step.
|
||||
"""
|
||||
steps: [SmoketestStep!]!
|
||||
}
|
||||
|
||||
"""
|
||||
Results for a single step in the smoketest.
|
||||
"""
|
||||
type SmoketestStep {
|
||||
"""
|
||||
Name of the step (e.g. 'Create Template').
|
||||
"""
|
||||
name: String!
|
||||
"""
|
||||
True if the step succeeded.
|
||||
"""
|
||||
success: Boolean!
|
||||
"""
|
||||
Status message or error message for the step.
|
||||
"""
|
||||
message: String
|
||||
}
|
||||
|
||||
####################################################################
|
||||
|
|
@ -413,6 +487,14 @@ input CreateHost {
|
|||
"""
|
||||
groupids: [Int]
|
||||
"""
|
||||
List of template IDs to link to the host.
|
||||
"""
|
||||
templateids: [Int]
|
||||
"""
|
||||
List of template names to link to the host.
|
||||
"""
|
||||
templateNames: [String]
|
||||
"""
|
||||
Location information for the host.
|
||||
"""
|
||||
location: LocationInput
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue