Post API help to drop measurements

We’re using Influx 1.2.2 (haven’t been able to go to 1.3 due to some compatibility issues with other apps).

I need to drop some measurements using the http API. One measurement, for instance, is “Cal_Eye.Device.S1.Press”

If I do this like:
"http://host:8086/write?u=username&p=password&db=mydb&q=DROP MEASUREMENT “Cal_Eye.Device.S1.Press”

It gives an error about a post request but still says it dropped the measurement.

But then when I use show measurements to see the measurement it’s still listed. And when I try to query from it, there are no data points.

What am I doing wrong? And is there a correct way to use POST to do this? I can’t find anything in the help.

Have you tried making a POST request with the requisite fields? What language are you working with? In Python you might do something like:

requests.post('http://localhost:8086/query', 
              data={'db': 'kcam',
                    'q': 'drop measurement “Cal_Eye.Device.S1.Press”'})

Or using curl:

curl http://localhost:8086/query \
  -d db=kcam \
  -d q='drop measurement "Cal_Eye.Device.S1.Press"'

I’m trying but I keep getting 400 errors. I’m just posting the raw bytes of these strings through C#
"db=raw&q=drop measurement \"Cal_Eye.Device.S1.Press\""
"db=raw&q='drop measurement \"Cal_Eye.Device.S1.Press\"'"

Is this supposed to be multipart? I can’t find anything about the post API on the Influx site. If you go to the query section it just shows the get API. The only thing I can find about post on there is writing data, which is a completely different format.

There are several curl examples using POST in the documentation. Using those examples and the --trace-ascii flag to curl, you can see that the POST request has content-type application/x-www-form-urlencoded. E.g., for the “drop measurement” command, the request looks like:

POST /query HTTP/1.1
Host: localhost:8086
Authorization: Basic cm9vdDpyb290
User-Agent: curl/7.52.1
Accept: */*
Content-Length: 52
Content-Type: application/x-www-form-urlencoded

db=mydb&q=drop measurement "Cal_Eye.Device.S1.Press"

If you’re making the same request and getting back a 400 error, the first place to look would be in the influxdb server logs to see if there was anything useful.

Thanks, I figured it out - I wasn’t setting the content type in the post request. I fixed that and it went through without the 400 error. I got the following response:
{"results":[{"statement_id":0}]}

But there still seems to be a bug - despite the fact that it was deleted, the measurement still shows up when I run “SHOW MEASUREMENTS”

And when I try to delete it again, it confirms that the measurement doesn’t exist:
{"results": [{"statement_id": 0, "error": "measurement not found: Cal_Eye.Device.S1.Press" }]}

The act of dropping them does clear them out, but it doesn’t seem to get rid of the measurement itself… So I have no clue how to get rid of these measurements right now…

Is this a bug or am I doing something wrong?

Hi there,
Were you able to resolve the issue.? I mean were you able to find a workaround to drop the type of measurements you have listed.

-Avin