delete data from influxdb 2.0 - influxdb

I want to delete data from influxdb v2.0:
I read its doc and I try 2 ways that it says, but I get error.
https://docs.influxdata.com/influxdb/v2.0/write-data/delete-data/
in cli:
influx delete \
--host HOST \
--org ORG \
--token TOKEN \
--bucket BUCKET \
--start 2021-06-01T00:00:00Z \
--stop 2021-06-01T01:00:00Z
error:
Error: Failed to delete data: Not implemented.
See 'influx delete -h' for help
Can you help me, how can I delete data?

Delete data from same host:
influx delete --bucket example-bucket \
--start 2020-03-01T00:00:00Z \
--stop 2020-11-14T00:00:00Z
You can also delete data via Curl
curl --request POST https://influxurl/api/v2/delete?org=example-org&bucket=example-bucket \
--header 'Authorization: Token YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"start": "2022-01-19T06:32:00Z",
"stop": "2022-01-19T06:33:00Z",
"predicate": "_measurement=\"example-measurement\" AND feature=\"temp2\" "
}'
Predicate method not working properly. (bug)

For local CLI in docker container.
I had multiple measurements in one bucket, so to delete only them using predicate is necessary. I 've put one day before the first measurement in start and one day after last measurment in stop
influx delete --bucket home \
--start 2021-04-01T00:00:00Z \
--stop 2023-01-12T00:00:00Z \
--predicate '_measurement="personal_rating6"'

Related

Jenkins : Pass mixed parameters to Jenkins API

Current Jenkins parameter looks like below and <input_paramter> are the actual values to be substituted over there.
I have an idea on how to pass string parameters or json parameters separately but unsure how to handle them both simultaneously.
Referred Jenkins documentation as well as multiple questions posted on this forum, but could not figure that out.
curl -X POST https://myjenkins.instance/build \
-H 'Content-Type: application/json' \
--user user:token \
FILE_PATH="/home/mac/results" \
PACKAGE_VERSION=64 \
<how to handle the json parameters>

Decline Pull request in Bitbucket when Building fail in Jenkins

I have triggered a build in Jenkins after creating a new pull request in bitbucket.
I want to automatically decline the pull request right away when building fail in Jenkins.
How do I do it and how can I set up it.
Is it possible to use a shell script in your case?
Something like this:
#!/usr/bin/env bash
if test $1 -ne 0; then
curl https://api.bitbucket.org//2.0/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/decline \
-u $3:$4 \
--request POST \
--header 'Content-Type: application/json' \
--data '{}'
fi
exit $1
Then, you can call the script as:
chmod +x decline-pull-request.sh
decline-pull-request.sh $(status) $(pullRequestId) $(bitbucketUsername) $(bitbucketPassword)

You must use HTTPS while generating Kong client credentials

Can anyone please help me out. I'm getting error while generating KONG client credentials on HTTP port 8000.
{
"error_description": "You must use HTTPS",
"error": "access_denied"
}
I have added trusted_ips = 0.0.0.0/0,::/0 in kong.conf also, but it didn't work.
You should do it over https(using port 8443 instead of 8000).If youre using localhost Do something like:
curl -X POST \
--url "https://127.0.0.1:8443/<route name>/oauth2/token " \
--header "Host: <route host>" \
--data "grant_type=password" \
--data "client_id=<clientid>" \
--data "client_secret=<clientsecret>" \
--data "provision_key=<provision_key>"\
--data "redirect_uri=http://localhost/cb/" \
--data "authenticated_userid=<userid>" \
--insecure
you can follow this link for further details on how to go about this

Wget to download excel from Jira automatically

I have tried the below commands to get the excel file automatically from jira but I'm getting different data other than the filter data.
wget --user username--password pass -O test.xls --ignore-length=on http://esjirq62.emea.nsn-net.net:8080/sr/jira.issueviews:searchrequest-excel-all-fields/70920/SearchRequest-70920.xls?tempMax=1000;
curl -D my-output.xml -u upgrade:hjjKl801 -X GET -H "Content-Type: application/json" http://esjirq62.emea.nsn-net.net:8080/sr/jira.issueviews:searchrequest-excel-all-fields/70920/SearchRequest-70920.xls?tempMax=1000
Please help me here.
You have to set correct encoding header gzip :
curl -D my-output.xml -u upgrade:secret -X GET -H "Content-Type: application/json" -H "Accept-Encoding: gzip" "http://esjirq62.emea.nsn-net.net:8080/sr/jira.issueviews:searchrequest-excel-all-fields/70920/SearchRequest-70920.xls?tempMax=1000"
Some notes:
Remove password from your example
-D flag for curl dumps headers, not output. Did you mean -o maybe?
Content-Type header can be skipped
To be on the safe side, put the url in double quotes
You can copy request from Google Chrome using developer tools
I can't get Wget work in my environment (permission denied error; maybe because of SSO?) but following curl command .
"D:\DSUsers\uid41890\Tools\curl.exe" -o C:\Users\uid41890\Documents\JIRA\search.csv -u uid41890:password -X GET "http://jiraurl:port/sr/jira.issueviews:searchrequest-csv-current-fields/17899/SearchRequest-17899.csv"
No need for Header options as mentioned in #grundic's answer.
Replace -D by -o in your original command and change the output file format from xml to csv for example.
You must use -O flag as:
curl -o excel.xls -O -u upgrade:hjjKl801 -X GET -H "Content-Type: application/json" http://esjirq62.emea.nsn-net.net:8080/sr/jira.issueviews:searchrequest-excel-all-fields/70920/SearchRequest-70920.xls?tempMax=1000

Parse cloud code return 114 function not found

I followed the instruction of parse.com to create a new site including cloud code and public. The static page works. But the cloud code doesn't work.
Here is the code in main.js:
Parse.Cloud.define("hello", function(request, response) {
response.success("Hello world!");
});
And I'm using curl to test this code after I run parse deploy.
curl -X POST \
-H "X-Parse-Application-Id: t14gtZouSBVNPbFI5JanDHmLYk9iD9ceAkbr0ON2" \
-H "X-Parse-REST-API-Key: IYt8Z03n44pVsuJ9vlL6yXz5qDVmZAEqht8q2VPf" \
-H "Content-Type: application/json" \
-d '{}' \
https://api.parse.com/1/functions/hello
It returns:
{"code":141,"error":"function not found"}
Any idea? Thanks
You can try to call "classes" to get access from curl to your Cloud functions:
https://api.parse.com/1/classes/hello

Resources