magpie.cli.sync_services

Sync registered services in Magpie with resources retrieved from actual service.

Module Contents

Classes

SyncServiceInterface

Initialize self. See help(type(self)) for accurate signature.

SyncServiceGeoserver

Initialize self. See help(type(self)) for accurate signature.

SyncServiceProjectAPI

Initialize self. See help(type(self)) for accurate signature.

SyncServiceThredds

Initialize self. See help(type(self)) for accurate signature.

SyncServiceDefault

Initialize self. See help(type(self)) for accurate signature.

Functions

is_valid_resource_schema(resources: JSON) → bool

Returns True if the structure of the input dictionary is a tree of the following form:

magpie.cli.sync_services.is_valid_resource_schema(resources: JSON) → bool[source]

Returns True if the structure of the input 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

Initialize self. See help(type(self)) for accurate signature.

sync_type :Str[source]
property max_depth(self) → int[source]

The max depth at which remote resources are fetched.

abstract get_resources(self)[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: magpie.cli.sync_services.SyncServiceInterface

Initialize self. See help(type(self)) for accurate signature.

sync_type = geoserver-api[source]
property max_depth(self)[source]

The max depth at which remote resources are fetched.

get_resources(self)[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: magpie.cli.sync_services.SyncServiceInterface

Initialize self. See help(type(self)) for accurate signature.

sync_type = project-api[source]
property max_depth(self)[source]

The max depth at which remote resources are fetched.

get_resources(self)[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: magpie.cli.sync_services.SyncServiceInterface

Initialize self. See help(type(self)) for accurate signature.

sync_type = thredds[source]
property max_depth(self)[source]

The max depth at which remote resources are fetched.

static _resource_id(resource)[source]
get_resources(self)[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: magpie.cli.sync_services.SyncServiceInterface

Initialize self. See help(type(self)) for accurate signature.

property max_depth(self)[source]

The max depth at which remote resources are fetched.

get_resources(self)[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[Str, Type[SyncServiceInterface]][source]