Use HTTP requests for WPS rook

[1]:
import requests

url = 'http://rook.dkrz.de/wps'

GetCapabilities

[2]:
req_url = f"{url}?service=WPS&request=GetCapabilities"
req_url
[2]:
'http://rook.dkrz.de/wps?service=WPS&request=GetCapabilities'
[3]:
resp = requests.get(req_url)
resp.ok
[3]:
True
[4]:
print(resp.text)
<?xml version="1.0" encoding="UTF-8"?>
<!-- PyWPS 4.4.0 -->
<wps:Capabilities service="WPS" version="1.0.0" xml:lang="en-US" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 ../wpsGetCapabilities_response.xsd" updateSequence="1">
    <ows:ServiceIdentification>
        <ows:Title>rook</ows:Title>
        <ows:Abstract>A WPS service for roocs.</ows:Abstract>
        <ows:Keywords>
        <ows:Keyword>PyWPS</ows:Keyword>
        <ows:Keyword> WPS</ows:Keyword>
        <ows:Keyword> OGC</ows:Keyword>
        <ows:Keyword> processing</ows:Keyword>
        <ows:Keyword> birdhouse</ows:Keyword>
        <ows:Keyword> roocs</ows:Keyword>
        <ows:Keyword> demo</ows:Keyword>
        <ows:Keyword> cp4cds</ows:Keyword>
        <ows:Keyword> copernicus</ows:Keyword>
        <ows:Keyword> ecmwf</ows:Keyword>
            <ows:Type codeSpace="ISOTC211/19115">theme</ows:Type>
        </ows:Keywords>
        <ows:ServiceType>WPS</ows:ServiceType>
        <ows:ServiceTypeVersion>1.0.0</ows:ServiceTypeVersion>
        <ows:ServiceTypeVersion>2.0.0</ows:ServiceTypeVersion>
        <ows:Fees></ows:Fees>
        <ows:AccessConstraints>
        open access
        </ows:AccessConstraints>
    </ows:ServiceIdentification>
    <ows:ServiceProvider>
        <ows:ProviderName>rook4.cloud.dkrz.de</ows:ProviderName>
        <ows:ProviderSite xlink:href="https://roocs.github.io/"/>
        <ows:ServiceContact>
            <ows:IndividualName>DKRZ</ows:IndividualName>
            <ows:PositionName>Position Title</ows:PositionName>
            <ows:ContactInfo>
                <ows:Phone>
                    <ows:Voice>+xx-xxx-xxx-xxxx</ows:Voice>
                    <ows:Facsimile></ows:Facsimile>
                </ows:Phone>
                <ows:Address>
                    <ows:DeliveryPoint></ows:DeliveryPoint>
                    <ows:City>Hamburg</ows:City>
                    <ows:AdministrativeArea></ows:AdministrativeArea>
                    <ows:PostalCode>Zip or Postal Code</ows:PostalCode>
                    <ows:Country>Germany</ows:Country>
                    <ows:ElectronicMailAddress>Email Address</ows:ElectronicMailAddress>
                </ows:Address>
            </ows:ContactInfo>
        </ows:ServiceContact>
    </ows:ServiceProvider>
    <ows:OperationsMetadata>
        <ows:Operation name="GetCapabilities">
            <ows:DCP>
                <ows:HTTP>
                    <ows:Get xlink:href="http://rook4.cloud.dkrz.de:80/wps"/>
                </ows:HTTP>
            </ows:DCP>
        </ows:Operation>
        <ows:Operation name="DescribeProcess">
            <ows:DCP>
                <ows:HTTP>
                    <ows:Get xlink:href="http://rook4.cloud.dkrz.de:80/wps"/>
                    <ows:Post xlink:href="http://rook4.cloud.dkrz.de:80/wps"/>
                </ows:HTTP>
            </ows:DCP>
        </ows:Operation>
        <ows:Operation name="Execute">
            <ows:DCP>
                <ows:HTTP>
                    <ows:Get xlink:href="http://rook4.cloud.dkrz.de:80/wps"/>
                    <ows:Post xlink:href="http://rook4.cloud.dkrz.de:80/wps"/>
                </ows:HTTP>
            </ows:DCP>
        </ows:Operation>
    </ows:OperationsMetadata>
    <wps:ProcessOfferings>
        <wps:Process wps:processVersion="1.0">
            <ows:Identifier>subset</ows:Identifier>
            <ows:Title>Subset</ows:Title>
            <ows:Abstract>Run subsetting on climate model data. Calls daops operators.</ows:Abstract>
            <ows:Metadata xlink:title="DAOPS" xlink:type="simple"
              xlink:href="https://github.com/roocs/daops"
            />
        </wps:Process>
        <wps:Process wps:processVersion="1.0">
            <ows:Identifier>average</ows:Identifier>
            <ows:Title>Average</ows:Title>
            <ows:Abstract>Run averaging on climate model data. Calls daops operators.</ows:Abstract>
            <ows:Metadata xlink:title="DAOPS" xlink:type="simple"
              xlink:href="https://github.com/roocs/daops"
            />
        </wps:Process>
        <wps:Process wps:processVersion="1.0">
            <ows:Identifier>orchestrate</ows:Identifier>
            <ows:Title>Orchestrate</ows:Title>
            <ows:Abstract>Run a workflow with combined operations. A workflow can be build using the rooki client.</ows:Abstract>
            <ows:Metadata xlink:title="Rooki" xlink:type="simple"
              xlink:href="https://github.com/roocs/rooki"
            />
        </wps:Process>
    </wps:ProcessOfferings>
    <wps:Languages>
        <wps:Default>
            <ows:Language>en-US</ows:Language>
        </wps:Default>
        <wps:Supported>
            <ows:Language>en-US</ows:Language>
        </wps:Supported>
    </wps:Languages>
