Skip to content

Commit ae71b29

Browse files
committed
docs: how to write Dictionary-style object
1 parent 914dd59 commit ae71b29

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

examples/buckets_management.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,21 @@
44
with InfluxDBClient(url='http://localhost:8086', token='my-token', org='my-org') as client:
55
write_api = client.write_api(write_options=SYNCHRONOUS)
66

7-
write_api.write(bucket='my-bucket', record='h2o_feet,location=coyote_creek water_level=1.0 1')
7+
record = [
8+
{
9+
"measurement": "cpu_load_short",
10+
"tags": {
11+
"host": "server01",
12+
"region": "us-west"
13+
},
14+
"time": "2009-11-10T23:00:00Z",
15+
"fields": {
16+
"Float_value": 0.64,
17+
"Int_value": 3,
18+
"String_value": "Text",
19+
"Bool_value": True
20+
}
21+
}
22+
]
23+
24+
write_api.write(bucket='my-bucket', record=record)

0 commit comments

Comments
 (0)