Cilia/Cilia Advanced/REST API

From Wiki Adele Team
Jump to: navigation, search

CILIA API REST

i This API is for the 1.6.0 version. For the previous API use the following link


previous version.


Prerequisites

The Cilia API REST is based on Jersey. And uses RoSe to eases the usage. In order to export the API Rest it is needed to have the following bundles.

For RoSe

  • rose-core-1.0.2 [1]
  • jersey-exporter-1.0.2 [2]
  • json-configurator-1.0.2 [3]

Other dependencies

  • jersey-core-1.9
  • jersey-server-1.9
  • felix jetty-2.2.0
  • javax.mail.mail-1.4.3
  • jaxb-api-osgi-2.2.1
  • chameleon json-service-json.org-0.4.0


Or you can also use the distribution provided, to unzip it and launch it. snapshot distribution or release distribution

Manipulating a Chain

Method PATH PARAMETERS DESCRIPTION EXAMPLE (Using command line tool cURL)
GET <HTTP_SERVER>/cilia NONE Get the list of chain ids. curl -X GET http://localhost:8080/cilia
GET <HTTP_SERVER>/cilia/<CHAIN_ID> NONE Get the information of a mediation chain. curl -X GET http://localhost:8080/cilia/HelloWorld
POST <HTTP_SERVER>/cilia/<CHAIN_ID> NONE Creates an empty chain. curl -X POST http://localhost:8080/cilia/HelloWorld
PUT <HTTP_SERVER>/cilia/<CHAIN_ID>/components
  • command=copy
  • from=<componentID>
  • to=<componentID>
Copy the information of an existent component to another. curl -X PUT -d "command=copy&from=m1&to=m2" http://localhost:8080/cilia/HelloWorld/components
PUT <HTTP_SERVER>/cilia/<CHAIN_ID>/components
  • command=replace
  • from=<componentID>
  • to=<componentID>
Replace one component for another and copy his data. curl -X PUT -d "command=replace&from=m1&to=m2" http://localhost:8080/cilia/HelloWorld/components
DELETE <HTTP_SERVER>/cilia/<CHAIN_ID> NONE Delete a mediation chain curl -X DELETE http://localhost:8080/cilia/HelloWorld

Manipulating Components

Method PATH PARAMETERS DESCRIPTION EXAMPLE (Using command line tool cURL)
GET <HTTP_SERVER>/cilia/<CHAIN_ID>/components/<ID> NONE Get the information of a component (mediator or adapter) curl -X GET http://localhost:8080/cilia/HelloWorld/components/hello-mediator-1
GET <HTTP_SERVER>/cilia/<CHAIN_ID>/mediators/<ID> NONE Get the information of a mediator curl -X GET http://localhost:8080/cilia/HelloWorld/mediators/hello-mediator-1
GET <HTTP_SERVER>/cilia/<CHAIN_ID>/adapters/<ID> NONE Get the information of an adapter curl -X GET http://localhost:8080/cilia/HelloWorld/adapters/adapter1
POST <HTTP_SERVER>/cilia/<CHAIN_ID>/mediator/<TYPE>/<ID> properties=<Properties in JSON> Creates a mediator component curl -X POST -d "properties={name=titi}" http://localhost:8080/cilia/HelloWorld/mediator/HelloMediator/hello-mediator-1
POST <HTTP_SERVER>/cilia/<CHAIN_ID>/adapter/<TYPE>/<ID> properties=<Properties in JSON Format> Creates an adapter component curl -X POST -d "properties={namespace=titi}" http://localhost:8080/cilia/HelloWorld/adapter/ConsoleAdapter/console-adapter-1
PUT <HTTP_SERVER>/cilia/<CHAIN_ID>/components/<ID> properties=<Properties in JSON Format> Modify the component properties curl -X PUT -d "properties={prefix=Hi}" http://localhost:8080/cilia/HelloWorld/components/hello-mediator-1
DELETE <HTTP_SERVER>/cilia/<CHAIN_ID>/components/<ID> NONE Remove a component in the given chain. curl -X DELETE http://localhost:8080/cilia/HelloWorld/components/hello-mediator-1
DELETE <HTTP_SERVER>/cilia/<CHAIN_ID>/mediators/<ID> NONE Remove a mediator in the given chain. curl -X DELETE http://localhost:8080/cilia/HelloWorld/mediators/hello-mediator-1
DELETE <HTTP_SERVER>/cilia/<CHAIN_ID>/adapters/<ID> NONE Remove an adapter in the given chain. curl -X DELETE http://localhost:8080/cilia/HelloWorld/adapters/console-adapter-1

Manipulating Bindings

Method PATH PARAMETERS DESCRIPTION EXAMPLE (Using command line tool cURL)
POST <HTTP_SERVER>/cilia/<CHAIN_ID>/bindings
  • from=<ID>:<PORT>
  • to=<ID>:<PORT>
  • linker=<PROTOCOL>
  • properties=<Properties in JSON format>
Perform a binding between two components. curl -d "from=hello-mediator-1:unique&to=console-adapter-1:unique&linker=JMS_Joram&properties={jms.topic=wiki}" -X POST http://localhost:8080/cilia/HelloWorld/bindings
DELETE <HTTP_SERVER>/cilia/<CHAIN_ID>/bindings?from=<id:port>&to=<id:port> NONE Remove a binding between two components. curl -X DELETE http://localhost:8080/cilia/HelloWorld/bindings?from=hello-mediator-1:unique&to=console-adapter-1:unique