HttpConfigHelper¶
-
class
server.
HttpConfigHelper
¶ Bases:
object
Static Helper class for generating nginx config file
Methods Summary
create_config_file
(_server)Generates a new config file for nginx and saves it to the specific location It will overwrite the existing one create_dns_entry
(_server)Update for AWS antano.io dns entries reload_nginx
(_server_dns)Reloads the nginx and apply a certBot certificate write_config_file
(config[, _location])Writes the current config to nginx config file Methods Documentation
-
static
create_config_file
(_server)¶ Generates a new config file for nginx and saves it to the specific location It will overwrite the existing one
Parameters: _server ([dict]) – [server param dict] Example
_server = {“id”: 1, “num_of_processes”: 1, “dns_entry”: “localhost”, “server_name”: “MyAntanoServer”, “active_service”: [
- {
- # udp service “id”: 1, “antano_server_id”: 1, # needs to be the same as id above “service_type_id”: 1, “port”: 19022, “https”: 49022, “host”: “0.0.0.0”, “endpoint”: “test_xxx”, “message_format_in_id”: 1, # message_format “message_format_out_id”: 1, # message_format
},
]
}
-
static
create_dns_entry
(_server)¶ Update for AWS antano.io dns entries
Parameters: _config_file (dict) – current config file from server
-
static
reload_nginx
(_server_dns)¶ Reloads the nginx and apply a certBot certificate
Parameters: _server_dns ([string]) – [current server dns entry]
-
static
write_config_file
(config, _location='/etc/nginx/conf.d/antano.conf')¶ Writes the current config to nginx config file
Parameters: - config ([Block]) – [nginx blocks]
- _location ([string]) – [location where to save the file]
-
static