2018-05-11 12:47:21 +00:00
|
|
|
export default function(type, count, obj) {
|
|
|
|
var key = '';
|
2018-10-19 15:17:02 +00:00
|
|
|
obj['CONSUL_ACLS_ENABLE'] = 1;
|
2018-05-11 12:47:21 +00:00
|
|
|
switch (type) {
|
|
|
|
case 'dc':
|
|
|
|
key = 'CONSUL_DATACENTER_COUNT';
|
|
|
|
break;
|
|
|
|
case 'service':
|
|
|
|
key = 'CONSUL_SERVICE_COUNT';
|
|
|
|
break;
|
|
|
|
case 'node':
|
2019-03-22 17:10:33 +00:00
|
|
|
case 'instance':
|
2018-05-11 12:47:21 +00:00
|
|
|
key = 'CONSUL_NODE_COUNT';
|
|
|
|
break;
|
|
|
|
case 'kv':
|
|
|
|
key = 'CONSUL_KV_COUNT';
|
|
|
|
break;
|
|
|
|
case 'acl':
|
|
|
|
key = 'CONSUL_ACL_COUNT';
|
2018-10-19 15:17:02 +00:00
|
|
|
obj['CONSUL_ACLS_ENABLE'] = 1;
|
2018-05-11 12:47:21 +00:00
|
|
|
break;
|
2018-06-19 14:25:56 +00:00
|
|
|
case 'session':
|
|
|
|
key = 'CONSUL_SESSION_COUNT';
|
|
|
|
break;
|
2018-06-15 11:47:12 +00:00
|
|
|
case 'intention':
|
|
|
|
key = 'CONSUL_INTENTION_COUNT';
|
|
|
|
break;
|
2018-10-19 15:17:02 +00:00
|
|
|
case 'policy':
|
|
|
|
key = 'CONSUL_POLICY_COUNT';
|
|
|
|
obj['CONSUL_ACLS_ENABLE'] = 1;
|
|
|
|
break;
|
2019-05-01 18:09:29 +00:00
|
|
|
case 'role':
|
|
|
|
key = 'CONSUL_ROLE_COUNT';
|
|
|
|
obj['CONSUL_ACLS_ENABLE'] = 1;
|
|
|
|
break;
|
2018-10-19 15:17:02 +00:00
|
|
|
case 'token':
|
|
|
|
key = 'CONSUL_TOKEN_COUNT';
|
|
|
|
obj['CONSUL_ACLS_ENABLE'] = 1;
|
|
|
|
break;
|
2018-05-11 12:47:21 +00:00
|
|
|
}
|
|
|
|
if (key) {
|
|
|
|
obj[key] = count;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
}
|