New parameters for service::api section
Change-Id: I18bde9968517c1f35af26a930e6e14a2dd98dd22 Closes-Bug: 1654208
This commit is contained in:
parent
39603d4a2f
commit
b1d6d9e1ef
|
@ -60,6 +60,38 @@
|
|||
# (optional) Maximum line size of message headers to be accepted.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*default_limit_admin*]
|
||||
# (optional) Default per-page limit for the Admin API.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*max_limit_admin*]
|
||||
# (optional) Max page size in the Admin API.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*default_limit_v2*]
|
||||
# (optional) Default per-page limit for the V2 API.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*max_limit_v2*]
|
||||
# (optional) Max page size in the V2 API.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*pecan_debug*]
|
||||
# (optional) Show the pecan HTML based debug interface (v2 only).
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*enabled_extensions_v1*]
|
||||
# (optional) API Version 1 extensions.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*enabled_extensions_v2*]
|
||||
# (optional) API Version 2 extensions.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*enabled_extensions_admin*]
|
||||
# (optional) Admin API extensions.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# DEPRECATED PARAMETERS
|
||||
#
|
||||
# [*api_host*]
|
||||
|
@ -71,20 +103,28 @@
|
|||
# Defaults to undef
|
||||
#
|
||||
class designate::api (
|
||||
$package_ensure = present,
|
||||
$api_package_name = $::designate::params::api_package_name,
|
||||
$enabled = true,
|
||||
$service_ensure = 'running',
|
||||
$auth_strategy = $::os_service_default,
|
||||
$enable_api_v1 = $::os_service_default,
|
||||
$enable_api_v2 = $::os_service_default,
|
||||
$enable_api_admin = $::os_service_default,
|
||||
$api_base_uri = $::os_service_default,
|
||||
$listen = $::os_service_default,
|
||||
$workers = $::os_service_default,
|
||||
$threads = $::os_service_default,
|
||||
$enable_host_header = $::os_service_default,
|
||||
$max_header_line = $::os_service_default,
|
||||
$package_ensure = present,
|
||||
$api_package_name = $::designate::params::api_package_name,
|
||||
$enabled = true,
|
||||
$service_ensure = 'running',
|
||||
$auth_strategy = $::os_service_default,
|
||||
$enable_api_v1 = $::os_service_default,
|
||||
$enable_api_v2 = $::os_service_default,
|
||||
$enable_api_admin = $::os_service_default,
|
||||
$api_base_uri = $::os_service_default,
|
||||
$listen = $::os_service_default,
|
||||
$workers = $::os_service_default,
|
||||
$threads = $::os_service_default,
|
||||
$enable_host_header = $::os_service_default,
|
||||
$max_header_line = $::os_service_default,
|
||||
$default_limit_admin = $::os_service_default,
|
||||
$max_limit_admin = $::os_service_default,
|
||||
$default_limit_v2 = $::os_service_default,
|
||||
$max_limit_v2 = $::os_service_default,
|
||||
$pecan_debug = $::os_service_default,
|
||||
$enabled_extensions_v1 = $::os_service_default,
|
||||
$enabled_extensions_v2 = $::os_service_default,
|
||||
$enabled_extensions_admin = $::os_service_default,
|
||||
# DEPRECATED PARAMETERS
|
||||
$api_host = undef,
|
||||
$api_port = undef,
|
||||
|
@ -115,6 +155,14 @@ class designate::api (
|
|||
'service:api/threads' : value => $threads;
|
||||
'service:api/enable_host_header' : value => $enable_host_header;
|
||||
'service:api/max_header_line' : value => $max_header_line;
|
||||
'service:api/default_limit_admin' : value => $default_limit_admin;
|
||||
'service:api/max_limit_admin' : value => $max_limit_admin;
|
||||
'service:api/default_limit_v2' : value => $default_limit_v2;
|
||||
'service:api/max_limit_v2' : value => $max_limit_v2;
|
||||
'service:api/pecan_debug' : value => $pecan_debug;
|
||||
'service:api/enabled_extensions_v1' : value => $enabled_extensions_v1;
|
||||
'service:api/enabled_extensions_v2' : value => $enabled_extensions_v2;
|
||||
'service:api/enabled_extensions_admin' : value => $enabled_extensions_admin;
|
||||
}
|
||||
|
||||
if $auth_strategy == 'keystone' {
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
fixes:
|
||||
- workers option for service:api section in designate config file.
|
||||
- threads option for service:api section in designate config file.
|
||||
- enable_host_header option for service:api section in designate config file.
|
||||
- max_header_line option for service:api section in designate config file.
|
||||
- default_limit_admin option for service:api section in designate config file.
|
||||
- max_limit_admin option for service:api section in designate config file.
|
||||
- default_limit_v2 option for service:api section in designate config file.
|
||||
- max_limit_v2 option for service:api section in designate config file.
|
||||
- pecan_debug option for service:api section in designate config file.
|
||||
- enabled_extensions_v1 option for service:api section in designate config file.
|
||||
- enabled_extensions_v2 option for service:api section in designate config file.
|
||||
- enabled_extensions_admin option for service:api section in designate config file.
|
|
@ -42,14 +42,61 @@ describe 'designate::api' do
|
|||
is_expected.to contain_designate_config('service:api/threads').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_designate_config('service:api/enable_host_header').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_designate_config('service:api/max_header_line').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_designate_config('service:api/default_limit_admin').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_designate_config('service:api/max_limit_admin').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_designate_config('service:api/default_limit_v2').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_designate_config('service:api/max_limit_v2').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_designate_config('service:api/pecan_debug').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_designate_config('service:api/enabled_extensions_v1').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_designate_config('service:api/enabled_extensions_v2').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_designate_config('service:api/enabled_extensions_admin').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to_not contain_designate__keystone__authtoken('designate_config')
|
||||
end
|
||||
end
|
||||
|
||||
context 'when using auth against keystone' do
|
||||
before { params.merge!(:auth_strategy => 'keystone') }
|
||||
it 'configures designate-api with keystone auth strategy' do
|
||||
is_expected.to contain_designate_config('service:api/auth_strategy').with_value('keystone')
|
||||
end
|
||||
context 'when overriding parameters' do
|
||||
before do
|
||||
params.merge!({
|
||||
:auth_strategy => 'noauth',
|
||||
:enable_api_v1 => false,
|
||||
:enable_api_v2 => true,
|
||||
:enable_api_admin => true,
|
||||
:api_base_uri => 'http://myhost.es:9001/',
|
||||
:listen => '0.0.0.0:9001',
|
||||
:workers => '10',
|
||||
:threads => '1500',
|
||||
:enable_host_header => true,
|
||||
:max_header_line => '17777',
|
||||
:default_limit_admin => '25',
|
||||
:max_limit_admin => '1500',
|
||||
:default_limit_v2 => '25',
|
||||
:max_limit_v2 => '1500',
|
||||
:pecan_debug => true,
|
||||
:enabled_extensions_v1 => 'diagnostics,quotas,reports,sync,touch',
|
||||
:enabled_extensions_v2 => 'experimental',
|
||||
:enabled_extensions_admin => 'reports,quotas,counts,tenants,target_sync',
|
||||
})
|
||||
end
|
||||
|
||||
it 'configure service_api' do
|
||||
is_expected.to contain_designate_config('service:api/auth_strategy').with_value(params[:auth_strategy])
|
||||
is_expected.to contain_designate_config('service:api/enable_api_v1').with_value(params[:enable_api_v1])
|
||||
is_expected.to contain_designate_config('service:api/enable_api_v2').with_value(params[:enable_api_v2])
|
||||
is_expected.to contain_designate_config('service:api/enable_api_admin').with_value(params[:enable_api_admin])
|
||||
is_expected.to contain_designate_config('service:api/api_base_uri').with_value(params[:api_base_uri])
|
||||
is_expected.to contain_designate_config('service:api/listen').with_value(params[:listen])
|
||||
is_expected.to contain_designate_config('service:api/workers').with_value(params[:workers])
|
||||
is_expected.to contain_designate_config('service:api/threads').with_value(params[:threads])
|
||||
is_expected.to contain_designate_config('service:api/enable_host_header').with_value(params[:enable_host_header])
|
||||
is_expected.to contain_designate_config('service:api/max_header_line').with_value(params[:max_header_line])
|
||||
is_expected.to contain_designate_config('service:api/default_limit_admin').with_value(params[:default_limit_admin])
|
||||
is_expected.to contain_designate_config('service:api/max_limit_admin').with_value(params[:max_limit_admin])
|
||||
is_expected.to contain_designate_config('service:api/default_limit_v2').with_value(params[:default_limit_v2])
|
||||
is_expected.to contain_designate_config('service:api/max_limit_v2').with_value(params[:max_limit_v2])
|
||||
is_expected.to contain_designate_config('service:api/pecan_debug').with_value(params[:pecan_debug])
|
||||
is_expected.to contain_designate_config('service:api/enabled_extensions_v1').with_value(params[:enabled_extensions_v1])
|
||||
is_expected.to contain_designate_config('service:api/enabled_extensions_v2').with_value(params[:enabled_extensions_v2])
|
||||
is_expected.to contain_designate_config('service:api/enabled_extensions_admin').with_value(params[:enabled_extensions_admin])
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue