giosystemcore.settings

A module for reading settings stored in an online REST API.

This module provides a global interface for accessing giosystem settings stored in the giosystem-settings-django app, which is another component of giosystem.

Usually all that is necessary is to instantiate a SettingsManager object, providing it with the correct URL for the giosystem-settings-django app. This is achieved by calling the module’s get_settings() function.

import giosystemcore.settings

settings_url = 'http://geo2.meteo.pt/giosystem/settings/api/v1/'
giosystemcore.settings.get_settings(settings_url)
class giosystemcore.settings.SettingsManager(url, initialize_logging=True)

Read the settings stored online in the django app.

Settings are fetched when needed instead of all in one go.

get_all_areas_settings()

Return the settings for all of the defined areas

This method will only query the online REST API if its cache is empty.

get_all_ecflow_servers_settings()

Return the settings for all of the defined ecflow servers

This method will only query the online REST API if its cache is empty.

get_all_files_settings()

Return the settings for all of the defined GioFiles

This method will only query the online REST API if its cache is empty.

get_all_hosts_settings()

Return the settings for all of the defined hosts

This method will only query the online REST API if its cache is empty.

get_all_organizations_settings()

Return the settings for all of the defined organizations

This method will only query the online REST API if its cache is empty.

get_all_packages_settings()

Return the settings for all of the defined GioPackages

This method will only query the online REST API if its cache is empty.

get_all_palettes_settings()

Return the settings for all of the defined palettes

This method will only query the online REST API if its cache is empty.

get_all_products_settings()

Return the settings for all of the defined products

This method will only query the online REST API if its cache is empty.

get_all_sources_settings()

Return the settings for all of the defined sources

This method will only query the online REST API if its cache is empty.

get_archive_settings()

Get the specific settings for the archive host.

get_data_receiver_settings()

Get the specific settings for the data receiver host.

get_file_settings(name)

Return the settings for the file.

get_ftp_server_settings()

Get the specific settings for the ftp server host.

get_host_settings(name)

Return the settings for the host.

get_io_buffer_settings()

Get the specific settings for the io buffer host.

get_order_server_settings()

Get the specific settings for the ordering server host.

get_package_settings(name)

Return the settings for the package.

get_product_settings_by_name(short_name)

Get product settings given its short name.

get_source_settings_by_name(name)

Get source settings given its name.

get_suite_settings_by_name(name)

Get a suite’s settings given its name.

get_web_server_settings()

Get the specific settings for the web server host.

giosystemcore.settings.get_settings(base_url=None, initialize_logging=True)

Return the settings manager.

If the settings manager has already been created by a previous call, it will be returned. If not, the base_url argument must be provided so that a new settings manager can be created from the settings present at the URL. This ensures that multiple calls to this function will not trigger unneeded network traffic.

Parameters:base_url (str) – URL to query the REST API and get the defined settings. A value of None will assume that the previously cached settings should be returned instead.