Merge "Allow port in JSON ingester config"

This commit is contained in:
Zuul 2019-03-07 13:26:25 +00:00 committed by Gerrit Code Review
commit fa524f86bd
7 changed files with 172 additions and 9 deletions

View File

@ -65,8 +65,14 @@ class ExecApiManager(object):
'supported.'.auth_config['type'])
name = config['name']
port = config.get('api_endpoint_port')
if port is not None:
port_str = ':' + str(port)
else:
port_str = ''
self._exec_api_endpoints[name] = (
config.get('api_endpoint_host', '').rstrip('/') + '/'
config.get('api_endpoint_host', '').rstrip('/')
+ port_str + '/'
+ config.get('api_endpoint_path', '').lstrip('/'))
self._exec_api_sessions[name] = session

View File

@ -74,8 +74,15 @@ class JsonIngester(datasource_driver.PollingDataSourceDriver):
self._create_schema_and_tables()
self.poll_time = self._config.get('poll_interval', 60)
self._setup_table_key_sets()
self._api_endpoint = self._config.get('api_endpoint_host', '').rstrip(
'/') + '/' + self._config.get('api_endpoint_path', '').lstrip('/')
port = self._config.get('api_endpoint_port')
if port is not None:
port_str = ':' + str(port)
else:
port_str = ''
self._api_endpoint = (
self._config.get('api_endpoint_host', '').rstrip('/')
+ port_str + '/'
+ self._config.get('api_endpoint_path', '').lstrip('/'))
self._initialize_session()
self._initialize_update_methods()
if len(self.update_methods) > 0:

View File

@ -0,0 +1,11 @@
name: _cve
allow_exec_api: true
poll_interval: 86400 # one day
api_endpoint_host: https://cve.circl.lu
api_endpoint_path: api/
tables:
linux_kernel:
poll:
api_path: search/linux/kernel
api_method: get
jsonpath: $[:]

View File

@ -0,0 +1,54 @@
name: _identity
poll_interval: 60
allow_exec_api: true
authentication: !ref keystone_admin_auth_config
api_endpoint_host: !ref primary_host
api_endpoint_path: identity/v3/
api_default_headers:
X-OpenStack-Nova-API-Version: "2.26"
tables:
domains:
poll:
api_path: domains
api_method: get
jsonpath: $.domains[:]
groups:
poll:
api_path: groups
api_method: get
jsonpath: $.groups[:]
projects:
poll:
api_path: projects
api_method: get
jsonpath: $.projects[:]
regions:
poll:
api_path: regions
api_method: get
jsonpath: $.regions[:]
roles:
poll:
api_path: roles
api_method: get
jsonpath: $.roles[:]
services:
poll:
api_path: services
api_method: get
jsonpath: $.services[:]
endpoints:
poll:
api_path: endpoints
api_method: get
jsonpath: $.endpoints[:]
registered_limits:
poll:
api_path: registered_limits
api_method: get
jsonpath: $.registered_limits[:]
users:
poll:
api_path: users
api_method: get
jsonpath: $.users[:]

View File

@ -0,0 +1,6 @@
name: _monasca
tables:
alarms:
webhook:
record_jsonpath: $
id_jsonpath: $.alarm_id

View File

@ -0,0 +1,63 @@
name: _networking
poll_interval: 60
allow_exec_api: true
authentication: !ref keystone_admin_auth_config
api_endpoint_host: !ref primary_host
api_endpoint_path: v2.0/
api_endpoint_port: 9696
tables:
networks:
poll:
api_path: networks
api_method: get
jsonpath: $.networks[:]
ports:
poll:
api_path: ports
api_method: get
jsonpath: $.ports[:]
floatingips:
poll:
api_path: floatingips
api_method: get
jsonpath: $.floatingips[:]
routers:
poll:
api_path: routers
api_method: get
jsonpath: $.routers[:]
subnets:
poll:
api_path: subnets
api_method: get
jsonpath: $.subnets[:]
firewall_groups:
poll:
api_path: fwaas/firewall_groups
api_method: get
jsonpath: $.firewall_groups[:]
firewall_policies:
poll:
api_path: fwaas/firewall_policies
api_method: get
jsonpath: $.firewall_policies[:]
firewall_rules:
poll:
api_path: fwaas/firewall_rules
api_method: get
jsonpath: $.firewall_rules[:]
security_groups:
poll:
api_path: security-groups
api_method: get
jsonpath: $.security_groups[:]
rbac_policies:
poll:
api_path: rbac-policies
api_method: get
jsonpath: $.rbac_policies[:]
agents:
poll:
api_path: agents
api_method: get
jsonpath: $.agents[:]

View File

@ -1,5 +1,5 @@
name: nova
poll_interval: 5
name: _compute
poll_interval: 60
allow_exec_api: true
authentication: !ref keystone_admin_auth_config
api_endpoint_host: !ref primary_host
@ -17,7 +17,23 @@ tables:
api_path: servers/detail
api_method: get
jsonpath: $.servers[:]
alarms:
webhook:
record_jsonpath: $.payload
id_jsonpath: $.id
hypervisors:
poll:
api_path: os-hypervisors/detail
api_method: get
jsonpath: $.hypervisors[:]
availability_zones:
poll:
api_path: os-availability-zone/detail
api_method: get
jsonpath: $.availabilityZoneInfo[:]
migrations:
poll:
api_path: os-migrations
api_method: get
jsonpath: $.migrations[:]
services:
poll:
api_path: os-services
api_method: get
jsonpath: $.services[:]