Line Protocol
influxdb.line_protocol
Define the line_protocol handler.
Functions
quote_ident(value)
Indent the quotes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str
|
the value to quote |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
the quoted identifier |
Source code in influxdb/line_protocol.py
71 72 73 74 75 76 77 78 79 80 81 | |
quote_literal(value)
Quote provided literal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str
|
the value to quote |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
the quoted literal |
Source code in influxdb/line_protocol.py
84 85 86 87 88 89 90 91 92 93 94 | |
make_line(measurement, tags=None, fields=None, time=None, precision=None)
Extract the actual point from a given measurement line.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
measurement
|
str
|
the measurement name |
required |
tags
|
dict
|
dictionary of tag key-value pairs |
None
|
fields
|
dict
|
dictionary of field key-value pairs |
None
|
time
|
the timestamp for the point |
None
|
|
precision
|
str
|
time precision (n, u, ms, s, m, h) |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
the line protocol representation of the point |
Source code in influxdb/line_protocol.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | |
make_lines(data, precision=None)
Extract points from given dict.
Extracts the points from the given dict and returns a Unicode string matching the line protocol introduced in InfluxDB 0.9.0.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict
|
dictionary containing 'points' key with list of point objects |
required |
precision
|
str
|
time precision (n, u, ms, s, m, h) |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
line protocol formatted string |
Source code in influxdb/line_protocol.py
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | |