Ejemplo n.º 1
0
func (dpnSync *DPNSync) getIngests(remoteClient *network.DPNRestClient, pageNumber int, bagUUID string) *network.DPNResponse {
	params := url.Values{}
	params.Set("bag", bagUUID)
	params.Set("latest", "true")
	params.Set("page", fmt.Sprintf("%d", pageNumber))
	params.Set("per_page", strconv.Itoa(SYNC_BATCH_SIZE))
	return remoteClient.IngestList(params)
}
Ejemplo n.º 2
0
func (dpnSync *DPNSync) getMembers(remoteClient *network.DPNRestClient, pageNumber int) *network.DPNResponse {
	remoteNode := dpnSync.RemoteNodes[remoteClient.Node]
	params := url.Values{}
	params.Set("after", remoteNode.LastPullDate.Format(time.RFC3339Nano))
	params.Set("page", fmt.Sprintf("%d", pageNumber))
	params.Set("per_page", strconv.Itoa(SYNC_BATCH_SIZE))
	return remoteClient.FixityCheckList(params)
}
Ejemplo n.º 3
0
func (dpnSync *DPNSync) getFixities(remoteClient *network.DPNRestClient, pageNumber int) *network.DPNResponse {
	// Get fixities for the remote node *calculated by that node*
	remoteNode := dpnSync.RemoteNodes[remoteClient.Node]
	params := url.Values{}
	params.Set("after", remoteNode.LastPullDate.Format(time.RFC3339Nano))
	params.Set("node", remoteNode.Namespace)
	params.Set("page", fmt.Sprintf("%d", pageNumber))
	params.Set("per_page", strconv.Itoa(SYNC_BATCH_SIZE))
	return remoteClient.FixityCheckList(params)
}
Ejemplo n.º 4
0
func (dpnSync *DPNSync) getDigests(remoteClient *network.DPNRestClient, pageNumber int) *network.DPNResponse {
	// We want digests only from the node that calculated them.
	remoteNode := dpnSync.RemoteNodes[remoteClient.Node]
	params := url.Values{}
	params.Set("after", remoteNode.LastPullDate.Format(time.RFC3339Nano))
	params.Set("node", remoteNode.Namespace)
	params.Set("page", fmt.Sprintf("%d", pageNumber))
	params.Set("per_page", strconv.Itoa(SYNC_BATCH_SIZE))
	return remoteClient.DigestList(params)
}
Ejemplo n.º 5
0
func (dpnSync *DPNSync) getReplicationRequests(remoteClient *network.DPNRestClient, pageNumber int) *network.DPNResponse {
	// Get requests updated since the last time we pulled
	// from this node, where this node is the from_node.
	remoteNode := dpnSync.RemoteNodes[remoteClient.Node]
	params := url.Values{}
	params.Set("after", remoteNode.LastPullDate.Format(time.RFC3339Nano))
	params.Set("from_node", remoteNode.Namespace)
	params.Set("page", fmt.Sprintf("%d", pageNumber))
	params.Set("per_page", strconv.Itoa(SYNC_BATCH_SIZE))
	return remoteClient.ReplicationTransferList(params)
}
Ejemplo n.º 6
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)
}