VMware NSX GET API api/v1/ip-sets default page size 50
search cancel

VMware NSX GET API api/v1/ip-sets default page size 50

book

Article ID: 322572

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

  • Running the following Management Plane (MP) API call will show only 50 results, due to the default page size being 50:
GET https://<nsx-mgr-ip>/api/v1/ip-sets (or login to NSX manager as root user and run the equivalent curl -k -u '<username>:<password>' -H 'Content-Type: application/json' -X GET "https://<nsx-mgr-ip>/api/v1/ip-sets")
  • Whereas the Policy GET API call returns 1000, due to the default page size being 1000:
GET https://<nsx-mgr-ip>/policy/api/v1/infra/domains/<domain-id>/groups (or login to NSX manager as root user and run the equivalent curl -k -u '<username>:<password>' -H 'Content-Type: application/json' -X GET "https://<nsx-mgr-ip>/policy/api/v1/infra/domains/<domain-id>/groups")
  • The VMware NSX API guide shows the management GET API for api/v1/ip-sets default page size as 1000.

Note: The Policy API does not have an equivalent API to api/v1/ip-sets, as ip-sets are represented as groups in policy.

Environment

  • VMware NSX
  • VMware NSX-T Data Center

Cause

The API guide has an incorrect value for the default page size for the GET API api/v1/ip-sets.
It shows the default page size as 1000, whereas it should be 50.

Resolution

This issue is resolved in VMware NSX 3.2.4
This issue is resolved in VMware NSX 4.2.0

Workaround:
As the MP API's have been deprecated with VMware since NSX 3.2.x, it is advised to use the Policy API's, which have the correct values.