Create function to create note data
This commit is contained in:
parent
52ecd2dc53
commit
064d781607
12
agent.py
12
agent.py
|
@ -161,6 +161,13 @@ class ServerData:
|
||||||
logging.info("Post data created")
|
logging.info("Post data created")
|
||||||
return post_data
|
return post_data
|
||||||
|
|
||||||
|
def create_note_data(self, server_id):
|
||||||
|
note_data = {
|
||||||
|
'service_id': server_id,
|
||||||
|
'note': 'Bla bla bla'
|
||||||
|
}
|
||||||
|
return note_data
|
||||||
|
|
||||||
|
|
||||||
class ServerManager:
|
class ServerManager:
|
||||||
def __init__(self, host, api_key):
|
def __init__(self, host, api_key):
|
||||||
|
@ -249,10 +256,7 @@ def main():
|
||||||
logging.info('Server does not exist, Creating...')
|
logging.info('Server does not exist, Creating...')
|
||||||
logging.info(server_manager.create_server(post_data))
|
logging.info(server_manager.create_server(post_data))
|
||||||
|
|
||||||
note_data = {
|
note_data = server_data.create_note_data(server_id)
|
||||||
'service_id': server_id,
|
|
||||||
'note': 'Bla bla bla'
|
|
||||||
}
|
|
||||||
try:
|
try:
|
||||||
note = server_manager.get_note(server_id)
|
note = server_manager.get_note(server_id)
|
||||||
except urllib.error.HTTPError:
|
except urllib.error.HTTPError:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user