4.9. S-RAMP Command Line
4.9.1. Start the S-RAMP Shell
- Navigate to the
../bindirectory. - Run this command: ./s-ramp.sh
Result
The following appears on the screen:
**********************************************************************
_____ ______ ___ ___ ________
/ ___| | ___ \/ _ \| \/ | ___ \
\ `--. ______| |_/ / /_\ \ . . | |_/ /
`--. \______| /| _ | |\/| | __/
/\__/ / | |\ \| | | | | | | |
\____/ \_| \_\_| |_|_| |_|_|
JBoss S-RAMP Kurt Stam and Eric Wittmann, Licensed under the
Apache License, V2.0, Copyright 2012
**********************************************************************
s-ramp>
4.9.2. Connect to the S-RAMP Server
- Open a command terminal and navigate to
EAP_HOME/bindirectory. - Start the JBoss EAP server by entering following command:$ ./standalone.sh
- Open another terminal and type
connectand press Tab key. The command will auto-complete to says-ramp:connect http://localhost:8080/s-ramp-server.Enter username and password to connect via the S-RAMP shell. The username and password are defined in sramp.properties.
Result
When you press Tab key, the command will auto-complete to say s-ramp:connect http://localhost:8080/s-ramp-server and when you press the return key the cursor will go from red to green indicating successful connection to S-ramp server.
4.9.3. Browse the S-RAMP Repository
- Run this command: s-ramp:query /s-rampHere is an example of the output of this command:
Querying the S-RAMP repository: /s-ramp Atom Feed (9 entries) Idx Type Name --- ---- ---- 1 ImageDocument user-properties.png 2 Document overlord.demo.CheckDeployment-taskform.flt 3 BrmsPkgDocument SRAMPPackage.pkg 4 ImageDocument overlord.demo.SimpleReleaseProcess-image.png 5 ImageDocument run-build-install.png 6 Document overlord.demo.SimpleReleaseProcess-taskform.flt 7 ImageDocument audio-input-microphone-3.png 8 BpmnDocument overlord.demo.SimpleReleaseProcess.bpmn 9 TextDocument HttpClientWorkDefinitions.wid - To obtain the metaData of overlord.demo.SimpleReleaseProcess.bpmn (which is number 8 in the list in the output example), issue this command: s-ramp:getMetaData feed:8
Meta Data for: 31b3acbc-cda8-4856-9e34-d3e645283035 -------------- -- Core S-RAMP Info -- Type: BpmnDocument Model: ext UUID: 31b3acbc-cda8-4856-9e34-d3e645283035 Name: overlord.demo.SimpleReleaseProcess.bpmn Derived: false Created By: anonymous Created On: 2013-03-08T14:00:37.036-05:00 Modified By: anonymous Modified On: 2013-03-18T14:58:46.328-04:00 s-ramp>
4.9.4. Update Artifact Metadata
- To update a property on the artifact, enter s-ramp:property set and hit the tab key.This lists the properties that you can update.
description name version
- Add a description: s-ramp:property set description "BPMN2 artifact representing the SimpleReleaseProcess".
Successfully set property description. s-ramp> s-ramp:updateMetaData Successfully updated artifact overlord.demo.SimpleReleaseProcess.bpmn.
- Verify the change, by entering s-ramp:getMetaData feed:8.The change will appear at the bottom of the output:
Meta Data for: 31b3acbc-cda8-4856-9e34-d3e645283035 -------------- -- Core S-RAMP Info -- Type: BpmnDocument Model: ext UUID: 31b3acbc-cda8-4856-9e34-d3e645283035 Name: overlord.demo.SimpleReleaseProcess.bpmn Derived: false Created By: anonymous Created On: 2013-03-08T14:00:37.036-05:00 Modified By: anonymous Modified On: 2013-03-18T16:09:56.879-04:00 -- Description -- BPMN2 artifact representing the SimpleReleaseProcess
4.9.5. Add Custom Properties
- To add a custom property, run the s-ramp> s-ramp:property set month December command, where month is the name of the property and December is the value.
Successfully set property month.
- To update artifact, run the s-ramp> s-ramp:updateMetaData command.
Successfully updated artifact overlord.demo.SimpleReleaseProcess.bpmn.
- Verify the change, by entering s-ramp:getMetaData feed:8.The change will appear at the bottom of the output:
Meta Data for: 31b3acbc-cda8-4856-9e34-d3e645283035 -------------- -- Core S-RAMP Info -- Type: BpmnDocument Model: ext UUID: 31b3acbc-cda8-4856-9e34-d3e645283035 Name: overlord.demo.SimpleReleaseProcess.bpmn Derived: false Created By: anonymous Created On: 2013-03-08T14:00:37.036-05:00 Modified By: anonymous Modified On: 2013-03-18T16:21:16.119-04:00 -- Description -- BPMN2 artifact representing the SimpleReleaseProcess -- Custom Properties -- month: December
- Now when you enter s-ramp:property set and hit the tab key, you can see your newly added custom property:
description month name version
4.9.6. Add Classifications
- To add a classification of deployment-status to your artifact, use the s-ramp> s-ramp:classification add "http://www.jboss.org/overlord/deployment-status.owl#Dev" command.
Successfully added classification 'http://www.jboss.org/overlord/deployment-status.owl#Dev'.
- To update artifact, run the s-ramp> s-ramp:updateMetaData command.
Successfully updated artifact overlord.demo.SimpleReleaseProcess.bpmn.
- Verify the change, by entering s-ramp:getMetaData feed:8.The change will appear at the bottom of the output:
Meta Data for: 31b3acbc-cda8-4856-9e34-d3e645283035 -------------- -- Core S-RAMP Info -- Type: BpmnDocument Model: ext UUID: 31b3acbc-cda8-4856-9e34-d3e645283035 Name: overlord.demo.SimpleReleaseProcess.bpmn Derived: false Created By: anonymous Created On: 2013-03-08T14:00:37.036-05:00 Modified By: anonymous Modified On: 2013-03-18T16:30:42.641-04:00 -- Description -- BPMN2 artifact representing the SimpleReleaseProcess -- Classifications -- Classified By: http://www.jboss.org/overlord/deployment-status.owl#Dev -- Custom Properties -- month: December
4.9.7. Query the S-RAMP Repository using XPath2 Syntax
- S-RAMP supports an XPath2 Syntax for querying. For example, to obtain all WSDL models in the repository, use the s-ramp:query /s-ramp/wsdl/WsdlDocument command.
Querying the S-RAMP repository: /s-ramp/wsdl/WsdlDocumenta Atom Feed (1 entries) Idx Type Name --- ---- ---- 1 WsdlDocument OrderService.wsdlWhen this WSDL file is uploaded, the derived information is extracted from it and stored a WSDL model. - To see the various data structures the WSDL file derives, enter s-ramp:query /s-ramp/wsdl command and press the tab key.
Binding BindingOperation BindingOperationFault BindingOperationInput BindingOperationOutput Fault Message Operation OperationInput OperationOutput Part Port PortType WsdlDocument WsdlExtension WsdlService
The derived data is read-only. - To obtain all Operations in this WSDL, use the s-ramp:query /s-ramp/wsdl/Operation command.
Querying the S-RAMP repository: /s-ramp/wsdl/Operation Atom Feed (1 entries) Idx Type Name --- ---- ---- 1 Operation submitOrderTo narrow down this query, add a condition that the name needs to start with submit: s-ramp:query "/s-ramp/wsdl/Operation[xp2:matches(@name, 'submit.*')]"Querying the S-RAMP repository: /s-ramp/wsdl/Operation[xp2:matches(@name, 'submit.*')] Atom Feed (1 entries) Idx Type Name --- ---- ---- 1 Operation submitOrderEnsure that you use the surrounding quotes, and a.(dot) aftersubmitas required by XPath2. - To obtain all the artifacts that were derived from an artifact, use the following command:
/s-ramp[relatedDocument[@uuid = '<uuid>'
In this case, you can use the uuid of a wsdl and get all the artifacts derived from the wsdl:s-ramp:query "/s-ramp[relatedDocument[@uuid = '15a94308-a088-4a03-ad83-e60239af74e4']]" Querying the S-RAMP repository: /s-ramp[relatedDocument[@uuid = '15a94308-a088-4a03-ad83-e60239af74e4']] Atom Feed (16 entries) Idx Type Name --- ---- ---- 1 OperationInput submitOrder 2 WsdlService OrderService 3 SoapAddress soap:address 4 BindingOperationInput wsdl:input 5 SoapBinding soap:binding 6 Part parameters 7 Binding OrderServiceBinding 8 BindingOperationOutput wsdl:output 9 Message submitOrderResponse 10 OperationOutput submitOrderResponse 11 BindingOperation submitOrder 12 Message submitOrder 13 Operation submitOrder 14 Port OrderServicePort 15 Part parameters 16 PortType OrderService - To get a list of all artifacts that were extracted from another archive, use the following command:
s-ramp:query "/s-ramp[expandedFromDocument[@uuid = '<uuid>']"
For example, if you uploaded a jar file containing switchyard artifacts, with uddi 67c6f2d3-0f10-4f0d-ada6-d85f92f02a33:s-ramp:query "/s-ramp[expandedFromDocument[@uuid = '67c6f2d3-0f10-4f0d-ada6-d85f92f02a33']]" Querying the S-RAMP repository: /s-ramp[expandedFromDocument[@uuid = '67c6f2d3-0f10-4f0d-ada6-d85f92f02a33']] Atom Feed (3 entries) Idx Type Name --- ---- ---- 1 XmlDocument switchyard.xml 2 XmlDocument beans.xml 3 XmlDocument faces-config.xml
4.9.8. Extending the S-RAMP CLI
META-INF/services/org.overlord.sramp.shell.api.ShellCommandProvider.
~/.s-ramp/commands directory.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.