magpie.cli.sync_services ======================== .. py:module:: magpie.cli.sync_services .. autoapi-nested-parse:: Sync registered services in Magpie with resources retrieved from actual service. .. seealso:: - :py:mod:`magpie.cli.sync_resources` Attributes ---------- .. autoapisummary:: magpie.cli.sync_services.SYNC_SERVICES_TYPES Classes ------- .. autoapisummary:: magpie.cli.sync_services.SyncServiceInterface magpie.cli.sync_services.SyncServiceGeoserver magpie.cli.sync_services.SyncServiceProjectAPI magpie.cli.sync_services.SyncServiceThredds magpie.cli.sync_services.SyncServiceDefault Functions --------- .. autoapisummary:: magpie.cli.sync_services.is_valid_resource_schema Module Contents --------------- .. py:function:: is_valid_resource_schema(resources: magpie.typedefs.AnyNestedChildrenTree) -> bool Validates the resource structure. Expected dictionary is a tree of the following form: .. code-block:: json { "resource_name_1": { "children": { "resource_name_3": {"children": {}}, "resource_name_4": {"children": {}} } } "resource_name_2": {"children": {}} } .. py:class:: SyncServiceInterface(service_name, url) Bases: :py:obj:`object` .. py:attribute:: sync_type :type: magpie.typedefs.Str :value: None .. py:attribute:: service_name .. py:attribute:: url .. py:property:: max_depth :type: int :abstractmethod: The max depth at which remote resources are fetched. .. py:method:: get_resources() -> magpie.typedefs.ServiceResourceTypeTree :abstractmethod: This is the function actually fetching the data from the remote service. Implement this for every specific service. :return: The returned dictionary must be validated by 'is_valid_resource_schema' .. py:class:: SyncServiceGeoserver(service_name, url) Bases: :py:obj:`SyncServiceInterface` .. py:attribute:: sync_type :value: 'geoserver-api' .. py:property:: max_depth :type: None The max depth at which remote resources are fetched. .. py:method:: get_resources() -> magpie.typedefs.ServiceResourceTypeTree This is the function actually fetching the data from the remote service. Implement this for every specific service. :return: The returned dictionary must be validated by 'is_valid_resource_schema' .. py:class:: SyncServiceProjectAPI(service_name, url) Bases: :py:obj:`SyncServiceInterface` .. py:attribute:: sync_type :value: 'project-api' .. py:property:: max_depth :type: None The max depth at which remote resources are fetched. .. py:method:: get_resources() -> magpie.typedefs.ServiceResourceTypeTree This is the function actually fetching the data from the remote service. Implement this for every specific service. :return: The returned dictionary must be validated by 'is_valid_resource_schema' .. py:class:: SyncServiceThredds(service_name, url) Bases: :py:obj:`SyncServiceInterface` .. py:attribute:: sync_type :value: 'thredds' .. py:property:: max_depth :type: int The max depth at which remote resources are fetched. .. py:method:: _resource_id(resource) :staticmethod: .. py:method:: get_resources() -> magpie.typedefs.ServiceResourceTypeTree This is the function actually fetching the data from the remote service. Implement this for every specific service. :return: The returned dictionary must be validated by 'is_valid_resource_schema' .. py:class:: SyncServiceDefault(service_name, url) Bases: :py:obj:`SyncServiceInterface` .. py:property:: max_depth :type: None The max depth at which remote resources are fetched. .. py:method:: get_resources() -> magpie.typedefs.ServiceResourceTypeTree This is the function actually fetching the data from the remote service. Implement this for every specific service. :return: The returned dictionary must be validated by 'is_valid_resource_schema' .. py:data:: SYNC_SERVICES_TYPES :type: Dict[magpie.typedefs.Str, Type[SyncServiceInterface]]