Skip to content
Snippets Groups Projects
Commit 9ac9292c authored by Erik Reid's avatar Erik Reid
Browse files

renamed param

parent ec2978d1
Branches
Tags
No related merge requests found
...@@ -46,7 +46,7 @@ _DEFAULT_CONFIG = { ...@@ -46,7 +46,7 @@ _DEFAULT_CONFIG = {
'https://test-poller-sensu-agent02.geant.org:8080', 'https://test-poller-sensu-agent02.geant.org:8080',
'https://test-poller-sensu-agent03.geant.org:8080' 'https://test-poller-sensu-agent03.geant.org:8080'
], ],
'token': '696a815c-607e-4090-81de-58988c83033e', 'api-key': '696a815c-607e-4090-81de-58988c83033e',
'interface-check': { 'interface-check': {
'script': '/var/lib/sensu/bin/counter2influx.sh', 'script': '/var/lib/sensu/bin/counter2influx.sh',
'measurement': 'counters', 'measurement': 'counters',
...@@ -103,10 +103,10 @@ CONFIG_SCHEMA = { ...@@ -103,10 +103,10 @@ CONFIG_SCHEMA = {
'items': {'type': 'string'}, 'items': {'type': 'string'},
'minItems': 1 'minItems': 1
}, },
'token': {'type': 'string'}, 'api-key': {'type': 'string'},
'interface-check': {'$ref': '#/definitions/influx-check'} 'interface-check': {'$ref': '#/definitions/influx-check'}
}, },
'required': ['api-base', 'token', 'interface-check'], 'required': ['api-base', 'api-key', 'interface-check'],
'additionalProperties': False 'additionalProperties': False
}, },
'statsd': { 'statsd': {
......
...@@ -13,7 +13,7 @@ def load_all_checks(params, namespace='default'): ...@@ -13,7 +13,7 @@ def load_all_checks(params, namespace='default'):
r = requests.get( r = requests.get(
f'{url}/api/core/v2/namespaces/{namespace}/checks', f'{url}/api/core/v2/namespaces/{namespace}/checks',
headers={ headers={
'Authorization': f'Key {params["token"]}', 'Authorization': f'Key {params["api-key"]}',
'Accepts': 'application/json', 'Accepts': 'application/json',
}) })
r.raise_for_status() r.raise_for_status()
...@@ -28,7 +28,7 @@ def create_check(params, check, namespace='default'): ...@@ -28,7 +28,7 @@ def create_check(params, check, namespace='default'):
r = requests.post( r = requests.post(
f'{url}/api/core/v2/namespaces/{namespace}/checks', f'{url}/api/core/v2/namespaces/{namespace}/checks',
headers={ headers={
'Authorization': f'Key {params["token"]}', 'Authorization': f'Key {params["api-key"]}',
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
json=check) json=check)
...@@ -42,7 +42,7 @@ def update_check(params, check, namespace='default'): ...@@ -42,7 +42,7 @@ def update_check(params, check, namespace='default'):
r = requests.put( r = requests.put(
f'{url}/api/core/v2/namespaces/{namespace}/checks/{name}', f'{url}/api/core/v2/namespaces/{namespace}/checks/{name}',
headers={ headers={
'Authorization': f'Key {params["token"]}', 'Authorization': f'Key {params["api-key"]}',
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
json=check) json=check)
...@@ -58,5 +58,5 @@ def delete_check(params, check, namespace='default'): ...@@ -58,5 +58,5 @@ def delete_check(params, check, namespace='default'):
url = random.choice(params['api-base']) url = random.choice(params['api-base'])
r = requests.delete( r = requests.delete(
f'{url}/api/core/v2/namespaces/{namespace}/checks/{name}', f'{url}/api/core/v2/namespaces/{namespace}/checks/{name}',
headers={'Authorization': f'Key {params["token"]}'}) headers={'Authorization': f'Key {params["api-key"]}'})
r.raise_for_status() r.raise_for_status()
...@@ -32,7 +32,7 @@ def config(): ...@@ -32,7 +32,7 @@ def config():
'https://bogus-sensu02.xxx.yyy:12345', 'https://bogus-sensu02.xxx.yyy:12345',
'https://bogus-sensu03.xxx.yyy:12345' 'https://bogus-sensu03.xxx.yyy:12345'
], ],
'token': 'abc-token-blah-blah', 'api-key': 'abc-sensu-key-blah-blah',
'interface-check': { 'interface-check': {
'script': '/var/lib/sensu/bin/counter2influx.sh', 'script': '/var/lib/sensu/bin/counter2influx.sh',
'measurement': 'counters', 'measurement': 'counters',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment