isogeo_pysdk.api.routes_service module

Isogeo API v1 - API Routes for Metadata of Services (web geo services)

See: http://help.isogeo.com/api/complete/index.html#definition-resource

class isogeo_pysdk.api.routes_service.ApiService(api_client=None)[source]

Bases: object

Routes as methods of Isogeo API used to manipulate metadatas of web geo services (services). It’s a set of helpers and shortcuts to make easier the sevrice management with the isogeo API.

create(workgroup_id: str, service_url: str, service_type: str = 'guess', service_format: str = None, service_title: str = None, check_exists: bool = 1, ignore_avaibility: bool = 0, http_verb: str = 'HEAD') → isogeo_pysdk.models.metadata.Metadata[source]

Add a new metadata of a geographic webservice to a workgroup.

It’s just a helper to make it easy to create a metadata of a service with autofill for service layers.

Parameters:
  • workgroup_id (str) – identifier of the owner workgroup
  • service_url (str) – URL of the service
  • service_type (str) – type of service. Must be one of: ‘esri’, ‘esri_ogc’, ‘ogc’, ‘guess’
  • service_format (str) – format of the web service. Must be one of the accepted codes in API (Non exhaustive list: ‘efs’, ‘ems’, ‘wfs’, ‘wms’, ‘wmts’). If is None, so the it’ll try to guess it from the URL.
  • service_title (str) – title for the metadata service in case of analisis fail. OPTIONNAL.
  • check_exists (bool) – check if a metadata with the same service base URL and format alerady exists. Defaults to True.
  • ignore_avaibility (bool) – the service URL is tested to determine if it can be reached (HEAD then GET). This option allow to ignore the test result. Can be useful if the service is only reachable by certains URLs or domains like *.isogeo.com. Defaults to False.
  • http_verb (str) – HTTP verb to use to check the if the service is available. Must be one of: GET, HEAD
Return type:

Service

Raises:
  • ValueError – if workgroup_id is not a correct UUID | if http_verb or service_type is not a correct value
  • AlreadyExistError – if a metadata service with the same base URL already exists in the workgroup
Example:
# for an OGC WMS by GeoServer, passing type and format
isogeo.services.create(
    workgroup_id=WORKGROUP_UUID,
    service_type="ogc",
    service_format="wms",
    service_url="https://magosm.magellium.com/geoserver/ows?service=wms&version=1.3.0&request=GetCapabilities"
)
# for an OGC WFS by ArcGIS Server, passing only the service URL with query parameters
new_srv = isogeo.services.create(
    workgroup_id=WORKGROUP_UUID,
    service_url="https://ligeo.paysdelaloire.fr/server/services/Le_Mans/Le_Mans_service/MapServer/WFSServer?request=GetCapabilities&service=WFS",
)
# for an Esri FeatureServer
new_srv = isogeo.services.create(
    workgroup_id=WORKGROUP_UUID,
    service_url="https://api-carto.dijon.fr/arcgis/rest/services/SIGNALISATION/signalisation_MAJ/FeatureServer?f=pjson",
)
update(service: isogeo_pysdk.models.metadata.Metadata, check_only: bool = 0) → isogeo_pysdk.models.metadata.Metadata[source]

Update a metadata of service while keeping the associations of the layers.

Parameters:
  • metadata (Metadata) – identifier of the resource to verify
  • check_only (bool) – option to only get the diff
Return type:

Metadata