Apache Ranger v 2.1.0.
I try send get request
"/service/public/v2/api/policy/?pageSize=10&startIndex=15"
or
"/service/public/v2/api/policy?pageSize=10&startIndex=15"
or
"/service/public/v2/api/service/hadoop/policy?pageSize=10&startIndex=15"
to REST API Ranger but always see 10 results from 1 record (49 policies).
Why startIndex request param is ignoring?
NOTE: I haven't used this software.
Try without the trailing slash, i.e. like so:
/service/public/v2/api/policy?pageSize=10&startIndex=15
Also, according to the documentation, the syntax is like so:
/service/public/v2/api/service/{service-name}/policy
Notice the {service-name} in there. I don't see this in your example.
Related
sending the following REST filter to a loopback endpoint
filter[where][and][0][polity]=true&filter[where][and][1][or][0][code]=test&filter[where][and][1][or][1][name]=test
produces this where JSON object:
{"and":[{"polity":true},{"or":[{"[code]":"test"},{"[name]":"test"}]}]}
Please note the unnecessary square brackets around code and name.
It should be a simple logical test
polity=true & (code=test || name=test)
sending the (corrected) JSON to the endpoint works fine.
loopback version: 3.0.0 and 2.22.0
is it a known bug?
which loopback module is responsible for convert the request parameters to where object?
I am trying to synchronize an Outlook folder (say the Inbox) using the beta version of the Outlook Rest Api see doc here
I need only to retrieve the property IsRead and the PR_INTERNET_MESSAGE_ID
So following documentation, for the first synchronization my requests look like:
The following Http headers are always added:
request.Headers.Add("Prefer", "odata.track-changes");
request.Headers.Add("Prefer", "odata.maxpagesize=5"); //Use a small page size easier for debugging
The first initial full synchronization request
https://outlook.office365.com/api/beta/Me/MailFolders('inbox')/messages?$select=IsRead&$expand=SingleValueExtendedProperties($filter=(PropertyId eq 'String 0x1035'))
Good results the value array contain what I need.
The second request after the first request uses the deltatoken
https://outlook.office365.com/api/beta/Me/MailFolders('inbox')/messages?$select=IsRead,Subject&$expand=SingleValueExtendedProperties($filter=(PropertyId eq 'String 0x1035'))&$deltatoken=a758b90491954a61ad463ef3a0e690a2
Bad results, no SingleValueExtendedProperties entries
Next requests for paginations with skiptoken...
https://outlook.office365.com/api/beta/Me/MailFolders('inbox')/messages?$select=IsRead,Subject&$expand=SingleValueExtendedProperties($filter=(PropertyId eq 'String 0x1035'))&$skiptoken=e99ad10324464488b6b219ca5ed6be1c
Bad results again, same as 2.
It looks like a bug to me. Can you provide a workaround? From a list of ItemId is possible to retrieve easily the list of corresponding PR_InternetMessage_Id efficiently (not item per item)?
Note also that in the documentation it is written that:
The response will include a Preference-Applied: odata.track-changes
header. If you attempt to sync a resource that is not supported, this
header will not be returned in the response. Check for this header
before processing the response to avoid errors.
It seems that for 2. and 3. calls this response header "Preference-Applied" is not set.
The sync functionality today doesn't support extended properties. However, we are working to enable this and it should start working in a few weeks.
EDIT:
For a workaround for the very special case of the PR_INTERNETMESSAGE_ID look at the comment below.
I am trying to redirect all traffic for one domain to another. Rather than running a server specifically for this job I was trying to use AWS API Gateway with lambda to perform the redirect.
I have this working ok for the root path "/" but any requests for sub-paths e.g. /a are not handled. Is there a way to define a "catch all" resource or wildcard path handler?
As of last week, API Gateway now supports what they call “Catch-all Path Variables”.
Full details and a walk-through here: API Gateway Update – New Features Simplify API Development
You can create a resource with path like /{thepath+}. Plus sign is important.
Then in your lambda function you can access the value with both
event.path - always contains the full path
or event.pathParameters.thepath - contains the part defined by you. Other possible use case: define resource like /images/{imagepath+} to only match pathes with certain prefix. The variable will contain only the subpath.
You can debug all the values passed to your function with: JSON.stringify(event)
Full documentation
Update: As of last week, API Gateway now supports what they call “Catch-all Path Variables”. See API Gateway Update – New Features Simplify API Development.
You will need to create a resource for each level unfortunately. The reason for this is API Gateway allows you to access those params via an object.
For example: method.request.path.XXXX
So if you did just /{param} you could access that with: method.request.path.param but if you had a nested path (params with slashes), it wouldn't work. You'd also get a 404 for the entire request.
If method.request.path.param was an array instead...then it could get params by position when not named. For example method.request.path.param[] ...Named params could even be handled under there, but accessing them wouldn't really be easy. It would require using something some sort of JSON path mapping (think like what you can do with their mapping templates). Sadly this is not how it's handled in API Gateway.
I think it's ok though because this might make configuring API Gateway even more complex. However, it does also limit API Gateway and to handle this situation you will ultimately end up with a more confusing configuration anyway.
So, you can go the long way here. Create the same method for multiple resources and do something like: /{1}/{2}/{3}/{4}/{5}/{6}/{7} and so on. Then you can handle each path parameter level if need be.
IF the number of parameters is always the same, then you're a bit luckier and only need to set up a bunch of resources, but one method at the end.
source: https://forums.aws.amazon.com/thread.jspa?messageID=689700򨘤
Related to HTTPAPI that AWS introduced recently, $default is used a wildcard for catching all routes that don't match a defined pattern.
For more details, refer to: aws blogs
You can create a resource with path variable /{param}, and you can treat this as wildcard path handler.
Thanks,
- Ka Hou
I am working with the following documentation to implement REST-based searching using Confluence CQL: https://developer.atlassian.com/confdev/confluence-rest-api/advanced-searching-using-cql and https://docs.atlassian.com/atlassian-confluence/REST/latest/#d3e648
I am able to do GET requests using the user id / password against other endpoints against my Confluence Cloud account. However, when I try to pass a CQL query to the search endpoint, as follows:
text ~ Tomcat
I get the following error:
{
"statusCode":400,
"data":
{"authorized":false,"valid":true,"errors":[]},
"message":"Could not parse cql : text %7E Tomcat"
}
Can anyone tell me what may be causing this? It looks like the CQL encoding for passing in HTTP GET is causing an error on the back end somehow. I am using Java to encode my GET parameters with UTF-8. This exact approach works just with with JIRA Cloud search using JIRA Query Language (JQL), so I'm confused what's going on here.
The endpoint I use is:
https://mycompany.atlassian.net/confluence/rest/api/content/search?
I have tried it with HTTPS and HTTP. I understand that for the search endpoint, a 400 response means "Returned if the CQL is invalid or missing" - any ideas what I'm missing here or what may be wrong with my CQL?
The authorization error is caused by you not being logged into your confluence instance...
Try logging in and use a url like this one (in some instances the confluence/ isn't needed)
https://mycompany.atlassian.net/confluence/rest/api/content/search?cql=space=DS
I need to update an order which is done via PUT method passing the order id as part of the https url string and a single parameter, the status_id.
https://mystore.mybigcommerce.com/orders/12345.json
I have tried several methods to pass the status_id value but no matter what I try "status_id=12" or formatted as JSON "{"status_id": 12,}" I always get the same response:
[{"status":415,"message":"The specified input content type is not valid."}]
I have also tried as a POST request passing the JSON or XML code as raw data but that method is not supported.
How am I supposed to pass that field=value pair? can I embed it in the url string?
I also tried it but it wouldn't work for me.
Any ideas?
In case you are wondering I am doing it within FileMaker with TROIUrl plugIn, not a very popular technology, but the GET method retrieving orders works like a charm
TURL_Put( ""; $url ;"status_id=12") (I have also tried other FM plugIns to no avail)
Don't get too caught up in the Filemaker part, I don't expect many people out there to be familiar with BigCommerce and Filemaker. I just need a generic answer.
Thanks
Commandline tool curl is worth a try. It supports put and https.
Mac OS X: curl already installed, call from FileMaker via AppleScript do shell script.
Windows: must be installed, call via Powershell.
It works for me using { "status_id": "3" } which means you probably need to put quotes around the actual number.
Also, it is a PUT operation and application/json which is part of the request content.
The error message received by the OP:
[{"status":415,"message":"The specified input content type is not valid."}]
Is saying that he did not supply the 'Content-Type' header in his request or that the header supplied is for a content type that is not allowed. For the OP's case using JSON he would need to include the header:
Content-Type: application/json
in his HTTPS request. This description can be found along with those of the other status codes you may see here:
https://developer.bigcommerce.com/api/status-codes