github.com/kubearmor/cilium@v1.6.12/api/v1/models/endpoint_status.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 ) 14 15 // EndpointStatus The current state and configuration of the endpoint, its policy & datapath, and subcomponents 16 // swagger:model EndpointStatus 17 type EndpointStatus struct { 18 19 // Status of internal controllers attached to this endpoint 20 Controllers ControllerStatuses `json:"controllers,omitempty"` 21 22 // Unique identifiers for this endpoint from outside cilium 23 ExternalIdentifiers *EndpointIdentifiers `json:"external-identifiers,omitempty"` 24 25 // Summary overall endpoint & subcomponent health 26 Health *EndpointHealth `json:"health,omitempty"` 27 28 // The security identity for this endpoint 29 Identity *Identity `json:"identity,omitempty"` 30 31 // Labels applied to this endpoint 32 Labels *LabelConfigurationStatus `json:"labels,omitempty"` 33 34 // Most recent status log. See endpoint/{id}/log for the complete log. 35 Log EndpointStatusLog `json:"log,omitempty"` 36 37 // Networking properties of the endpoint 38 Networking *EndpointNetworking `json:"networking,omitempty"` 39 40 // The policy applied to this endpoint from the policy repository 41 Policy *EndpointPolicyStatus `json:"policy,omitempty"` 42 43 // The configuration in effect on this endpoint 44 Realized *EndpointConfigurationSpec `json:"realized,omitempty"` 45 46 // Current state of endpoint 47 // Required: true 48 State EndpointState `json:"state"` 49 } 50 51 // Validate validates this endpoint status 52 func (m *EndpointStatus) Validate(formats strfmt.Registry) error { 53 var res []error 54 55 if err := m.validateControllers(formats); err != nil { 56 res = append(res, err) 57 } 58 59 if err := m.validateExternalIdentifiers(formats); err != nil { 60 res = append(res, err) 61 } 62 63 if err := m.validateHealth(formats); err != nil { 64 res = append(res, err) 65 } 66 67 if err := m.validateIdentity(formats); err != nil { 68 res = append(res, err) 69 } 70 71 if err := m.validateLabels(formats); err != nil { 72 res = append(res, err) 73 } 74 75 if err := m.validateLog(formats); err != nil { 76 res = append(res, err) 77 } 78 79 if err := m.validateNetworking(formats); err != nil { 80 res = append(res, err) 81 } 82 83 if err := m.validatePolicy(formats); err != nil { 84 res = append(res, err) 85 } 86 87 if err := m.validateRealized(formats); err != nil { 88 res = append(res, err) 89 } 90 91 if err := m.validateState(formats); err != nil { 92 res = append(res, err) 93 } 94 95 if len(res) > 0 { 96 return errors.CompositeValidationError(res...) 97 } 98 return nil 99 } 100 101 func (m *EndpointStatus) validateControllers(formats strfmt.Registry) error { 102 103 if swag.IsZero(m.Controllers) { // not required 104 return nil 105 } 106 107 if err := m.Controllers.Validate(formats); err != nil { 108 if ve, ok := err.(*errors.Validation); ok { 109 return ve.ValidateName("controllers") 110 } 111 return err 112 } 113 114 return nil 115 } 116 117 func (m *EndpointStatus) validateExternalIdentifiers(formats strfmt.Registry) error { 118 119 if swag.IsZero(m.ExternalIdentifiers) { // not required 120 return nil 121 } 122 123 if m.ExternalIdentifiers != nil { 124 if err := m.ExternalIdentifiers.Validate(formats); err != nil { 125 if ve, ok := err.(*errors.Validation); ok { 126 return ve.ValidateName("external-identifiers") 127 } 128 return err 129 } 130 } 131 132 return nil 133 } 134 135 func (m *EndpointStatus) validateHealth(formats strfmt.Registry) error { 136 137 if swag.IsZero(m.Health) { // not required 138 return nil 139 } 140 141 if m.Health != nil { 142 if err := m.Health.Validate(formats); err != nil { 143 if ve, ok := err.(*errors.Validation); ok { 144 return ve.ValidateName("health") 145 } 146 return err 147 } 148 } 149 150 return nil 151 } 152 153 func (m *EndpointStatus) validateIdentity(formats strfmt.Registry) error { 154 155 if swag.IsZero(m.Identity) { // not required 156 return nil 157 } 158 159 if m.Identity != nil { 160 if err := m.Identity.Validate(formats); err != nil { 161 if ve, ok := err.(*errors.Validation); ok { 162 return ve.ValidateName("identity") 163 } 164 return err 165 } 166 } 167 168 return nil 169 } 170 171 func (m *EndpointStatus) validateLabels(formats strfmt.Registry) error { 172 173 if swag.IsZero(m.Labels) { // not required 174 return nil 175 } 176 177 if m.Labels != nil { 178 if err := m.Labels.Validate(formats); err != nil { 179 if ve, ok := err.(*errors.Validation); ok { 180 return ve.ValidateName("labels") 181 } 182 return err 183 } 184 } 185 186 return nil 187 } 188 189 func (m *EndpointStatus) validateLog(formats strfmt.Registry) error { 190 191 if swag.IsZero(m.Log) { // not required 192 return nil 193 } 194 195 if err := m.Log.Validate(formats); err != nil { 196 if ve, ok := err.(*errors.Validation); ok { 197 return ve.ValidateName("log") 198 } 199 return err 200 } 201 202 return nil 203 } 204 205 func (m *EndpointStatus) validateNetworking(formats strfmt.Registry) error { 206 207 if swag.IsZero(m.Networking) { // not required 208 return nil 209 } 210 211 if m.Networking != nil { 212 if err := m.Networking.Validate(formats); err != nil { 213 if ve, ok := err.(*errors.Validation); ok { 214 return ve.ValidateName("networking") 215 } 216 return err 217 } 218 } 219 220 return nil 221 } 222 223 func (m *EndpointStatus) validatePolicy(formats strfmt.Registry) error { 224 225 if swag.IsZero(m.Policy) { // not required 226 return nil 227 } 228 229 if m.Policy != nil { 230 if err := m.Policy.Validate(formats); err != nil { 231 if ve, ok := err.(*errors.Validation); ok { 232 return ve.ValidateName("policy") 233 } 234 return err 235 } 236 } 237 238 return nil 239 } 240 241 func (m *EndpointStatus) validateRealized(formats strfmt.Registry) error { 242 243 if swag.IsZero(m.Realized) { // not required 244 return nil 245 } 246 247 if m.Realized != nil { 248 if err := m.Realized.Validate(formats); err != nil { 249 if ve, ok := err.(*errors.Validation); ok { 250 return ve.ValidateName("realized") 251 } 252 return err 253 } 254 } 255 256 return nil 257 } 258 259 func (m *EndpointStatus) validateState(formats strfmt.Registry) error { 260 261 if err := m.State.Validate(formats); err != nil { 262 if ve, ok := err.(*errors.Validation); ok { 263 return ve.ValidateName("state") 264 } 265 return err 266 } 267 268 return nil 269 } 270 271 // MarshalBinary interface implementation 272 func (m *EndpointStatus) MarshalBinary() ([]byte, error) { 273 if m == nil { 274 return nil, nil 275 } 276 return swag.WriteJSON(m) 277 } 278 279 // UnmarshalBinary interface implementation 280 func (m *EndpointStatus) UnmarshalBinary(b []byte) error { 281 var res EndpointStatus 282 if err := swag.ReadJSON(b, &res); err != nil { 283 return err 284 } 285 *m = res 286 return nil 287 }