-
Notifications
You must be signed in to change notification settings - Fork 24
Design doc for AMT WSMAN Class data fetch feature
ShradhaGupta31 edited this page May 11, 2026
·
3 revisions
This document describes the execution flow of:
rpc diagnostics ws-man get ...
sequenceDiagram
participant U as User
participant R as WSManGetCmd.Run
participant C as resolveClasses
participant P as ensureAMTPassword
participant M as newWSMANMessages
participant F as classFetcher
participant O as renderResults
participant T as table renderer
U->>R: ws-man get -c <class> --format <fmt>
R->>C: validate class args
C-->>R: classes / error
R->>P: ensure credentials
P-->>R: ok / error
R->>M: create wsman client
M-->>R: messages / error
loop each class
R->>F: fetch data
F-->>R: data / error
end
R->>O: render by format
alt format == table
O->>T: extractClassInstances
T->>T: parse raw XMLOutput if present
T-->>O: Name/Value table
end
O-->>R: rendered bytes
R-->>U: stdout or output file
-
ensureAMTPassword(ctx)is required so WS-Man requests have credentials. It is fetched using GetLocalSystemAccount(). - In multi-class mode, a single class fetch failure does not stop the whole command.
-
--format tableis XML-driven and prefers rawXMLOutputso zero/false/empty fields are preserved. This is mainly for user to get only the meaningful data. -
--format jsonand--format xmlkeep their existing serialization behavior.
internal/commands/diagnostics/wsman.go