// SMARTFOXSERVER 2X ADMIN TOOL'S CLUSTER CONFIGURATOR MODULE
// Cluster configuration settings descriptor file
// 
// The "category" attribute indicates in which tab on the interface (if a TabNavigator is used) the parameter will be displayed. If missing a default category is used.

//-------------------------------------------
// ORCHESTRATION
//-------------------------------------------

// CUSTOM SCALE UP CONDITION CLASS NAME
{
	"name":"scaleUpConditionClass",
	"category":"Orchestration",
	"label":"Custom scale-up condition class name",
	"tooltip":"The fully qualified name of a custom class that triggers scale-up cluster events when needed (must extend the BaseScalingCondition class)",
	"type":"TextInput",
	"value":"{$BasicValue=clusterSettings.scaleUpConditionClass}",
	"attributes":
	{
		"pattern":"[a-zA-Z0-9._]+",
		"maxlength":250
	}
},

// CUSTOM SCALE DOWN CONDITION CLASS NAME
{
	"name":"scaleDownConditionClass",
	"category":"Orchestration",
	"label":"Custom scale-down condition class name",
	"tooltip":"The fully qualified name of a custom class that triggers scale-down cluster events when needed (must extend the BaseScalingCondition class)",
	"type":"TextInput",
	"value":"{$BasicValue=clusterSettings.scaleDownConditionClass}",
	"attributes":
	{
		"pattern":"[a-zA-Z0-9._]+",
		"maxlength":250
	}
},

// SCALE-UP PROPERTIES
{
	"name":"scaleUpProperties",
	"category":"Orchestration",
	"label":"Scale-up properties",
	"tooltip":"Parameters required by the internal conductor to configure the scale-up logic",
	"type":"DataGrid",
	"defaultListItem":
	[
		{
			"name":"name",
			"label":"Name",
			"tooltip":"Parameter's name",
			"type":"TextInput",
			"value":"",
			"validator":"notNull",
			"attributes":
			{
				"maxlength":100
			}
		},
		{
			"name":"value",
			"label":"Value",
			"tooltip":"Parameter's value",
			"type":"TextInput",
			"value":"",
			"attributes":
			{
				"maxlength":100
			}
		}
	],
	"listValues":{$List=scaleUpProperties, instance=clusterSettings, fields=name;value},
	"clazz":"com.smartfoxserver.cluster.config.ClusterSettings$NamedProperty",
	"immediate":true
},

// SCALE-DOWN PROPERTIES
{
	"name":"scaleDownProperties",
	"category":"Orchestration",
	"label":"Scale-down properties",
	"tooltip":"Parameters required by the internal conductor to configure the scale-down logic",
	"type":"DataGrid",
	"defaultListItem":
	[
		{
			"name":"name",
			"label":"Name",
			"tooltip":"Parameter's name",
			"type":"TextInput",
			"value":"",
			"validator":"notNull",
			"attributes":
			{
				"maxlength":100
			}
		},
		{
			"name":"value",
			"label":"Value",
			"tooltip":"Parameter's value",
			"type":"TextInput",
			"value":"",
			"attributes":
			{
				"maxlength":100
			}
		}
	],
	"listValues":{$List=scaleDownProperties, instance=clusterSettings, fields=name;value},
	"clazz":"com.smartfoxserver.cluster.config.ClusterSettings$NamedProperty",
	"immediate":true
},

// MIN NUMBER OF GAME NODES
{
	"name":"minGameNodes",
	"category":"Orchestration",
	"label":"Minimum # of Game Nodes",
	"tooltip":"Minimum number of Game Nodes that should still be available after a scale-down operation",
	"type":"NumericStepper",
	"value":{$BasicValue=clusterSettings.minGameNodes},
	"attributes":
	{
		"min":0
	},
	"immediate":true
},

// SCALE UP COOLDOWN TIME
{
	"name":"scaleUpCooldownSeconds",
	"category":"Orchestration",
	"label":"Scale-up cooldown time",
	"tooltip":"The number of seconds for the cooldown phase occurring between each scale-up event, while the new servers are being spun up",
	"type":"NumericStepper",
	"value":{$BasicValue=clusterSettings.scaleUpCooldownSeconds},
	"attributes":
	{
		"min":60
	},
	"immediate":true
},

// SCALE DOWN COOLDOWN TIME
{
	"name":"scaleDownCooldownSeconds",
	"category":"Orchestration",
	"label":"Scale-down cooldown time",
	"tooltip":"The number of seconds for the cooldown phase occurring between each scale-down event",
	"type":"NumericStepper",
	"value":{$BasicValue=clusterSettings.scaleDownCooldownSeconds},
	"attributes":
	{
		"min":60
	},
	"immediate":true
},

// INSTANCE RECYCLING TIME
{
	"name":"instanceRecyclingMinTime",
	"category":"Orchestration",
	"label":"Instance recycling minimum time",
	"tooltip":"Number of minutes during which an inactive game node can be recycled; after this time, an inactive game node can be terminated",
	"type":"NumericStepper",
	"value":{$BasicValue=clusterSettings.instanceRecyclingMinTime},
	"attributes":
	{
		"min":1
	},
	"immediate":true
},

