Reading resqml data using fetpapi

Hi @philippeVerney

I have build jar of fetpapi(with fesapi 2.4.1.0 ) and OpenETP docker is also running using these commands

docker-compose run open_etp_server_runtime openETPServer server --init
docker-compose run -p 9002:9002 open_etp_server_runtime openETPServer server --start

In OpenETP i have loaded resqml data

Using fetpapiClient i want to read this resqml data from openETP docker’s , in this class

Could you please help me and provide some example code how to read resqml data from openETP using Fetpapi.

Hello @philippeVerney,

I want to provide some additional details on this ticket.
Please see that I am able to query the stats from this ETP Server in command line.

[open-etp-server]$ docker-compose run open_etp_server_runtime openETPServer space -S ws://xx.xxx.xxx.xxx:9002 -u foo -p bar -s demo/Volve --stats
/usr/local/lib/python3.6/site-packages/paramiko/transport.py:33: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
from cryptography.hazmat.backends import default_backend
Removing open-etp-server_open_etp_server_runtime_1
Creating open-etp-server_open_etp_server_runtime_run … done
1 eml20.obj_EpcExternalPartReference
89 resqml20.obj_ContinuousProperty
85 resqml20.obj_FaultInterpretation
7 resqml20.obj_GeneticBoundaryFeature
7 resqml20.obj_Grid2dRepresentation
15 resqml20.obj_HorizonInterpretation
1 resqml20.obj_LocalTime3dCrs
1 resqml20.obj_OrganizationFeature
103 resqml20.obj_PolylineSetRepresentation
6 resqml20.obj_PropertyKind
2 resqml20.obj_StratigraphicColumn
2 resqml20.obj_StratigraphicColumnRankInterpretation
8 resqml20.obj_StratigraphicUnitFeature
16 resqml20.obj_StratigraphicUnitInterpretation
76 resqml20.obj_SubRepresentation
65 resqml20.obj_TectonicBoundaryFeature
7 resqml20.obj_TriangulatedSetRepresentation
491 TOTAL

Below is the code snippet of FetpapiClient.

	DataObjectRepository repo = new DataObjectRepository();
	// host and port are pointing to where ETP Server (docker) is running, target is "/". 
	// not providing any authorization as ETP Server is not running in secure mode (ws, not wss)
	// Question: what is target ?

	MyInitializationParameters initParam = new MyInitializationParameters(host, port, target, repo);
	System.out.println("Connecting to " + host + ":" + port + " path \"" + target +"\" and authorization \"" + authorization + "\"");
	
	PlainClientSession session = fetpapi.createWsClientSession(initParam, authorization);
	// [http] xx.xxx.xxx.xxx [::ffff:xx.xxx.xxx.xxx]:57254 "GET //.well-known/etp-server-capabilities?GetVersion=etp12.energistics.org HTTP/1.1" 404 55 "Boost.Beast                                 /322"

	repo.setHdfProxyFactory(new FesapiHdfProxyFactory(session));
	
	session.run();
	// Error: No Authorization HTTP header (or URL query-string): Connection refused.
	// [error] Handshake ended with HTTP error: 401
	// [fail] WebSocket Connection [::ffff:xx.xxx.xxx.xxx]:57454 v13 "" // 401 websocketpp:27 Connection rejected

	// Can I get dataspeaces ? 
	DataspaceVector dsVector = session.getDataspaces();
	
	// Can I read data from repo like I would do using FESAPI on Resqml files ?
	StringVector allUuids = repo.getUuids();
	for (String uuid : allUuids) {
		AbstractObject obj = null;
		try {
			obj = repo.getDataObjectByUuid(uuid);
		} catch (IllegalArgumentException e) {
		}
	}

	session.close();

Questions:

  1. Seems like the APIs are expecting authorization. Is there an API that can be used without providing authorization ?
  2. It would be great if you could expand this example to show how to read data using FESAPI/FETPAPI
  3. Could you please point to any javadoc for the FETPAPI APIs ?
  4. At some point I remember seeing a demo video by @philippeVerney in OSDU showing usage of FETPAPI(?), I can’t find it anymore. Could you please point me to any demo/design doc etc. to help me better understand how FESAPI and FETPAPI work together ?

We are evaluating to use FETPAPI to read/write following data types from/to ETP Server:
Horizons
Faults
Well Picks
Well Logs

Could you please also comment about the stability of FETPAPI APIs and some idea on when first version is likely to be released ?

Thanks,
Shakir

Hi,

No, you must first initiate the ETP session and for that you need "authorization " because you provided one when starting openEtpServer with “-u foo -p bar” parameters. You may try to disable authorization on server side.
Otherwise, please provide authorization which would be “Basic Zm9vOmJhcg==” based on “-u foo -p bar”

Not enough time for now but this is the plan. And we also encourage contribution.
The C++ example is more complete but more complex. You may give a look at it fetpapiClient/main.cpp at main · F2I-Consulting/fetpapiClient · GitHub especially lines 241 to 271 for your particular question.

It is not generated yet. This generation is on the TODO list.

Same answer.
But basically, the idea is to get the ETP dataobjects which you want from the ETP server and add them into the repository. Then, you use your repository exactly as usual.
Here is probably the video you talk about: Cisco Webex Meetings

The plan is to make a first release in 2023. I think it will be second semester.
I don’t expect huge changes in FETPAPI. Cleaning and testing are the main things to do.

Thanks for your response @philippeVerney !