2017-02-06 23:53:01 +01:00
|
|
|
package consul
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
consulapi "github.com/hashicorp/consul/api"
|
|
|
|
"github.com/hashicorp/errwrap"
|
|
|
|
"github.com/hashicorp/terraform/helper/schema"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfACLDatacenter typeKey = iota
|
|
|
|
agentSelfACLDefaultPolicy
|
|
|
|
agentSelfACLDisableTTL
|
|
|
|
agentSelfACLDownPolicy
|
|
|
|
agentSelfACLEnforceVersion8
|
|
|
|
agentSelfACLTTL
|
|
|
|
agentSelfAddresses
|
|
|
|
agentSelfAdvertiseAddr
|
|
|
|
agentSelfAdvertiseAddrWAN
|
|
|
|
agentSelfAdvertiseAddrs
|
|
|
|
agentSelfAtlasJoin
|
|
|
|
agentSelfBindAddr
|
|
|
|
agentSelfBootstrap
|
|
|
|
agentSelfBootstrapExpect
|
|
|
|
agentSelfCAFile
|
|
|
|
agentSelfCertFile
|
|
|
|
agentSelfCheckDeregisterIntervalMin
|
|
|
|
agentSelfCheckDisableAnonymousSignature
|
|
|
|
agentSelfCheckDisableRemoteExec
|
|
|
|
agentSelfCheckReapInterval
|
|
|
|
agentSelfCheckUpdateInterval
|
|
|
|
agentSelfClientAddr
|
|
|
|
agentSelfDNSConfig
|
|
|
|
agentSelfDNSRecursors
|
|
|
|
agentSelfDataDir
|
|
|
|
agentSelfDatacenter
|
|
|
|
agentSelfDevMode
|
|
|
|
agentSelfDisableCoordinates
|
|
|
|
agentSelfDisableUpdateCheck
|
|
|
|
agentSelfDomain
|
|
|
|
agentSelfEnableDebug
|
|
|
|
agentSelfEnableSyslog
|
|
|
|
agentSelfEnableUI
|
|
|
|
agentSelfID
|
|
|
|
agentSelfKeyFile
|
|
|
|
agentSelfLeaveOnInt
|
|
|
|
agentSelfLeaveOnTerm
|
|
|
|
agentSelfLogLevel
|
|
|
|
agentSelfName
|
|
|
|
agentSelfPerformance
|
|
|
|
agentSelfPidFile
|
|
|
|
agentSelfPorts
|
|
|
|
agentSelfProtocol
|
|
|
|
agentSelfReconnectTimeoutLAN
|
|
|
|
agentSelfReconnectTimeoutWAN
|
|
|
|
agentSelfRejoinAfterLeave
|
|
|
|
agentSelfRetryJoin
|
|
|
|
agentSelfRetryJoinEC2
|
|
|
|
agentSelfRetryJoinGCE
|
|
|
|
agentSelfRetryJoinWAN
|
|
|
|
agentSelfRetryMaxAttempts
|
|
|
|
agentSelfRetryMaxAttemptsWAN
|
|
|
|
agentSelfRevision
|
|
|
|
agentSelfSerfLANBindAddr
|
|
|
|
agentSelfSerfWANBindAddr
|
|
|
|
agentSelfServer
|
|
|
|
agentSelfServerName
|
|
|
|
agentSelfSessionTTLMin
|
|
|
|
agentSelfStartJoin
|
|
|
|
agentSelfStartJoinWAN
|
|
|
|
agentSelfSyslogFacility
|
|
|
|
agentSelfTLSMinVersion
|
|
|
|
agentSelfTaggedAddresses
|
|
|
|
agentSelfTelemetry
|
|
|
|
agentSelfTranslateWANAddrs
|
|
|
|
agentSelfUIDir
|
|
|
|
agentSelfUnixSockets
|
|
|
|
agentSelfVerifyIncoming
|
|
|
|
agentSelfVerifyOutgoing
|
|
|
|
agentSelfVerifyServerHostname
|
|
|
|
agentSelfVersion
|
|
|
|
agentSelfVersionPrerelease
|
2017-02-06 23:53:01 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfDNSAllowStale typeKey = iota
|
|
|
|
agentSelfDNSMaxStale
|
|
|
|
agentSelfRecursorTimeout
|
|
|
|
agentSelfDNSDisableCompression
|
|
|
|
agentSelfDNSEnableTruncate
|
|
|
|
agentSelfDNSNodeTTL
|
|
|
|
agentSelfDNSOnlyPassing
|
|
|
|
agentSelfDNSUDPAnswerLimit
|
|
|
|
agentSelfServiceTTL
|
2017-02-06 23:53:01 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfPerformanceRaftMultiplier typeKey = iota
|
2017-02-06 23:53:01 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfPortsDNS typeKey = iota
|
|
|
|
agentSelfPortsHTTP
|
|
|
|
agentSelfPortsHTTPS
|
|
|
|
agentSelfPortsRPC
|
|
|
|
agentSelfPortsSerfLAN
|
|
|
|
agentSelfPortsSerfWAN
|
|
|
|
agentSelfPortsServer
|
2017-02-06 23:53:01 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfTaggedAddressesLAN typeKey = iota
|
|
|
|
agentSelfTaggedAddressesWAN
|
2017-02-06 23:53:01 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfTelemetryCirconusAPIApp typeKey = iota
|
|
|
|
agentSelfTelemetryCirconusAPIURL
|
|
|
|
agentSelfTelemetryCirconusBrokerID
|
|
|
|
agentSelfTelemetryCirconusBrokerSelectTag
|
|
|
|
agentSelfTelemetryCirconusCheckDisplayName
|
|
|
|
agentSelfTelemetryCirconusCheckForceMetricActiation
|
|
|
|
agentSelfTelemetryCirconusCheckID
|
|
|
|
agentSelfTelemetryCirconusCheckInstanceID
|
|
|
|
agentSelfTelemetryCirconusCheckSearchTag
|
|
|
|
agentSelfTelemetryCirconusCheckSubmissionURL
|
|
|
|
agentSelfTelemetryCirconusCheckTags
|
|
|
|
agentSelfTelemetryCirconusSubmissionInterval
|
|
|
|
agentSelfTelemetryDisableHostname
|
|
|
|
agentSelfTelemetryDogStatsdAddr
|
|
|
|
agentSelfTelemetryDogStatsdTags
|
|
|
|
agentSelfTelemetryStatsdAddr
|
|
|
|
agentSelfTelemetryStatsiteAddr
|
|
|
|
agentSelfTelemetryStatsitePrefix
|
2017-02-06 23:53:01 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
// Schema for consul's /v1/agent/self endpoint
|
2017-02-10 02:23:37 +01:00
|
|
|
var agentSelfMap = map[typeKey]*typeEntry{
|
|
|
|
agentSelfACLDatacenter: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "ACLDatacenter",
|
|
|
|
SchemaName: "acl_datacenter",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfACLDefaultPolicy: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "ACLDefaultPolicy",
|
|
|
|
SchemaName: "acl_default_policy",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfACLDisableTTL: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "ACLDisabledTTL",
|
|
|
|
SchemaName: "acl_disable_ttl",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeFloat,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfACLDownPolicy: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "ACLDownPolicy",
|
|
|
|
SchemaName: "acl_down_policy",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfACLEnforceVersion8: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "ACLEnforceVersion8",
|
|
|
|
SchemaName: "acl_enforce_version_8",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfACLTTL: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "ACLTTL",
|
|
|
|
SchemaName: "acl_ttl",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeFloat,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfAddresses: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "Addresses",
|
|
|
|
SchemaName: "addresses",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeMap,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfAdvertiseAddr: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "AdvertiseAddr",
|
|
|
|
SchemaName: "advertise_addr",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfAdvertiseAddrs: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "AdvertiseAddrs",
|
|
|
|
SchemaName: "advertise_addrs",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeMap,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfAdvertiseAddrWAN: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "AdvertiseAddrWan",
|
|
|
|
SchemaName: "advertise_addr_wan",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
|
|
|
// Omitting the following since they've been depreciated:
|
|
|
|
//
|
|
|
|
// "AtlasInfrastructure": "",
|
|
|
|
// "AtlasEndpoint": "",
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfAtlasJoin: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "AtlasJoin",
|
|
|
|
SchemaName: "atlas_join",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfBindAddr: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "BindAddr",
|
|
|
|
SchemaName: "bind_addr",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfBootstrap: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "Bootstrap",
|
|
|
|
SchemaName: "bootstrap",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfBootstrapExpect: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "BootstrapExpect",
|
|
|
|
SchemaName: "bootstrap_expect",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeFloat,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfCAFile: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "CAFile",
|
|
|
|
SchemaName: "ca_file",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfCertFile: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "CertFile",
|
|
|
|
SchemaName: "cert_file",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfCheckDeregisterIntervalMin: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "CheckDeregisterIntervalMin",
|
|
|
|
SchemaName: "check_deregister_interval_min",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeFloat,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfCheckDisableAnonymousSignature: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "DisableAnonymousSignature",
|
|
|
|
SchemaName: "disable_anonymous_signature",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfCheckDisableRemoteExec: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "DisableRemoteExec",
|
|
|
|
SchemaName: "disable_remote_exec",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfCheckReapInterval: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "CheckReapInterval",
|
|
|
|
SchemaName: "check_reap_interval",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeFloat,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfCheckUpdateInterval: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "CheckUpdateInterval",
|
|
|
|
SchemaName: "check_update_interval",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeFloat,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfClientAddr: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "ClientAddr",
|
|
|
|
SchemaName: "client_addr",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfDNSConfig: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "DNSConfig",
|
|
|
|
SchemaName: "dns_config",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeMap,
|
2017-02-10 02:23:37 +01:00
|
|
|
SetMembers: map[typeKey]*typeEntry{
|
|
|
|
agentSelfDNSAllowStale: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "AllowStale",
|
|
|
|
SchemaName: "allow_stale",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfDNSDisableCompression: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "DisableCompression",
|
|
|
|
SchemaName: "disable_compression",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfDNSEnableTruncate: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "EnableTruncate",
|
|
|
|
SchemaName: "enable_truncate",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfDNSMaxStale: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "MaxStale",
|
|
|
|
SchemaName: "max_stale",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeFloat,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfDNSNodeTTL: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "NodeTTL",
|
|
|
|
SchemaName: "node_ttl",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeFloat,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfDNSOnlyPassing: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "OnlyPassing",
|
|
|
|
SchemaName: "only_passing",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfRecursorTimeout: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "RecursorTimeout",
|
|
|
|
SchemaName: "recursor_timeout",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeFloat,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfServiceTTL: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "ServiceTTL",
|
|
|
|
SchemaName: "service_ttl",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeFloat,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfDNSUDPAnswerLimit: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "UDPAnswerLimit",
|
|
|
|
SchemaName: "udp_answer_limit",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeFloat,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfDataDir: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "DataDir",
|
|
|
|
SchemaName: "data_dir",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfDatacenter: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "Datacenter",
|
|
|
|
SchemaName: "datacenter",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfDevMode: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "DevMode",
|
|
|
|
SchemaName: "dev_mode",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfDisableCoordinates: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "DisableCoordinates",
|
|
|
|
SchemaName: "coordinates",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfDisableUpdateCheck: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "DisableUpdateCheck",
|
|
|
|
SchemaName: "update_check",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfDNSRecursors: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "DNSRecursors",
|
2017-02-10 02:23:37 +01:00
|
|
|
APIAliases: []apiAttr{"DNSRecursor"},
|
2017-02-06 23:53:01 +01:00
|
|
|
SchemaName: "dns_recursors",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeList,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfDomain: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "Domain",
|
|
|
|
SchemaName: "domain",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfEnableDebug: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "EnableDebug",
|
|
|
|
SchemaName: "debug",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfEnableSyslog: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "EnableSyslog",
|
|
|
|
SchemaName: "syslog",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfEnableUI: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "EnableUi",
|
|
|
|
SchemaName: "ui",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
},
|
|
|
|
// "HTTPAPIResponseHeaders": nil,
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfID: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "NodeID",
|
|
|
|
SchemaName: "id",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
ValidateFuncs: []interface{}{
|
2017-02-10 02:23:37 +01:00
|
|
|
validateRegexp(`(?i)^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$`),
|
2017-02-06 23:53:01 +01:00
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
APITest: apiTestID,
|
|
|
|
APIToState: apiToStateID,
|
2017-02-06 23:53:01 +01:00
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfKeyFile: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "KeyFile",
|
|
|
|
SchemaName: "key_file",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfLeaveOnInt: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "SkipLeaveOnInt",
|
|
|
|
SchemaName: "leave_on_int",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeBool,
|
2017-02-10 02:23:37 +01:00
|
|
|
APITest: apiTestBool,
|
|
|
|
APIToState: negateBoolToState(apiToStateBool),
|
2017-02-06 23:53:01 +01:00
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfLeaveOnTerm: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "LeaveOnTerm",
|
|
|
|
SchemaName: "leave_on_term",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfLogLevel: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "LogLevel",
|
|
|
|
SchemaName: "log_level",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfName: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "NodeName",
|
|
|
|
SchemaName: "name",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfPerformance: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "Performance",
|
|
|
|
SchemaName: "performance",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeMap,
|
2017-02-10 02:23:37 +01:00
|
|
|
SetMembers: map[typeKey]*typeEntry{
|
|
|
|
agentSelfPerformanceRaftMultiplier: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "RaftMultiplier",
|
|
|
|
SchemaName: "raft_multiplier",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeFloat,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfPidFile: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "PidFile",
|
|
|
|
SchemaName: "pid_file",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfPorts: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "Ports",
|
|
|
|
SchemaName: "ports",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeMap,
|
2017-02-10 02:23:37 +01:00
|
|
|
SetMembers: map[typeKey]*typeEntry{
|
|
|
|
agentSelfPortsDNS: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "DNS",
|
|
|
|
SchemaName: "dns",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeFloat,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfPortsHTTP: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "HTTP",
|
|
|
|
SchemaName: "http",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeFloat,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfPortsHTTPS: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "HTTPS",
|
|
|
|
SchemaName: "https",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeFloat,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfPortsRPC: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "RPC",
|
|
|
|
SchemaName: "rpc",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeFloat,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfPortsSerfLAN: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "SerfLan",
|
|
|
|
SchemaName: "serf_lan",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeFloat,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfPortsSerfWAN: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "SerfWan",
|
|
|
|
SchemaName: "serf_wan",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeFloat,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfPortsServer: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "Server",
|
|
|
|
SchemaName: "server",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeFloat,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfProtocol: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "Protocol",
|
|
|
|
SchemaName: "protocol",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeFloat,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfReconnectTimeoutLAN: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "ReconnectTimeoutLan",
|
|
|
|
SchemaName: "reconnect_timeout_lan",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeFloat,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfReconnectTimeoutWAN: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "ReconnectTimeoutWan",
|
|
|
|
SchemaName: "reconnect_timeout_wan",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeFloat,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfRejoinAfterLeave: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "RejoinAfterLeave",
|
|
|
|
SchemaName: "rejoin_after_leave",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
},
|
|
|
|
// "RetryIntervalWanRaw": "",
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfRetryJoin: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "RetryJoin",
|
|
|
|
SchemaName: "retry_join",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeList,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfRetryJoinWAN: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "RetryJoinWan",
|
|
|
|
SchemaName: "retry_join_wan",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeList,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfRetryMaxAttempts: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "RetryMaxAttempts",
|
|
|
|
SchemaName: "retry_max_attempts",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeFloat,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfRetryMaxAttemptsWAN: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "RetryMaxAttemptsWan",
|
|
|
|
SchemaName: "retry_max_attempts_wan",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeFloat,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfRetryJoinEC2: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "RetryJoinEC2",
|
|
|
|
SchemaName: "retry_join_ec2",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeMap,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfRetryJoinGCE: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "RetryJoinGCE",
|
|
|
|
SchemaName: "retry_join_GCE",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeMap,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfRevision: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "Revision",
|
|
|
|
SchemaName: "revision",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfSerfLANBindAddr: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "SerfLanBindAddr",
|
|
|
|
SchemaName: "serf_lan_bind_addr",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfSerfWANBindAddr: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "SerfWanBindAddr",
|
|
|
|
SchemaName: "serf_wan_bind_addr",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfServer: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "Server",
|
|
|
|
SchemaName: "server",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfServerName: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "ServerName",
|
|
|
|
SchemaName: "server_name",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfSessionTTLMin: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "SessionTTLMin",
|
|
|
|
SchemaName: "session_ttl_min",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeFloat,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfStartJoin: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "StartJoin",
|
|
|
|
SchemaName: "start_join",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeList,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfStartJoinWAN: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "StartJoinWan",
|
|
|
|
SchemaName: "start_join_wan",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeList,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfSyslogFacility: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "SyslogFacility",
|
|
|
|
SchemaName: "syslog_facility",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfTaggedAddresses: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "TaggedAddresses",
|
|
|
|
SchemaName: "tagged_addresses",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeMap,
|
2017-02-10 02:23:37 +01:00
|
|
|
SetMembers: map[typeKey]*typeEntry{
|
|
|
|
agentSelfTaggedAddressesLAN: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "LAN",
|
|
|
|
SchemaName: "lan",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfTaggedAddressesWAN: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "WAN",
|
|
|
|
SchemaName: "wan",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfTelemetry: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "Telemetry",
|
|
|
|
SchemaName: "telemetry",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeMap,
|
2017-02-10 02:23:37 +01:00
|
|
|
SetMembers: map[typeKey]*typeEntry{
|
|
|
|
agentSelfTelemetryCirconusAPIApp: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "CirconusAPIApp",
|
|
|
|
SchemaName: "circonus_api_app",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfTelemetryCirconusAPIURL: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "CirconusAPIURL",
|
|
|
|
SchemaName: "circonus_api_url",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfTelemetryCirconusBrokerID: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "CirconusBrokerID",
|
|
|
|
SchemaName: "circonus_broker_id",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfTelemetryCirconusBrokerSelectTag: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "CirconusBrokerSelectTag",
|
|
|
|
SchemaName: "circonus_broker_select_tag",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfTelemetryCirconusCheckDisplayName: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "CirconusCheckDisplayName",
|
|
|
|
SchemaName: "circonus_check_display_name",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfTelemetryCirconusCheckForceMetricActiation: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "CirconusCheckForceMetricActivation",
|
|
|
|
SchemaName: "circonus_check_force_metric_activation",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfTelemetryCirconusCheckID: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "CirconusCheckID",
|
|
|
|
SchemaName: "circonus_check_id",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfTelemetryCirconusCheckInstanceID: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "CirconusCheckInstanceID",
|
|
|
|
SchemaName: "circonus_check_instance_id",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfTelemetryCirconusCheckSearchTag: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "CirconusCheckSearchTag",
|
|
|
|
SchemaName: "circonus_check_search_tag",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfTelemetryCirconusCheckSubmissionURL: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "CirconusCheckSubmissionURL",
|
|
|
|
SchemaName: "circonus_check_submission_url",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfTelemetryCirconusCheckTags: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "CirconusCheckTags",
|
|
|
|
SchemaName: "circonus_check_tags",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfTelemetryCirconusSubmissionInterval: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "CirconusSubmissionInterval",
|
|
|
|
SchemaName: "circonus_submission_interval",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfTelemetryDisableHostname: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "DisableHostname",
|
|
|
|
SchemaName: "disable_hostname",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfTelemetryDogStatsdAddr: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "DogStatsdAddr",
|
|
|
|
SchemaName: "dog_statsd_addr",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfTelemetryDogStatsdTags: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "DogStatsdTags",
|
|
|
|
SchemaName: "dog_statsd_tags",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfTelemetryStatsdAddr: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "StatsdTags",
|
|
|
|
SchemaName: "statsd_tags",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfTelemetryStatsiteAddr: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "StatsiteAddr",
|
|
|
|
SchemaName: "statsite_addr",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfTelemetryStatsitePrefix: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "StatsitePrefix",
|
|
|
|
SchemaName: "statsite_prefix",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfTLSMinVersion: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "TLSMinVersion",
|
|
|
|
SchemaName: "tls_min_version",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfTranslateWANAddrs: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "TranslateWanAddrs",
|
|
|
|
SchemaName: "translate_wan_addrs",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfUIDir: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "UiDir",
|
|
|
|
SchemaName: "ui_dir",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfUnixSockets: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "UnixSockets",
|
|
|
|
SchemaName: "unix_sockets",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeMap,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfVerifyIncoming: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "VerifyIncoming",
|
|
|
|
SchemaName: "verify_incoming",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfVerifyServerHostname: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "VerifyServerHostname",
|
|
|
|
SchemaName: "verify_server_hostname",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfVerifyOutgoing: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "VerifyOutgoing",
|
|
|
|
SchemaName: "verify_outgoing",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeBool,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfVersion: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "Version",
|
|
|
|
SchemaName: "version",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
2017-02-10 02:23:37 +01:00
|
|
|
agentSelfVersionPrerelease: {
|
2017-02-06 23:53:01 +01:00
|
|
|
APIName: "VersionPrerelease",
|
|
|
|
SchemaName: "version_prerelease",
|
2017-02-10 02:23:37 +01:00
|
|
|
Source: sourceAPIResult,
|
2017-02-06 23:53:01 +01:00
|
|
|
Type: schema.TypeString,
|
|
|
|
},
|
|
|
|
// "Watches": nil,
|
|
|
|
}
|
|
|
|
|
|
|
|
func dataSourceConsulAgentSelf() *schema.Resource {
|
|
|
|
return &schema.Resource{
|
|
|
|
Read: dataSourceConsulAgentSelfRead,
|
2017-02-10 02:23:37 +01:00
|
|
|
Schema: typeEntryMapToSchema(agentSelfMap),
|
2017-02-06 23:53:01 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func dataSourceConsulAgentSelfRead(d *schema.ResourceData, meta interface{}) error {
|
|
|
|
client := meta.(*consulapi.Client)
|
|
|
|
info, err := client.Agent().Self()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2017-02-10 02:23:37 +01:00
|
|
|
const apiAgentConfig = "Config"
|
|
|
|
cfg, ok := info[apiAgentConfig]
|
2017-02-06 23:53:01 +01:00
|
|
|
if !ok {
|
2017-02-10 02:23:37 +01:00
|
|
|
return fmt.Errorf("No %s info available within provider's agent/self endpoint", apiAgentConfig)
|
2017-02-06 23:53:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// TODO(sean@): It'd be nice if this data source had a way of filtering out
|
|
|
|
// irrelevant data so only the important bits are persisted in the state file.
|
|
|
|
// Something like an attribute mask or even a regexp of matching schema names
|
|
|
|
// would be sufficient in the most basic case. Food for thought.
|
2017-02-10 02:23:37 +01:00
|
|
|
dataSourceWriter := newStateWriter(d)
|
2017-02-06 23:53:01 +01:00
|
|
|
|
2017-02-10 02:23:37 +01:00
|
|
|
for k, e := range agentSelfMap {
|
2017-02-06 23:53:01 +01:00
|
|
|
apiTest := e.APITest
|
|
|
|
if apiTest == nil {
|
|
|
|
apiTest = e.LookupDefaultTypeHandler().APITest
|
|
|
|
}
|
|
|
|
if apiTest == nil {
|
|
|
|
panic(fmt.Sprintf("PROVIDER BUG: %v missing APITest method", k))
|
|
|
|
}
|
|
|
|
|
|
|
|
apiToState := e.APIToState
|
|
|
|
if apiToState == nil {
|
|
|
|
apiToState = e.LookupDefaultTypeHandler().APIToState
|
|
|
|
}
|
|
|
|
if apiToState == nil {
|
|
|
|
panic(fmt.Sprintf("PROVIDER BUG: %v missing APIToState method", k))
|
|
|
|
}
|
|
|
|
|
|
|
|
if v, ok := apiTest(e, cfg); ok {
|
|
|
|
if err := apiToState(e, v, dataSourceWriter); err != nil {
|
|
|
|
return errwrap.Wrapf(fmt.Sprintf("error writing %q's data to state: {{err}}", e.SchemaName), err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|