<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Nagini library in Python not able to get more than 1000 objects in VMware Aria Operations  Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-Aria-Operations/Nagini-library-in-Python-not-able-to-get-more-than-1000-objects/m-p/503866#M3002</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As I commented the answer was in the subject of this sharing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Feb 2018 12:53:06 GMT</pubDate>
    <dc:creator>gok</dc:creator>
    <dc:date>2018-02-15T12:53:06Z</dc:date>
    <item>
      <title>Nagini library in Python not able to get more than 1000 objects</title>
      <link>https://communities.vmware.com/t5/VMware-Aria-Operations/Nagini-library-in-Python-not-able-to-get-more-than-1000-objects/m-p/503865#M3001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: 16px; color: #24292e; font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';"&gt;Hello all,&lt;/P&gt;&lt;P style="margin-bottom: 16px; color: #24292e; font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';"&gt;I want to share an issue I found using Nagini library on python environment in order to get and modify data from VROPS&lt;/P&gt;&lt;P style="margin-bottom: 16px; color: #24292e; font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';"&gt;By default the system answer with 1000 object per page as we can see at&lt;BR /&gt;&lt;A _jive_internal="true" href="https://communities.vmware.com/suite-api/api/adapterkinds/VMWARE/resourcekinds/VIRTUALMACHINE/resources" rel="nofollow"&gt;https://&amp;lt;vrops-server&amp;gt;/suite-api/api/adapterkinds/VMWARE/resourcekinds/VIRTUALMACHINE/resources&lt;/A&gt;&lt;/P&gt;&lt;P style="margin-bottom: 16px; color: #24292e; font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';"&gt;In order to get more objects in the same page you need to pass the maximum number of objects that you want like&lt;BR /&gt;&lt;A _jive_internal="true" href="https://communities.vmware.com/suite-api/api/adapterkinds/VMWARE/resourcekinds/VIRTUALMACHINE/resources/resources/?page=0&amp;amp;pageSize=4000" rel="nofollow"&gt;https://&amp;lt;vrops-server&amp;gt;/suite-api/api/adapterkinds/VMWARE/resourcekinds/VIRTUALMACHINE/resources/resources/?page=0&amp;amp;pageSize=4000&lt;/A&gt;&lt;/P&gt;&lt;P style="margin-bottom: 16px; color: #24292e; font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';"&gt;So as we want to use Nagini Library over python, we need to translate this to Nagini.&lt;/P&gt;&lt;P style="margin-bottom: 16px; color: #24292e; font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';"&gt;&lt;BR /&gt;Having a look on the Nagini code at the function that we call&lt;/P&gt;&lt;P style="margin-bottom: 16px; color: #24292e; font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';"&gt;find_create_resource_with_adapter_uuid or find_create_resource_with_adapter_key, Nagini use a method called get_resources_with_adapter_and_resource_kind, but in the admitted parameters there is not PageSize&lt;/P&gt;&lt;P style="margin-bottom: 16px; color: #24292e; font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';"&gt;But if we go to the method.json we can see that the option is there&lt;BR /&gt;"name" : "get_resources_with_adapter_and_resource_kind",&lt;BR /&gt;"url" : "/api/adapterkinds/{adapterKindKey}/resourcekinds/{resourceKindKey}/resources",&lt;BR /&gt;"http_method" : "GET",&lt;BR /&gt;"doc" : "Query for Resources within a particular Adapter Kind and Resource Kind.&lt;BR /&gt;",&lt;BR /&gt;"query_params" : [ {&lt;BR /&gt;"name" : "page",&lt;BR /&gt;"doc" : "Page number from which data needs to be displayed (0-based)",&lt;BR /&gt;"type" : "int",&lt;BR /&gt;"optional" : true,&lt;BR /&gt;"repeating" : false&lt;BR /&gt;}, {&lt;BR /&gt;"name" : "pageSize",&lt;BR /&gt;"doc" : "Expected number of entries per page",&lt;BR /&gt;"type" : "int",&lt;BR /&gt;"optional" : true,&lt;BR /&gt;"repeating" : false },&lt;/P&gt;&lt;P style="color: #24292e; font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';"&gt;So I have modify nagini.py on the both functions I commented above to introduce the PageSize as a parameter and magic ... it works !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #24292e; font-family: -apple-system, system-ui, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';"&gt;Now the question is why to have a Flag and not use it? and why there is not any documentation of Nagini, even if you search in google appear a github from a Harry Potter follower talking something about hacking school....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Juan Jose Vidañez&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2018 12:47:36 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-Aria-Operations/Nagini-library-in-Python-not-able-to-get-more-than-1000-objects/m-p/503865#M3001</guid>
      <dc:creator>gok</dc:creator>
      <dc:date>2018-02-15T12:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Nagini library in Python not able to get more than 1000 objects</title>
      <link>https://communities.vmware.com/t5/VMware-Aria-Operations/Nagini-library-in-Python-not-able-to-get-more-than-1000-objects/m-p/503866#M3002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As I commented the answer was in the subject of this sharing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2018 12:53:06 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-Aria-Operations/Nagini-library-in-Python-not-able-to-get-more-than-1000-objects/m-p/503866#M3002</guid>
      <dc:creator>gok</dc:creator>
      <dc:date>2018-02-15T12:53:06Z</dc:date>
    </item>
  </channel>
</rss>

