Skip to content

Commit

Permalink
Merge pull request #20083 from influxdata/larger-pagesize
Browse files Browse the repository at this point in the history
fix(api): raise API pagesizes
  • Loading branch information
docmerlin authored Nov 18, 2020
2 parents 71f8de3 + 4b99125 commit d93560f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

### Features

1. [20036](https://github.com/influxdata/influxdb/pull/20036): Warn if V1 users are upgraded, but V1 auth wasn't enabled
1. [20039](https://github.com/influxdata/influxdb/pull/20039): Export 1.x CQs as part of `influxd upgrade`
1. [20067](https://github.com/influxdata/influxdb/pull/20067): Add DBRP cli commands as `influxd v1 dbrp`
1. [20036](https://github.com/influxdata/influxdb/pull/20036): Warn if V1 users are upgraded, but V1 auth wasn't enabled.
1. [20039](https://github.com/influxdata/influxdb/pull/20039): Export 1.x CQs as part of `influxd upgrade`.
1. [20067](https://github.com/influxdata/influxdb/pull/20067): Add DBRP cli commands as `influxd v1 dbrp`.
1. [20083](https://github.com/influxdata/influxdb/pull/20083): Increased the API DefaultPageSize and MaxPageSize to 2000.

### Bug Fixes

Expand Down
7 changes: 4 additions & 3 deletions dashboards/transport/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"io/ioutil"
"net/http"
"net/http/httptest"
"strconv"
"testing"
"time"

Expand Down Expand Up @@ -144,7 +145,7 @@ func TestService_handleGetDashboards(t *testing.T) {
body: `
{
"links": {
"self": "/api/v2/dashboards?descending=false&limit=20&offset=0"
"self": "/api/v2/dashboards?descending=false&limit=` + strconv.Itoa(influxdb.DefaultPageSize) + `&offset=0"
},
"dashboards": [
{
Expand Down Expand Up @@ -241,7 +242,7 @@ func TestService_handleGetDashboards(t *testing.T) {
body: `
{
"links": {
"self": "/api/v2/dashboards?descending=false&limit=20&offset=0"
"self": "/api/v2/dashboards?descending=false&limit=` + strconv.Itoa(influxdb.DefaultPageSize) + `&offset=0"
},
"dashboards": []
}`,
Expand Down Expand Up @@ -303,7 +304,7 @@ func TestService_handleGetDashboards(t *testing.T) {
body: `
{
"links": {
"self": "/api/v2/dashboards?descending=false&limit=20&offset=0&orgID=0000000000000001"
"self": "/api/v2/dashboards?descending=false&limit=` + strconv.Itoa(influxdb.DefaultPageSize) + `&offset=0&orgID=0000000000000001"
},
"dashboards": [
{
Expand Down
5 changes: 3 additions & 2 deletions http/variable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"io/ioutil"
"net/http"
"net/http/httptest"
"strconv"
"testing"
"time"

Expand Down Expand Up @@ -110,7 +111,7 @@ func TestVariableService_handleGetVariables(t *testing.T) {
contentType: "application/json; charset=utf-8",
body: `{
"links":{
"self":"/api/v2/variables?descending=false&limit=20&offset=0"
"self":"/api/v2/variables?descending=false&limit=` + strconv.Itoa(platform.DefaultPageSize) + `&offset=0"
},
"variables":[
{
Expand Down Expand Up @@ -254,7 +255,7 @@ func TestVariableService_handleGetVariables(t *testing.T) {
contentType: "application/json; charset=utf-8",
body: `{
"links": {
"self": "/api/v2/variables?descending=false&limit=20&offset=0&orgID=0000000000000001"
"self": "/api/v2/variables?descending=false&limit=` + strconv.Itoa(platform.DefaultPageSize) + `&offset=0&orgID=0000000000000001"
},
"variables": [
{
Expand Down
5 changes: 3 additions & 2 deletions paging.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import (
)

const (
DefaultPageSize = 20
MaxPageSize = 100
// TODO(docmerlin): change this when pagination is fixed
DefaultPageSize = 2000
MaxPageSize = 2000
)

// PagingFilter represents a filter containing url query params.
Expand Down

0 comments on commit d93560f

Please sign in to comment.