Pion Core - Web Services
This page documents the web services used by the Pion Platform Server.
https://pion_server_address:port_number/...
- GET /config
This service returns the system configuration information for the Pion Platform
<PionConfig>
<Version>1.0.0</Version>
<PlatformConfig>/etc/pion/platform.xml</PlatformConfig>
<VocabularyConfig>/etc/pion/vocabularies.xml</VocabularyConfig>
<CodecConfig>/etc/pion/codecs.xml</CodecConfig>
<DatabaseConfig>/etc/pion/databases.xml</DatabaseConfig>
<ReactorConfig>/etc/pion/reactors.xml</ReactorConfig>
<ServiceConfig>/etc/pion/services.xml</ServiceConfig>
<LogConfig>/etc/pion/logconfig.txt</LogConfig>
<VocabularyPath>/etc/pion/vocabularies/</VocabularyPath>
<PluginPath>/etc/pion/plugins/codecs/</PluginPath>
<PluginPath>/etc/pion/plugins/databases/</PluginPath>
<PluginPath>/etc/pion/plugins/reactors/</PluginPath>
<PluginPath>/etc/pion/plugins/services/</PluginPath>
</PionConfig> - GET /config/vocabularies
This service returns a list of all vocabularies.
<PionConfig>
<VocabularyPath>vocabularies</VocabularyPath>
<VocabularyConfig id="urn:vocab:clf">vocabularies/clf.xml</VocabularyConfig>
<VocabularyConfig id="urn:vocab:myterms">vocabularies/myterms.xml</VocabularyConfig>
...
</PionConfig> - [GET, POST, PUT, DELETE] /config/vocabularies/vocabulary-id
If the GET request method is used, this service will return the configuration for a particular vocabulary that is identified by vocabulary-id (including all of its terms).
If the POST request method is used, the request's entity content should contain the XML configuration for a new vocabulary (excluding any terms) that will be identified by vocabulary-id. If successful, the new vocabulary will be created, and a "201 Created" response that contains the new vocabulary configuration will be sent to the client.
If the PUT request method is used, the request's entity content should contain updated XML configuration for an existing vocabulary that is identified by vocabulary-id (excluding any terms). If successful, the vocabulary's configuration will be updated, and a response containing the updated configuration will be sent to the client.
If the DELETE request method is used, this service will remove the vocabulary that is identified by vocabulary-id, including any terms that it contains. If successful, a "204 No Content" response will be sent to the client.
<PionConfig>
<Vocabulary id="urn:vocab:clf">
<Name>Common Log Format</Name>
<Comment>Vocabulary for the Common and Combined Log Formats (CLF)</Comment>
<Locked>true</Locked>
<Term id="urn:vocab:clf#remotehost">
<Type>shortstring</Type>
<Comment>Remote hostname (or IP number if DNS hostname is not available)</Comment>
</Term>
<Term id="urn:vocab:clf#rfc931">
...
</Term>
...
</Vocabulary>
</PionConfig> - GET /config/terms
This service will return the configuration for all vocabulary terms.
<PionConfig>
<Term id="urn:vocab:clf#remotehost">
<Type>shortstring</Type>
<Comment>Remote hostname (or IP number if DNS hostname is not available)</Comment>
</Term>
<Term id="urn:vocab:clf#rfc931">
...
</Term>
...
</PionConfig> - [GET, POST, PUT, DELETE] /config/terms/term-id
If the GET request method is used, this service will return the configuration for a particular vocabulary term that is identified by term-id (i.e. "urn:vocab:clf#date").
If the POST request method is used, the request's entity content should contain the XML configuration for a new vocabulary term that will be identified by term-id. If successful, the new term will be created, and a "201 Created" response that contains the new term configuration will be sent to the client.
If the PUT request method is used, the request's entity content should contain updated XML configuration for an existing vocabulary term that is identified by term-id. If successful, the term's configuration will be updated, and a response containing the updated configuration will be sent to the client.
If the DELETE request method is used, this service will remove the vocabulary term that is identified by term-id. If successful, a "204 No Content" response will be sent to the client.
<PionConfig>
<Term id="urn:vocab:clf#remotehost">
<Type>shortstring</Type>
<Comment>Remote hostname (or IP number if DNS hostname is not available)</Comment>
</Term>
</PionConfig> - [GET, POST] /config/codecs
If the GET request method is used, this service will return the configuration for all codecs.
If the POST request method is used, the request's entity content should contain the XML configuration for a new codec (without an identifier). If successful, the new codec will be created and assigned a unique identifier, and a "201 Created" response that contains the new codec configuration (including the new identifier) will be sent to the client.
<PionConfig>
<Codec id="a174c3b0-bfcd-11dc-9db2-0016cb926e68">
<Name>Common Log Format</Name>
...
</Codec>
<Codec id="3f49f2da-bfe3-11dc-8875-0016cb926e68">
<Name>Combined Log Format</Name>
...
</Codec>
...
</PionConfig> - [GET, PUT, DELETE] /config/codecs/codec-id
If the GET request method is used, this service will return the configuration for a particular codec that is identified by codec-id.
If the PUT request method is used, the request's entity content should contain updated XML configuration for an existing codec that is identified by codec-id. If successful, the codec's configuration will be updated, and a response containing the updated configuration will be sent to the client.
If the DELETE request method is used, this service will remove the codec that is identified by codec-id. If successful, a "204 No Content" response will be sent to the client.
<PionConfig>
<Codec id="a174c3b0-bfcd-11dc-9db2-0016cb926e68">
<Name>Common Log Format</Name>
<Comment>Codec for the Common Log Format (CLF)</Comment>
<Plugin>LogCodec</Plugin>
<EventType>urn:vocab:clf#http-request</EventType>
<Field term="urn:vocab:clf#remotehost">remotehost</Field>
<Field term="urn:vocab:clf#rfc931">rfc931</Field>
<Field term="urn:vocab:clf#authuser">authuser</Field>
...
</Codec>
</PionConfig> - [GET, POST] /config/protocols
If the GET request method is used, this service will return the configuration for all protocols.
If the POST request method is used, the request's entity content should contain the XML configuration for a new protocol (without an identifier). If successful, the new protocol will be created and assigned a unique identifier, and a "201 Created" response that contains the new protocol configuration (including the new identifier) will be sent to the client.
<PionConfig xmlns="http://purl.org/pion/config">
<Protocol id="37A7DC3E-EE7E-4420-B0DD-CADE20DEF840">
<Name>HTTP (no content)</Name>
...
</Protocol>
<Protocol id="593f044a-ac60-11dd-aba3-001cc02bd66b">
<Name>HTTP (full content)</Name>
...
</Protocol>
</PionConfig> - [GET, PUT, DELETE] /config/protocols/protocol-id
If the GET request method is used, this service will return the configuration for a particular protocol that is identified by protocol-id.
If the PUT request method is used, the request's entity content should contain updated XML configuration for an existing protocol that is identified by protocol-id. If successful, the protocol's configuration will be updated, and a response containing the updated configuration will be sent to the client.
If the DELETE request method is used, this service will remove the protocol that is identified by protocol-id. If successful, a "204 No Content" response will be sent to the client.
<PionConfig xmlns="http://purl.org/pion/config">
<Protocol id="37A7DC3E-EE7E-4420-B0DD-CADE20DEF840">
<Name>HTTP (no content)</Name>
<Comment>HTTP Protocol parser</Comment>
<Plugin>HTTPProtocol</Plugin>
<EventType>urn:vocab:clickstream#http-event</EventType>
<Extract term="urn:vocab:clickstream#host">
<Source>cs-header</Source>
<Name>Host</Name>
</Extract>
...
<Extract term="urn:vocab:clickstream#page-title">
<Source>sc-content</Source>
<Match><TITLE>(.*)</TITLE></Match>
<Format>$1</Format>
<ContentType>^text/html</ContentType>
<MaxSize>102400</MaxSize>
</Extract>
</Protocol>
</PionConfig> - [GET, POST] /config/databases
If the GET request method is used, this service will return the configuration for all databases.
If the POST request method is used, the request's entity content should contain the XML configuration for a new database (without an identifier). If successful, the new database will be created and assigned a unique identifier, and a "201 Created" response that contains the new database configuration (including the new identifier) will be sent to the client.
<PionConfig>
<Database id="135443dc-e19f-11dc-baac-0019e3f89cd2">
<Name>Web Requests Data Store</Name>
...
</Database>
<Database id="29b2188e-e19f-11dc-9eb0-0019e3f89cd2">
<Name>Campaign Referrals Data Store</Name>
...
</Database>
...
</PionConfig> - [GET, PUT, DELETE] /config/databases/database-id
If the GET request method is used, this service will return the configuration for a particular database that is identified by database-id.
If the PUT request method is used, the request's entity content should contain updated XML configuration for an existing database that is identified by database-id. If successful, the database's configuration will be updated, and a response containing the updated configuration will be sent to the client.
If the DELETE request method is used, this service will remove the database that is identified by database-id. If successful, a "204 No Content" response will be sent to the client.
<PionConfig>
<Database id="135443dc-e19f-11dc-baac-0019e3f89cd2">
<Name>Web Requests Data Store</Name>
<Comment>Stores web requests into an embedded SQLite database</Comment>
...
</Database>
</PionConfig> - [GET, POST] /config/reactors
If the GET request method is used, this service will return the configuration for all reactors.
If the POST request method is used, the request's entity content should contain the XML configuration for a new reactor (without an identifier). If successful, the new reactor will be created and assigned a unique identifier, and a "201 Created" response that contains the new reactor configuration (including the new identifier) will be sent to the client.
<PionConfig>
<Reactor id="153f6c40-cb78-11dc-8fa0-0019e3f89cd2">
<Name>Only IE Requests</Name>
...
</Reactor>
<Reactor id="0cc21558-cf84-11dc-a9e0-0019e3f89cd2">
<Name>Do Nothing</Name>
...
</Reactor>
...
</PionConfig> - GET /config/reactors/stats
This service returns statistical information for all reactors
<PionStats>
<Reactor id="153f6c40-cb78-11dc-8fa0-0019e3f89cd2">
<Running>false</Running>
<EventsIn>910</EventsIn>
<EventsOut>910</EventsOut>
</Reactor>
<Reactor id="0cc21558-cf84-11dc-a9e0-0019e3f89cd2">
<Running>true</Running>
<EventsIn>13312312501</EventsIn>
<EventsOut>12312501</EventsOut>
</Reactor>
...
<TotalOps>13312313411</TotalOps>
</PionStats> - GET /config/reactors/plugins
This service returns the type and plugin name for all reactors that are available in the user interface.
<PionConfig>
<Reactor>
<ReactorType>collection</ReactorType>
<Plugin>LogInputReactor</Plugin>
</Reactor>
<Reactor>
<ReactorType>processing</ReactorType>
<Plugin>FilterReactor</Plugin>
</Reactor>
...
</PionConfig> - [GET, PUT, DELETE] /config/reactors/reactor-id
If the GET request method is used, this service will return the configuration for a particular reactor that is identified by reactor-id.
If the PUT request method is used, the request's entity content should contain updated XML configuration for an existing reactor that is identified by reactor-id. If successful, the reactor's configuration will be updated, and a response containing the updated configuration will be sent to the client.
If the DELETE request method is used, this service will remove the reactor that is identified by reactor-id, as well as all of its connections. If successful, a "204 No Content" response will be sent to the client.
<PionConfig>
<Reactor id="153f6c40-cb78-11dc-8fa0-0019e3f89cd2">
<Name>Only IE Requests</Name>
<Comment>Filter events that are not requests from IE browsers</Comment>
<Plugin>FilterReactor</Plugin>
<Workspace>Test Workspace</Workspace>
<X>50</X>
<Y>100</Y>
<Comparison>
<Term>urn:vocab:clf#useragent</Term>
<Type>contains</Type>
<Value>MSIE</Value>
</Comparison>
</Reactor>
</PionConfig> - PUT /config/reactors/reactor-id/start
This service will start the reactor identified by reactor-id if it is idle. If successful, a response containing all reactor statistics will be sent to the client.
<PionStats>
<Reactor id="153f6c40-cb78-11dc-8fa0-0019e3f89cd2">
<Running>false</Running>
<EventsIn>910</EventsIn>
<EventsOut>910</EventsOut>
</Reactor>
<Reactor id="0cc21558-cf84-11dc-a9e0-0019e3f89cd2">
<Running>true</Running>
<EventsIn>13312312501</EventsIn>
<EventsOut>12312501</EventsOut>
</Reactor>
...
<TotalOps>13312313411</TotalOps>
</PionStats> - PUT /config/reactors/reactor-id/stop
This service will stop the reactor identified by reactor-id if it is active. If successful, a response containing all reactor statistics will be sent to the client.
<PionStats>
<Reactor id="153f6c40-cb78-11dc-8fa0-0019e3f89cd2">
<Running>false</Running>
<EventsIn>910</EventsIn>
<EventsOut>910</EventsOut>
</Reactor>
<Reactor id="0cc21558-cf84-11dc-a9e0-0019e3f89cd2">
<Running>true</Running>
<EventsIn>13312312501</EventsIn>
<EventsOut>12312501</EventsOut>
</Reactor>
...
<TotalOps>13312313411</TotalOps>
</PionStats> - PUT /config/reactors/reactor-id/move
The request's entity content should contain the XML configuration for an existing reactor that is identified by reactor-id, with updated values for the X, Y and Workspace elements. If any other elements of the configuration have changed since the last update, this request should not be sent, because the reactor will not get the new values. If successful, the reactor's configuration will be updated, and a response containing the updated configuration will be sent to the client.
<PionConfig>
<Reactor id="153f6c40-cb78-11dc-8fa0-0019e3f89cd2">
<Name>Only IE Requests</Name>
<Comment>Filter events that are not requests from IE browsers</Comment>
<Plugin>FilterReactor</Plugin>
<Workspace>Test Workspace</Workspace>
<X>150</X>
<Y>200</Y>
<Comparison>
<Term>urn:vocab:clf#useragent</Term>
<Type>contains</Type>
<Value>MSIE</Value>
</Comparison>
</Reactor>
</PionConfig> - GET /config/services
This service returns a list of all web services
<PionConfig>
<Server id="main-server">
<WebService id="ui-service">
...
</WebService>
<PlatformService id="config-service">
...
</PlatformService>
...
</Server>
<Server id="hello-server">
...
</Server>
...
</PionConfig> - GET /config/services/server-id
This service returns the service configuration for a particular web server that is identified by server-id
<PionConfig>
<Server id="main-server">
<Port>8080</Port>
<SSLKey>sslkey.pem</SSLKey>
<WebService id="ui-service">
<Name>User Interface Service</Name>
...
</WebService>
<PlatformService id="config-service">
<Name>Configuration Service</Name>
...
</PlatformService>
...
</Server>
</PionConfig> - [GET, POST] /config/connections
If the GET request method is used, this service will return a list of all reactor connections (including internal connections and feed connections).
If the POST request method is used, the request's entity content should contain the XML configuration for a new reactor connection (without an identifier). If successful, the new connection will be created and assigned a unique identifier, and a "201 Created" response that contains the new connection information (including the new identifier) will be sent to the client.
<PionConfig>
<Connection id="dc2ca920-dc1d-11dc-b241-0019e3f89cd2">
<Type>reactor</Type>
<From>153f6c40-cb78-11dc-8fa0-0019e3f89cd2</From>
<To>0cc21558-cf84-11dc-a9e0-0019e3f89cd2</To>
</Connection>
<Connection id="9c7a94e2-e1a2-11dc-a76e-0019e3f89cd2">
<Type>input</Type>
<From>10.0.0.123:52220</From>
<To>0cc21558-cf84-11dc-a9e0-0019e3f89cd2</To>
</Connection>
<Connection id="e6bd01a6-e0e5-11dc-986e-0019e3f89cd2">
<Type>output</Type>
<From>153f6c40-cb78-11dc-8fa0-0019e3f89cd2</From>
<To>127.0.0.1:53442</To>
</Connection>
</PionConfig> - [GET, DELETE] /config/connections/connection-id
If the GET request method is used, this service will return information for a particular connection that is identified by connection-id.
If the DELETE request method is used, this service will remove the connection that is identified by connection-id. If successful, a "204 No Content" response will be sent to the client.
<PionConfig>
<Connection id="dc2ca920-dc1d-11dc-b241-0019e3f89cd2">
<Type>reactor</Type>
<From>153f6c40-cb78-11dc-8fa0-0019e3f89cd2</From>
<To>0cc21558-cf84-11dc-a9e0-0019e3f89cd2</To>
</Connection>
</PionConfig> - [GET, POST] /config/users
If the GET request method is used, this service will return the configuration for all users.
If the POST request method is used, the request's entity content should contain the XML configuration for a new user. If successful, the new user will be created with the specified identifier, and a "201 Created" response that contains the new user configuration will be sent to the client. If the specified identifier is not unique, an error will be returned.
<PionConfig>
<User id="user_2">
<Password>openSesame</Password>
...
</User>
</PionConfig> - [GET, PUT, DELETE] /config/users/user-id
If the GET request method is used, this service will return the configuration for the user identified by user-id.
If the PUT request method is used, the request's entity content should contain an updated XML configuration for an existing user identified by user-id. If successful, the user's configuration will be updated, and a response containing the updated configuration will be sent to the client.
If the DELETE request method is used, this service will remove the user that is identified by user-id. If successful, a "204 No Content" response will be sent to the client.
<PionConfig>
<User>
<Password>openSesame</Password>
<FirstName>Ann</FirstName>
...
</User>
</PionConfig> - GET /config/plugins
This service returns a list of all plugin libraries found on the plugin paths.
<PionConfig>
<Plugin>JSONCodec</Plugin>
<Plugin>LogCodec</Plugin>
...
<Plugin>DatabaseOutputReactor</Plugin>
<Plugin>FilterReactor</Plugin>
...
<Plugin>FeedService</Plugin>
...
</PionConfig> - [GET, PUT, POST] /feed/reactor-id/codec-id
This service establishes a feed connection to an existing reactor that is identified by reactor-id. If the GET HTTP method is used for the request, an output connection will be created to send events to the client. If the PUT or POST HTTP method is used, an input connection will be created to receive events from the client. The new connection will use the codec that is identified by codec-id to read or write events. To acknowledge that the feed connection has been established, an HTTP response will be sent to the client that is similar to the following:
HTTP/1.1 201 Created
Content-Type: text/xml
Connection: Keep-Alive
Content-Length: 199<PionConfig>
<Connection id="e6bd01a6-e0e5-11dc-986e-0019e3f89cd2">
<Type>output</Type>
<From>153f6c40-cb78-11dc-8fa0-0019e3f89cd2</From>
<To>127.0.0.1:53442</To>
</Connection>
</PionConfig> - GET /log
This service returns the most recent log entries (assuming Pion has been built with one of the supported logging frameworks)
1203560365995798 INFO pion - Pion has started successfully - [GET, PUT] /key (Enterprise Edition)
If the GET request method is used, this service will return the current license key information.
If the PUT request method is used, the request's entity content should contain a license key. If successful, the license key provided will be stored and used to unlock functionality in the Enterprise Edition, and a response containing the updated license key information will be sent to the client.
<License>
<Product>Pion Enterprise</Product>
<Name>Licensee's Name</Name>
<Email>Licensee's Email</Email>
<Version>1.0</Version>
<Expiration>2008-10-04</Expiration>
</License> - GET /key/status (Enterprise Edition)
This service returns the status of the Pion Enterprise Edition license key. Status may be either "valid", "invalid", or "empty".
<License>
<Status>valid</Status>
</License>