// REMOTE EXTENSION DEPLOY TIMEOUT
{
	"name":"remoteExtensionDeployTimeout",
	"category":"Orchestration",
	"label":"Remote Extension deployment timeout",
	"tooltip":"Timeout (in seconds) after which the Extension deployment to game nodes (see Extension Deployer module) is aborted",
	"type":"NumericStepper",
	"value":{$BasicValue=clusterSettings.remoteExtensionDeployTimeout},
	"attributes":
	{
		"min":1
	}
},

//-------------------------------------------
// LOAD BALANCER
//-------------------------------------------

// CUSTOM LOAD BALANCER CLASS NAME
{
	"name":"loadBalancerClassName",
	"category":"Load Balancer",
	"label":"Custom load balancer class name",
	"tooltip":"The fully qualified name of a class that implements a custom load balancing logic",
	"type":"TextInput",
	"value":"{$BasicValue=clusterSettings.loadBalancerClassName}",
	"attributes":
	{
		"pattern":"[a-zA-Z0-9._]+",
		"maxlength":250
	}
},

// LOAD BALANCER PROPERTIES
{
	"name":"loadBalancerProperties",
	"category":"Load Balancer",
	"label":"Load Balancer properties",
	"tooltip":"Custom parameters for the selected Load Balancer",
	"type":"DataGrid",
	"defaultListItem":
	[
		{
			"name":"name",
			"label":"Name",
			"tooltip":"Parameter's name",
			"type":"TextInput",
			"value":"",
			"validator":"notNull",
			"attributes":
			{
				"maxlength":100
			}
		},
		{
			"name":"value",
			"label":"Value",
			"tooltip":"Parameter's value",
			"type":"TextInput",
			"value":"",
			"attributes":
			{
				"maxlength":100
			}
		}
	],
	"listValues":{$List=loadBalancerProperties, instance=clusterSettings, fields=name;value},
	"clazz":"com.smartfoxserver.cluster.config.ClusterSettings$NamedProperty",
	"immediate":true
},

// MAX GAME NODES CCU 
{
	"name":"maxGameNodesCCU",
	"category":"Load Balancer",
	"label":"Maximum # of users per Game Node",
	"tooltip":"Overrides the maximum number of users allowed in the 'Cluster' Zone on all Game Nodes; if set to 0, the value set in the Zone configuration is used (no override)",
	"type":"NumericStepper",
	"value":{$BasicValue=clusterSettings.maxGameNodesCCU},
	"attributes":
	{
		"min":0
	},
	"immediate":true
},

// HEALTH CHECK INTERVAL
{
	"name":"healthCheckInterval",
	"category":"Load Balancer",
	"label":"Health Check Interval",
	"tooltip":"Health check frequency in seconds (recommended 10-20 secs)",
	"type":"NumericStepper",
	"value":{$BasicValue=clusterSettings.healthCheckInterval},
	"attributes":
	{
		"min":10, "max":30
	}
},

// HEALTH CHECK MAX MILLIS
{
	"name":"healthCheckMaxMillis",
	"category":"Load Balancer",
	"label":"Health Check Max Time",
	"tooltip":"Max. time in milliseconds for a healty response (recommended = 50-200ms)",
	"type":"NumericStepper",
	"value":{$BasicValue=clusterSettings.healthCheckMaxMillis},
	"attributes":
	{
		"min":50, "max":400, "step":10
	}
},


// HEALTH CHECK SUCCESS COUNT
{
	"name":"healthCheckSuccessCount",
	"category":"Load Balancer",
	"label":"Health Success Count",
	"tooltip":"Number of consecutive successful health checks to consider the Node as 'healthy' (recommended = 2-3)",
	"type":"NumericStepper",
	"value":{$BasicValue=clusterSettings.healthCheckSuccessCount},
	"attributes":
	{
		"min":2, "max":10
	}
},

// HEALTH CHECK FAIL COUNT
{
	"name":"healthCheckFailCount",
	"category":"Load Balancer",
	"label":"Health Fail Count",
	"tooltip":"Number of consecutive failed health checks to consider the Node as 'unhealthy' (recommended = 2-3)",
	"type":"NumericStepper",
	"value":{$BasicValue=clusterSettings.healthCheckFailCount},
	"attributes":
	{
		"min":2, "max":10
	}
},

// HEALTH CHECK FAIL DEACTIVATION THRESHOLD
{
	"name":"healthCheckFailDeactivationThreshold",
	"category":"Load Balancer",
	"label":"Deactivation Threshold",
	"tooltip":"The amount of time a Node can spend in 'unhealthy' state before being deactivated",
	"type":"NumericStepper",
	"value":{$BasicValue=clusterSettings.healthCheckFailDeactivationThreshold},
	"attributes":
	{
		"min":30
	}
}
