Thanks Harish. What are the values to be passed to resultIndex and resultSize for following example.
Say, there are 350 Cloud regions. Say, OOF wants to get 100 cloud regions at a time Would the calls be like this: GET /aai/v14/cloud-infrastructure/cloud-regions?resultIndex=0&resultSize=100 GET /aai/v14/cloud-infrastructure/cloud-regions?resultIndex=101&resultSize=100 GET /aai/v14/cloud-infrastructure/cloud-regions?resultIndex=201&resultSize=100 GET /aai/v14/cloud-infrastructure/cloud-regions?resultIndex=301&resultSize=100 Thanks Srini From: KAJUR, HARISH V [mailto:[email protected]] Sent: Sunday, September 23, 2018 4:05 PM To: [email protected]; Addepalli, Srinivasa R <[email protected]>; Ranganathan, Dileep <[email protected]>; FORSYTH, JAMES <[email protected]> Cc: REEHIL, WILLIAM E <[email protected]> Subject: RE: [onap-discuss] [AAI] Optimizing querying all flavors in a cloud region Hi Srini, Starting Casablanca release in AAI, we can do pagination by adding the following query parameters: resultIndex and resultSize resultIndex is the index of the current page resultSize how many cloud regions you want in a single page. GET /aai/v14/cloud-infrastructure/cloud-regions?resultIndex=0&resultSize=10 Will return a response of 10 cloud regions and additional response headers: total-pages and total-results. total-pages will return 100 if there are 1000 cloud regions per your example. total-results will be 1000. The total-pages will change based on the resultSize that you choose when you make your initial GET request. If you wanted to do 100 cloud regions per page and you set resultSize=100, then total-pages will only be 10. Thanks, Harish From: [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>> On Behalf Of Srini Sent: Friday, September 21, 2018 1:12 PM To: [email protected]<mailto:[email protected]>; KAJUR, HARISH V <[email protected]<mailto:[email protected]>>; Ranganathan, Dileep <[email protected]<mailto:[email protected]>>; FORSYTH, JAMES <[email protected]<mailto:[email protected]>> Subject: Re: [onap-discuss] [AAI] Optimizing querying all flavors in a cloud region If the pagination is provided by A&AI, I think that is the right approach to take. I am also concerned the case where there are thousands of cloud regions, each having tens of flavors with each flavor having tens of HPA capabilities. Amount of data that needs to go over HTTP could be huge. Pagination helps. Hi Harish, Can you provide some examples on pagination granularity supported by A&AI? As you see in this case, there are set of cloud-regions, and for each cloud-region, there could be set of flavor records. For each flavor record, there are set of HPA capability records. Say that there are 1000 cloud regions. Say that OOF wants to read 10 at a time. How can this be done? Any examples would be good. Thanks Srini From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of Venkata Harish K Kajur Sent: Friday, September 21, 2018 9:38 AM To: Ranganathan, Dileep <[email protected]<mailto:[email protected]>>; FORSYTH, JAMES <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]> Subject: Re: [onap-discuss] [AAI] Optimizing querying all flavors in a cloud region Hi Dileep, Can you please provide me with more info such as the localhost_access.log of the request? Is this Casablanca code? If it is, what can be done is use pagination and have your client do multiple parallel requests rather than One GET ALL to speed up. Thanks, Harish From: Ranganathan, Dileep <[email protected]<mailto:[email protected]>> Sent: Friday, September 21, 2018 11:58 AM To: KAJUR, HARISH V <[email protected]<mailto:[email protected]>>; FORSYTH, JAMES <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]> Subject: RE: [AAI] Optimizing querying all flavors in a cloud region Thanks Harish. In our use case we also need the children inside the flavors too. We are trying to get the HPACapabilities object from flavors. Is there a way to speed up? Thanks, Dileep From: KAJUR, HARISH V [mailto:[email protected]] Sent: Friday, September 21, 2018 7:18 AM To: Ranganathan, Dileep <[email protected]<mailto:[email protected]>>; FORSYTH, JAMES <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]> Subject: RE: [AAI] Optimizing querying all flavors in a cloud region Hi Dileep, I don't think an index here will help because you are not filtering on anything. Indexes help if you are doing a lookup for a specific vertexes or set of vertexes based on a property. In this case, you wanted to get all the flavors in a specific cloud region. I would suggest then to change to doing this: GET {aai_endpoint}/aai/{aai_version}/cloud-infrastructure/cloud-regions/cloud-region/{cloud_owner}/{cloud_region_id}/flavors/?depth=0&nodes-only=true If you only care about the flavors and not the children underneath the flavors, then this query will significantly improve the performance of the query. As this query is saying get me all the flavors and only the flavors excluding the nested children and so forth and also ignore the relationships (nodes-only=true). If you only care about the flavors then this will help. Thanks, Harish From: Ranganathan, Dileep <[email protected]<mailto:[email protected]>> Sent: Friday, September 21, 2018 2:11 AM To: FORSYTH, JAMES <[email protected]<mailto:[email protected]>>; KAJUR, HARISH V <[email protected]<mailto:[email protected]>>; [email protected]<mailto:[email protected]> Subject: [AAI] Optimizing querying all flavors in a cloud region Hi AAI team, We have a use case where we need to query all flavors inside a cloud region. We are having latency in some environments which is more than 30 seconds delay. Is there a way we can index this and speed up performance? GET {aai_endpoint}/aai/{aai_version}/cloud-infrastructure/cloud-regions/cloud-region/{cloud_owner}/{cloud_region_id}/flavors/?depth=all Is there as similar construct like <xml-property name="indexedProps" value=""/> for ArrayList object flavors? <java-type name="Flavors"> <xml-properties> <xml-property name="description" value="Collection of openstack flavors."/> </xml-properties> <xml-root-element name=""/> <java-attributes> <xml-element container-type="java.util.ArrayList" java-attribute="flavor" name="flavor" type="inventory.aai.onap.org.v14.Flavor"/> </java-attributes> </java-type> Thanks, Dileep -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#12604): https://lists.onap.org/g/onap-discuss/message/12604 Mute This Topic: https://lists.onap.org/mt/25839741/21656 Group Owner: [email protected] Unsubscribe: https://lists.onap.org/g/onap-discuss/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
