Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #76 from fastly/ejthurgo/quick-backup-fix
Browse files Browse the repository at this point in the history
Backup fix
  • Loading branch information
Ed Thurgood committed Feb 15, 2019
2 parents 9606794 + df1e27e commit 6477f49
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion waflyctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -1867,6 +1867,7 @@ func backupConfig(apiEndpoint, apiKey, serviceID, wafID string, client fastly.Cl
result.page = append(result.page, body)

currentpage := body.Meta.CurrentPage
perpage := body.Meta.PerPage
totalpages := body.Meta.TotalPages

Info.Printf("Backing up %d rules", body.Meta.RecordCount)
Expand All @@ -1876,7 +1877,7 @@ func backupConfig(apiEndpoint, apiKey, serviceID, wafID string, client fastly.Cl

Info.Printf("Reading page: %d out of %d", currentpage, totalpages)
//set our API call
apiCall := apiEndpoint + "/service/" + serviceID + "/wafs/" + wafID + "/rule_statuses?page[size]=200&page[number]=" + strconv.Itoa(currentpage)
apiCall := fmt.Sprintf("%s/service/%s/wafs/%s/rule_statuses?page[size]=%d&page[number]=%d", apiEndpoint, serviceID, wafID, perpage, currentpage)

resp, err := resty.R().
SetHeader("Accept", "application/vnd.api+json").
Expand Down

0 comments on commit 6477f49

Please sign in to comment.