</wps:Capabilities>

DescribeProcess subset

[5]:
req_url = f"{url}?service=WPS&version=1.0.0&request=DescribeProcess&identifier=subset"
req_url
[5]:
'http://rook.dkrz.de/wps?service=WPS&version=1.0.0&request=DescribeProcess&identifier=subset'
[6]:
resp = requests.get(req_url)
resp.ok
[6]:
True
[7]:
print(resp.text)
<?xml version="1.0" encoding="UTF-8"?>
<!-- PyWPS 4.4.0 -->
<wps:ProcessDescriptions xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 ../wpsDescribeProcess_response.xsd" service="WPS" version="1.0.0" xml:lang="en-US">
    <ProcessDescription wps:processVersion="1.0" storeSupported="true" statusSupported="true">
        <ows:Identifier>subset</ows:Identifier>
        <ows:Title>Subset</ows:Title>
        <ows:Abstract>Run subsetting on climate model data. Calls daops operators.</ows:Abstract>
        <ows:Metadata xlink:title="DAOPS" xlink:type="simple"
            xlink:href="https://github.com/roocs/daops"
        />
        <DataInputs>
            <Input minOccurs="1" maxOccurs="1">
                <ows:Identifier>collection</ows:Identifier>
                <ows:Title>Collection</ows:Title>
                <ows:Abstract>A dataset identifier or list of comma separated identifiersExample: c3s-cmip5.output1.ICHEC.EC-EARTH.historical.day.atmos.day.r1i1p1.tas.latest</ows:Abstract>
                <LiteralData>
                <ows:DataType ows:reference="http://www.w3.org/TR/xmlschema-2/#string">string</ows:DataType>
                </LiteralData>
            </Input>
            <Input minOccurs="0" maxOccurs="1">
                <ows:Identifier>time</ows:Identifier>
                <ows:Title>Time Period</ows:Title>
                <ows:Abstract>The time period to subset over separated by /Example: 1860-01-01/1900-12-30</ows:Abstract>
                <LiteralData>
                <ows:DataType ows:reference="http://www.w3.org/TR/xmlschema-2/#string">string</ows:DataType>
                </LiteralData>
            </Input>
            <Input minOccurs="0" maxOccurs="1">
                <ows:Identifier>area</ows:Identifier>
                <ows:Title>Area</ows:Title>
                <ows:Abstract>The area to subset over as 4 comma separated values.Example: 0.,49.,10.,65</ows:Abstract>
                <LiteralData>
                <ows:DataType ows:reference="http://www.w3.org/TR/xmlschema-2/#string">string</ows:DataType>
                </LiteralData>
            </Input>
            <Input minOccurs="0" maxOccurs="1">
                <ows:Identifier>level</ows:Identifier>
                <ows:Title>Level</ows:Title>
                <ows:Abstract>The level range to subset over separated by a /Example: 0/1000</ows:Abstract>
                <LiteralData>
                <ows:DataType ows:reference="http://www.w3.org/TR/xmlschema-2/#string">string</ows:DataType>
                </LiteralData>
            </Input>
            <Input minOccurs="1" maxOccurs="1">
                <ows:Identifier>pre_checked</ows:Identifier>
                <ows:Title>Pre-Checked</ows:Title>
                <ows:Abstract>Use checked data only.</ows:Abstract>
                <LiteralData>
                <ows:DataType ows:reference="http://www.w3.org/TR/xmlschema-2/#boolean">boolean</ows:DataType>
                <DefaultValue>False</DefaultValue>
                </LiteralData>
            </Input>
            <Input minOccurs="1" maxOccurs="1">
                <ows:Identifier>apply_fixes</ows:Identifier>
                <ows:Title>Apply Fixes</ows:Title>
                <ows:Abstract>Apply fixes to datasets.</ows:Abstract>
                <LiteralData>
                <ows:DataType ows:reference="http://www.w3.org/TR/xmlschema-2/#boolean">boolean</ows:DataType>
                <DefaultValue>False</DefaultValue>
                </LiteralData>
            </Input>
            <Input minOccurs="1" maxOccurs="1">
                <ows:Identifier>original_files</ows:Identifier>
                <ows:Title>Original Files</ows:Title>
                <ows:Abstract>Return original files only.</ows:Abstract>
                <LiteralData>
                <ows:DataType ows:reference="http://www.w3.org/TR/xmlschema-2/#boolean">boolean</ows:DataType>
                <DefaultValue>False</DefaultValue>
                </LiteralData>
            </Input>
        </DataInputs>
        <ProcessOutputs>
            <Output>
                <ows:Identifier>output</ows:Identifier>
                <ows:Title>METALINK v4 output</ows:Title>
                <ows:Abstract>Metalink v4 document with references to NetCDF files.</ows:Abstract>
                <ComplexOutput>
                    <Default>
                        <Format>
                            <MimeType>application/metalink+xml; version=4.0</MimeType>
                            <Schema>metalink/4.0/metalink4.xsd</Schema>
                        </Format>
                    </Default>
                    <Supported>
                        <Format>
                            <MimeType>application/metalink+xml; version=4.0</MimeType>
                            <Schema>metalink/4.0/metalink4.xsd</Schema>
                        </Format>
                    </Supported>
                </ComplexOutput>
            </Output>
            <Output>
                <ows:Identifier>prov</ows:Identifier>
                <ows:Title>Provenance</ows:Title>
                <ows:Abstract>Provenance document using W3C standard.</ows:Abstract>
                <ComplexOutput>
                    <Default>
                        <Format>
                            <MimeType>application/json</MimeType>
                        </Format>
                    </Default>
                    <Supported>
                        <Format>
                            <MimeType>application/json</MimeType>
                        </Format>
                    </Supported>
                </ComplexOutput>
            </Output>
            <Output>
                <ows:Identifier>prov_plot</ows:Identifier>
                <ows:Title>Provenance Diagram</ows:Title>
                <ows:Abstract>Provenance document as diagram.</ows:Abstract>
                <ComplexOutput>
                    <Default>
                        <Format>
                            <MimeType>image/png</MimeType>
                            <Encoding>base64</Encoding>
                        </Format>
                    </Default>
                    <Supported>
                        <Format>
                            <MimeType>image/png</MimeType>
                            <Encoding>base64</Encoding>
                        </Format>
                    </Supported>
                </ComplexOutput>
            </Output>
        </ProcessOutputs>
    </ProcessDescription>
