magpie.cli.sync_services

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

Module Contents

Functions

is_valid_resource_schema(resources: magpie.typedefs.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: magpie.typedefs.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

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

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

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

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

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]