github.com/kubearmor/cilium@v1.6.12/api/v1/health/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 "encoding/json" 10 "strconv" 11 12 strfmt "github.com/go-openapi/strfmt" 13 14 "github.com/go-openapi/errors" 15 "github.com/go-openapi/swag" 16 "github.com/go-openapi/validate" 17 ) 18 19 // StatusResponse Health and status information of daemon 20 // swagger:model statusResponse 21 type StatusResponse struct { 22 23 // cilium 24 Cilium *StatusResponseCilium `json:"cilium,omitempty"` 25 26 // cluster 27 Cluster *StatusResponseCluster `json:"cluster,omitempty"` 28 29 // container runtime 30 ContainerRuntime *StatusResponseContainerRuntime `json:"container-runtime,omitempty"` 31 32 // Collection of controller statuses 33 Controllers []*StatusResponseControllersItems0 `json:"controllers"` 34 35 // ipam 36 IPAM *StatusResponseIPAM `json:"ipam,omitempty"` 37 38 // kubernetes 39 Kubernetes *StatusResponseKubernetes `json:"kubernetes,omitempty"` 40 41 // kvstore 42 Kvstore *StatusResponseKvstore `json:"kvstore,omitempty"` 43 44 // node monitor 45 NodeMonitor *StatusResponseNodeMonitor `json:"nodeMonitor,omitempty"` 46 47 // proxy 48 Proxy *StatusResponseProxy `json:"proxy,omitempty"` 49 50 // List of stale information in the status 51 Stale map[string]strfmt.DateTime `json:"stale,omitempty"` 52 } 53 54 // Validate validates this status response 55 func (m *StatusResponse) Validate(formats strfmt.Registry) error { 56 var res []error 57 58 if err := m.validateCilium(formats); err != nil { 59 res = append(res, err) 60 } 61 62 if err := m.validateCluster(formats); err != nil { 63 res = append(res, err) 64 } 65 66 if err := m.validateContainerRuntime(formats); err != nil { 67 res = append(res, err) 68 } 69 70 if err := m.validateControllers(formats); err != nil { 71 res = append(res, err) 72 } 73 74 if err := m.validateIPAM(formats); err != nil { 75 res = append(res, err) 76 } 77 78 if err := m.validateKubernetes(formats); err != nil { 79 res = append(res, err) 80 } 81 82 if err := m.validateKvstore(formats); err != nil { 83 res = append(res, err) 84 } 85 86 if err := m.validateNodeMonitor(formats); err != nil { 87 res = append(res, err) 88 } 89 90 if err := m.validateProxy(formats); err != nil { 91 res = append(res, err) 92 } 93 94 if err := m.validateStale(formats); err != nil { 95 res = append(res, err) 96 } 97 98 if len(res) > 0 { 99 return errors.CompositeValidationError(res...) 100 } 101 return nil 102 } 103 104 func (m *StatusResponse) validateCilium(formats strfmt.Registry) error { 105 106 if swag.IsZero(m.Cilium) { // not required 107 return nil 108 } 109 110 if m.Cilium != nil { 111 if err := m.Cilium.Validate(formats); err != nil { 112 if ve, ok := err.(*errors.Validation); ok { 113 return ve.ValidateName("cilium") 114 } 115 return err 116 } 117 } 118 119 return nil 120 } 121 122 func (m *StatusResponse) validateCluster(formats strfmt.Registry) error { 123 124 if swag.IsZero(m.Cluster) { // not required 125 return nil 126 } 127 128 if m.Cluster != nil { 129 if err := m.Cluster.Validate(formats); err != nil { 130 if ve, ok := err.(*errors.Validation); ok { 131 return ve.ValidateName("cluster") 132 } 133 return err 134 } 135 } 136 137 return nil 138 } 139 140 func (m *StatusResponse) validateContainerRuntime(formats strfmt.Registry) error { 141 142 if swag.IsZero(m.ContainerRuntime) { // not required 143 return nil 144 } 145 146 if m.ContainerRuntime != nil { 147 if err := m.ContainerRuntime.Validate(formats); err != nil { 148 if ve, ok := err.(*errors.Validation); ok { 149 return ve.ValidateName("container-runtime") 150 } 151 return err 152 } 153 } 154 155 return nil 156 } 157 158 func (m *StatusResponse) validateControllers(formats strfmt.Registry) error { 159 160 if swag.IsZero(m.Controllers) { // not required 161 return nil 162 } 163 164 for i := 0; i < len(m.Controllers); i++ { 165 if swag.IsZero(m.Controllers[i]) { // not required 166 continue 167 } 168 169 if m.Controllers[i] != nil { 170 if err := m.Controllers[i].Validate(formats); err != nil { 171 if ve, ok := err.(*errors.Validation); ok { 172 return ve.ValidateName("controllers" + "." + strconv.Itoa(i)) 173 } 174 return err 175 } 176 } 177 178 } 179 180 return nil 181 } 182 183 func (m *StatusResponse) validateIPAM(formats strfmt.Registry) error { 184 185 if swag.IsZero(m.IPAM) { // not required 186 return nil 187 } 188 189 if m.IPAM != nil { 190 if err := m.IPAM.Validate(formats); err != nil { 191 if ve, ok := err.(*errors.Validation); ok { 192 return ve.ValidateName("ipam") 193 } 194 return err 195 } 196 } 197 198 return nil 199 } 200 201 func (m *StatusResponse) validateKubernetes(formats strfmt.Registry) error { 202 203 if swag.IsZero(m.Kubernetes) { // not required 204 return nil 205 } 206 207 if m.Kubernetes != nil { 208 if err := m.Kubernetes.Validate(formats); err != nil { 209 if ve, ok := err.(*errors.Validation); ok { 210 return ve.ValidateName("kubernetes") 211 } 212 return err 213 } 214 } 215 216 return nil 217 } 218 219 func (m *StatusResponse) validateKvstore(formats strfmt.Registry) error { 220 221 if swag.IsZero(m.Kvstore) { // not required 222 return nil 223 } 224 225 if m.Kvstore != nil { 226 if err := m.Kvstore.Validate(formats); err != nil { 227 if ve, ok := err.(*errors.Validation); ok { 228 return ve.ValidateName("kvstore") 229 } 230 return err 231 } 232 } 233 234 return nil 235 } 236 237 func (m *StatusResponse) validateNodeMonitor(formats strfmt.Registry) error { 238 239 if swag.IsZero(m.NodeMonitor) { // not required 240 return nil 241 } 242 243 if m.NodeMonitor != nil { 244 if err := m.NodeMonitor.Validate(formats); err != nil { 245 if ve, ok := err.(*errors.Validation); ok { 246 return ve.ValidateName("nodeMonitor") 247 } 248 return err 249 } 250 } 251 252 return nil 253 } 254 255 func (m *StatusResponse) validateProxy(formats strfmt.Registry) error { 256 257 if swag.IsZero(m.Proxy) { // not required 258 return nil 259 } 260 261 if m.Proxy != nil { 262 if err := m.Proxy.Validate(formats); err != nil { 263 if ve, ok := err.(*errors.Validation); ok { 264 return ve.ValidateName("proxy") 265 } 266 return err 267 } 268 } 269 270 return nil 271 } 272 273 func (m *StatusResponse) validateStale(formats strfmt.Registry) error { 274 275 if swag.IsZero(m.Stale) { // not required 276 return nil 277 } 278 279 for k := range m.Stale { 280 281 if err := validate.FormatOf("stale"+"."+k, "body", "date-time", m.Stale[k].String(), formats); err != nil { 282 return err 283 } 284 285 } 286 287 return nil 288 } 289 290 // MarshalBinary interface implementation 291 func (m *StatusResponse) MarshalBinary() ([]byte, error) { 292 if m == nil { 293 return nil, nil 294 } 295 return swag.WriteJSON(m) 296 } 297 298 // UnmarshalBinary interface implementation 299 func (m *StatusResponse) UnmarshalBinary(b []byte) error { 300 var res StatusResponse 301 if err := swag.ReadJSON(b, &res); err != nil { 302 return err 303 } 304 *m = res 305 return nil 306 } 307 308 // StatusResponseCilium Status of an individual component 309 // swagger:model StatusResponseCilium 310 type StatusResponseCilium struct { 311 312 // Human readable status/error/warning message 313 Msg string `json:"msg,omitempty"` 314 315 // State the component is in 316 // Enum: [Ok Warning Failure Disabled] 317 State string `json:"state,omitempty"` 318 } 319 320 // Validate validates this status response cilium 321 func (m *StatusResponseCilium) Validate(formats strfmt.Registry) error { 322 var res []error 323 324 if err := m.validateState(formats); err != nil { 325 res = append(res, err) 326 } 327 328 if len(res) > 0 { 329 return errors.CompositeValidationError(res...) 330 } 331 return nil 332 } 333 334 var statusResponseCiliumTypeStatePropEnum []interface{} 335 336 func init() { 337 var res []string 338 if err := json.Unmarshal([]byte(`["Ok","Warning","Failure","Disabled"]`), &res); err != nil { 339 panic(err) 340 } 341 for _, v := range res { 342 statusResponseCiliumTypeStatePropEnum = append(statusResponseCiliumTypeStatePropEnum, v) 343 } 344 } 345 346 const ( 347 348 // StatusResponseCiliumStateOk captures enum value "Ok" 349 StatusResponseCiliumStateOk string = "Ok" 350 351 // StatusResponseCiliumStateWarning captures enum value "Warning" 352 StatusResponseCiliumStateWarning string = "Warning" 353 354 // StatusResponseCiliumStateFailure captures enum value "Failure" 355 StatusResponseCiliumStateFailure string = "Failure" 356 357 // StatusResponseCiliumStateDisabled captures enum value "Disabled" 358 StatusResponseCiliumStateDisabled string = "Disabled" 359 ) 360 361 // prop value enum 362 func (m *StatusResponseCilium) validateStateEnum(path, location string, value string) error { 363 if err := validate.Enum(path, location, value, statusResponseCiliumTypeStatePropEnum); err != nil { 364 return err 365 } 366 return nil 367 } 368 369 func (m *StatusResponseCilium) validateState(formats strfmt.Registry) error { 370 371 if swag.IsZero(m.State) { // not required 372 return nil 373 } 374 375 // value enum 376 if err := m.validateStateEnum("cilium"+"."+"state", "body", m.State); err != nil { 377 return err 378 } 379 380 return nil 381 } 382 383 // MarshalBinary interface implementation 384 func (m *StatusResponseCilium) MarshalBinary() ([]byte, error) { 385 if m == nil { 386 return nil, nil 387 } 388 return swag.WriteJSON(m) 389 } 390 391 // UnmarshalBinary interface implementation 392 func (m *StatusResponseCilium) UnmarshalBinary(b []byte) error { 393 var res StatusResponseCilium 394 if err := swag.ReadJSON(b, &res); err != nil { 395 return err 396 } 397 *m = res 398 return nil 399 } 400 401 // StatusResponseCluster Status of cluster 402 // swagger:model StatusResponseCluster 403 type StatusResponseCluster struct { 404 405 // cilium health 406 CiliumHealth *StatusResponseClusterCiliumHealth `json:"ciliumHealth,omitempty"` 407 408 // List of known nodes 409 Nodes []*StatusResponseClusterNodesItems0 `json:"nodes"` 410 411 // Name of local node (if available) 412 Self string `json:"self,omitempty"` 413 } 414 415 // Validate validates this status response cluster 416 func (m *StatusResponseCluster) Validate(formats strfmt.Registry) error { 417 var res []error 418 419 if err := m.validateCiliumHealth(formats); err != nil { 420 res = append(res, err) 421 } 422 423 if err := m.validateNodes(formats); err != nil { 424 res = append(res, err) 425 } 426 427 if len(res) > 0 { 428 return errors.CompositeValidationError(res...) 429 } 430 return nil 431 } 432 433 func (m *StatusResponseCluster) validateCiliumHealth(formats strfmt.Registry) error { 434 435 if swag.IsZero(m.CiliumHealth) { // not required 436 return nil 437 } 438 439 if m.CiliumHealth != nil { 440 if err := m.CiliumHealth.Validate(formats); err != nil { 441 if ve, ok := err.(*errors.Validation); ok { 442 return ve.ValidateName("cluster" + "." + "ciliumHealth") 443 } 444 return err 445 } 446 } 447 448 return nil 449 } 450 451 func (m *StatusResponseCluster) validateNodes(formats strfmt.Registry) error { 452 453 if swag.IsZero(m.Nodes) { // not required 454 return nil 455 } 456 457 for i := 0; i < len(m.Nodes); i++ { 458 if swag.IsZero(m.Nodes[i]) { // not required 459 continue 460 } 461 462 if m.Nodes[i] != nil { 463 if err := m.Nodes[i].Validate(formats); err != nil { 464 if ve, ok := err.(*errors.Validation); ok { 465 return ve.ValidateName("cluster" + "." + "nodes" + "." + strconv.Itoa(i)) 466 } 467 return err 468 } 469 } 470 471 } 472 473 return nil 474 } 475 476 // MarshalBinary interface implementation 477 func (m *StatusResponseCluster) MarshalBinary() ([]byte, error) { 478 if m == nil { 479 return nil, nil 480 } 481 return swag.WriteJSON(m) 482 } 483 484 // UnmarshalBinary interface implementation 485 func (m *StatusResponseCluster) UnmarshalBinary(b []byte) error { 486 var res StatusResponseCluster 487 if err := swag.ReadJSON(b, &res); err != nil { 488 return err 489 } 490 *m = res 491 return nil 492 } 493 494 // StatusResponseClusterCiliumHealth Status of an individual component 495 // swagger:model StatusResponseClusterCiliumHealth 496 type StatusResponseClusterCiliumHealth struct { 497 498 // Human readable status/error/warning message 499 Msg string `json:"msg,omitempty"` 500 501 // State the component is in 502 // Enum: [Ok Warning Failure Disabled] 503 State string `json:"state,omitempty"` 504 } 505 506 // Validate validates this status response cluster cilium health 507 func (m *StatusResponseClusterCiliumHealth) Validate(formats strfmt.Registry) error { 508 var res []error 509 510 if err := m.validateState(formats); err != nil { 511 res = append(res, err) 512 } 513 514 if len(res) > 0 { 515 return errors.CompositeValidationError(res...) 516 } 517 return nil 518 } 519 520 var statusResponseClusterCiliumHealthTypeStatePropEnum []interface{} 521 522 func init() { 523 var res []string 524 if err := json.Unmarshal([]byte(`["Ok","Warning","Failure","Disabled"]`), &res); err != nil { 525 panic(err) 526 } 527 for _, v := range res { 528 statusResponseClusterCiliumHealthTypeStatePropEnum = append(statusResponseClusterCiliumHealthTypeStatePropEnum, v) 529 } 530 } 531 532 const ( 533 534 // StatusResponseClusterCiliumHealthStateOk captures enum value "Ok" 535 StatusResponseClusterCiliumHealthStateOk string = "Ok" 536 537 // StatusResponseClusterCiliumHealthStateWarning captures enum value "Warning" 538 StatusResponseClusterCiliumHealthStateWarning string = "Warning" 539 540 // StatusResponseClusterCiliumHealthStateFailure captures enum value "Failure" 541 StatusResponseClusterCiliumHealthStateFailure string = "Failure" 542 543 // StatusResponseClusterCiliumHealthStateDisabled captures enum value "Disabled" 544 StatusResponseClusterCiliumHealthStateDisabled string = "Disabled" 545 ) 546 547 // prop value enum 548 func (m *StatusResponseClusterCiliumHealth) validateStateEnum(path, location string, value string) error { 549 if err := validate.Enum(path, location, value, statusResponseClusterCiliumHealthTypeStatePropEnum); err != nil { 550 return err 551 } 552 return nil 553 } 554 555 func (m *StatusResponseClusterCiliumHealth) validateState(formats strfmt.Registry) error { 556 557 if swag.IsZero(m.State) { // not required 558 return nil 559 } 560 561 // value enum 562 if err := m.validateStateEnum("cluster"+"."+"ciliumHealth"+"."+"state", "body", m.State); err != nil { 563 return err 564 } 565 566 return nil 567 } 568 569 // MarshalBinary interface implementation 570 func (m *StatusResponseClusterCiliumHealth) MarshalBinary() ([]byte, error) { 571 if m == nil { 572 return nil, nil 573 } 574 return swag.WriteJSON(m) 575 } 576 577 // UnmarshalBinary interface implementation 578 func (m *StatusResponseClusterCiliumHealth) UnmarshalBinary(b []byte) error { 579 var res StatusResponseClusterCiliumHealth 580 if err := swag.ReadJSON(b, &res); err != nil { 581 return err 582 } 583 *m = res 584 return nil 585 } 586 587 // StatusResponseClusterNodesItems0 Known node in the cluster 588 // swagger:model StatusResponseClusterNodesItems0 589 type StatusResponseClusterNodesItems0 struct { 590 591 // health endpoint address 592 HealthEndpointAddress *StatusResponseClusterNodesItems0HealthEndpointAddress `json:"health-endpoint-address,omitempty"` 593 594 // Name of the node including the cluster association. This is typically 595 // <clustername>/<hostname>. 596 // 597 Name string `json:"name,omitempty"` 598 599 // primary address 600 PrimaryAddress *StatusResponseClusterNodesItems0PrimaryAddress `json:"primary-address,omitempty"` 601 602 // Alternative addresses assigned to the node 603 SecondaryAddresses []*StatusResponseClusterNodesItems0SecondaryAddressesItems0 `json:"secondary-addresses"` 604 } 605 606 // Validate validates this status response cluster nodes items0 607 func (m *StatusResponseClusterNodesItems0) Validate(formats strfmt.Registry) error { 608 var res []error 609 610 if err := m.validateHealthEndpointAddress(formats); err != nil { 611 res = append(res, err) 612 } 613 614 if err := m.validatePrimaryAddress(formats); err != nil { 615 res = append(res, err) 616 } 617 618 if err := m.validateSecondaryAddresses(formats); err != nil { 619 res = append(res, err) 620 } 621 622 if len(res) > 0 { 623 return errors.CompositeValidationError(res...) 624 } 625 return nil 626 } 627 628 func (m *StatusResponseClusterNodesItems0) validateHealthEndpointAddress(formats strfmt.Registry) error { 629 630 if swag.IsZero(m.HealthEndpointAddress) { // not required 631 return nil 632 } 633 634 if m.HealthEndpointAddress != nil { 635 if err := m.HealthEndpointAddress.Validate(formats); err != nil { 636 if ve, ok := err.(*errors.Validation); ok { 637 return ve.ValidateName("health-endpoint-address") 638 } 639 return err 640 } 641 } 642 643 return nil 644 } 645 646 func (m *StatusResponseClusterNodesItems0) validatePrimaryAddress(formats strfmt.Registry) error { 647 648 if swag.IsZero(m.PrimaryAddress) { // not required 649 return nil 650 } 651 652 if m.PrimaryAddress != nil { 653 if err := m.PrimaryAddress.Validate(formats); err != nil { 654 if ve, ok := err.(*errors.Validation); ok { 655 return ve.ValidateName("primary-address") 656 } 657 return err 658 } 659 } 660 661 return nil 662 } 663 664 func (m *StatusResponseClusterNodesItems0) validateSecondaryAddresses(formats strfmt.Registry) error { 665 666 if swag.IsZero(m.SecondaryAddresses) { // not required 667 return nil 668 } 669 670 for i := 0; i < len(m.SecondaryAddresses); i++ { 671 if swag.IsZero(m.SecondaryAddresses[i]) { // not required 672 continue 673 } 674 675 if m.SecondaryAddresses[i] != nil { 676 if err := m.SecondaryAddresses[i].Validate(formats); err != nil { 677 if ve, ok := err.(*errors.Validation); ok { 678 return ve.ValidateName("secondary-addresses" + "." + strconv.Itoa(i)) 679 } 680 return err 681 } 682 } 683 684 } 685 686 return nil 687 } 688 689 // MarshalBinary interface implementation 690 func (m *StatusResponseClusterNodesItems0) MarshalBinary() ([]byte, error) { 691 if m == nil { 692 return nil, nil 693 } 694 return swag.WriteJSON(m) 695 } 696 697 // UnmarshalBinary interface implementation 698 func (m *StatusResponseClusterNodesItems0) UnmarshalBinary(b []byte) error { 699 var res StatusResponseClusterNodesItems0 700 if err := swag.ReadJSON(b, &res); err != nil { 701 return err 702 } 703 *m = res 704 return nil 705 } 706 707 // StatusResponseClusterNodesItems0HealthEndpointAddress Addressing information of a node for all address families 708 // swagger:model StatusResponseClusterNodesItems0HealthEndpointAddress 709 type StatusResponseClusterNodesItems0HealthEndpointAddress struct { 710 711 // ipv4 712 IPV4 *StatusResponseClusterNodesItems0HealthEndpointAddressIPV4 `json:"ipv4,omitempty"` 713 714 // ipv6 715 IPV6 *StatusResponseClusterNodesItems0HealthEndpointAddressIPV6 `json:"ipv6,omitempty"` 716 } 717 718 // Validate validates this status response cluster nodes items0 health endpoint address 719 func (m *StatusResponseClusterNodesItems0HealthEndpointAddress) Validate(formats strfmt.Registry) error { 720 var res []error 721 722 if err := m.validateIPV4(formats); err != nil { 723 res = append(res, err) 724 } 725 726 if err := m.validateIPV6(formats); err != nil { 727 res = append(res, err) 728 } 729 730 if len(res) > 0 { 731 return errors.CompositeValidationError(res...) 732 } 733 return nil 734 } 735 736 func (m *StatusResponseClusterNodesItems0HealthEndpointAddress) validateIPV4(formats strfmt.Registry) error { 737 738 if swag.IsZero(m.IPV4) { // not required 739 return nil 740 } 741 742 if m.IPV4 != nil { 743 if err := m.IPV4.Validate(formats); err != nil { 744 if ve, ok := err.(*errors.Validation); ok { 745 return ve.ValidateName("health-endpoint-address" + "." + "ipv4") 746 } 747 return err 748 } 749 } 750 751 return nil 752 } 753 754 func (m *StatusResponseClusterNodesItems0HealthEndpointAddress) validateIPV6(formats strfmt.Registry) error { 755 756 if swag.IsZero(m.IPV6) { // not required 757 return nil 758 } 759 760 if m.IPV6 != nil { 761 if err := m.IPV6.Validate(formats); err != nil { 762 if ve, ok := err.(*errors.Validation); ok { 763 return ve.ValidateName("health-endpoint-address" + "." + "ipv6") 764 } 765 return err 766 } 767 } 768 769 return nil 770 } 771 772 // MarshalBinary interface implementation 773 func (m *StatusResponseClusterNodesItems0HealthEndpointAddress) MarshalBinary() ([]byte, error) { 774 if m == nil { 775 return nil, nil 776 } 777 return swag.WriteJSON(m) 778 } 779 780 // UnmarshalBinary interface implementation 781 func (m *StatusResponseClusterNodesItems0HealthEndpointAddress) UnmarshalBinary(b []byte) error { 782 var res StatusResponseClusterNodesItems0HealthEndpointAddress 783 if err := swag.ReadJSON(b, &res); err != nil { 784 return err 785 } 786 *m = res 787 return nil 788 } 789 790 // StatusResponseClusterNodesItems0HealthEndpointAddressIPV4 Addressing information 791 // swagger:model StatusResponseClusterNodesItems0HealthEndpointAddressIPV4 792 type StatusResponseClusterNodesItems0HealthEndpointAddressIPV4 struct { 793 794 // Node address type, one of HostName, ExternalIP or InternalIP 795 AddressType string `json:"address-type,omitempty"` 796 797 // Address pool to be used for local endpoints 798 AllocRange string `json:"alloc-range,omitempty"` 799 800 // True if address family is enabled 801 Enabled bool `json:"enabled,omitempty"` 802 803 // IP address of node 804 IP string `json:"ip,omitempty"` 805 } 806 807 // Validate validates this status response cluster nodes items0 health endpoint address IP v4 808 func (m *StatusResponseClusterNodesItems0HealthEndpointAddressIPV4) Validate(formats strfmt.Registry) error { 809 return nil 810 } 811 812 // MarshalBinary interface implementation 813 func (m *StatusResponseClusterNodesItems0HealthEndpointAddressIPV4) MarshalBinary() ([]byte, error) { 814 if m == nil { 815 return nil, nil 816 } 817 return swag.WriteJSON(m) 818 } 819 820 // UnmarshalBinary interface implementation 821 func (m *StatusResponseClusterNodesItems0HealthEndpointAddressIPV4) UnmarshalBinary(b []byte) error { 822 var res StatusResponseClusterNodesItems0HealthEndpointAddressIPV4 823 if err := swag.ReadJSON(b, &res); err != nil { 824 return err 825 } 826 *m = res 827 return nil 828 } 829 830 // StatusResponseClusterNodesItems0HealthEndpointAddressIPV6 Addressing information 831 // swagger:model StatusResponseClusterNodesItems0HealthEndpointAddressIPV6 832 type StatusResponseClusterNodesItems0HealthEndpointAddressIPV6 struct { 833 834 // Node address type, one of HostName, ExternalIP or InternalIP 835 AddressType string `json:"address-type,omitempty"` 836 837 // Address pool to be used for local endpoints 838 AllocRange string `json:"alloc-range,omitempty"` 839 840 // True if address family is enabled 841 Enabled bool `json:"enabled,omitempty"` 842 843 // IP address of node 844 IP string `json:"ip,omitempty"` 845 } 846 847 // Validate validates this status response cluster nodes items0 health endpoint address IP v6 848 func (m *StatusResponseClusterNodesItems0HealthEndpointAddressIPV6) Validate(formats strfmt.Registry) error { 849 return nil 850 } 851 852 // MarshalBinary interface implementation 853 func (m *StatusResponseClusterNodesItems0HealthEndpointAddressIPV6) MarshalBinary() ([]byte, error) { 854 if m == nil { 855 return nil, nil 856 } 857 return swag.WriteJSON(m) 858 } 859 860 // UnmarshalBinary interface implementation 861 func (m *StatusResponseClusterNodesItems0HealthEndpointAddressIPV6) UnmarshalBinary(b []byte) error { 862 var res StatusResponseClusterNodesItems0HealthEndpointAddressIPV6 863 if err := swag.ReadJSON(b, &res); err != nil { 864 return err 865 } 866 *m = res 867 return nil 868 } 869 870 // StatusResponseClusterNodesItems0PrimaryAddress Addressing information of a node for all address families 871 // swagger:model StatusResponseClusterNodesItems0PrimaryAddress 872 type StatusResponseClusterNodesItems0PrimaryAddress struct { 873 874 // ipv4 875 IPV4 *StatusResponseClusterNodesItems0PrimaryAddressIPV4 `json:"ipv4,omitempty"` 876 877 // ipv6 878 IPV6 *StatusResponseClusterNodesItems0PrimaryAddressIPV6 `json:"ipv6,omitempty"` 879 } 880 881 // Validate validates this status response cluster nodes items0 primary address 882 func (m *StatusResponseClusterNodesItems0PrimaryAddress) Validate(formats strfmt.Registry) error { 883 var res []error 884 885 if err := m.validateIPV4(formats); err != nil { 886 res = append(res, err) 887 } 888 889 if err := m.validateIPV6(formats); err != nil { 890 res = append(res, err) 891 } 892 893 if len(res) > 0 { 894 return errors.CompositeValidationError(res...) 895 } 896 return nil 897 } 898 899 func (m *StatusResponseClusterNodesItems0PrimaryAddress) validateIPV4(formats strfmt.Registry) error { 900 901 if swag.IsZero(m.IPV4) { // not required 902 return nil 903 } 904 905 if m.IPV4 != nil { 906 if err := m.IPV4.Validate(formats); err != nil { 907 if ve, ok := err.(*errors.Validation); ok { 908 return ve.ValidateName("primary-address" + "." + "ipv4") 909 } 910 return err 911 } 912 } 913 914 return nil 915 } 916 917 func (m *StatusResponseClusterNodesItems0PrimaryAddress) validateIPV6(formats strfmt.Registry) error { 918 919 if swag.IsZero(m.IPV6) { // not required 920 return nil 921 } 922 923 if m.IPV6 != nil { 924 if err := m.IPV6.Validate(formats); err != nil { 925 if ve, ok := err.(*errors.Validation); ok { 926 return ve.ValidateName("primary-address" + "." + "ipv6") 927 } 928 return err 929 } 930 } 931 932 return nil 933 } 934 935 // MarshalBinary interface implementation 936 func (m *StatusResponseClusterNodesItems0PrimaryAddress) MarshalBinary() ([]byte, error) { 937 if m == nil { 938 return nil, nil 939 } 940 return swag.WriteJSON(m) 941 } 942 943 // UnmarshalBinary interface implementation 944 func (m *StatusResponseClusterNodesItems0PrimaryAddress) UnmarshalBinary(b []byte) error { 945 var res StatusResponseClusterNodesItems0PrimaryAddress 946 if err := swag.ReadJSON(b, &res); err != nil { 947 return err 948 } 949 *m = res 950 return nil 951 } 952 953 // StatusResponseClusterNodesItems0PrimaryAddressIPV4 Addressing information 954 // swagger:model StatusResponseClusterNodesItems0PrimaryAddressIPV4 955 type StatusResponseClusterNodesItems0PrimaryAddressIPV4 struct { 956 957 // Node address type, one of HostName, ExternalIP or InternalIP 958 AddressType string `json:"address-type,omitempty"` 959 960 // Address pool to be used for local endpoints 961 AllocRange string `json:"alloc-range,omitempty"` 962 963 // True if address family is enabled 964 Enabled bool `json:"enabled,omitempty"` 965 966 // IP address of node 967 IP string `json:"ip,omitempty"` 968 } 969 970 // Validate validates this status response cluster nodes items0 primary address IP v4 971 func (m *StatusResponseClusterNodesItems0PrimaryAddressIPV4) Validate(formats strfmt.Registry) error { 972 return nil 973 } 974 975 // MarshalBinary interface implementation 976 func (m *StatusResponseClusterNodesItems0PrimaryAddressIPV4) MarshalBinary() ([]byte, error) { 977 if m == nil { 978 return nil, nil 979 } 980 return swag.WriteJSON(m) 981 } 982 983 // UnmarshalBinary interface implementation 984 func (m *StatusResponseClusterNodesItems0PrimaryAddressIPV4) UnmarshalBinary(b []byte) error { 985 var res StatusResponseClusterNodesItems0PrimaryAddressIPV4 986 if err := swag.ReadJSON(b, &res); err != nil { 987 return err 988 } 989 *m = res 990 return nil 991 } 992 993 // StatusResponseClusterNodesItems0PrimaryAddressIPV6 Addressing information 994 // swagger:model StatusResponseClusterNodesItems0PrimaryAddressIPV6 995 type StatusResponseClusterNodesItems0PrimaryAddressIPV6 struct { 996 997 // Node address type, one of HostName, ExternalIP or InternalIP 998 AddressType string `json:"address-type,omitempty"` 999 1000 // Address pool to be used for local endpoints 1001 AllocRange string `json:"alloc-range,omitempty"` 1002 1003 // True if address family is enabled 1004 Enabled bool `json:"enabled,omitempty"` 1005 1006 // IP address of node 1007 IP string `json:"ip,omitempty"` 1008 } 1009 1010 // Validate validates this status response cluster nodes items0 primary address IP v6 1011 func (m *StatusResponseClusterNodesItems0PrimaryAddressIPV6) Validate(formats strfmt.Registry) error { 1012 return nil 1013 } 1014 1015 // MarshalBinary interface implementation 1016 func (m *StatusResponseClusterNodesItems0PrimaryAddressIPV6) MarshalBinary() ([]byte, error) { 1017 if m == nil { 1018 return nil, nil 1019 } 1020 return swag.WriteJSON(m) 1021 } 1022 1023 // UnmarshalBinary interface implementation 1024 func (m *StatusResponseClusterNodesItems0PrimaryAddressIPV6) UnmarshalBinary(b []byte) error { 1025 var res StatusResponseClusterNodesItems0PrimaryAddressIPV6 1026 if err := swag.ReadJSON(b, &res); err != nil { 1027 return err 1028 } 1029 *m = res 1030 return nil 1031 } 1032 1033 // StatusResponseClusterNodesItems0SecondaryAddressesItems0 Addressing information 1034 // swagger:model StatusResponseClusterNodesItems0SecondaryAddressesItems0 1035 type StatusResponseClusterNodesItems0SecondaryAddressesItems0 struct { 1036 1037 // Node address type, one of HostName, ExternalIP or InternalIP 1038 AddressType string `json:"address-type,omitempty"` 1039 1040 // Address pool to be used for local endpoints 1041 AllocRange string `json:"alloc-range,omitempty"` 1042 1043 // True if address family is enabled 1044 Enabled bool `json:"enabled,omitempty"` 1045 1046 // IP address of node 1047 IP string `json:"ip,omitempty"` 1048 } 1049 1050 // Validate validates this status response cluster nodes items0 secondary addresses items0 1051 func (m *StatusResponseClusterNodesItems0SecondaryAddressesItems0) Validate(formats strfmt.Registry) error { 1052 return nil 1053 } 1054 1055 // MarshalBinary interface implementation 1056 func (m *StatusResponseClusterNodesItems0SecondaryAddressesItems0) MarshalBinary() ([]byte, error) { 1057 if m == nil { 1058 return nil, nil 1059 } 1060 return swag.WriteJSON(m) 1061 } 1062 1063 // UnmarshalBinary interface implementation 1064 func (m *StatusResponseClusterNodesItems0SecondaryAddressesItems0) UnmarshalBinary(b []byte) error { 1065 var res StatusResponseClusterNodesItems0SecondaryAddressesItems0 1066 if err := swag.ReadJSON(b, &res); err != nil { 1067 return err 1068 } 1069 *m = res 1070 return nil 1071 } 1072 1073 // StatusResponseContainerRuntime Status of an individual component 1074 // swagger:model StatusResponseContainerRuntime 1075 type StatusResponseContainerRuntime struct { 1076 1077 // Human readable status/error/warning message 1078 Msg string `json:"msg,omitempty"` 1079 1080 // State the component is in 1081 // Enum: [Ok Warning Failure Disabled] 1082 State string `json:"state,omitempty"` 1083 } 1084 1085 // Validate validates this status response container runtime 1086 func (m *StatusResponseContainerRuntime) Validate(formats strfmt.Registry) error { 1087 var res []error 1088 1089 if err := m.validateState(formats); err != nil { 1090 res = append(res, err) 1091 } 1092 1093 if len(res) > 0 { 1094 return errors.CompositeValidationError(res...) 1095 } 1096 return nil 1097 } 1098 1099 var statusResponseContainerRuntimeTypeStatePropEnum []interface{} 1100 1101 func init() { 1102 var res []string 1103 if err := json.Unmarshal([]byte(`["Ok","Warning","Failure","Disabled"]`), &res); err != nil { 1104 panic(err) 1105 } 1106 for _, v := range res { 1107 statusResponseContainerRuntimeTypeStatePropEnum = append(statusResponseContainerRuntimeTypeStatePropEnum, v) 1108 } 1109 } 1110 1111 const ( 1112 1113 // StatusResponseContainerRuntimeStateOk captures enum value "Ok" 1114 StatusResponseContainerRuntimeStateOk string = "Ok" 1115 1116 // StatusResponseContainerRuntimeStateWarning captures enum value "Warning" 1117 StatusResponseContainerRuntimeStateWarning string = "Warning" 1118 1119 // StatusResponseContainerRuntimeStateFailure captures enum value "Failure" 1120 StatusResponseContainerRuntimeStateFailure string = "Failure" 1121 1122 // StatusResponseContainerRuntimeStateDisabled captures enum value "Disabled" 1123 StatusResponseContainerRuntimeStateDisabled string = "Disabled" 1124 ) 1125 1126 // prop value enum 1127 func (m *StatusResponseContainerRuntime) validateStateEnum(path, location string, value string) error { 1128 if err := validate.Enum(path, location, value, statusResponseContainerRuntimeTypeStatePropEnum); err != nil { 1129 return err 1130 } 1131 return nil 1132 } 1133 1134 func (m *StatusResponseContainerRuntime) validateState(formats strfmt.Registry) error { 1135 1136 if swag.IsZero(m.State) { // not required 1137 return nil 1138 } 1139 1140 // value enum 1141 if err := m.validateStateEnum("container-runtime"+"."+"state", "body", m.State); err != nil { 1142 return err 1143 } 1144 1145 return nil 1146 } 1147 1148 // MarshalBinary interface implementation 1149 func (m *StatusResponseContainerRuntime) MarshalBinary() ([]byte, error) { 1150 if m == nil { 1151 return nil, nil 1152 } 1153 return swag.WriteJSON(m) 1154 } 1155 1156 // UnmarshalBinary interface implementation 1157 func (m *StatusResponseContainerRuntime) UnmarshalBinary(b []byte) error { 1158 var res StatusResponseContainerRuntime 1159 if err := swag.ReadJSON(b, &res); err != nil { 1160 return err 1161 } 1162 *m = res 1163 return nil 1164 } 1165 1166 // StatusResponseControllersItems0 Status of a controller 1167 // swagger:model StatusResponseControllersItems0 1168 type StatusResponseControllersItems0 struct { 1169 1170 // configuration 1171 Configuration *StatusResponseControllersItems0Configuration `json:"configuration,omitempty"` 1172 1173 // Name of controller 1174 Name string `json:"name,omitempty"` 1175 1176 // status 1177 Status *StatusResponseControllersItems0Status `json:"status,omitempty"` 1178 1179 // UUID of controller 1180 // Format: uuid 1181 UUID strfmt.UUID `json:"uuid,omitempty"` 1182 } 1183 1184 // Validate validates this status response controllers items0 1185 func (m *StatusResponseControllersItems0) Validate(formats strfmt.Registry) error { 1186 var res []error 1187 1188 if err := m.validateConfiguration(formats); err != nil { 1189 res = append(res, err) 1190 } 1191 1192 if err := m.validateStatus(formats); err != nil { 1193 res = append(res, err) 1194 } 1195 1196 if err := m.validateUUID(formats); err != nil { 1197 res = append(res, err) 1198 } 1199 1200 if len(res) > 0 { 1201 return errors.CompositeValidationError(res...) 1202 } 1203 return nil 1204 } 1205 1206 func (m *StatusResponseControllersItems0) validateConfiguration(formats strfmt.Registry) error { 1207 1208 if swag.IsZero(m.Configuration) { // not required 1209 return nil 1210 } 1211 1212 if m.Configuration != nil { 1213 if err := m.Configuration.Validate(formats); err != nil { 1214 if ve, ok := err.(*errors.Validation); ok { 1215 return ve.ValidateName("configuration") 1216 } 1217 return err 1218 } 1219 } 1220 1221 return nil 1222 } 1223 1224 func (m *StatusResponseControllersItems0) validateStatus(formats strfmt.Registry) error { 1225 1226 if swag.IsZero(m.Status) { // not required 1227 return nil 1228 } 1229 1230 if m.Status != nil { 1231 if err := m.Status.Validate(formats); err != nil { 1232 if ve, ok := err.(*errors.Validation); ok { 1233 return ve.ValidateName("status") 1234 } 1235 return err 1236 } 1237 } 1238 1239 return nil 1240 } 1241 1242 func (m *StatusResponseControllersItems0) validateUUID(formats strfmt.Registry) error { 1243 1244 if swag.IsZero(m.UUID) { // not required 1245 return nil 1246 } 1247 1248 if err := validate.FormatOf("uuid", "body", "uuid", m.UUID.String(), formats); err != nil { 1249 return err 1250 } 1251 1252 return nil 1253 } 1254 1255 // MarshalBinary interface implementation 1256 func (m *StatusResponseControllersItems0) MarshalBinary() ([]byte, error) { 1257 if m == nil { 1258 return nil, nil 1259 } 1260 return swag.WriteJSON(m) 1261 } 1262 1263 // UnmarshalBinary interface implementation 1264 func (m *StatusResponseControllersItems0) UnmarshalBinary(b []byte) error { 1265 var res StatusResponseControllersItems0 1266 if err := swag.ReadJSON(b, &res); err != nil { 1267 return err 1268 } 1269 *m = res 1270 return nil 1271 } 1272 1273 // StatusResponseControllersItems0Configuration Configuration of controller 1274 // swagger:model StatusResponseControllersItems0Configuration 1275 type StatusResponseControllersItems0Configuration struct { 1276 1277 // Retry on error 1278 ErrorRetry bool `json:"error-retry,omitempty"` 1279 1280 // Base error retry back-off time 1281 // Format: duration 1282 ErrorRetryBase strfmt.Duration `json:"error-retry-base,omitempty"` 1283 1284 // Regular synchronization interval 1285 // Format: duration 1286 Interval strfmt.Duration `json:"interval,omitempty"` 1287 } 1288 1289 // Validate validates this status response controllers items0 configuration 1290 func (m *StatusResponseControllersItems0Configuration) Validate(formats strfmt.Registry) error { 1291 var res []error 1292 1293 if err := m.validateErrorRetryBase(formats); err != nil { 1294 res = append(res, err) 1295 } 1296 1297 if err := m.validateInterval(formats); err != nil { 1298 res = append(res, err) 1299 } 1300 1301 if len(res) > 0 { 1302 return errors.CompositeValidationError(res...) 1303 } 1304 return nil 1305 } 1306 1307 func (m *StatusResponseControllersItems0Configuration) validateErrorRetryBase(formats strfmt.Registry) error { 1308 1309 if swag.IsZero(m.ErrorRetryBase) { // not required 1310 return nil 1311 } 1312 1313 if err := validate.FormatOf("configuration"+"."+"error-retry-base", "body", "duration", m.ErrorRetryBase.String(), formats); err != nil { 1314 return err 1315 } 1316 1317 return nil 1318 } 1319 1320 func (m *StatusResponseControllersItems0Configuration) validateInterval(formats strfmt.Registry) error { 1321 1322 if swag.IsZero(m.Interval) { // not required 1323 return nil 1324 } 1325 1326 if err := validate.FormatOf("configuration"+"."+"interval", "body", "duration", m.Interval.String(), formats); err != nil { 1327 return err 1328 } 1329 1330 return nil 1331 } 1332 1333 // MarshalBinary interface implementation 1334 func (m *StatusResponseControllersItems0Configuration) MarshalBinary() ([]byte, error) { 1335 if m == nil { 1336 return nil, nil 1337 } 1338 return swag.WriteJSON(m) 1339 } 1340 1341 // UnmarshalBinary interface implementation 1342 func (m *StatusResponseControllersItems0Configuration) UnmarshalBinary(b []byte) error { 1343 var res StatusResponseControllersItems0Configuration 1344 if err := swag.ReadJSON(b, &res); err != nil { 1345 return err 1346 } 1347 *m = res 1348 return nil 1349 } 1350 1351 // StatusResponseControllersItems0Status Current status of controller 1352 // swagger:model StatusResponseControllersItems0Status 1353 type StatusResponseControllersItems0Status struct { 1354 1355 // Number of consecutive errors since last success 1356 ConsecutiveFailureCount int64 `json:"consecutive-failure-count,omitempty"` 1357 1358 // Total number of failed runs 1359 FailureCount int64 `json:"failure-count,omitempty"` 1360 1361 // Error message of last failed run 1362 LastFailureMsg string `json:"last-failure-msg,omitempty"` 1363 1364 // Timestamp of last error 1365 // Format: date-time 1366 LastFailureTimestamp strfmt.DateTime `json:"last-failure-timestamp,omitempty"` 1367 1368 // Timestamp of last success 1369 // Format: date-time 1370 LastSuccessTimestamp strfmt.DateTime `json:"last-success-timestamp,omitempty"` 1371 1372 // Total number of successful runs 1373 SuccessCount int64 `json:"success-count,omitempty"` 1374 } 1375 1376 // Validate validates this status response controllers items0 status 1377 func (m *StatusResponseControllersItems0Status) Validate(formats strfmt.Registry) error { 1378 var res []error 1379 1380 if err := m.validateLastFailureTimestamp(formats); err != nil { 1381 res = append(res, err) 1382 } 1383 1384 if err := m.validateLastSuccessTimestamp(formats); err != nil { 1385 res = append(res, err) 1386 } 1387 1388 if len(res) > 0 { 1389 return errors.CompositeValidationError(res...) 1390 } 1391 return nil 1392 } 1393 1394 func (m *StatusResponseControllersItems0Status) validateLastFailureTimestamp(formats strfmt.Registry) error { 1395 1396 if swag.IsZero(m.LastFailureTimestamp) { // not required 1397 return nil 1398 } 1399 1400 if err := validate.FormatOf("status"+"."+"last-failure-timestamp", "body", "date-time", m.LastFailureTimestamp.String(), formats); err != nil { 1401 return err 1402 } 1403 1404 return nil 1405 } 1406 1407 func (m *StatusResponseControllersItems0Status) validateLastSuccessTimestamp(formats strfmt.Registry) error { 1408 1409 if swag.IsZero(m.LastSuccessTimestamp) { // not required 1410 return nil 1411 } 1412 1413 if err := validate.FormatOf("status"+"."+"last-success-timestamp", "body", "date-time", m.LastSuccessTimestamp.String(), formats); err != nil { 1414 return err 1415 } 1416 1417 return nil 1418 } 1419 1420 // MarshalBinary interface implementation 1421 func (m *StatusResponseControllersItems0Status) MarshalBinary() ([]byte, error) { 1422 if m == nil { 1423 return nil, nil 1424 } 1425 return swag.WriteJSON(m) 1426 } 1427 1428 // UnmarshalBinary interface implementation 1429 func (m *StatusResponseControllersItems0Status) UnmarshalBinary(b []byte) error { 1430 var res StatusResponseControllersItems0Status 1431 if err := swag.ReadJSON(b, &res); err != nil { 1432 return err 1433 } 1434 *m = res 1435 return nil 1436 } 1437 1438 // StatusResponseIPAM Status of IP address management 1439 // swagger:model StatusResponseIPAM 1440 type StatusResponseIPAM struct { 1441 1442 // Map of allocated IPs 1443 // 1444 Allocations map[string]string `json:"allocations,omitempty"` 1445 1446 // ipv4 1447 IPV4 []string `json:"ipv4"` 1448 1449 // ipv6 1450 IPV6 []string `json:"ipv6"` 1451 1452 // status 1453 Status string `json:"status,omitempty"` 1454 } 1455 1456 // Validate validates this status response IP a m 1457 func (m *StatusResponseIPAM) Validate(formats strfmt.Registry) error { 1458 return nil 1459 } 1460 1461 // MarshalBinary interface implementation 1462 func (m *StatusResponseIPAM) MarshalBinary() ([]byte, error) { 1463 if m == nil { 1464 return nil, nil 1465 } 1466 return swag.WriteJSON(m) 1467 } 1468 1469 // UnmarshalBinary interface implementation 1470 func (m *StatusResponseIPAM) UnmarshalBinary(b []byte) error { 1471 var res StatusResponseIPAM 1472 if err := swag.ReadJSON(b, &res); err != nil { 1473 return err 1474 } 1475 *m = res 1476 return nil 1477 } 1478 1479 // StatusResponseKubernetes Status of Kubernetes integration 1480 // swagger:model StatusResponseKubernetes 1481 type StatusResponseKubernetes struct { 1482 1483 // k8s api versions 1484 K8sAPIVersions []string `json:"k8s-api-versions"` 1485 1486 // Human readable status/error/warning message 1487 Msg string `json:"msg,omitempty"` 1488 1489 // State the component is in 1490 // Enum: [Ok Warning Failure Disabled] 1491 State string `json:"state,omitempty"` 1492 } 1493 1494 // Validate validates this status response kubernetes 1495 func (m *StatusResponseKubernetes) Validate(formats strfmt.Registry) error { 1496 var res []error 1497 1498 if err := m.validateState(formats); err != nil { 1499 res = append(res, err) 1500 } 1501 1502 if len(res) > 0 { 1503 return errors.CompositeValidationError(res...) 1504 } 1505 return nil 1506 } 1507 1508 var statusResponseKubernetesTypeStatePropEnum []interface{} 1509 1510 func init() { 1511 var res []string 1512 if err := json.Unmarshal([]byte(`["Ok","Warning","Failure","Disabled"]`), &res); err != nil { 1513 panic(err) 1514 } 1515 for _, v := range res { 1516 statusResponseKubernetesTypeStatePropEnum = append(statusResponseKubernetesTypeStatePropEnum, v) 1517 } 1518 } 1519 1520 const ( 1521 1522 // StatusResponseKubernetesStateOk captures enum value "Ok" 1523 StatusResponseKubernetesStateOk string = "Ok" 1524 1525 // StatusResponseKubernetesStateWarning captures enum value "Warning" 1526 StatusResponseKubernetesStateWarning string = "Warning" 1527 1528 // StatusResponseKubernetesStateFailure captures enum value "Failure" 1529 StatusResponseKubernetesStateFailure string = "Failure" 1530 1531 // StatusResponseKubernetesStateDisabled captures enum value "Disabled" 1532 StatusResponseKubernetesStateDisabled string = "Disabled" 1533 ) 1534 1535 // prop value enum 1536 func (m *StatusResponseKubernetes) validateStateEnum(path, location string, value string) error { 1537 if err := validate.Enum(path, location, value, statusResponseKubernetesTypeStatePropEnum); err != nil { 1538 return err 1539 } 1540 return nil 1541 } 1542 1543 func (m *StatusResponseKubernetes) validateState(formats strfmt.Registry) error { 1544 1545 if swag.IsZero(m.State) { // not required 1546 return nil 1547 } 1548 1549 // value enum 1550 if err := m.validateStateEnum("kubernetes"+"."+"state", "body", m.State); err != nil { 1551 return err 1552 } 1553 1554 return nil 1555 } 1556 1557 // MarshalBinary interface implementation 1558 func (m *StatusResponseKubernetes) MarshalBinary() ([]byte, error) { 1559 if m == nil { 1560 return nil, nil 1561 } 1562 return swag.WriteJSON(m) 1563 } 1564 1565 // UnmarshalBinary interface implementation 1566 func (m *StatusResponseKubernetes) UnmarshalBinary(b []byte) error { 1567 var res StatusResponseKubernetes 1568 if err := swag.ReadJSON(b, &res); err != nil { 1569 return err 1570 } 1571 *m = res 1572 return nil 1573 } 1574 1575 // StatusResponseKvstore Status of an individual component 1576 // swagger:model StatusResponseKvstore 1577 type StatusResponseKvstore struct { 1578 1579 // Human readable status/error/warning message 1580 Msg string `json:"msg,omitempty"` 1581 1582 // State the component is in 1583 // Enum: [Ok Warning Failure Disabled] 1584 State string `json:"state,omitempty"` 1585 } 1586 1587 // Validate validates this status response kvstore 1588 func (m *StatusResponseKvstore) Validate(formats strfmt.Registry) error { 1589 var res []error 1590 1591 if err := m.validateState(formats); err != nil { 1592 res = append(res, err) 1593 } 1594 1595 if len(res) > 0 { 1596 return errors.CompositeValidationError(res...) 1597 } 1598 return nil 1599 } 1600 1601 var statusResponseKvstoreTypeStatePropEnum []interface{} 1602 1603 func init() { 1604 var res []string 1605 if err := json.Unmarshal([]byte(`["Ok","Warning","Failure","Disabled"]`), &res); err != nil { 1606 panic(err) 1607 } 1608 for _, v := range res { 1609 statusResponseKvstoreTypeStatePropEnum = append(statusResponseKvstoreTypeStatePropEnum, v) 1610 } 1611 } 1612 1613 const ( 1614 1615 // StatusResponseKvstoreStateOk captures enum value "Ok" 1616 StatusResponseKvstoreStateOk string = "Ok" 1617 1618 // StatusResponseKvstoreStateWarning captures enum value "Warning" 1619 StatusResponseKvstoreStateWarning string = "Warning" 1620 1621 // StatusResponseKvstoreStateFailure captures enum value "Failure" 1622 StatusResponseKvstoreStateFailure string = "Failure" 1623 1624 // StatusResponseKvstoreStateDisabled captures enum value "Disabled" 1625 StatusResponseKvstoreStateDisabled string = "Disabled" 1626 ) 1627 1628 // prop value enum 1629 func (m *StatusResponseKvstore) validateStateEnum(path, location string, value string) error { 1630 if err := validate.Enum(path, location, value, statusResponseKvstoreTypeStatePropEnum); err != nil { 1631 return err 1632 } 1633 return nil 1634 } 1635 1636 func (m *StatusResponseKvstore) validateState(formats strfmt.Registry) error { 1637 1638 if swag.IsZero(m.State) { // not required 1639 return nil 1640 } 1641 1642 // value enum 1643 if err := m.validateStateEnum("kvstore"+"."+"state", "body", m.State); err != nil { 1644 return err 1645 } 1646 1647 return nil 1648 } 1649 1650 // MarshalBinary interface implementation 1651 func (m *StatusResponseKvstore) MarshalBinary() ([]byte, error) { 1652 if m == nil { 1653 return nil, nil 1654 } 1655 return swag.WriteJSON(m) 1656 } 1657 1658 // UnmarshalBinary interface implementation 1659 func (m *StatusResponseKvstore) UnmarshalBinary(b []byte) error { 1660 var res StatusResponseKvstore 1661 if err := swag.ReadJSON(b, &res); err != nil { 1662 return err 1663 } 1664 *m = res 1665 return nil 1666 } 1667 1668 // StatusResponseNodeMonitor Status of the node monitor 1669 // swagger:model StatusResponseNodeMonitor 1670 type StatusResponseNodeMonitor struct { 1671 1672 // Number of CPUs to listen on for events. 1673 Cpus int64 `json:"cpus,omitempty"` 1674 1675 // Number of samples lost by perf. 1676 Lost int64 `json:"lost,omitempty"` 1677 1678 // Number of pages used for the perf ring buffer. 1679 Npages int64 `json:"npages,omitempty"` 1680 1681 // Pages size used for the perf ring buffer. 1682 Pagesize int64 `json:"pagesize,omitempty"` 1683 1684 // Number of unknown samples. 1685 Unknown int64 `json:"unknown,omitempty"` 1686 } 1687 1688 // Validate validates this status response node monitor 1689 func (m *StatusResponseNodeMonitor) Validate(formats strfmt.Registry) error { 1690 return nil 1691 } 1692 1693 // MarshalBinary interface implementation 1694 func (m *StatusResponseNodeMonitor) MarshalBinary() ([]byte, error) { 1695 if m == nil { 1696 return nil, nil 1697 } 1698 return swag.WriteJSON(m) 1699 } 1700 1701 // UnmarshalBinary interface implementation 1702 func (m *StatusResponseNodeMonitor) UnmarshalBinary(b []byte) error { 1703 var res StatusResponseNodeMonitor 1704 if err := swag.ReadJSON(b, &res); err != nil { 1705 return err 1706 } 1707 *m = res 1708 return nil 1709 } 1710 1711 // StatusResponseProxy Status of proxy 1712 // swagger:model StatusResponseProxy 1713 type StatusResponseProxy struct { 1714 1715 // IP address that the proxy listens on 1716 IP string `json:"ip,omitempty"` 1717 1718 // Port range used for proxying 1719 PortRange string `json:"port-range,omitempty"` 1720 } 1721 1722 // Validate validates this status response proxy 1723 func (m *StatusResponseProxy) Validate(formats strfmt.Registry) error { 1724 return nil 1725 } 1726 1727 // MarshalBinary interface implementation 1728 func (m *StatusResponseProxy) MarshalBinary() ([]byte, error) { 1729 if m == nil { 1730 return nil, nil 1731 } 1732 return swag.WriteJSON(m) 1733 } 1734 1735 // UnmarshalBinary interface implementation 1736 func (m *StatusResponseProxy) UnmarshalBinary(b []byte) error { 1737 var res StatusResponseProxy 1738 if err := swag.ReadJSON(b, &res); err != nil { 1739 return err 1740 } 1741 *m = res 1742 return nil 1743 }