</wps:ProcessDescriptions>

Execute subset (sync mode)

Edit data inputs

[8]:
collection = "CMIP6.CMIP.IPSL.IPSL-CM6A-LR.historical.r1i1p1f1.Amon.rlds.gr.v20180803"
time = "1985-01-01/2014-12-30"

[9]:
datainputs = f"DataInputs=collection={collection};time={time}"
req_url = f"{url}?service=WPS&version=1.0.0&request=Execute&identifier=subset&{datainputs}"
req_url
[9]:
'http://rook.dkrz.de/wps?service=WPS&version=1.0.0&request=Execute&identifier=subset&DataInputs=collection=CMIP6.CMIP.IPSL.IPSL-CM6A-LR.historical.r1i1p1f1.Amon.rlds.gr.v20180803;time=1985-01-01/2014-12-30'
[10]:
resp = requests.get(req_url)
resp.ok
[10]:
True
[11]:
print(resp.text)
<?xml version="1.0" encoding="UTF-8"?>
<wps:ExecuteResponse xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 ../wpsExecute_response.xsd" service="WPS" version="1.0.0" xml:lang="en-US" serviceInstance="http://rook4.cloud.dkrz.de:80/wps?request=GetCapabilities&amp;amp;service=WPS" statusLocation="">
    <wps:Process wps:processVersion="1.0">
        <ows:Identifier>subset</ows:Identifier>
        <ows:Title>Subset</ows:Title>
        <ows:Abstract>Run subsetting on climate model data. Calls daops operators.</ows:Abstract>
        </wps:Process>
    <wps:Status creationTime="2021-03-18T15:08:21Z">
        <wps:ProcessSucceeded>PyWPS Process Subset finished</wps:ProcessSucceeded>
        </wps:Status>
        <wps:ProcessOutputs>
                <wps:Output>
            <ows:Identifier>output</ows:Identifier>
            <ows:Title>METALINK v4 output</ows:Title>
            <ows:Abstract>Metalink v4 document with references to NetCDF files.</ows:Abstract>
            <wps:Reference href="http://rook4.cloud.dkrz.de:80/outputs/rook/63eb9d28-87f3-11eb-b8ed-fa163e1098db/input.meta4" mimeType="application/metalink+xml; version=4.0" encoding="" schema="metalink/4.0/metalink4.xsd"/>
                </wps:Output>
                <wps:Output>
            <ows:Identifier>prov</ows:Identifier>
            <ows:Title>Provenance</ows:Title>
            <ows:Abstract>Provenance document using W3C standard.</ows:Abstract>
            <wps:Reference href="http://rook4.cloud.dkrz.de:80/outputs/rook/63eb9d28-87f3-11eb-b8ed-fa163e1098db/provenance.json" mimeType="application/json" encoding="" schema=""/>
                </wps:Output>
                <wps:Output>
            <ows:Identifier>prov_plot</ows:Identifier>
            <ows:Title>Provenance Diagram</ows:Title>
            <ows:Abstract>Provenance document as diagram.</ows:Abstract>
            <wps:Reference href="http://rook4.cloud.dkrz.de:80/outputs/rook/63eb9d28-87f3-11eb-b8ed-fa163e1098db/provenance.png" mimeType="image/png" encoding="base64" schema=""/>
                </wps:Output>
        </wps:ProcessOutputs>
