-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Added - **Support for fetching all items with `perpage=-1`** A new feature has been added to the endpoint where if the `perpage` parameter is set to `-1`, it will return all available items for that endpoint. This eliminates the need for multiple paginated requests when retrieving the full set of data. **Behavior:** - When `perpage` is set to `-1`, all items will be returned. - For positive values of `perpage`, the traditional pagination logic will be applied. **Benefits:** - Simplifies fetching all data in a single request. - Reduces the need for multiple API calls to retrieve the full dataset.
- Loading branch information
1 parent
9934b48
commit f19e904
Showing
20 changed files
with
5,716 additions
and
694 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
|
||
meraki "github.com/meraki/dashboard-api-go/v4/sdk" | ||
) | ||
|
||
var client *meraki.Client | ||
|
||
func main() { | ||
var err error | ||
fmt.Println("Authenticating") | ||
client, err = meraki.NewClient() | ||
if err != nil { | ||
fmt.Println(err) | ||
return | ||
} | ||
|
||
nResponse, _, err := client.Organizations.GetOrganizations(nil) | ||
if err != nil { | ||
fmt.Println(err) | ||
return | ||
} | ||
if nResponse != nil { | ||
fmt.Println(nResponse) | ||
return | ||
} | ||
fmt.Println("There's no data on response") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
|
||
meraki "github.com/meraki/dashboard-api-go/v4/sdk" | ||
) | ||
|
||
var client *meraki.Client | ||
|
||
func main() { | ||
var err error | ||
fmt.Println("Authenticating") | ||
client, err = meraki.NewClient() | ||
if err != nil { | ||
fmt.Println(err) | ||
return | ||
} | ||
|
||
nResponse, _, err := client.Organizations.GetOrganizationDevices("828099381482762270", &meraki.GetOrganizationDevicesQueryParams{ | ||
PerPage: -1, | ||
TagsFilterType: "withAnyTags", | ||
}) | ||
// nResponse, _, err := client.Organizations.GetOrganizationAssuranceAlertsOverviewByNetwork("828099381482762270", &meraki.GetOrganizationAssuranceAlertsOverviewByNetworkQueryParams{ | ||
// PerPage: -1, | ||
// }) | ||
// nResponse, _, err := client.Devices.GetOrganizationWirelessControllerDevicesInterfacesL2StatusesChangeHistoryByDevice("828099381482762270", &meraki.GetOrganizationWirelessControllerDevicesInterfacesL2StatusesChangeHistoryByDeviceQueryParams{ | ||
// PerPage: -1, | ||
// }) | ||
|
||
// nResponse, _, err := client.Switch.GetOrganizationSwitchPortsClientsOverviewByDevice("828099381482762270", &meraki.GetOrganizationSwitchPortsClientsOverviewByDeviceQueryParams{ | ||
// PerPage: -1, | ||
// }) | ||
// nResponse, _, err := client.Switch.GetOrganizationSwitchPortsTopologyDiscoveryByDevice("828099381482762270", &meraki.GetOrganizationSwitchPortsTopologyDiscoveryByDeviceQueryParams{ | ||
// PerPage: -1, | ||
// }) | ||
|
||
// nResponse, _, err := client.WirelessController.GetOrganizationWirelessControllerAvailabilitiesChangeHistory("828099381482762270", &meraki.GetOrganizationWirelessControllerAvailabilitiesChangeHistoryQueryParams{ | ||
// PerPage: -1, | ||
// }) | ||
// nResponse, _, err := client.WirelessController.GetOrganizationWirelessControllerDevicesInterfacesL3StatusesChangeHistoryByDevice("828099381482762270", &meraki.GetOrganizationWirelessControllerDevicesInterfacesL3StatusesChangeHistoryByDeviceQueryParams{ | ||
// PerPage: -1, | ||
// }) | ||
|
||
// nResponse, _, err := client.Wireless.GetOrganizationWirelessAirMarshalRules("828099381482762270", &meraki.GetOrganizationWirelessAirMarshalRulesQueryParams{ | ||
// PerPage: -1, | ||
// }) | ||
|
||
if err != nil { | ||
fmt.Println(err) | ||
return | ||
} | ||
if nResponse != nil { | ||
fmt.Println("\n Cantidad: ", len(*nResponse)) | ||
fmt.Printf("%v", *nResponse) | ||
return | ||
} | ||
|
||
fmt.Println("There's no data on response") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
|
||
meraki "github.com/meraki/dashboard-api-go/v4/sdk" | ||
) | ||
|
||
var client *meraki.Client | ||
|
||
func main() { | ||
var err error | ||
fmt.Println("Authenticating") | ||
client, err = meraki.NewClient() | ||
if err != nil { | ||
fmt.Println(err) | ||
return | ||
} | ||
|
||
nResponse, _, err := client.Networks.GetNetworkClientsApplicationUsage("L_828099381482771185", &meraki.GetNetworkClientsApplicationUsageQueryParams{ | ||
PerPage: -1, | ||
Clients: "4c:c8:a1:0b:01:58", | ||
}) | ||
|
||
if err != nil { | ||
fmt.Println(err) | ||
return | ||
} | ||
if nResponse != nil { | ||
fmt.Println("\n Cantidad: ", len(*nResponse)) | ||
fmt.Printf("%v", *nResponse) | ||
return | ||
} | ||
|
||
fmt.Println("There's no data on response") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.