- Community Home
- >
- Software
- >
- HPE OneView
- >
- Re: Interconnects api call only return 10 values e...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2017 06:44 AM - edited 06-22-2017 06:46 AM
06-22-2017 06:44 AM - edited 06-22-2017 06:46 AM
Interconnects api call only return 10 values even though I specify higher in the count.
/interconnects?start=0&count=50 still only returns ten values. I have tried changing the X-API-Version to various values. The same string will work for the enclosures and another api call where all the values are returned beyond the ten limit. I have also tried -1 as a value. Is the interconnect call different somehow? I am going to need all 100+ interconnects in one file, how can I get the call to work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2017 07:36 AM
06-22-2017 07:36 AM
Re: Interconnects api call only return 10 values even though I specify higher in the count.
Try using -1 as the value of "count" (i.e. fetch all items).
Also -- what does the "total" property inside the returned InterconnectCollection contain (this should be the total number available to fetch)?
Good Luck!
Richard.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2017 07:43 AM
06-22-2017 07:43 AM
Re: Interconnects api call only return 10 values even though I specify higher in the count.
Thanks for the reply but I have already tried -1 and that returns even less members (5). The total value is equal to 132 of which I have also tried to set count equal to but only get 10 members.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2017 07:55 AM
06-22-2017 07:55 AM
Re: Interconnects api call only return 10 values even though I specify higher in the count.
What happens with a non-zero start value? How about start=50 and count=40 for example (maybe count=10 if the chunk size is baked-in as 10)?
The fact that you have this mechanism working elsewhere but you run into a "hard" limit on this "branch" is very odd.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2017 08:42 AM
06-22-2017 08:42 AM
Re: Interconnects api call only return 10 values even though I specify higher in the count.
I agree with the weirdness of this api call. I have tried different start values and as long as the difference is 10 or greater between the start and count then it will only return 10 members. Like you alluded it feels like a hard limit but I really hope not; I don't want to run this 14 times and figure out how to join all the calls.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2017 08:23 PM
06-26-2017 08:23 PM
Re: Interconnects api call only return 10 values even though I specify higher in the count.
Unfortunately, this is a hard limit and cannot be overridden. In order to get the full collection, you can do one of the following:
- Use the Python or PowerShell (Get-HPOVInterconnect) libraries, which will handle API pagination for you
- handle pagination yourself.
The API supports paginated collections. Within the collection object, you will see a property called nextPageUri. You would use this value within a loop to store the contents of the members property.
I am an HPE employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2017 01:27 PM
07-20-2017 01:27 PM
Re: Interconnects api call only return 10 values even though I specify higher in the count.
Here is the rest api function I created in python 2.7 to overcome the 10 ICM limit. Please note, you will need to create a for loop to get the enclosure names. Pass the name of each enclosure into this function and you will get all the ICMs in your enclosures.
def GetInterconnectMultiEnc(self,ip,auth,api,name):
url = "https://%s/rest/interconnects" % ip
querystring = {"filter":"\"'enclosureName' = %s\"" %name}
headers = {
'auth': auth,
'x-api-version': api,
}
response = requests.request("GET", url, headers=headers,params=querystring, verify=False)
return(json.loads(response.text))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2017 03:30 PM
07-20-2017 03:30 PM
Re: Interconnects api call only return 10 values even though I specify higher in the count.
You don’t need to do that. When you get the JSON back, it is a member collection object. Look at the nextPageUri to loop through the results to get your Interconnects. Take a look at the GET /rest/interconnects Response Body section. It shows you the expected JSON attributes/properties that will be returned, which is part of an InterconnectCollectionV300 object. Our Python and PowerShell libraries handle this for you, so no need for custom scripts.
I am an HPE employee