isogeo_pysdk.api.routes_service_layers module
Isogeo API v1 - API Routes for ServiceLayers entities
See: http://help.isogeo.com/api/complete/index.html
- class isogeo_pysdk.api.routes_service_layers.ApiServiceLayer(api_client=None)
Bases:
object
Routes as methods of Isogeo API used to manipulate service_layers.
- associate_metadata(service, layer, dataset)
Associate a service layer with a dataset metadata.
If the specified layer is already associated, the response is 409.
- Parameters
service (Metadata) – metadata of the service which contains the layer
layer (ServiceLayer) – layer model object to associate
dataset (Metadata) – metadata of the dataset to associate with
- Example
>>> # retrieve objects to be associated. First: the metadata of the service. >>> service = isogeo.metadata.get( metadata_id=str, ) >>> # second: the layer of the service you want to associate >>> layer = isogeo.metadata.layers.layer( metadata_id=service._id, layer_id=str, ) >>> # third: the dataset to be associated with the service layer >>> dataset = isogeo.metadata.get( metadata_id=str, ) >>> # associate them >>> isogeo.metadata.layers.associate_metadata( service=service, layer=layer, dataset=metadata )
- Return type
- create(metadata, layer)
Add a new layer to a metadata (= resource).
- Parameters
metadata (Metadata) – metadata (resource) to edit. Must be a service.
ServiceLayer (ServiceLayer) – service_layer object to create
- Return type
- delete(layer, metadata=None)
Delete a service layer from Isogeo database.
- Parameters
layer (ServiceLayer) – ServiceLayer model object to delete
metadata (Metadata) – parent metadata (resource) containing the service_layer
- dissociate_metadata(service, layer, dataset)
Removes the association between a a service layer with a dataset metadata.
If the association doesn’t exist, the response is 404.
- Parameters
service (Metadata) – metadata of the service which contains the layer
layer (ServiceLayer) – layer model object to associate
dataset (Metadata) – metadata of the dataset to associate with
- Return type
- layer(metadata_id, layer_id)
Get details about a specific service_layer.
- Parameters
- Return type
- listing(metadata)
Get all service layers of a metadata.
- update(layer, metadata=None)
Update a service layer.
- Parameters
layer (ServiceLayer) – ServiceLayer model object to update
metadata (Metadata) – parent metadata (resource) containing the service_layer
- Return type