@@ -9,34 +9,38 @@ import (
9
9
// RedfishOptions contains the redfish provider specific options.
10
10
type RedfishOptions struct {
11
11
// Port that redfish will use for calls.
12
- Port int `json:"port"`
12
+ // +optional
13
+ Port int `json:"port,omitempty"`
13
14
// UseBasicAuth for redfish calls. The default is false which means token based auth is used.
14
- UseBasicAuth bool `json:"useBasicAuth"`
15
+ // +optional
16
+ UseBasicAuth bool `json:"useBasicAuth,omitempty"`
15
17
// SystemName is the name of the system to use for redfish calls.
16
18
// With redfish implementations that manage multiple systems via a single endpoint, this allows for specifying the system to manage.
17
- SystemName string `json:"systemName"`
19
+ // +optional
20
+ SystemName string `json:"systemName,omitempty"`
18
21
}
19
22
20
23
// IPMITOOLOptions contains the ipmitool provider specific options.
21
24
type IPMITOOLOptions struct {
22
25
// Port that ipmitool will use for calls.
23
26
// +optional
24
- Port int `json:"port"`
27
+ Port int `json:"port,omitempty "`
25
28
// CipherSuite that ipmitool will use for calls.
26
29
// +optional
27
- CipherSuite string `json:"cipherSuite"`
30
+ CipherSuite string `json:"cipherSuite,omitempty "`
28
31
}
29
32
30
33
// IntelAMTOptions contains the intelAMT provider specific options.
31
34
type IntelAMTOptions struct {
32
35
// Port that intelAMT will use for calls.
33
- Port int `json:"port"`
36
+ // +optional
37
+ Port int `json:"port,omitempty"`
34
38
35
39
// HostScheme determines whether to use http or https for intelAMT calls.
36
40
// +optional
37
41
// +kubebuilder:validation:Enum=http;https
38
42
// +kubebuilder:default:=http
39
- HostScheme string `json:"hostScheme"`
43
+ HostScheme string `json:"hostScheme,omitempty "`
40
44
}
41
45
42
46
// HMACAlgorithm is a type for HMAC algorithms.
@@ -53,72 +57,72 @@ type RPCOptions struct {
53
57
ConsumerURL string `json:"consumerURL"`
54
58
// LogNotificationsDisabled determines whether responses from rpc consumer/listeners will be logged or not.
55
59
// +optional
56
- LogNotificationsDisabled bool `json:"logNotificationsDisabled"`
60
+ LogNotificationsDisabled bool `json:"logNotificationsDisabled,omitempty "`
57
61
// Request is the options used to create the rpc HTTP request.
58
62
// +optional
59
- Request * RequestOpts `json:"request"`
63
+ Request * RequestOpts `json:"request,omitempty "`
60
64
// Signature is the options used for adding an HMAC signature to an HTTP request.
61
65
// +optional
62
- Signature * SignatureOpts `json:"signature"`
66
+ Signature * SignatureOpts `json:"signature,omitempty "`
63
67
// HMAC is the options used to create a HMAC signature.
64
68
// +optional
65
- HMAC * HMACOpts `json:"hmac"`
69
+ HMAC * HMACOpts `json:"hmac,omitempty "`
66
70
// Experimental options.
67
71
// +optional
68
- Experimental * ExperimentalOpts `json:"experimental"`
72
+ Experimental * ExperimentalOpts `json:"experimental,omitempty "`
69
73
}
70
74
71
75
// RequestOpts are the options used when creating an HTTP request.
72
76
type RequestOpts struct {
73
77
// HTTPContentType is the content type to use for the rpc request notification.
74
78
// +optional
75
- HTTPContentType string `json:"httpContentType"`
79
+ HTTPContentType string `json:"httpContentType,omitempty "`
76
80
// HTTPMethod is the HTTP method to use for the rpc request notification.
77
81
// +optional
78
- HTTPMethod string `json:"httpMethod"`
82
+ HTTPMethod string `json:"httpMethod,omitempty "`
79
83
// StaticHeaders are predefined headers that will be added to every request.
80
84
// +optional
81
- StaticHeaders http.Header `json:"staticHeaders"`
85
+ StaticHeaders http.Header `json:"staticHeaders,omitempty "`
82
86
// TimestampFormat is the time format for the timestamp header.
83
87
// +optional
84
- TimestampFormat string `json:"timestampFormat"`
88
+ TimestampFormat string `json:"timestampFormat,omitempty "`
85
89
// TimestampHeader is the header name that should contain the timestamp. Example: X-BMCLIB-Timestamp
86
90
// +optional
87
- TimestampHeader string `json:"timestampHeader"`
91
+ TimestampHeader string `json:"timestampHeader,omitempty "`
88
92
}
89
93
90
94
// SignatureOpts are the options used for adding an HMAC signature to an HTTP request.
91
95
type SignatureOpts struct {
92
96
// HeaderName is the header name that should contain the signature(s). Example: X-BMCLIB-Signature
93
97
// +optional
94
- HeaderName string `json:"headerName"`
98
+ HeaderName string `json:"headerName,omitempty "`
95
99
// AppendAlgoToHeaderDisabled decides whether to append the algorithm to the signature header or not.
96
100
// Example: X-BMCLIB-Signature becomes X-BMCLIB-Signature-256
97
101
// When set to true, a header will be added for each algorithm. Example: X-BMCLIB-Signature-256 and X-BMCLIB-Signature-512
98
102
// +optional
99
- AppendAlgoToHeaderDisabled bool `json:"appendAlgoToHeaderDisabled"`
103
+ AppendAlgoToHeaderDisabled bool `json:"appendAlgoToHeaderDisabled,omitempty "`
100
104
// IncludedPayloadHeaders are headers whose values will be included in the signature payload. Example: X-BMCLIB-My-Custom-Header
101
105
// All headers will be deduplicated.
102
106
// +optional
103
- IncludedPayloadHeaders []string `json:"includedPayloadHeaders"`
107
+ IncludedPayloadHeaders []string `json:"includedPayloadHeaders,omitempty "`
104
108
}
105
109
106
110
// HMACOpts are the options used to create an HMAC signature.
107
111
type HMACOpts struct {
108
112
// PrefixSigDisabled determines whether the algorithm will be prefixed to the signature. Example: sha256=abc123
109
113
// +optional
110
- PrefixSigDisabled bool `json:"prefixSigDisabled"`
114
+ PrefixSigDisabled bool `json:"prefixSigDisabled,omitempty "`
111
115
// Secrets are a map of algorithms to secrets used for signing.
112
116
// +optional
113
- Secrets HMACSecrets `json:"secrets"`
117
+ Secrets HMACSecrets `json:"secrets,omitempty "`
114
118
}
115
119
116
120
// ExperimentalOpts are options we're still learning about and should be used carefully.
117
121
type ExperimentalOpts struct {
118
122
// CustomRequestPayload must be in json.
119
123
// +optional
120
- CustomRequestPayload string `json:"customRequestPayload"`
124
+ CustomRequestPayload string `json:"customRequestPayload,omitempty "`
121
125
// DotPath is the path to the json object where the bmclib RequestPayload{} struct will be embedded. For example: object.data.body
122
126
// +optional
123
- DotPath string `json:"dotPath"`
127
+ DotPath string `json:"dotPath,omitempty "`
124
128
}
0 commit comments