Add osapi_max_limit parameter
osapi_max_limit makes tunable the number of objects returned by a single API call. This is useful in large installations where tenants are likely to have more than 1000 snapshots. backup scripts that rely on: existing_snapshots = cinder.volume_snapshots.list(search_opts=opts) may have false negatives because the result is truncated to the default value of 1000 items. Change-Id: Id16eadb5d71d1d313399e638be948d79190bde6a
This commit is contained in:
@@ -136,6 +136,11 @@
|
|||||||
# (Optional) Base URL that will be presented to users in links to the OpenStack Volume API.
|
# (Optional) Base URL that will be presented to users in links to the OpenStack Volume API.
|
||||||
# Defaults to $::os_service_default
|
# Defaults to $::os_service_default
|
||||||
#
|
#
|
||||||
|
# [*osapi_max_limit*]
|
||||||
|
# (Optional) The maximum number of items that a collection resource
|
||||||
|
# returns in a single response (integer value)
|
||||||
|
# Defaults to $::os_service_default
|
||||||
|
#
|
||||||
class cinder::api (
|
class cinder::api (
|
||||||
$keystone_password,
|
$keystone_password,
|
||||||
$keystone_enabled = true,
|
$keystone_enabled = true,
|
||||||
@@ -165,6 +170,7 @@ class cinder::api (
|
|||||||
$sync_db = true,
|
$sync_db = true,
|
||||||
$public_endpoint = $::os_service_default,
|
$public_endpoint = $::os_service_default,
|
||||||
$osapi_volume_base_url = $::os_service_default,
|
$osapi_volume_base_url = $::os_service_default,
|
||||||
|
$osapi_max_limit = $::os_service_default,
|
||||||
# DEPRECATED PARAMETERS
|
# DEPRECATED PARAMETERS
|
||||||
$validation_options = {},
|
$validation_options = {},
|
||||||
) {
|
) {
|
||||||
@@ -217,6 +223,7 @@ class cinder::api (
|
|||||||
'DEFAULT/default_volume_type': value => $default_volume_type;
|
'DEFAULT/default_volume_type': value => $default_volume_type;
|
||||||
'DEFAULT/public_endpoint': value => $public_endpoint;
|
'DEFAULT/public_endpoint': value => $public_endpoint;
|
||||||
'DEFAULT/osapi_volume_base_URL': value => $osapi_volume_base_url;
|
'DEFAULT/osapi_volume_base_URL': value => $osapi_volume_base_url;
|
||||||
|
'DEFAULT/osapi_max_limit': value => $osapi_max_limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
cinder_config {
|
cinder_config {
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ describe 'cinder::api' do
|
|||||||
is_expected.to contain_cinder_config('DEFAULT/osapi_volume_base_URL').with(
|
is_expected.to contain_cinder_config('DEFAULT/osapi_volume_base_URL').with(
|
||||||
:value => '<SERVICE DEFAULT>'
|
:value => '<SERVICE DEFAULT>'
|
||||||
)
|
)
|
||||||
|
is_expected.to contain_cinder_config('DEFAULT/osapi_max_limit').with(
|
||||||
|
:value => '<SERVICE DEFAULT>'
|
||||||
|
)
|
||||||
is_expected.to contain_cinder_config('DEFAULT/os_region_name').with(
|
is_expected.to contain_cinder_config('DEFAULT/os_region_name').with(
|
||||||
:value => '<SERVICE DEFAULT>'
|
:value => '<SERVICE DEFAULT>'
|
||||||
)
|
)
|
||||||
@@ -289,6 +292,17 @@ describe 'cinder::api' do
|
|||||||
is_expected.to contain_cinder_config('keystone_authtoken/auth_uri').with_value("https://localhost:5000/")
|
is_expected.to contain_cinder_config('keystone_authtoken/auth_uri').with_value("https://localhost:5000/")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'with a custom osapi_max_limit' do
|
||||||
|
let :params do
|
||||||
|
req_params.merge({'osapi_max_limit' => '10000'})
|
||||||
|
end
|
||||||
|
it 'should configure the osapi_max_limit to 10000' do
|
||||||
|
is_expected.to contain_cinder_config('DEFAULT/osapi_max_limit').with(
|
||||||
|
:value => '10000'
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
on_supported_os({
|
on_supported_os({
|
||||||
|
|||||||
Reference in New Issue
Block a user