source: branches/branch-1.8/zoo-project/zoo-services/utils/open-api/server/publish.py @ 976

Last change on this file since 976 was 968, checked in by djay, 4 years ago

Add websocketd container to docker-compose and make the OGC API - Processes and it basic UI available.

  • Property svn:executable set to *
File size: 634 bytes
Line 
1#!/usr/bin/python3
2import os
3import sys
4import redis
5data = sys.stdin.read();
6
7print('Content-Type: text/html')
8print('')
9print('Environment variables')
10for param in os.environ.keys():
11        print ("<b>%20s</b>: %s<br/>" % (param, os.environ[param]))
12
13print(data)
14
15from urllib import parse
16
17try:
18    params=parse.parse_qs(os.environ["QUERY_STRING"])
19    r=None
20    if "ZOO_REDIS_HOST" in os.environ:
21        r = redis.Redis(host=os.environ["ZOO_REDIS_HOST"], port=6379, db=0)
22    else:
23        r = redis.Redis(host='redis', port=6379, db=0)
24    print(params)
25    r.publish(params["jobid"][0],data)
26except Exception as e:
27        print(e)
28
Note: See TracBrowser for help on using the repository browser.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png