</wps:ExecuteResponse>

Load metalink result document

Replace the metalink output URL.

metalink_url = ''
[12]:
metalink_url = 'http://rook4.cloud.dkrz.de/outputs/rook/8c23a070-87f2-11eb-bc89-fa163e1098db/provenance.json'

[13]:
print(requests.get(metalink_url).text)
{"prefix": {"provone": "http://purl.dataone.org/provone/2015/01/15/ontology#", "dcterms": "http://purl.org/dc/terms/", "default": "http://purl.org/roocs/prov#"}, "agent": {"copernicus_CDS": {"prov:type": "prov:Organization", "dcterms:title": "Copernicus Climate Data Store"}, "rook": {"prov:type": "prov:SoftwareAgent", "dcterms:source": "https://github.com/roocs/rook/releases/tag/v0.4.0"}, "daops": {"prov:type": "prov:SoftwareAgent", "dcterms:source": "https://github.com/roocs/daops/releases/tag/v0.5.0"}}, "wasAttributedTo": {"_:id1": {"prov:entity": "rook", "prov:agent": "copernicus_CDS"}}, "activity": {"subset": {"time": "1985-01-01/2014-12-30", "apply_fixes": false}}, "entity": {"CMIP6.CMIP.IPSL.IPSL-CM6A-LR.historical.r1i1p1f1.Amon.rlds.gr.v20180803": {}, "rlds_Amon_IPSL-CM6A-LR_historical_r1i1p1f1_gr_19850116-20141216.nc": {}}, "wasStartedBy": {"_:id2": {"prov:activity": "subset", "prov:trigger": "rook", "prov:starter": "daops"}}, "wasDerivedFrom": {"_:id3": {"prov:generatedEntity": "rlds_Amon_IPSL-CM6A-LR_historical_r1i1p1f1_gr_19850116-20141216.nc", "prov:usedEntity": "CMIP6.CMIP.IPSL.IPSL-CM6A-LR.historical.r1i1p1f1.Amon.rlds.gr.v20180803", "prov:activity": "subset"}}}

Execute subset (async mode)

