Discuss.FOLIO.org is no longer used. This is a static snapshot of the website as of February 14, 2023.

How to understand “we create a JSON structure of a moduleDescriptor and POST it to Okapi”?

folios
3 Mar '17

How to POST to Okapi ?

peter
3 Mar '17

Please read and follow the Okapi Guide and Reference. If there are parts of that guide that are a problem, please message me directly.

peter
3 Mar '17

curl is a command, so this is a command line that uses HTTP post to send the contents of /tmp/okapi-proxy-test-basic.json to the Okapi Gateway:

curl -w '\n' -X POST -D - \
    -H "Content-type: application/json" \
    -d @/tmp/okapi-proxy-test-basic.json \
    http://localhost:9130/_/proxy/modules

Based on your earlier screen captures, it looks like you are using a Microsoft Windows system. That may be a significant part of your issues. The curl command is a part of Linux and MacOS operating systems, and the developers are using those two operating systems for developing Stripes and Okapi.

peter
5 Mar '17

The last curl command in the “Deploying the Module” section demonstrates this:

curl -w '\n' http://localhost:9131/testb

folios
6 Mar '17

Where is the location of the file of “okapi-proxy-test-basic.json” after being posted to Okapi and can I find it ?

peter
6 Mar '17

Are you looking for the file itself? It isn’t on the server. The contents of the JSON was read by Okapi and the configuration of the server changed as a result. The development version of Okapi uses an in-memory database, so nothing is stored to disk.

folios
8 Mar '17

It sames that every Module and Tenant will auto acquire an unique port (allocated by Okapi) after registering on Okapi , but an unique server e.g API server and UI server also using a port respectively when it is started . Therefore the result is that my module hasn’t registered on Okapi infactly because the ports of them is conflict if they are the same port.
Could help me to correct my comprehension ? Thank you !

peter
8 Mar '17

Each Okapi Module is assigned a unique port, but Okapi Modules are expected to support multitenancy (through the X-Okapi-Tenant header), so there is not a unique port for each tenant.

folios
9 Mar '17

I tried to change the path of “okapi-proxy-test-basic.json” to new path of my module e.g API Server , but it’s failed , so how could I realise my thought ?

{
  "id" : "test-basic",
  "name" : "Okapi test module",
  "provides" : [ {
    "id" : "test-basic",
    "version" : "2.2.3",
    "routingEntries" : [ {
      "methods" : [ "GET", "POST" ],
      "path" : "/testb",
      "level" : "30",
       "permissionsRequired" : [ "test-basic.needed" ],
      "permissionsDesired" : [ "test-basic.extra" ]
    } ]
  }, {
    "id" : "_tenant",
    "version" : "1.0.0",
    "interfaceType" : "system",
    "routingEntries" : [ {
      "methods" : [ "POST", "DELETE" ],
      "path" : "/_/tenant",
      "type" : "request-response"
    } ]
  } ],
  "launchDescriptor" : {
    "exec" : "java -Dport=%p -jar okapi-test-module/target/okapi-test-module-fat.jar"
  }
}
peter
9 Mar '17

Do you mean the path in the launchDescriptor setting? The path is relative to the working directory where Okapi Gateway is running.

folios
10 Mar '17

What’s the mean of "path" : "/testb" , and I want to request my API Server which URI is like 192.168.17.128:8080/index.html through Okapi , and what’s the solution ?

peter
13 Mar '17

I think you are misunderstanding the purpose of Okapi. Okapi is not a general proxy server, nor is it something that is intended to be accessed by end-users. There isn’t, and probably never would be, an index.html response from the Okapi gateway or from the Okapi modules.

folios
14 Mar '17

Is it ok to request data from oracle database through okapi directly ?

peter
14 Mar '17

The Okapi Gateway does not connect directly to the database; an Okapi Module would be the interface to any underlying storage.

Last week we released a tutorial for FOLIO from a developer perspective. You might find it valuable in understanding the concepts behind FOLIO and what needs FOLIO is designed to solve:

http://dev.folio.org/curriculum/

folios
15 Mar '17

How soon can I lean 5. Build a skeletal RAML-module-builder module on http://dev.folio.org/curriculum/ ?

folios
16 Mar '17

I can get target/domain-models-runtimes-fat.jar in module of domain-models-runtime after run mvn install on raml-models-builder , then I got directory of domain-models-runtime-fat after decompressing domain-models-runtimes-fat.jar as following capture .
As we can see there are lots of sub directories under the directory of domain-models-runtime-fat , it sames that the html of http://localhost:8081/apidocs/ come from directory of apidocs only , so what function of other directories ? Can you give an explanation ?
capture of question

folios
30 Mar '17

Excuse me , how can I access website of https://github.com/folio-org/stripes-connect/blob/master/doc/api.md.It may be that I need to be involved in team of indexdata.slack.com,can you let me join in ?

peter
30 Mar '17

The links at the bottom of that page are not related to Index Data’s internal slack team. I’ve logged a ticket to fix the missing images: https://issues.folio.org/browse/STRIPES-284