github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/builtin/providers/circonus/consts.go (about)

     1  package circonus
     2  
     3  const (
     4  	// Provider-level constants
     5  
     6  	// defaultAutoTag determines the default behavior of circonus.auto_tag.
     7  	defaultAutoTag = false
     8  
     9  	// When auto_tag is enabled, the default tag category and value will be set to
    10  	// the following value unless overriden.
    11  	defaultCirconusTag circonusTag = "author:terraform"
    12  
    13  	// When hashing a Set, default to a buffer this size
    14  	defaultHashBufSize = 512
    15  
    16  	providerAPIURLAttr  = "api_url"
    17  	providerAutoTagAttr = "auto_tag"
    18  	providerKeyAttr     = "key"
    19  
    20  	apiConsulCheckBlacklist    = "check_name_blacklist"
    21  	apiConsulDatacenterAttr    = "dc"
    22  	apiConsulNodeBlacklist     = "node_blacklist"
    23  	apiConsulServiceBlacklist  = "service_blacklist"
    24  	apiConsulStaleAttr         = "stale"
    25  	checkConsulTokenHeader     = `X-Consul-Token`
    26  	checkConsulV1NodePrefix    = "node"
    27  	checkConsulV1Prefix        = "/v1/health"
    28  	checkConsulV1ServicePrefix = "service"
    29  	checkConsulV1StatePrefix   = "state"
    30  	defaultCheckConsulHTTPAddr = "http://consul.service.consul"
    31  	defaultCheckConsulPort     = "8500"
    32  
    33  	defaultCheckJSONMethod  = "GET"
    34  	defaultCheckJSONPort    = "443"
    35  	defaultCheckJSONVersion = "1.1"
    36  
    37  	defaultCheckICMPPingAvailability = 100.0
    38  	defaultCheckICMPPingCount        = 5
    39  	defaultCheckICMPPingInterval     = "2s"
    40  
    41  	defaultCheckCAQLTarget = "q._caql"
    42  
    43  	defaultCheckHTTPCodeRegexp = `^200$`
    44  	defaultCheckHTTPMethod     = "GET"
    45  	defaultCheckHTTPVersion    = "1.1"
    46  
    47  	defaultCheckHTTPTrapAsync = false
    48  
    49  	defaultCheckCloudWatchVersion = "2010-08-01"
    50  
    51  	defaultCollectorDetailAttrs = 10
    52  
    53  	defaultGraphDatapoints = 8
    54  	defaultGraphLineStyle  = "stepped"
    55  	defaultGraphStyle      = "line"
    56  	defaultGraphFunction   = "gauge"
    57  
    58  	metricUnit       = ""
    59  	metricUnitRegexp = `^.*$`
    60  
    61  	defaultRuleSetLast       = "300s"
    62  	defaultRuleSetMetricType = "numeric"
    63  	defaultRuleSetRuleLen    = 4
    64  	defaultAlertSeverity     = 1
    65  	defaultRuleSetWindowFunc = "average"
    66  	ruleSetAbsentMin         = "70s"
    67  )
    68  
    69  // Consts and their close relative, Go pseudo-consts.
    70  
    71  // validMetricTypes: See `type`: https://login.circonus.com/resources/api/calls/check_bundle
    72  var validMetricTypes = validStringValues{
    73  	`caql`,
    74  	`composite`,
    75  	`histogram`,
    76  	`numeric`,
    77  	`text`,
    78  }
    79  
    80  // validAggregateFuncs: See `aggregate_function`: https://login.circonus.com/resources/api/calls/graph
    81  var validAggregateFuncs = validStringValues{
    82  	`none`,
    83  	`min`,
    84  	`max`,
    85  	`sum`,
    86  	`mean`,
    87  	`geometric_mean`,
    88  }
    89  
    90  // validGraphLineStyles: See `line_style`: https://login.circonus.com/resources/api/calls/graph
    91  var validGraphLineStyles = validStringValues{
    92  	`stepped`,
    93  	`interpolated`,
    94  }
    95  
    96  // validGraphStyles: See `style`: https://login.circonus.com/resources/api/calls/graph
    97  var validGraphStyles = validStringValues{
    98  	`area`,
    99  	`line`,
   100  }
   101  
   102  // validAxisAttrs: See `line_style`: https://login.circonus.com/resources/api/calls/graph
   103  var validAxisAttrs = validStringValues{
   104  	`left`,
   105  	`right`,
   106  }
   107  
   108  // validGraphFunctionValues: See `derive`: https://login.circonus.com/resources/api/calls/graph
   109  var validGraphFunctionValues = validStringValues{
   110  	`counter`,
   111  	`derive`,
   112  	`gauge`,
   113  }
   114  
   115  // validRuleSetWindowFuncs: See `derive` or `windowing_func`: https://login.circonus.com/resources/api/calls/rule_set
   116  var validRuleSetWindowFuncs = validStringValues{
   117  	`average`,
   118  	`stddev`,
   119  	`derive`,
   120  	`derive_stddev`,
   121  	`counter`,
   122  	`counter_stddev`,
   123  	`derive_2`,
   124  	`derive_2_stddev`,
   125  	`counter_2`,
   126  	`counter_2_stddev`,
   127  }
   128  
   129  const (
   130  	// Supported circonus_trigger.metric_types.  See `metric_type`:
   131  	// https://login.circonus.com/resources/api/calls/rule_set
   132  	ruleSetMetricTypeNumeric = "numeric"
   133  	ruleSetMetricTypeText    = "text"
   134  )
   135  
   136  // validRuleSetMetricTypes: See `metric_type`: https://login.circonus.com/resources/api/calls/rule_set
   137  var validRuleSetMetricTypes = validStringValues{
   138  	ruleSetMetricTypeNumeric,
   139  	ruleSetMetricTypeText,
   140  }