Cegal Hub - remote Cegal Hub Server with Petrel demo#
This demo assumes you have access to a running Cegal Hub Server instance in the cloud on the below address.
Activate the Cegal Hub Server if not already activated
cegalhub client activate --address="cegalhub.demo1-ispace.cegal-geo.com" --port=443 --tls
Create a Cegal Hub Client for use with a remote Cegal Hub Server
cegalhub agent --address="cegalhub.demo1-ispace.cegal-geo.com" --port=443 --tls --alp
For PTP or another Keystone application that wishes to supply Bearer tokens (because of protected payloads in the connector) supply your own oidc_options to match the logical Keystone app registration. The default oidc_options of None falls back to using oidc_options for the logical Prizme app. The logical Keystone application must have access to the logical Keystone hub_connector_api scope if Cegal Hub Server is configured with client authentication.
The oidc _options are part of the cegal-keystoneauth package available on PyPI
[ ]:
from cegalprizm.hub import Hub, ConnectionParameters
[ ]:
cp = ConnectionParameters(host="cegalhub.demo1-ispace.cegal-geo.com", port="443", use_tls=True, use_auth=True)
[ ]:
hub = Hub(connection_parameters=cp)
hub
Activate the remote Cegal Hub Server if not already activated
This is only needed to be done once on a running Cegal Hub Server
[ ]:
hub.activate()
Obtain a handle to the Cegal Hub Agent on the local machine for use later
[ ]:
agent = hub.default_agent_ctx()
Launch a new instance of Petrel in the background from your Cegal Hub Agent and get a handle to Petrel
[ ]:
petrel = agent.new_petrel_instance(petrel_version=2021)
Load a Petrel project
[ ]:
petrel.load_project(path="C:\data\GroningenHub2\GroningenHub2.pet")
Shutdown Petrel
[ ]:
petrel.poison_petrel()
Query the Cegal Hub server and check available Cegal Hub Connectors
[ ]:
hub.print_query_server()
[ ]:
hub.print_query_connectors(show_meta=False, show_payloads=False, show_labels=False)