agent: Omit certains keys from the /self endpoint

This commit is contained in:
Armon Dadgar 2014-05-29 11:24:37 -07:00
parent acc048036b
commit 753cec4cfa
2 changed files with 6 additions and 11 deletions

View File

@ -54,7 +54,7 @@ type Config struct {
Domain string `mapstructure:"domain"`
// Encryption key to use for the Serf communication
EncryptKey string `mapstructure:"encrypt"`
EncryptKey string `mapstructure:"encrypt" json:"-"`
// LogLevel is the level of the logs to putout
LogLevel string `mapstructure:"log_level"`
@ -144,16 +144,16 @@ type Config struct {
// AEInterval controls the anti-entropy interval. This is how often
// the agent attempts to reconcile it's local state with the server'
// representation of our state. Defaults to every 60s.
AEInterval time.Duration `mapstructure:"-"`
AEInterval time.Duration `mapstructure:"-" json:"-"`
// Checks holds the provided check definitions
Checks []*CheckDefinition `mapstructure:"-"`
Checks []*CheckDefinition `mapstructure:"-" json:"-"`
// Services holds the provided service definitions
Services []*ServiceDefinition `mapstructure:"-"`
Services []*ServiceDefinition `mapstructure:"-" json:"-"`
// ConsulConfig can either be provided or a default one created
ConsulConfig *consul.Config `mapstructure:"-"`
ConsulConfig *consul.Config `mapstructure:"-" json:"-"`
}
type dirEnts []os.FileInfo

View File

@ -305,7 +305,6 @@ It returns a JSON body like this:
"DataDir": "/tmp/consul",
"DNSRecursor": "",
"Domain": "consul.",
"EncryptKey": "",
"LogLevel": "INFO",
"NodeName": "foobar",
"ClientAddr": "127.0.0.1",
@ -333,11 +332,7 @@ It returns a JSON body like this:
"UiDir": "",
"PidFile": "",
"EnableSyslog": false,
"RejoinAfterLeave": false,
"AEInterval": 60000000000,
"Checks": null,
"Services": null,
"ConsulConfig": null
"RejoinAfterLeave": false
},
"Member": {
"Name": "foobar",