magpie.cli.sync_services

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

Module Contents

Classes

SyncServiceInterface

SyncServiceGeoserver

SyncServiceProjectAPI

SyncServiceThredds

SyncServiceDefault

Functions

is_valid_resource_schema(→ bool)

Validates the resource structure.

Attributes

SYNC_SERVICES_TYPES

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

abstract property max_depth: int[source]

The max depth at which remote resources are fetched.

sync_type: magpie.typedefs.Str[source]
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

property max_depth: None[source]

The max depth at which remote resources are fetched.

sync_type = 'geoserver-api'[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.SyncServiceProjectAPI(service_name, url)[source]

Bases: SyncServiceInterface

property max_depth: None[source]

The max depth at which remote resources are fetched.

sync_type = 'project-api'[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.SyncServiceThredds(service_name, url)[source]

Bases: SyncServiceInterface

property max_depth: int[source]

The max depth at which remote resources are fetched.

sync_type = 'thredds'[source]
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]