github.com/kubearmor/cilium@v1.6.12/api/v1/models/status_response.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package models 4 5 // This file was generated by the swagger tool. 6 // Editing this file might prove futile when you re-run the swagger generate command 7 8 import ( 9 strfmt "github.com/go-openapi/strfmt" 10 11 "github.com/go-openapi/errors" 12 "github.com/go-openapi/swag" 13 "github.com/go-openapi/validate" 14 ) 15 16 // StatusResponse Health and status information of daemon 17 // swagger:model StatusResponse 18 // +k8s:deepcopy-gen=true 19 type StatusResponse struct { 20 21 // Status of Cilium daemon 22 Cilium *Status `json:"cilium,omitempty"` 23 24 // When supported by the API, this client ID should be used by the 25 // client when making another request to the server. 26 // See for example "/cluster/nodes". 27 // 28 ClientID int64 `json:"client-id,omitempty"` 29 30 // Status of cluster 31 Cluster *ClusterStatus `json:"cluster,omitempty"` 32 33 // Status of local container runtime 34 ContainerRuntime *Status `json:"container-runtime,omitempty"` 35 36 // Status of all endpoint controllers 37 Controllers ControllerStatuses `json:"controllers,omitempty"` 38 39 // Status of IP address management 40 IPAM *IPAMStatus `json:"ipam,omitempty"` 41 42 // Status of Kubernetes integration 43 Kubernetes *K8sStatus `json:"kubernetes,omitempty"` 44 45 // Status of key/value datastore 46 Kvstore *Status `json:"kvstore,omitempty"` 47 48 // Status of the node monitor 49 NodeMonitor *MonitorStatus `json:"nodeMonitor,omitempty"` 50 51 // Status of proxy 52 Proxy *ProxyStatus `json:"proxy,omitempty"` 53 54 // List of stale information in the status 55 Stale map[string]strfmt.DateTime `json:"stale,omitempty"` 56 } 57 58 // Validate validates this status response 59 func (m *StatusResponse) Validate(formats strfmt.Registry) error { 60 var res []error 61 62 if err := m.validateCilium(formats); err != nil { 63 res = append(res, err) 64 } 65 66 if err := m.validateCluster(formats); err != nil { 67 res = append(res, err) 68 } 69 70 if err := m.validateContainerRuntime(formats); err != nil { 71 res = append(res, err) 72 } 73 74 if err := m.validateControllers(formats); err != nil { 75 res = append(res, err) 76 } 77 78 if err := m.validateIPAM(formats); err != nil { 79 res = append(res, err) 80 } 81 82 if err := m.validateKubernetes(formats); err != nil { 83 res = append(res, err) 84 } 85 86 if err := m.validateKvstore(formats); err != nil { 87 res = append(res, err) 88 } 89 90 if err := m.validateNodeMonitor(formats); err != nil { 91 res = append(res, err) 92 } 93 94 if err := m.validateProxy(formats); err != nil { 95 res = append(res, err) 96 } 97 98 if err := m.validateStale(formats); err != nil { 99 res = append(res, err) 100 } 101 102 if len(res) > 0 { 103 return errors.CompositeValidationError(res...) 104 } 105 return nil 106 } 107 108 func (m *StatusResponse) validateCilium(formats strfmt.Registry) error { 109 110 if swag.IsZero(m.Cilium) { // not required 111 return nil 112 } 113 114 if m.Cilium != nil { 115 if err := m.Cilium.Validate(formats); err != nil { 116 if ve, ok := err.(*errors.Validation); ok { 117 return ve.ValidateName("cilium") 118 } 119 return err 120 } 121 } 122 123 return nil 124 } 125 126 func (m *StatusResponse) validateCluster(formats strfmt.Registry) error { 127 128 if swag.IsZero(m.Cluster) { // not required 129 return nil 130 } 131 132 if m.Cluster != nil { 133 if err := m.Cluster.Validate(formats); err != nil { 134 if ve, ok := err.(*errors.Validation); ok { 135 return ve.ValidateName("cluster") 136 } 137 return err 138 } 139 } 140 141 return nil 142 } 143 144 func (m *StatusResponse) validateContainerRuntime(formats strfmt.Registry) error { 145 146 if swag.IsZero(m.ContainerRuntime) { // not required 147 return nil 148 } 149 150 if m.ContainerRuntime != nil { 151 if err := m.ContainerRuntime.Validate(formats); err != nil { 152 if ve, ok := err.(*errors.Validation); ok { 153 return ve.ValidateName("container-runtime") 154 } 155 return err 156 } 157 } 158 159 return nil 160 } 161 162 func (m *StatusResponse) validateControllers(formats strfmt.Registry) error { 163 164 if swag.IsZero(m.Controllers) { // not required 165 return nil 166 } 167 168 if err := m.Controllers.Validate(formats); err != nil { 169 if ve, ok := err.(*errors.Validation); ok { 170 return ve.ValidateName("controllers") 171 } 172 return err 173 } 174 175 return nil 176 } 177 178 func (m *StatusResponse) validateIPAM(formats strfmt.Registry) error { 179 180 if swag.IsZero(m.IPAM) { // not required 181 return nil 182 } 183 184 if m.IPAM != nil { 185 if err := m.IPAM.Validate(formats); err != nil { 186 if ve, ok := err.(*errors.Validation); ok { 187 return ve.ValidateName("ipam") 188 } 189 return err 190 } 191 } 192 193 return nil 194 } 195 196 func (m *StatusResponse) validateKubernetes(formats strfmt.Registry) error { 197 198 if swag.IsZero(m.Kubernetes) { // not required 199 return nil 200 } 201 202 if m.Kubernetes != nil { 203 if err := m.Kubernetes.Validate(formats); err != nil { 204 if ve, ok := err.(*errors.Validation); ok { 205 return ve.ValidateName("kubernetes") 206 } 207 return err 208 } 209 } 210 211 return nil 212 } 213 214 func (m *StatusResponse) validateKvstore(formats strfmt.Registry) error { 215 216 if swag.IsZero(m.Kvstore) { // not required 217 return nil 218 } 219 220 if m.Kvstore != nil { 221 if err := m.Kvstore.Validate(formats); err != nil { 222 if ve, ok := err.(*errors.Validation); ok { 223 return ve.ValidateName("kvstore") 224 } 225 return err 226 } 227 } 228 229 return nil 230 } 231 232 func (m *StatusResponse) validateNodeMonitor(formats strfmt.Registry) error { 233 234 if swag.IsZero(m.NodeMonitor) { // not required 235 return nil 236 } 237 238 if m.NodeMonitor != nil { 239 if err := m.NodeMonitor.Validate(formats); err != nil { 240 if ve, ok := err.(*errors.Validation); ok { 241 return ve.ValidateName("nodeMonitor") 242 } 243 return err 244 } 245 } 246 247 return nil 248 } 249 250 func (m *StatusResponse) validateProxy(formats strfmt.Registry) error { 251 252 if swag.IsZero(m.Proxy) { // not required 253 return nil 254 } 255 256 if m.Proxy != nil { 257 if err := m.Proxy.Validate(formats); err != nil { 258 if ve, ok := err.(*errors.Validation); ok { 259 return ve.ValidateName("proxy") 260 } 261 return err 262 } 263 } 264 265 return nil 266 } 267 268 func (m *StatusResponse) validateStale(formats strfmt.Registry) error { 269 270 if swag.IsZero(m.Stale) { // not required 271 return nil 272 } 273 274 for k := range m.Stale { 275 276 if err := validate.FormatOf("stale"+"."+k, "body", "date-time", m.Stale[k].String(), formats); err != nil { 277 return err 278 } 279 280 } 281 282 return nil 283 } 284 285 // MarshalBinary interface implementation 286 func (m *StatusResponse) MarshalBinary() ([]byte, error) { 287 if m == nil { 288 return nil, nil 289 } 290 return swag.WriteJSON(m) 291 } 292 293 // UnmarshalBinary interface implementation 294 func (m *StatusResponse) UnmarshalBinary(b []byte) error { 295 var res StatusResponse 296 if err := swag.ReadJSON(b, &res); err != nil { 297 return err 298 } 299 *m = res 300 return nil 301 }