Security/Projects/Minion/PluginService: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
Line 7: Line 7:
* Communication with the Plugins
* Communication with the Plugins
* Threading requests
* Threading requests
==Notes==
The PluginService basically provides an environment in which plugins can run.
The plugins run within this service, and it handles the threading and the external (REST) API.
==API==
This is at a very early stage, so is still fairly fluid.
{| border="1" cellpadding="1"
|+Multiplication table
|-
! Op !! URL !! Method !! Notes
|-
| GET || /info || get_info || Get info about the PluginService
|-
| GET || /sessions || get_sessions() || Returns a list of all of the current sessions
|-
| PUT || /session/create/<plugin_name> || create_session(plugin_name) || Create a session with the specified plugin
|-
| DELETE || /session/<session> || terminate_session(session) || Terminates the specified session
|-
| GET || /session/<session>/status || get_session_status(session) || Get the status of the specified session
|-
| GET || /session/<session>/states || get_session_states(session) || Returns the valid states the specified session can be set to
|-
| POST ||"/session/<session>/state/<state> || set_session_states(session, state) || Sets the session state - used for starting, stopping etc
|}


==Main Classes==
==Main Classes==

Revision as of 14:56, 22 October 2012

Minion Plugin Service

Overview

The Plugin Service is responsible for:

  • Providing a REST based API
  • Handling requests from trusted components (eg the Task Engine)
  • Communication with the Plugins
  • Threading requests

Notes

The PluginService basically provides an environment in which plugins can run.

The plugins run within this service, and it handles the threading and the external (REST) API.

API

This is at a very early stage, so is still fairly fluid.


Multiplication table
Op URL Method Notes
GET /info get_info Get info about the PluginService
GET /sessions get_sessions() Returns a list of all of the current sessions
PUT /session/create/<plugin_name> create_session(plugin_name) Create a session with the specified plugin
DELETE /session/<session> terminate_session(session) Terminates the specified session
GET /session/<session>/status get_session_status(session) Get the status of the specified session
GET /session/<session>/states get_session_states(session) Returns the valid states the specified session can be set to
POST "/session/<session>/state/<state> set_session_states(session, state) Sets the session state - used for starting, stopping etc

Main Classes

PluginService

This is the guts of the plugin service, and will implement (or control) all of the functionality.

It can be run 'inline' for testing / development purposes.

PluginServiceRestApi

This is a wrapper around the PluginService, and provides a simple REST API.

At some point this will become a 'proper' stand alone service.

PluginServiceClient

This provides the same interface as the PluginService, but communicates with a separate plugin service process via the REST API.

Clients should be able to switch between the PluginService and the PluginServiceClient without having to make any changes.

Notes

  • TBA