Hello. I’m trying to create bucket in my task, use http.post() function.
I referred to this topic: How am I able to create and drop buckets in Tasks?
and use post function like this:
import "http"
import "json"
http.post(
url: "http://localhost:8086/api/v2/buckets",
headers: {
Authorization: "Token {my token}",
"Content-type": "application/json"
},
data: json.encode(v: {
"name": "TestBucket",
"orgID": {myOrg},
"retentionRules": [{
"everySeconds": 86400,
"shardGroupDurationSeconds": 0,
"type": "expire"
}],
"schemaType": "implicit"
}),
)
But influxdb returns error “failed to unmarshal json: id must have a length of 16 bytes”.
When I check InfluxDB 2.0 api document, “id” doesn’t need at bucket create request body.
What am I missing?