Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Lyo/AutomationRIO

< Lyo

Building and Running the OSLC4J Automation Reference Implementation in Eclipse

Prerequisites

  • Eclipse 3.6 or higher IDE
  • EGit team provider for git (recommended) or git command line package.
  • m2eclipse for Maven support in the Eclipse IDE
  • OSLC4J. You can either
    • Build OSLC4J from source (recommended)
    • or, download the jars and dependencies and add them to the OSLC4JAutomation WebApp Libraries (disable the Maven nature of the projects).
  • OSLC4J requires a Java 1.6 compiler and Java 1.6 runtime. The Eclipse project settings have been set appropriately. If you are building outside of Eclipse, please use Java 1.6.

Get the Automation sample source and import

  • Use Git or EGit to clone the Lyo RIO repository from http://git.eclipse.org/gitroot/lyo/org.eclipse.lyo.rio.git
  • From the Git Repositories view, right click the RIO repository and select Import Projects and import the following projects
    • OSLC4JAutomation
    • OSLC4JAutomationCommon
    • OSLC4JAutomationTest

Build the 3 Automation projects

  • In each project, find the 'pom.xml file, right click and select Maven->install

Launch the Automation Provider

  • Go to Run -> Run Configurations
  • Expand Maven Build and select Launch OSLC4JAutomation
  • Select Run

After a few seconds, you should see the following message in the Console: INFO: Service provider registration complete.

Test that the tools is running by pointing a REST browser tool such as RESTClient at the following URL (be sure to set the Accept header value to application/rdf+xml, application/xml or applicaton/json):

http://localhost:8080/OSLC4JAutomation/autoPlans

Functionality

There are no UIs for the provider yet, those are being developed. Currently the provider supports the following functionality:

  • A sample AutomationPlan and AutomationRequest are created when the provider starts. The Automation Plan is for execution of a system command.
    • Creating a new AutomationRequest for the AutomationPlan with an inputParameter called command, the specified command will be executed and the output returned in an AutomationResult
    • Example of an AutomationRequest you can post to run a command (adjust URLs accordingly):
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:oslc="http://open-services.net/ns/core#"
    xmlns:oslc_data="http://open-services.net/ns/servicemanagement/1.0/"
    xmlns:foaf="http://xmlns.com/foaf/0.1/"
    xmlns:dcterms="http://purl.org/dc/terms/"
    xmlns:oslc_auto="http://open-services.net/ns/auto#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
  <oslc_auto:AutomationRequest>
    <oslc_auto:inputParameter>
      <oslc_auto:ParameterInstance>
        <rdf:value>ps -ef</rdf:value>
        <oslc:name>command</oslc:name>
      </oslc_auto:ParameterInstance>
    </oslc_auto:inputParameter>
    <oslc_auto:executesAutomationPlan rdf:resource="http://example.eclipse.com:8080/OSLC4JAutomation/autoPlans/1"/>
    <dcterms:title rdf:datatype="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral">Sample Remote Command Automation Request</dcterms:title>
  </oslc_auto:AutomationRequest>
</rdf:RDF>
  • If you create a generic AutomationRequest (i.e. not for the special AutomationPlan, the provider will create a corresponding AutomationResult and put it in NEW state
  • If you set the desiredState in an AutomationRequest or AutomationResult and PUT it to the provider, the state will change

TO DO list

  • Delegated creation and selection UI
  • HTML and OSLC Compact representations of resources
  • Support OSLC Query

Back to the top