We currently do not support that feature.

William Reehil
Active and Available Inventory
D2 PLATFORM & SYSTEMS DEVELOPMENT - Principal Member of Technical Staff
AT&T Services Middletown, NJ
O: (732) 420-7806 | C: (732) 865-5333


From: Addepalli, Srinivasa R [mailto:[email protected]]
Sent: Monday, September 24, 2018 1:33 PM
To: REEHIL, WILLIAM E <[email protected]>; KAJUR, HARISH V <[email protected]>; 
[email protected]; Ranganathan, Dileep 
<[email protected]>; FORSYTH, JAMES <[email protected]>
Subject: RE: [onap-discuss] [AAI] Optimizing querying all flavors in a cloud 
region

Thanks for sending this. I was about to ask this very question of other entries 
getting added or deleted during the traversal.  In other systems I have 
involved in before,  there used to be  indication in the response to provide 
enough information for consumers to know that the list is modified. It is 
achieved using timestamp of last update of the list. It is consumer 
responsibility to check the time stamp of non-initial response with 
initial-response and if they are different, figure out whether to restart the 
traversal or move forward.

In A&AI, what mechanism is provided for consumers to the list is different?

Thanks
Srini


From: REEHIL, WILLIAM E [mailto:[email protected]]
Sent: Monday, September 24, 2018 10:19 AM
To: Addepalli, Srinivasa R 
<[email protected]<mailto:[email protected]>>; 
KAJUR, HARISH V <[email protected]<mailto:[email protected]>>; 
[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

Srini,

If you are doing processing using pagination be aware that the results are 
returned in chunks dynamically for the chunks present at the given time of the 
query, there is no concept of persistence of an original set of results.

So say you come in and ask for resultIndex=1&resultSize=1 and there are 10 
entries

[Node 1], Node 2, Node 3, Node 4, Node 5, Node 6, Node 7, Node 8, Node 9, Node 
10

Then you say resultIndex=2&resultSize=1 you get that Node 2

Node 1, [Node 2], Node 3, Node 4, Node 5, Node 6, Node 7, Node 8, Node 9, Node 
10

Then say Node 1 gets deleted

Node 2, Node 3, Node 4, Node 5, Node 6, Node 7, Node 8, Node 9, Node 10

Then say you ask for resultIndex=3&resultSize=1 you would get Node 4 because 
now the entire set is different

Node 2, Node 3, [Node 4], Node 5, Node 6, Node 7, Node 8, Node 9, Node 10

Thanks,

William Reehil
Active and Available Inventory
D2 PLATFORM & SYSTEMS DEVELOPMENT - Principal Member of Technical Staff
AT&T Services Middletown, NJ
O: (732) 420-7806 | C: (732) 865-5333


From: Addepalli, Srinivasa R [mailto:[email protected]]
Sent: Monday, September 24, 2018 12:30 PM
To: REEHIL, WILLIAM E <[email protected]<mailto:[email protected]>>; KAJUR, HARISH V 
<[email protected]<mailto:[email protected]>>; 
[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

Thank you.

I guess it helps the client (in this case OOF) to figure out when to end the 
traversal. Also, I guess it helps in figuring out the number of entries 
returned in the last request as the last response would have entries less than 
the requested entries.

Thanks
Srini


From: REEHIL, WILLIAM E [mailto:[email protected]]
Sent: Monday, September 24, 2018 9:02 AM
To: KAJUR, HARISH V <[email protected]<mailto:[email protected]>>; 
[email protected]<mailto:[email protected]>; Addepalli, 
Srinivasa R 
<[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

Srini,

Please start at 1 as 1 and 0 are treated as the same in the code

GET /aai/v14/cloud-infrastructure/cloud-regions?resultIndex=1&resultSize=100
GET /aai/v14/cloud-infrastructure/cloud-regions?resultIndex=2&resultSize=100
GET /aai/v14/cloud-infrastructure/cloud-regions?resultIndex=3&resultSize=100
GET /aai/v14/cloud-infrastructure/cloud-regions?resultIndex=4&resultSize=100

Other things to note, you will get headers back with the total number of 
indices and results

Below headers are accessible,

[cid:[email protected]]

Thanks,


William Reehil
Active and Available Inventory
D2 PLATFORM & SYSTEMS DEVELOPMENT - Principal Member of Technical Staff
AT&T Services Middletown, NJ
O: (732) 420-7806 | C: (732) 865-5333


From: KAJUR, HARISH V
Sent: Monday, September 24, 2018 11:53 AM
To: [email protected]<mailto:[email protected]>; 
[email protected]<mailto:[email protected]>; 
Ranganathan, Dileep 
<[email protected]<mailto:[email protected]>>; FORSYTH, 
JAMES <[email protected]<mailto:[email protected]>>
Cc: REEHIL, WILLIAM E <[email protected]<mailto:[email protected]>>
Subject: RE: [onap-discuss] [AAI] Optimizing querying all flavors in a cloud 
region

Hi Srini,

The calls you have is incorrect. For your example, these are the calls:

GET /aai/v14/cloud-infrastructure/cloud-regions?resultIndex=0&resultSize=100
GET /aai/v14/cloud-infrastructure/cloud-regions?resultIndex=1&resultSize=100
GET /aai/v14/cloud-infrastructure/cloud-regions?resultIndex=2&resultSize=100
GET /aai/v14/cloud-infrastructure/cloud-regions?resultIndex=3&resultSize=100

The first three pages will get 100 cloud regions each being specified the 
resultSize and the index only increments by 1 each time.
The last page will get the remaining 50 cloud regions.

Thanks,
Harish

From: [email protected]<mailto:[email protected]> 
<[email protected]<mailto:[email protected]>> On Behalf Of 
Srini
Sent: Monday, September 24, 2018 11:50 AM
To: KAJUR, HARISH V <[email protected]<mailto:[email protected]>>; 
[email protected]<mailto:[email protected]>; Ranganathan, 
Dileep <[email protected]<mailto:[email protected]>>; 
FORSYTH, JAMES <[email protected]<mailto:[email protected]>>
Cc: REEHIL, WILLIAM E <[email protected]<mailto:[email protected]>>
Subject: Re: [onap-discuss] [AAI] Optimizing querying all flavors in a cloud 
region

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]<mailto:[email protected]>; Addepalli, 
Srinivasa R 
<[email protected]<mailto:[email protected]>>; 
Ranganathan, Dileep 
<[email protected]<mailto:[email protected]>>; FORSYTH, 
JAMES <[email protected]<mailto:[email protected]>>
Cc: REEHIL, WILLIAM E <[email protected]<mailto:[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 (#12621): https://lists.onap.org/g/onap-discuss/message/12621
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]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to