forked from hpe-storage/common-host-libs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
windows_types.go
94 lines (77 loc) · 2.63 KB
/
windows_types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
(c) Copyright 2018 Hewlett Packard Enterprise Development LP
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package asupparser
import (
"encoding/xml"
)
///////////////////////////////////////////////////////////////////////////////
// Host Information Phase 1 - Windows XML Layout
///////////////////////////////////////////////////////////////////////////////
// XMLNodeHostInfo represent root element for host information
type XMLNodeHostInfo struct {
// OS generic XML nodes
XMLName xml.Name `xml:"root"`
Host string `xml:"host,attr"`
Version string `xml:"version,attr"`
SystemInfo string `xml:"systeminfo"`
OS string `xml:"os"`
// Windows specific XML nodes
GetWindowsFeature string `xml:"GET_WINDOWSFEATURE"`
MpioRegisteredDsm string `xml:"MPIO_REGISTERED_DSM"`
}
// XMLArrayHeader represents header added by GDD for host info
type XMLArrayHeader struct {
TimeStamp string `xml:"timestamp,attr"`
}
///////////////////////////////////////////////////////////////////////////////
// Host Information Phase 1 - Windows JSON Node Data Layout
///////////////////////////////////////////////////////////////////////////////
// JSONSystemInfo represents systeminfo element
type JSONSystemInfo struct {
Name string
Manufacturer string
Model string
}
// JSONOS represents os element
type JSONOS struct {
Name string
Version string
}
// JSONGetWindowsFeature represents windows feature element
type JSONGetWindowsFeature struct {
Name string
Installed bool
FeatureType string
}
// JSONDsmParameter represents DSM information
type JSONDsmParameter struct {
DsmName string
DsmVersion string
}
// JSONMpioRegisteredDsms represents registered windows DSM information
type JSONMpioRegisteredDsms struct {
NumberDSMs int
DsmParameters []JSONDsmParameter
}
// HostInformation represents Windows host information
type HostInformation struct {
SystemInfo JSONSystemInfo
OS JSONOS
GetWindowsFeature []JSONGetWindowsFeature
MpioRegisteredDsms JSONMpioRegisteredDsms
}
// XMLDataEntry represents each host entry in the host info log
type XMLDataEntry struct {
TimeStamp string
XMLHostInfo string
}