Esempio n. 1
0
func (dpnSync *DPNSync) getBags(remoteClient *network.DPNRestClient, pageNumber int) *network.DPNResponse {
	// We want to get all bags updated since the last time we pulled
	// from this node, and only those bags for which the node we're
	// querying is the admin node.
	remoteNode := dpnSync.RemoteNodes[remoteClient.Node]
	params := url.Values{}
	params.Set("after", remoteNode.LastPullDate.Format(time.RFC3339Nano))
	params.Set("admin_node", remoteNode.Namespace)
	params.Set("page", fmt.Sprintf("%d", pageNumber))
	params.Set("per_page", strconv.Itoa(SYNC_BATCH_SIZE))
	return remoteClient.DPNBagList(params)
}