Merge "Add ability to configure api_result_limit"

This commit is contained in:
Zuul 2018-07-16 07:11:05 +00:00 committed by Gerrit Code Review
commit 7c33c07858
8 changed files with 28 additions and 5 deletions

View File

@ -364,3 +364,10 @@ options:
twice the number of CPU cores a service unit has. When deployed in
a LXD container, this default value will be capped to 4 workers
unless this configuration option is set.
api-result-limit:
type: int
default:
description: |
The maximum number of objects (e.g. Swift objects or Glance images) to
display on a single page before providing a paging element (a “more” link)
to paginate results.

View File

@ -199,6 +199,8 @@ class HorizonContext(OSContextGenerator):
'multi_domain': False if config('default-domain') else True,
"default_create_volume": config("default-create-volume"),
'image_formats': config('image-formats'),
'api_result_limit': config('api-result-limit')
if config('api-result-limit') > 0 else 1000,
}
return ctxt

View File

@ -237,7 +237,7 @@ SECONDARY_ENDPOINT_TYPE = "{{ secondary_endpoint }}"
# The number of objects (Swift containers/objects or images) to display
# on a single page before providing a paging element (a "more" link)
# to paginate results.
API_RESULT_LIMIT = 1000
API_RESULT_LIMIT = {{ api_result_limit }}
API_RESULT_PAGE_SIZE = 20
# The timezone of the server. This should correspond with the timezone

View File

@ -341,7 +341,7 @@ SECONDARY_ENDPOINT_TYPE = "{{ secondary_endpoint }}"
# The number of objects (Swift containers/objects or images) to display
# on a single page before providing a paging element (a "more" link)
# to paginate results.
API_RESULT_LIMIT = 1000
API_RESULT_LIMIT = {{ api_result_limit }}
API_RESULT_PAGE_SIZE = 20
# The size of chunk in bytes for downloading objects from Swift

View File

@ -421,7 +421,7 @@ SECONDARY_ENDPOINT_TYPE = "{{ secondary_endpoint }}"
# The number of objects (Swift containers/objects or images) to display
# on a single page before providing a paging element (a "more" link)
# to paginate results.
API_RESULT_LIMIT = 1000
API_RESULT_LIMIT = {{ api_result_limit }}
API_RESULT_PAGE_SIZE = 20
# The size of chunk in bytes for downloading objects from Swift

View File

@ -456,7 +456,7 @@ SECONDARY_ENDPOINT_TYPE = "{{ secondary_endpoint }}"
# The number of objects (Swift containers/objects or images) to display
# on a single page before providing a paging element (a "more" link)
# to paginate results.
API_RESULT_LIMIT = 1000
API_RESULT_LIMIT = {{ api_result_limit }}
API_RESULT_PAGE_SIZE = 20
# The size of chunk in bytes for downloading objects from Swift

View File

@ -459,7 +459,7 @@ SECONDARY_ENDPOINT_TYPE = "{{ secondary_endpoint }}"
# The number of objects (Swift containers/objects or images) to display
# on a single page before providing a paging element (a "more" link)
# to paginate results.
API_RESULT_LIMIT = 1000
API_RESULT_LIMIT = {{ api_result_limit }}
API_RESULT_PAGE_SIZE = 20
# The size of chunk in bytes for downloading objects from Swift

View File

@ -144,6 +144,7 @@ class TestHorizonContexts(CharmTestCase):
"allow_password_autocompletion": False,
"default_create_volume": True,
"image_formats": '',
"api_result_limit": 1000,
}
)
@ -170,6 +171,7 @@ class TestHorizonContexts(CharmTestCase):
"allow_password_autocompletion": False,
"default_create_volume": True,
"image_formats": '',
"api_result_limit": 1000,
}
)
@ -196,6 +198,7 @@ class TestHorizonContexts(CharmTestCase):
"allow_password_autocompletion": False,
"default_create_volume": True,
"image_formats": '',
"api_result_limit": 1000,
}
)
@ -222,6 +225,7 @@ class TestHorizonContexts(CharmTestCase):
"allow_password_autocompletion": False,
"default_create_volume": True,
"image_formats": '',
"api_result_limit": 1000,
}
)
@ -249,6 +253,7 @@ class TestHorizonContexts(CharmTestCase):
"allow_password_autocompletion": False,
"default_create_volume": True,
"image_formats": '',
"api_result_limit": 1000,
}
)
@ -279,6 +284,7 @@ class TestHorizonContexts(CharmTestCase):
"allow_password_autocompletion": False,
"default_create_volume": True,
"image_formats": '',
"api_result_limit": 1000,
}
)
@ -305,6 +311,7 @@ class TestHorizonContexts(CharmTestCase):
"allow_password_autocompletion": False,
"default_create_volume": True,
"image_formats": '',
"api_result_limit": 1000,
}
)
@ -331,6 +338,7 @@ class TestHorizonContexts(CharmTestCase):
"allow_password_autocompletion": False,
"default_create_volume": True,
"image_formats": '',
"api_result_limit": 1000,
}
)
@ -362,6 +370,7 @@ class TestHorizonContexts(CharmTestCase):
"allow_password_autocompletion": False,
"default_create_volume": True,
"image_formats": '',
"api_result_limit": 1000,
}
)
@ -388,6 +397,7 @@ class TestHorizonContexts(CharmTestCase):
"allow_password_autocompletion": False,
"default_create_volume": True,
"image_formats": '',
"api_result_limit": 1000,
}
)
@ -414,6 +424,7 @@ class TestHorizonContexts(CharmTestCase):
"allow_password_autocompletion": False,
"default_create_volume": True,
"image_formats": '',
"api_result_limit": 1000,
}
)
@ -441,6 +452,7 @@ class TestHorizonContexts(CharmTestCase):
"allow_password_autocompletion": True,
"default_create_volume": True,
"image_formats": '',
"api_result_limit": 1000,
}
)
@ -468,6 +480,7 @@ class TestHorizonContexts(CharmTestCase):
"allow_password_autocompletion": False,
"default_create_volume": False,
"image_formats": '',
"api_result_limit": 1000,
}
)
@ -495,6 +508,7 @@ class TestHorizonContexts(CharmTestCase):
"allow_password_autocompletion": False,
"default_create_volume": True,
"image_formats": 'iso qcow2 raw',
"api_result_limit": 1000,
}
)