i am new in influxDB, i want to delete some data from influxDB from postman. I am using below query from postman
"data":{
"start": "2021-01-09T12:00:00Z",
"stop": "2021-01-09T12:00:00Z",
"predicate": "_measurement=\"mymesurement\""
}
}
Also provided the Authorization token and content-type in the header
But when i executed the command it is giving me below error
{
"code": "invalid",
"message": "invalid request; error parsing request json: invalid RFC3339Nano for field start, please format your time with RFC3339Nano format, example: 2009-01-02T23:00:00Z"
}
Also tried in CLI but still getting the same error.
influx delete
--bucket 'mybucket'\
--org 'myorg' \
--token 'mytoken'
--start '2009-01-02T00:00:00.001Z' \
--stop '2009-01-02TT00:00:00.001Z' \
--predicate '_measurement=mymesurement'
Kindly help me to resolve the issue. Thanks in advance
It seems that you need to update both start and stop field to follow either RFC3339 or RFC3339Nano standard according to InfluxDB's Golang convention here. That is, RFC3339 = "2021-01-09T12:00:00Z00:00" (4 more digits after the "Z") or RFC3339Nano = "2021-01-09T12:00:00.000000000Z00:00" (9 more digits after the decimal point and before the "Z", plus 4 more digits after the "Z") .
InfluxDB support both format according to its original code and its docs.
P.S.: You'd better make the stop field different from the start one. Otherwise, there won't be any data deleted.
Related
i'm facing a problem regarding the shared secret in "clients.conf" file in freeradius server 3.0.25.
I tried to follow the documentation, but with no luck, in particular I'm trying to use the exact example in documentation of the octal representation of the secret "AB":
clients.conf:
secret = "\101\102"
then I run the radtest:
./radtest -x testing password localhost 0 "AB"
in server debug log I find:
"Dropping packet without response because of error: Received packet from 127.0.0.1 with invalid Message-Authenticator! (Shared secret is incorrect.)"
I tried every combination that come in mind: with or without quotes, with the "-t eap-md5" parameter in radtest, ..
Of course if I write 'secret = "AB" ' in clients.conf everything works, but I need octal representation because a client of ours uses special non printable characters in the secret.
Any help is appreciated
Thanks
I was able to make it work by changing the default value of parameter correct_escapes in file radiusd.conf:
correct_escapes = false <-- it was 'true' by default
Still is not clear to me why it doesn't work with correct_escapes set to 'true', maybe it's a bug?
I am wondering how to update event.TaskAttributes.variable value of a current task. I thought it's straight forward from the example by Twilio but I am not seeing any change If I followed the same and try to set/update a value of a specific attribute (defined in IVR voice flow widget).
https://www.twilio.com/docs/taskrouter/api/task#action-update
For example, there is an attribute called language which is a gather input digits field in IVR flow and at some point in the execution (while the caller is in waiting queue), we would like to update it to a different value. I tried via postman but it does nothing. Any help is greatly appreciated.
https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXX/Tasks/WTXXXXXX
{
"attributes": {
"language": "6"
}
}
Thanx!
In Postman use url-encoded format. The request should be encoded. Use 'Attributes' in place of 'attributes'. I am attaching a sample cURL request, this might be helpful
curl -X POST \
https://taskrouter.twilio.com/v1/Workspaces/WS...../Tasks/WTXXXX...... \
-H 'Authorization: Basic XXXXXXXXXXXXX' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'Attributes=%7B%22test2%22%3A%201%7D'
I built a slash command that I run, my server responds using the webhook URL the slash command sends out, the message posts to the channel, but then Slack shows a private message saying "Darn - that slash command didn't work (error message: 502_service_error)"
What's going on that's making Slack think my command failed? I tried adding an immediate response and this error still happens.
The code is an AWS Lambda function, the Slash Command is calling an AWS API Gateway to access it.
Here's my Python code which uses requests to return the data -
response = requests.post(
urllib.parse.unquote(response_hook), json={'attachments':[{'text': result, 'color': 'good'}], 'response_type': 'in_channel'},
headers={'Content-Type': 'application/json'}
)
Ended up figuring out the answer after more digging. I needed to add a specific response at the end of my function that let Slack know the message was received successfully. Below is the Python code I used to do that which resolved the issue -
return { "isBase64Encoded": True, "statusCode": 200, "headers": { }, "body": "" }
You may have to enable Lambda Proxy Integration in your API Gateway settings for this to work, that was enabled by default for me though.
The accepted answer is correct, Slack expects a '200' response with a slash command. Using the included 'callback' argument in the handler function of the lambda that receives the slash command works also.
callback(null);
The first argument to the callback is an error, so pass 'null' if ok.
AWS doc
Slack documentation
I am using Rails 5 as the backend of a mobile app. The problem I am trying to solve is receiving a request from the app containing information about the customer plus 2 photos. After a short approach two options appeared:
Send the files first in a multipart/form-data POST, and return an ID to the client. After that a "real" request is sent again and the server should associate the ID(metadata) and the file.
Send the files is Base64.encoded format without changing the JSON header. Something like:
curl -X POST \
-H "Content-Type: application/vnd.api+json" \
-H "Cache-Control: no-cache" \
-d '{
"data": {
"type": "identities",
"attributes": {
"param1": "first param",
"param2": "second param",
"image1": "data:image/png;base64,iVBORw0KGgoAAAANSU.....",
"image2": "data:image/png;base64,iVBORw0KGgoAAAANSU....."
}
}' "http://API_URL/identity"
My concerns about these 2 approaches respectively are:
Since we are expecting 2 files should we make a request for each one associating it with ID? What is expected to happen if the second call doesn't reach the server or is not valid?
What amount of bytes should we accept? I was thinking of 10MB but I am not sure if this is a good idea and how the server will react? Is it a good idea firstly to validate the type and size of the file on a UI level(the mobile app)?
If someone can suggest something else I would really appreciate it. Also if you have any experience with this problem please share useful references that you have used, I would appreciate them as well.
1) If you need 2 files at one request - pass 2 files as multipart/form-data, that is totally fine. If you use b64, you encode everything first and then decode everything. Not the best idea.
2) You should validate those files both at front and back end. Max amount of bytes should be like max_file1_size + max_file_2_size + max_other_fields_size + headers_size, it's less about guessing then trying.
3) It will be a good option to use carrierwave - nice gem, and you'll got a lot less space to mess :)
I am trying to update a subtask. More specifically just the due date.
I have tried several things and have failed.
This is what I have tried so far:
Attempt 1:
URL: https://app.asana.com/api/1.0/tasks/
JSON: {"data":{"due_on":"6/18/2017 12:00:00 AM"}}
Error: The remote server returned an error: (400) Bad Request.
Attempt 2: Added a parent id to JSON request
URL: /tasks/
JSON: ParentID is masked for security reasons
{"data":{"due_on":"6/18/2017 12:00:00 AM","parent":{"id":################,"name":null}}}
Error: The remote server returned an error: (400) Bad Request.
attempt 3: using /subtask in URL
URL: /tasks//subtasks/
JSON: {"data":{"due_on":"6/18/2017 12:00:00 AM"}}
ERROR: The remote server returned an error: (404) Not Found
What should be the correct URL to send the JSON request and what should be in the request to modify the subtask due date ?
Any help is greatly appreciated.
Thanks
Viv
Vivek,
The first thing I noticed is that the URL doesn't contain the ID of the task you're trying to update - I'm not sure if this is a copy-paste omission in the question, but if not and the URL you're using doesn't have the ID of the task, we won't know which task you're trying to set the due date for - so that might be one thing you're seeing :)
Additionally, I'd like to verify that you're using the HTTP verb PUT for these requests; you can POST new tasks in Asana, but to change fields on an existing task, we expect a PUT. Since subtasks count as tasks in Asana, this can be done just against https://app.asana.com/api/1.0/tasks/:task_id route
One more thing: setting the due date or due time in Asana are actually 2 separate things - most tasks have their due date set, but in our web app you can choose to add the time when setting the due date. This is represented in our API by the fields due_on for dates and due_at for times. If you just want the due date (inferred by the fact that the time is 12:00 AM) you'll probably want due_on and a string whose format is YYYY-MM-DD (in this case, 2017/06/18). If you want to set the actual time, you can use due_at with an ISO8601 timestamp, such as 2017-06-18T08:00:00Z
Putting it all together, here's a curl request I tested here with "due_at" to keep the time aspect in:
curl --request PUT \
--header "Authorization: Bearer $ASANA_PERSONAL_ACCESS_TOKEN" \
"https://app.asana.com/api/1.0/tasks/$TASK_ID" -d '{
"data": {
"due_at": "2017-06-08T12:00:00Z"
}
}'
Finally, and completely unrelated: do you happen to be the Vivek Patel currently working for Yelp? If so, I used to work with you at Sharpcast - small world! If not, no worries, feel free to ignore!