[14]:
req_url = f"{url}?service=WPS&version=1.0.0&request=Execute&identifier=subset&{datainputs}"
req_url += "&status=true&storeExecuteResponse=true"
req_url
[14]:
'http://rook.dkrz.de/wps?service=WPS&version=1.0.0&request=Execute&identifier=subset&DataInputs=collection=CMIP6.CMIP.IPSL.IPSL-CM6A-LR.historical.r1i1p1f1.Amon.rlds.gr.v20180803;time=1985-01-01/2014-12-30&status=true&storeExecuteResponse=true'
[15]:
resp = requests.get(req_url)
resp.ok
[15]:
True
[16]:
print(resp.text)
<?xml version="1.0" encoding="UTF-8"?>
<wps:ExecuteResponse xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 ../wpsExecute_response.xsd" service="WPS" version="1.0.0" xml:lang="en-US" serviceInstance="http://rook4.cloud.dkrz.de:80/wps?request=GetCapabilities&amp;amp;service=WPS" statusLocation="http://rook4.cloud.dkrz.de:80/outputs/rook/65b4dfc0-87f3-11eb-a430-fa163e1098db.xml">
    <wps:Process wps:processVersion="1.0">
        <ows:Identifier>subset</ows:Identifier>
        <ows:Title>Subset</ows:Title>
        <ows:Abstract>Run subsetting on climate model data. Calls daops operators.</ows:Abstract>
        </wps:Process>
    <wps:Status creationTime="2021-03-18T15:08:22Z">
        <wps:ProcessAccepted percentCompleted="0">PyWPS Process subset accepted</wps:ProcessAccepted>
        </wps:Status>
</wps:ExecuteResponse>

Poll status location

Replace the statusLocation URL.

statusLocation = ''
[17]:
# statusLocation = ''
statusLocation = 'http://rook4.cloud.dkrz.de/outputs/rook/bc97d460-87f2-11eb-b8ed-fa163e1098db.xml'

[18]:
resp = requests.get(statusLocation)
print(resp.text)
<?xml version="1.0" encoding="UTF-8"?>
<wps:ExecuteResponse xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 ../wpsExecute_response.xsd" service="WPS" version="1.0.0" xml:lang="en-US" serviceInstance="http://rook4.cloud.dkrz.de:80/wps?request=GetCapabilities&amp;amp;service=WPS" statusLocation="http://rook4.cloud.dkrz.de:80/outputs/rook/bc97d460-87f2-11eb-b8ed-fa163e1098db.xml">
    <wps:Process wps:processVersion="1.0">
        <ows:Identifier>subset</ows:Identifier>
        <ows:Title>Subset</ows:Title>
        <ows:Abstract>Run subsetting on climate model data. Calls daops operators.</ows:Abstract>
        </wps:Process>
    <wps:Status creationTime="2021-03-18T15:03:44Z">
        <wps:ProcessSucceeded>PyWPS Process Subset finished</wps:ProcessSucceeded>
        </wps:Status>
        <wps:ProcessOutputs>
                <wps:Output>
            <ows:Identifier>output</ows:Identifier>
            <ows:Title>METALINK v4 output</ows:Title>
            <ows:Abstract>Metalink v4 document with references to NetCDF files.</ows:Abstract>
            <wps:Reference href="http://rook4.cloud.dkrz.de:80/outputs/rook/bc97d460-87f2-11eb-b8ed-fa163e1098db/input.meta4" mimeType="application/metalink+xml; version=4.0" encoding="" schema="metalink/4.0/metalink4.xsd"/>
                </wps:Output>
                <wps:Output>
            <ows:Identifier>prov</ows:Identifier>
            <ows:Title>Provenance</ows:Title>
            <ows:Abstract>Provenance document using W3C standard.</ows:Abstract>
            <wps:Reference href="http://rook4.cloud.dkrz.de:80/outputs/rook/bc97d460-87f2-11eb-b8ed-fa163e1098db/provenance.json" mimeType="application/json" encoding="" schema=""/>
                </wps:Output>
                <wps:Output>
            <ows:Identifier>prov_plot</ows:Identifier>
            <ows:Title>Provenance Diagram</ows:Title>
            <ows:Abstract>Provenance document as diagram.</ows:Abstract>
            <wps:Reference href="http://rook4.cloud.dkrz.de:80/outputs/rook/bc97d460-87f2-11eb-b8ed-fa163e1098db/provenance.png" mimeType="image/png" encoding="base64" schema=""/>
                </wps:Output>
        </wps:ProcessOutputs>
