CC-5004: Fix mistake in api_client.cfg
-fixed by simply removing all unnecessary stuff to python file
This commit is contained in:
parent
018ec9231e
commit
54a9f50055
2 changed files with 49 additions and 121 deletions
|
@ -38,6 +38,53 @@ def convert_dict_value_to_utf8(md):
|
|||
#list comprehension to convert all values of md to utf-8
|
||||
return dict([(item[0], encode_to(item[1], "utf-8")) for item in md.items()])
|
||||
|
||||
|
||||
api_config = {}
|
||||
|
||||
# URL to get the version number of the server API
|
||||
api_config['version_url'] = 'version/api_key/%%api_key%%'
|
||||
#URL to register a components IP Address with the central web server
|
||||
api_config['register_component'] = 'register-component/format/json/api_key/%%api_key%%/component/%%component%%'
|
||||
|
||||
#media-monitor
|
||||
api_config['media_setup_url'] = 'media-monitor-setup/format/json/api_key/%%api_key%%'
|
||||
api_config['upload_recorded'] = 'upload-recorded/format/json/api_key/%%api_key%%/fileid/%%fileid%%/showinstanceid/%%showinstanceid%%'
|
||||
api_config['update_media_url'] = 'reload-metadata/format/json/api_key/%%api_key%%/mode/%%mode%%'
|
||||
api_config['list_all_db_files'] = 'list-all-files/format/json/api_key/%%api_key%%/dir_id/%%dir_id%%/all/%%all%%'
|
||||
api_config['list_all_watched_dirs'] = 'list-all-watched-dirs/format/json/api_key/%%api_key%%'
|
||||
api_config['add_watched_dir'] = 'add-watched-dir/format/json/api_key/%%api_key%%/path/%%path%%'
|
||||
api_config['remove_watched_dir'] = 'remove-watched-dir/format/json/api_key/%%api_key%%/path/%%path%%'
|
||||
api_config['set_storage_dir'] = 'set-storage-dir/format/json/api_key/%%api_key%%/path/%%path%%'
|
||||
api_config['update_fs_mount'] = 'update-file-system-mount/format/json/api_key/%%api_key%%'
|
||||
api_config['reload_metadata_group'] = 'reload-metadata-group/format/json/api_key/%%api_key%%'
|
||||
api_config['handle_watched_dir_missing'] = 'handle-watched-dir-missing/format/json/api_key/%%api_key%%/dir/%%dir%%'
|
||||
#show-recorder
|
||||
api_config['show_schedule_url'] = 'recorded-shows/format/json/api_key/%%api_key%%'
|
||||
api_config['upload_file_url'] = 'upload-file/format/json/api_key/%%api_key%%'
|
||||
api_config['upload_retries'] = '3'
|
||||
api_config['upload_wait'] = '60'
|
||||
#pypo
|
||||
api_config['export_url'] = 'schedule/api_key/%%api_key%%'
|
||||
api_config['get_media_url'] = 'get-media/file/%%file%%/api_key/%%api_key%%'
|
||||
api_config['update_item_url'] = 'notify-schedule-group-play/api_key/%%api_key%%/schedule_id/%%schedule_id%%'
|
||||
api_config['update_start_playing_url'] = 'notify-media-item-start-play/api_key/%%api_key%%/media_id/%%media_id%%/'
|
||||
api_config['get_stream_setting'] = 'get-stream-setting/format/json/api_key/%%api_key%%/'
|
||||
api_config['update_liquidsoap_status'] = 'update-liquidsoap-status/format/json/api_key/%%api_key%%/msg/%%msg%%/stream_id/%%stream_id%%/boot_time/%%boot_time%%'
|
||||
api_config['update_source_status'] = 'update-source-status/format/json/api_key/%%api_key%%/sourcename/%%sourcename%%/status/%%status%%'
|
||||
api_config['check_live_stream_auth'] = 'check-live-stream-auth/format/json/api_key/%%api_key%%/username/%%username%%/password/%%password%%/djtype/%%djtype%%'
|
||||
api_config['get_bootstrap_info'] = 'get-bootstrap-info/format/json/api_key/%%api_key%%'
|
||||
api_config['get_files_without_replay_gain'] = 'get-files-without-replay-gain/api_key/%%api_key%%/dir_id/%%dir_id%%'
|
||||
api_config['update_replay_gain_value'] = 'update-replay-gain-value/format/json/api_key/%%api_key%%'
|
||||
api_config['notify_webstream_data'] = 'notify-webstream-data/api_key/%%api_key%%/media_id/%%media_id%%/format/json'
|
||||
api_config['notify_liquidsoap_started'] = 'rabbitmq-do-push/api_key/%%api_key%%/format/json'
|
||||
api_config['get_stream_parameters'] = 'get-stream-parameters/api_key/%%api_key%%/format/json'
|
||||
api_config['push_stream_stats'] = 'push-stream-stats/api_key/%%api_key%%/format/json'
|
||||
api_config['update_stream_setting_table'] = 'update-stream-setting-table/api_key/%%api_key%%/format/json'
|
||||
api_config['get_files_without_silan_value'] = 'get-files-without-silan-value/api_key/%%api_key%%'
|
||||
api_config['update_cue_values_by_silan'] = 'update-cue-values-by-silan/api_key/%%api_key%%'
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
# Airtime API Client
|
||||
################################################################################
|
||||
|
@ -145,10 +192,11 @@ class AirtimeApiClient(object):
|
|||
# loading config file
|
||||
try:
|
||||
self.config = ConfigObj(config_path)
|
||||
self.config.update(api_config)
|
||||
self.services = RequestProvider(self.config)
|
||||
except Exception, e:
|
||||
self.logger.error('Error loading config file: %s', config_path)
|
||||
self.logger.error('Exception: %s', str(e))
|
||||
self.logger.error("traceback: %s", traceback.format_exc())
|
||||
sys.exit(1)
|
||||
|
||||
def __get_airtime_version(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue