{
  "description": "Rebalance is the Schema for the rebalances API.",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": [
        "string",
        "null"
      ]
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": [
        "string",
        "null"
      ]
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ]
    },
    "spec": {
      "additionalProperties": false,
      "properties": {
        "instanceName": {
          "description": "InstanceName represents the name of EMQX CR.",
          "type": "string"
        },
        "rebalanceStrategy": {
          "additionalProperties": false,
          "description": "RebalanceStrategy represents the strategy of EMQX rebalancing\nMore info: https://docs.emqx.com/en/emqx/v5.10/deploy/cluster/rebalancing.html#rebalancing",
          "properties": {
            "absConnThreshold": {
              "default": 1000,
              "description": "Represents the absolute threshold for checking connection balance.\nSame as `abs-conn-threshold` in [EMQX Rebalancing](https://docs.emqx.com/en/emqx/v5.10/deploy/cluster/rebalancing.html#rebalancing).",
              "format": "int32",
              "minimum": 1,
              "type": [
                "integer",
                "null"
              ]
            },
            "absSessThreshold": {
              "default": 1000,
              "description": "Represents the absolute threshold for checking session connection balance.\nSame as `abs-sess-threshold` in [EMQX Rebalancing](https://docs.emqx.com/en/emqx/v5.10/deploy/cluster/rebalancing.html#rebalancing)",
              "format": "int32",
              "minimum": 1,
              "type": [
                "integer",
                "null"
              ]
            },
            "connEvictRate": {
              "description": "Represents the source node client disconnect rate per second.\nSame as `conn-evict-rate` in [EMQX Rebalancing](https://docs.emqx.com/en/emqx/v5.10/deploy/cluster/rebalancing.html#rebalancing).",
              "format": "int32",
              "minimum": 1,
              "type": "integer"
            },
            "relConnThreshold": {
              "default": "1.1",
              "description": "Represents the relative threshold for checkin connection balance.\nSame as `rel-conn-threshold` in [EMQX Rebalancing](https://docs.emqx.com/en/emqx/v5.10/deploy/cluster/rebalancing.html#rebalancing).\nUsing floats is highly [discouraged](https://github.com/kubernetes-sigs/controller-tools/issues/245), defined as a _string_ instead.\nMust be greater than 1.0.",
              "pattern": "^[1-9]{1,8}\\.[0-9]{1,8}$",
              "type": [
                "string",
                "null"
              ]
            },
            "relSessThreshold": {
              "default": "1.1",
              "description": "Represents the relative threshold for checking session connection balance.\nSame as `rel-sess-threshold` in [EMQX Rebalancing](https://docs.emqx.com/en/emqx/v5.10/deploy/cluster/rebalancing.html#rebalancing).\nUsing floats is highly [discouraged](https://github.com/kubernetes-sigs/controller-tools/issues/245), defined as a _string_ instead.\nMust be greater than 1.0.",
              "pattern": "^[1-9]{1,8}\\.[0-9]{1,8}$",
              "type": [
                "string",
                "null"
              ]
            },
            "sessEvictRate": {
              "default": 500,
              "description": "Represents the source node session evacuation rate per second.\nSame as `sess-evict-rate` in [EMQX Rebalancing](https://docs.emqx.com/en/emqx/v5.10/deploy/cluster/rebalancing.html#rebalancing).",
              "format": "int32",
              "minimum": 1,
              "type": [
                "integer",
                "null"
              ]
            },
            "waitHealthCheck": {
              "default": 60,
              "description": "Represents the time (in seconds) to wait for the LB to remove the source node from the list of active backend nodes.\nAfter the specified waiting time is exceeded, the rebalancing task will start.\nSame as `wait-health-check` in [EMQX Rebalancing](https://docs.emqx.com/en/emqx/v5.10/deploy/cluster/rebalancing.html#rebalancing).",
              "format": "int32",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            },
            "waitTakeover": {
              "default": 60,
              "description": "Represents the time in seconds to wait for a client to\nreconnect to take over the session after all connections are disconnected.\nSame as `wait-takeover` in [EMQX Rebalancing](https://docs.emqx.com/en/emqx/v5.10/deploy/cluster/rebalancing.html#rebalancing).",
              "format": "int32",
              "minimum": 0,
              "type": [
                "integer",
                "null"
              ]
            }
          },
          "required": [
            "connEvictRate"
          ],
          "type": "object"
        }
      },
      "required": [
        "instanceName",
        "rebalanceStrategy"
      ],
      "type": [
        "object",
        "null"
      ]
    },
    "status": {
      "additionalProperties": false,
      "properties": {
        "completedTime": {
          "description": "CompletedTime Represents the time when the rebalance job was completed.",
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        },
        "conditions": {
          "description": "The latest available observations of an object's current state.\nWhen Rebalance fails, the condition will have type \"Failed\" and status false.\nWhen Rebalance is in processing, the condition will have a type \"Processing\" and status true.\nWhen Rebalance is completed, the condition will have a type \"Complete\" and status true.",
          "items": {
            "additionalProperties": false,
            "properties": {
              "lastTransitionTime": {
                "description": "Last time the condition transitioned from one status to another.",
                "format": "date-time",
                "type": [
                  "string",
                  "null"
                ]
              },
              "lastUpdateTime": {
                "description": "The last time this condition was updated.",
                "format": "date-time",
                "type": [
                  "string",
                  "null"
                ]
              },
              "message": {
                "description": "A human readable message indicating details about the transition.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "reason": {
                "description": "The reason for the condition's last transition.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "status": {
                "description": "Status of the condition, one of True, False, Unknown.",
                "type": "string"
              },
              "type": {
                "description": "Status of rebalance condition type. one of Processing, Complete, Failed.",
                "type": "string"
              }
            },
            "required": [
              "status",
              "type"
            ],
            "type": "object"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "phase": {
          "description": "Phase represents the phase of Rebalance.",
          "type": [
            "string",
            "null"
          ]
        },
        "rebalanceStates": {
          "items": {
            "additionalProperties": false,
            "description": "Rebalance defines the observed Rebalancing state of EMQX",
            "properties": {
              "connection_eviction_rate": {
                "description": "ConnectionEvictionRate represents the node session evacuation rate per second.",
                "format": "int32",
                "type": [
                  "integer",
                  "null"
                ]
              },
              "coordinator_node": {
                "description": "CoordinatorNode represents the node currently undergoing rebalancing.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "donors": {
                "description": "Donors represent the source nodes for rebalancing.",
                "items": {
                  "type": "string"
                },
                "type": [
                  "array",
                  "null"
                ]
              },
              "node": {
                "description": "Which node this rebalancing state belongs to.\nSee `v2beta1.EMQXNode.Node`.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "recipients": {
                "description": "Recipients represent the target node for rebalancing.",
                "items": {
                  "type": "string"
                },
                "type": [
                  "array",
                  "null"
                ]
              },
              "session_eviction_rate": {
                "description": "SessionEvictionRate represents the node session evacuation rate per second.",
                "format": "int32",
                "type": [
                  "integer",
                  "null"
                ]
              },
              "state": {
                "description": "State of the rebalancing.",
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "type": "object"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "startedTime": {
          "description": "StartedTime Represents the time when rebalance job start.",
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": [
        "object",
        "null"
      ]
    }
  },
  "type": "object"
}