</wps:ExecuteResponse>

Load metalink document

Replace the metalink output URL.

metalink_url = ''
[19]:
metalink_url = 'http://rook4.cloud.dkrz.de:80/outputs/rook/bc97d460-87f2-11eb-b8ed-fa163e1098db/input.meta4'

[20]:
print(requests.get(metalink_url).text)
<?xml version="1.0" encoding="UTF-8"?>
<metalink xmlns="urn:ietf:params:xml:ns:metalink">
    <published>2021-03-18T15:03:43Z</published>
    <generator>PyWPS/4.4.0</generator>

    <file name="rlds_Amon_IPSL-CM6A-LR_historical_r1i1p1f1_gr_19850116-20141216.nc">
        <identity>NetCDF file</identity>
        <size>20313784</size>
        <metaurl mediatype="application/x-netcdf">http://rook4.cloud.dkrz.de:80/outputs/rook/bfe9ffee-87f2-11eb-a863-fa163e1098db/rlds_Amon_IPSL-CM6A-LR_historical_r1i1p1f1_gr_19850116-20141216.nc</metaurl>
        <publisher name="None" url="http://rook4.cloud.dkrz.de:80/wps"/>
    </file>

</metalink>

Download netCDF output

Replace the download URL.

download_url = ''
[21]:
download_url = 'http://rook4.cloud.dkrz.de:80/outputs/rook/bfe9ffee-87f2-11eb-a863-fa163e1098db/rlds_Amon_IPSL-CM6A-LR_historical_r1i1p1f1_gr_19850116-20141216.nc</metaurl'

[22]:
print(download_url)
http://rook4.cloud.dkrz.de:80/outputs/rook/bfe9ffee-87f2-11eb-a863-fa163e1098db/rlds_Amon_IPSL-CM6A-LR_historical_r1i1p1f1_gr_19850116-20141216.nc</metaurl

Execute subset (POST, sync)

See WPS examples: http://schemas.opengis.net/wps/1.0.0/examples/

[23]:
xml = """<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<wps:Execute service="WPS" version="1.0.0" xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0
../wpsExecute_request.xsd">
    <ows:Identifier>subset</ows:Identifier>
    <wps:DataInputs>
            <wps:Input>
                    <ows:Identifier>collection</ows:Identifier>
                    <wps:Data>
                            <wps:LiteralData>c3s-cmip6.CMIP.IPSL.IPSL-CM6A-LR.historical.r1i1p1f1.Amon.rlds.gr.v20180803</wps:LiteralData>
                    </wps:Data>
        </wps:Input>
        <wps:Input>
                    <ows:Identifier>time</ows:Identifier>
                    <wps:Data>
                            <wps:LiteralData>1860-01-01/1900-12-30</wps:LiteralData>
                    </wps:Data>
            </wps:Input>
    </wps:DataInputs>
    <wps:ResponseForm>
            <wps:ResponseDocument storeExecuteResponse="false" status="false">
                    <wps:Output asReference="true">
                            <ows:Identifier>output</ows:Identifier>
                    </wps:Output>
            </wps:ResponseDocument>
    </wps:ResponseForm>
</wps:Execute>
"""
[24]:
resp = requests.post(url, data=xml)
resp.ok
[24]:
True
[25]:
print(resp.text)
<?xml version="1.0" encoding="UTF-8"?>
<wps:ExecuteResponse xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 ../wpsExecute_response.xsd" service="WPS" version="1.0.0" xml:lang="en-US" serviceInstance="http://rook4.cloud.dkrz.de:80/wps?request=GetCapabilities&amp;amp;service=WPS" statusLocation="">
    <wps:Process wps:processVersion="1.0">
        <ows:Identifier>subset</ows:Identifier>
        <ows:Title>Subset</ows:Title>
        <ows:Abstract>Run subsetting on climate model data. Calls daops operators.</ows:Abstract>
        </wps:Process>
    <wps:Status creationTime="2021-03-18T15:08:42Z">
        <wps:ProcessFailed>
            <wps:ExceptionReport>
                    <ows:Exception exceptionCode="NoApplicableCode" locator="None">
                            <ows:ExceptionText>Process error: Some or all of the requested collection are not in the list of available data.</ows:ExceptionText>
                    </ows:Exception>
            </wps:ExceptionReport>
        </wps:ProcessFailed>
        </wps:Status>
</wps:ExecuteResponse>