cowbird.services.impl.magpie

Module Contents

Classes

Magpie

Complete the Magpie’s webhook call by calling Magpie temporary urls. Also keep service-shared resources in sync when

class cowbird.services.impl.magpie.Magpie(settings: str, name: dict, **kwargs)[source]

Bases: cowbird.services.service.Service

Complete the Magpie’s webhook call by calling Magpie temporary urls. Also keep service-shared resources in sync when permissions are updated for one of them.

** Cowbird components diagram 1.2.0 needs to be update since Magpie can handle permissions synchronisation directly on permission update events. No need to handle them explicitly in nginx, thredds and geoserver classes.

Create the magpie instance and instantiate the permission synchronizer that will handle the permission events.

@param settings: Cowbird settings for convenience @param name: Service name

required_params[source]
abstract get_resource_id(self, resource_full_name)[source]

Each service must provide this implementation required by the permission synchronizer.

The function needs to find the resource id in Magpie from the resource full name using its knowledge of the service. If the resource doesn’t already exist, the function needs to create it, again using its knowledge of resource type and parent resource type if required.

abstract user_created(self, user_name)[source]
abstract user_deleted(self, user_name)[source]
permission_created(self, permission)[source]
permission_deleted(self, permission)[source]
create_permission(self: cowbird.permissions_synchronizer.Permission, permission)None[source]

Make sure that the specified permission exists on Magpie.

Todo

First need to check if the permission already exists If the permission doesn’t exist do a POST to create it If the permission exists but is different do a PUT to update it

delete_permission(self: cowbird.permissions_synchronizer.Permission, permission)None[source]

Remove the specified permission from Magpie if it exists.