Add ability to configure api_result_limit
In clouds with many containers or objects, listing them via Horizon can cause a signficant increase of system load. This patch enables configuration of the API_RESULT_LIMIT setting within Horizon. This limits the maximum number of objects to display on a single page before providing a paging element to paginate results. Change-Id: Ifaf39d6c9bf549428afd7653243c82cd719956f6 Closes-Bug: 1775002
This commit is contained in:
parent
a0056fabd2
commit
e58a1b2a3d
|
@ -357,3 +357,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.
|
||||
|
|
|
@ -198,6 +198,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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -139,6 +139,7 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"allow_password_autocompletion": False,
|
||||
"default_create_volume": True,
|
||||
"image_formats": '',
|
||||
"api_result_limit": 1000,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -164,6 +165,7 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"allow_password_autocompletion": False,
|
||||
"default_create_volume": True,
|
||||
"image_formats": '',
|
||||
"api_result_limit": 1000,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -189,6 +191,7 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"allow_password_autocompletion": False,
|
||||
"default_create_volume": True,
|
||||
"image_formats": '',
|
||||
"api_result_limit": 1000,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -214,6 +217,7 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"allow_password_autocompletion": False,
|
||||
"default_create_volume": True,
|
||||
"image_formats": '',
|
||||
"api_result_limit": 1000,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -240,6 +244,7 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"allow_password_autocompletion": False,
|
||||
"default_create_volume": True,
|
||||
"image_formats": '',
|
||||
"api_result_limit": 1000,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -269,6 +274,7 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"allow_password_autocompletion": False,
|
||||
"default_create_volume": True,
|
||||
"image_formats": '',
|
||||
"api_result_limit": 1000,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -294,6 +300,7 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"allow_password_autocompletion": False,
|
||||
"default_create_volume": True,
|
||||
"image_formats": '',
|
||||
"api_result_limit": 1000,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -319,6 +326,7 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"allow_password_autocompletion": False,
|
||||
"default_create_volume": True,
|
||||
"image_formats": '',
|
||||
"api_result_limit": 1000,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -349,6 +357,7 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"allow_password_autocompletion": False,
|
||||
"default_create_volume": True,
|
||||
"image_formats": '',
|
||||
"api_result_limit": 1000,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -374,6 +383,7 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"allow_password_autocompletion": False,
|
||||
"default_create_volume": True,
|
||||
"image_formats": '',
|
||||
"api_result_limit": 1000,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -399,6 +409,7 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"allow_password_autocompletion": False,
|
||||
"default_create_volume": True,
|
||||
"image_formats": '',
|
||||
"api_result_limit": 1000,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -425,6 +436,7 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"allow_password_autocompletion": True,
|
||||
"default_create_volume": True,
|
||||
"image_formats": '',
|
||||
"api_result_limit": 1000,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -451,6 +463,7 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"allow_password_autocompletion": False,
|
||||
"default_create_volume": False,
|
||||
"image_formats": '',
|
||||
"api_result_limit": 1000,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -477,6 +490,7 @@ class TestHorizonContexts(CharmTestCase):
|
|||
"allow_password_autocompletion": False,
|
||||
"default_create_volume": True,
|
||||
"image_formats": 'iso qcow2 raw',
|
||||
"api_result_limit": 1000,
|
||||
}
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue