Support more parameters to define/tune api behavior
Change-Id: Ic05d0cddfaccab6759b4d587e0fbc0bcff01977b
This commit is contained in:
parent
caec9bd63e
commit
59babeddfe
|
@ -26,18 +26,38 @@
|
|||
# (optional) Number of separate worker process for service.
|
||||
# Defaults to $::os_workers
|
||||
#
|
||||
# [*allow_bulk*]
|
||||
# (Optional) Allow the usage of the bulk API.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*allow_pagination*]
|
||||
# (Optional) Allow the usage of the pagination.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*allow_sorting*]
|
||||
# (Optional) Allow the usage of the sorting.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*pagination_max_limit*]
|
||||
# (Optional) The maximum number of items returned in a single response.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*package_ensure*]
|
||||
# (Optional) Ensure state for package.
|
||||
# Defaults to 'present'
|
||||
#
|
||||
class tacker::server(
|
||||
$manage_service = true,
|
||||
$enabled = true,
|
||||
$auth_strategy = 'keystone',
|
||||
$bind_host = $::os_service_default,
|
||||
$bind_port = $::os_service_default,
|
||||
$api_workers = $::os_workers,
|
||||
$package_ensure = 'present',
|
||||
$manage_service = true,
|
||||
$enabled = true,
|
||||
$auth_strategy = 'keystone',
|
||||
$bind_host = $::os_service_default,
|
||||
$bind_port = $::os_service_default,
|
||||
$api_workers = $::os_workers,
|
||||
$allow_bulk = $::os_service_default,
|
||||
$allow_pagination = $::os_service_default,
|
||||
$allow_sorting = $::os_service_default,
|
||||
$pagination_max_limit = $::os_service_default,
|
||||
$package_ensure = 'present',
|
||||
) {
|
||||
|
||||
include tacker::deps
|
||||
|
@ -55,10 +75,14 @@ class tacker::server(
|
|||
})
|
||||
|
||||
tacker_config {
|
||||
'DEFAULT/auth_strategy': value => $auth_strategy;
|
||||
'DEFAULT/bind_host': value => $bind_host;
|
||||
'DEFAULT/bind_port': value => $bind_port;
|
||||
'DEFAULT/api_workers': value => $api_workers;
|
||||
'DEFAULT/auth_strategy': value => $auth_strategy;
|
||||
'DEFAULT/bind_host': value => $bind_host;
|
||||
'DEFAULT/bind_port': value => $bind_port;
|
||||
'DEFAULT/api_workers': value => $api_workers;
|
||||
'DEFAULT/allow_bulk': value => $allow_bulk;
|
||||
'DEFAULT/allow_pagination': value => $allow_pagination;
|
||||
'DEFAULT/allow_sorting': value => $allow_sorting;
|
||||
'DEFAULT/pagination_max_limit': value => $pagination_max_limit;
|
||||
}
|
||||
|
||||
if $manage_service {
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
The following parameters have been added to the ``tacker::server`` class.
|
||||
|
||||
- ``allow_bulk``
|
||||
- ``allow_pagination``
|
||||
- ``allow_sorting``
|
||||
- ``pagination_max_limit``
|
|
@ -28,6 +28,10 @@ describe 'tacker::server' do
|
|||
is_expected.to contain_tacker_config('DEFAULT/bind_host').with_value( params[:bind_host] )
|
||||
is_expected.to contain_tacker_config('DEFAULT/bind_port').with_value( params[:bind_port] )
|
||||
is_expected.to contain_tacker_config('DEFAULT/api_workers').with_value(4)
|
||||
is_expected.to contain_tacker_config('DEFAULT/allow_bulk').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_tacker_config('DEFAULT/allow_pagination').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_tacker_config('DEFAULT/allow_sorting').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_tacker_config('DEFAULT/pagination_max_limit').with_value('<SERVICE DEFAULT>')
|
||||
end
|
||||
|
||||
[{:enabled => true}, {:enabled => false}].each do |param_hash|
|
||||
|
|
Loading…
Reference in New Issue