magpie.cli.sync_services
Sync registered services in Magpie with resources retrieved from actual service.
Module Contents
-
magpie.cli.sync_services.is_valid_resource_schema(resources: magpie.typedefs.AnyNestedChildrenTree) → bool[source]
Validates the resource structure.
Expected dictionary is a tree of the following form:
{
"resource_name_1": {
"children": {
"resource_name_3": {"children": {}},
"resource_name_4": {"children": {}}
}
}
"resource_name_2": {"children": {}}
}
-
class magpie.cli.sync_services.SyncServiceInterface(service_name, url)[source]
Bases: object
-
sync_type: magpie.typedefs.Str = None[source]
-
service_name[source]
-
url[source]
-
property max_depth: int[source]
- Abstractmethod:
The max depth at which remote resources are fetched.
-
abstract get_resources() → magpie.typedefs.ServiceResourceTypeTree[source]
This is the function actually fetching the data from the remote service. Implement this for every specific
service.
- Returns:
The returned dictionary must be validated by ‘is_valid_resource_schema’
-
class magpie.cli.sync_services.SyncServiceGeoserver(service_name, url)[source]
Bases: SyncServiceInterface
-
sync_type = 'geoserver-api'[source]
-
property max_depth: None[source]
The max depth at which remote resources are fetched.
-
get_resources() → magpie.typedefs.ServiceResourceTypeTree[source]
This is the function actually fetching the data from the remote service. Implement this for every specific
service.
- Returns:
The returned dictionary must be validated by ‘is_valid_resource_schema’
-
class magpie.cli.sync_services.SyncServiceProjectAPI(service_name, url)[source]
Bases: SyncServiceInterface
-
sync_type = 'project-api'[source]
-
property max_depth: None[source]
The max depth at which remote resources are fetched.
-
get_resources() → magpie.typedefs.ServiceResourceTypeTree[source]
This is the function actually fetching the data from the remote service. Implement this for every specific
service.
- Returns:
The returned dictionary must be validated by ‘is_valid_resource_schema’
-
class magpie.cli.sync_services.SyncServiceThredds(service_name, url)[source]
Bases: SyncServiceInterface
-
sync_type = 'thredds'[source]
-
property max_depth: int[source]
The max depth at which remote resources are fetched.
-
static _resource_id(resource)[source]
-
get_resources() → magpie.typedefs.ServiceResourceTypeTree[source]
This is the function actually fetching the data from the remote service. Implement this for every specific
service.
- Returns:
The returned dictionary must be validated by ‘is_valid_resource_schema’
-
class magpie.cli.sync_services.SyncServiceDefault(service_name, url)[source]
Bases: SyncServiceInterface
-
property max_depth: None[source]
The max depth at which remote resources are fetched.
-
get_resources() → magpie.typedefs.ServiceResourceTypeTree[source]
This is the function actually fetching the data from the remote service. Implement this for every specific
service.
- Returns:
The returned dictionary must be validated by ‘is_valid_resource_schema’
-
magpie.cli.sync_services.SYNC_SERVICES_TYPES: Dict[magpie.typedefs.Str, Type[SyncServiceInterface]][source]