GET Service for listing Buckets
With the tutorial in the link above, I am able to list Buckets in my account. However, the response only return 1000 Buckets which I believe is the limit for a single response. The problem is how can I list the remaining Buckets in my account? For listing Bucket Objects, we can add the marker param to indicate from which object to continue listing but it seems there is no such param for listing Buckets.
Edit:
I am using HMAC keys instead of OAuth2 to make request so I cannot use the JSON API, "HMAC keys can only be used to make requests to the XML API, not the JSON API", according to HMAC keys Restrictions
Current XML response which doesn't include anything like marker, cursor or pageToken:
<?xml version='1.0' encoding='UTF-8'?>
<ListAllMyBucketsResult
xmlns='http://doc.s3.amazonaws.com/2006-03-01'>
<Buckets>
<Bucket>
<Name>bucket-1</Name>
<CreationDate>2019-09-23T07:03:11.892Z</CreationDate>
</Bucket>
<Bucket>
<Name>bucket-2</Name>
<CreationDate>2019-09-23T07:03:12.578Z</CreationDate>
</Bucket>
...
<Bucket>
<Name>bucket-999</Name>
<CreationDate>2019-09-23T07:03:11.892Z</CreationDate>
</Bucket>
<Bucket>
<Name>bucket-1000</Name>
<CreationDate>2019-09-23T07:03:12.578Z</CreationDate>
</Bucket>
</Buckets>
</ListAllMyBucketsResult>
You could try using the JSON API's list method. With this method whenever your results are over the maximum a pageToken item will be returned, you can use it as a parameter for your next request in order to paginate through the results.
Before implementing it you can test this API from the documentation page.
When trying to scan HBase through the REST API in our cluster (CDH 5.14.0 | HBase 1.2.0-cdh5.14.0) the scanner's batch attribute is not working, always returns records one by one. The PUT request is as follows:
http://hbase-rest-server:20550/our-table/scanner/
With a scanner definition like:
<Scanner batch="1000" startRow="YWFh" stopRow="YmJi=" />
With the scanner id that comes in the response's location returns one record in every call in order:
http://hbase-rest-server:20550/our-table/scanner/1532043234571885278a
Why batch="1000" is not taken into account? What am I missing?
In application/octet-stream option, the scaner will ignore batching parameter.
Set Accept header to text/xml or any other options.
https://hbase.apache.org/1.2/apidocs/org/apache/hadoop/hbase/rest/package-summary.html
I have a REST request (Not completely REST though). The input data is received via HTTP payload as XML and thus the record to be read is specified in the xml as,
<Item>
<ID>1</ID>
</Item>
Here, if the ID '1' is not found in database, should I return 404 Not found.
According to https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html, 404 Not Found is referred as The server has not found anything matching the Request-URI. But in my case, the URI can be reached successfully and the data in payload could not be found. Is it appropriate to use 404 or should I use any other status code?
First of all, why are you sending a payload to retrieve data? If you want to retrieve data in a RESTful way, you should send the id in the path, like /some-resource/1. I hope there is a very good reason to don't follow that standard.
In any case, returning a 404 is the best approach, in my opinion. Any client would expect a 404 if the resource was not found, even when the formal definition specifies that the resource is in the URL.
I am running a request against the JIRA REST API and I am getting an error:
Response status code does not indicate success: 400 (Bad Request).
I am thinking it has to do with a maximum number of items that can be in the JQL search query.
My query looks something like this:
search?jql=issue+in+('PROJ-741','PROJ-724','PROJ-851','PROJ-854','PROJ-856','PROJ-857','PROJ-980','PROJ-1133','PROJ-1132','PROJ-1071','PROJ-852','PROJ-727','PROJ-725','PROJ-853','PROJ-726','PROJ-434','PROJ-436','PROJ-433','PROJ-734','PROJ-733','PROJ-732','PROJ-182','PROJ-174','PROJ-173','PROJ-133','PROJ-301','PROJ-300','PROJ-281','PROJ-266','PROJ-253','PROJ-293','PROJ-287','PROJ-284','PROJ-276','PROJ-271','PROJ-262','PROJ-248','PROJ-214','PROJ-322','PROJ-323','PROJ-310','PROJ-332','PROJ-399','PROJ-600','PROJ-346','PROJ-389','PROJ-409','PROJ-521','PROJ-505','PROJ-490','PROJ-432','PROJ-486','PROJ-464','PROJ-438','PROJ-566','PROJ-534','PROJ-471','PROJ-178','PROJ-240','PROJ-210','PROJ-205','PROJ-655','PROJ-427','PROJ-419','PROJ-422','PROJ-426','PROJ-441','PROJ-442','PROJ-193','PROJ-194','PROJ-197','PROJ-195','PROJ-196','PROJ-513','PROJ-198','PROJ-514','PROJ-199','PROJ-516','PROJ-515','PROJ-200','PROJ-517','PROJ-201','PROJ-441','PROJ-188','PROJ-190','PROJ-189','PROJ-191','PROJ-192','PROJ-134','PROJ-213','PROJ-217','PROJ-219','PROJ-238','PROJ-237','PROJ-239','PROJ-221','PROJ-330','PROJ-418','PROJ-119','PROJ-463','PROJ-789','PROJ-331','PROJ-837','PROJ-959','PROJ-864','PROJ-957','PROJ-787','PROJ-445','PROJ-476','PROJ-786','PROJ-790','PROJ-791','PROJ-792')&startAt=0&maxResults=900&fields=labels,assignee,components,id,key,created,resolutiondate,customfield_10100,summary,issuetype,status,priority
I could try to batch these up into multiple queries, but I first wanted to see if there was any documented limit (I couldn't find anything mentioned in the documentation).
There is no restriction on the JQL queries and fields has been mentioned within Atlassian Documentation.
But if the Query is too large to be encoded as a Query Param then you should instead POST to this resource.
Your JQL has used some reserved characters hence it is returning 400 Error.
I have corrected your Query which compiles correctly and returns 200 status.
Here it is:
search?jql=issue%20in%20('PROJ-741'%2C'PROJ-724'%2C'PROJ-851'%2C'PROJ-854'%2C'PROJ-856'%2C'PROJ-857'%2C'PROJ-980'%2C'PROJ-1133'%2C'PROJ-1132'%2C'PROJ-1071'%2C'PROJ-852'%2C'PROJ-727'%2C'PROJ-725'%2C'PROJ-853'%2C'PROJ-726'%2C'PROJ-434'%2C'PROJ-436'%2C'PROJ-433'%2C'PROJ-734'%2C'PROJ-733'%2C'PROJ-732'%2C'PROJ-182'%2C'PROJ-174'%2C'PROJ-173'%2C'PROJ-133'%2C'PROJ-301'%2C'PROJ-300'%2C'PROJ-281'%2C'PROJ-266'%2C'PROJ-253'%2C'PROJ-293'%2C'PROJ-287'%2C'PROJ-284'%2C'PROJ-276'%2C'PROJ-271'%2C'PROJ-262'%2C'PROJ-248'%2C'PROJ-214'%2C'PROJ-322'%2C'PROJ-323'%2C'PROJ-310'%2C'PROJ-332'%2C'PROJ-399'%2C'PROJ-600'%2C'PROJ-346'%2C'PROJ-389'%2C'PROJ-409'%2C'PROJ-521'%2C'PROJ-505'%2C'PROJ-490'%2C'PROJ-432'%2C'PROJ-486'%2C'PROJ-464'%2C'PROJ-438'%2C'PROJ-566'%2C'PROJ-534'%2C'PROJ-471'%2C'PROJ-178'%2C'PROJ-240'%2C'PROJ-210'%2C'PROJ-205'%2C'PROJ-655'%2C'PROJ-427'%2C'PROJ-419'%2C'PROJ-422'%2C'PROJ-426'%2C'PROJ-441'%2C'PROJ-442'%2C'PROJ-193'%2C'PROJ-194'%2C'PROJ-197'%2C'PROJ-195'%2C'PROJ-196'%2C'PROJ-513'%2C'PROJ-198'%2C'PROJ-514'%2C'PROJ-199'%2C'PROJ-516'%2C'PROJ-515'%2C'PROJ-200'%2C'PROJ-517'%2C'PROJ-201'%2C'PROJ-441'%2C'PROJ-188'%2C'PROJ-190'%2C'PROJ-189'%2C'PROJ-191'%2C'PROJ-192'%2C'PROJ-134'%2C'PROJ-213'%2C'PROJ-217'%2C'PROJ-219'%2C'PROJ-238'%2C'PROJ-237'%2C'PROJ-239'%2C'PROJ-221'%2C'PROJ-330'%2C'PROJ-418'%2C'PROJ-119'%2C'PROJ-463'%2C'PROJ-789'%2C'PROJ-331'%2C'PROJ-837'%2C'PROJ-959'%2C'PROJ-864'%2C'PROJ-957'%2C'PROJ-787'%2C'PROJ-445'%2C'PROJ-476'%2C'PROJ-786'%2C'PROJ-790'%2C'PROJ-791'%2C'PROJ-792')&maxResults=900&fields=labels%2Cassignee%2Ccomponents%2Cid%2Ckey%2Ccreated%2Cresolutiondate%2Ccustomfield_10100%2Csummary%2Cissuetype%2Cstatus%2Cpriority
I have created a topic using a Domain in my JasperReport Server. Now I need to get all the reports which have used that Domain or Topic by using REST API.
I have tried this REST call:
https://<host>/jasperserver-pro/rest_v2/resource/organizations/test/organizations/data/Reports?j_username=jasperadmin&j_password=jAspErAdmIn
It gives 200 OK. But no data, it only gives the login page source.
<title>TIBCO Jaspersoft: Login</title>
Can anyone tell me how how to get this from REST call?
First, your call to the API seems errorneous.
According to the docs the call to the repository service looks like this:
http://<host>:<port>/jasperserver[-pro]/rest_v2/resources?<parameters>
In your case this would be:
http://<host>/jasperserver-pro/rest_v2/resources?<parameters>
Sencond, since your call is different, you won't get any result. It is possible to search for a specific string:
http://<host>/jasperserver-pro/rest_v2/resources?q=Domain_Name
and / or a type:
http://<host>/jasperserver-pro/rest_v2/resources?q=Domain_Name&type=dataType
As far as I understand it, it is not possible to search which report use which resources, though.