adrianco / spigo

Simulate Protocol Interactions in Go
Apache License 2.0
1.12k stars 111 forks source link

Read and write configs to a file in json_arch. Remove omitempty from… #72

Closed jwatson0 closed 8 years ago

jwatson0 commented 8 years ago

Read and write configs to a file in json_arch. Remove omitempty from Configuration so that all options are written to the conf file.

This allows RegionNames, ZoneNames, and IPRanges to be overridden at run-time.

Config file name is json_arch/_conf.json, using the arch name from -a

Usage: $ ./spigo -saveconfig 2016/05/24 17:13:36 Saving config to json_arch/netflixoss_conf.json 2016/05/24 17:13:36 Loading architecture from json_arch/netflixoss_arch.json ... 2016/05/24 17:13:46 netflixoss.us-east-1.zoneB..eureka01...eureka.eureka: closing 2016/05/24 17:13:46 spigo: complete

$ ls -log jsonarch/netflixoss* -rw-r--r-- 1 1254 May 20 12:19 json_arch/netflixoss_arch.json -rw-r--r-- 1 1108 May 24 17:13 json_arch/netflixoss_conf.json

$ cat json_arch/netflixoss_conf.json { "arch": "netflixoss", "graphmlfile": "", "graphjsonfile": "", "neo4jurl": "", "runduration": 10000000000, "dunbar": 0, "population": 100, "msglog": false, "regions": 1, "regionnames": [ "us-east-1", "us-west-2", "eu-west-1", "eu-central-1", "ap-southeast-1", "ap-southeast-2" ], "ipranges": [ [ "54.198.", "54.221.", "50.19." ], [ "54.245.", "54.244.", "54.214." ], [ "54.247.", "54.246.", "54.288." ], [ "54.93.", "54.28.", "54.78." ], [ "54.251.", "54.254.", "54.255." ], [ "54.252.", "54.253.", "54.206." ] ], "zonenames": [ "zoneA", "zoneB", "zoneC" ], "collect": false, "stopstep": 0, "eurekapoll": "1s", "filter": false, "keyvals": "" }

adrianco commented 8 years ago

Thanks!