paginate
The paginate
parameter is used to return results in a pagination friendly format.
It can be used in conjunction with the count and start parameters.
This query returns the id
and name
attributes of first 5 policies:
nctl raw "/policies/api/policy?fields=name,id&paginate=true&start=0&count=5" | jq
results:
{
"start": 0,
"count": 5,
"total": 65,
"entries": [
{
"id": "f86d6075-569c-4fe5-a8cd-4df6fe012e19",
"name": "add-networkpolicy-dns"
},
{
"id": "9ddaac9f-075f-4e69-a1bc-a0243d2f6072",
"name": "disable-automount-sa-token"
},
{
"id": "38d8b01c-cb2d-4414-8fbe-e673b0225542",
"name": "disallow-capabilities"
},
{
"id": "b8593a74-c92c-4906-a514-54081d8e8bae",
"name": "disallow-capabilities-strict"
},
{
"id": "2e7da966-2a29-4fbe-a8ba-03d146cdcf1c",
"name": "disallow-host-namespaces"
}
]
}