felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r1777976 - /felix/site/trunk/content/documentation/subprojects/apache-felix-web-console/web-console-restful-api.mdtext
Date Mon, 09 Jan 2017 14:47:53 GMT
Author: davidb
Date: Mon Jan  9 14:47:53 2017
New Revision: 1777976

URL: http://svn.apache.org/viewvc?rev=1777976&view=rev
Log:
Add example CURL commands to show how to interface with configadmin over rest-ful API

Modified:
    felix/site/trunk/content/documentation/subprojects/apache-felix-web-console/web-console-restful-api.mdtext

Modified: felix/site/trunk/content/documentation/subprojects/apache-felix-web-console/web-console-restful-api.mdtext
URL: http://svn.apache.org/viewvc/felix/site/trunk/content/documentation/subprojects/apache-felix-web-console/web-console-restful-api.mdtext?rev=1777976&r1=1777975&r2=1777976&view=diff
==============================================================================
--- felix/site/trunk/content/documentation/subprojects/apache-felix-web-console/web-console-restful-api.mdtext
(original)
+++ felix/site/trunk/content/documentation/subprojects/apache-felix-web-console/web-console-restful-api.mdtext
Mon Jan  9 14:47:53 2017
@@ -298,12 +298,13 @@ TBD
 
 ## Configuration Admin Plugin
 
-TBD
+The Configuration Admin Plugin can be accessed directly by sending POST requests to it.
 
 ### POST Requests
 
-Configuration handling is done based on the PID of the configuration. Each POST can either
contain the PID as a suffix like `../PID`or with the parameter `pid`. The parameter `pidFilter`
might contain an additional filter expression.
+Configuration handling is done based on the PID of the configuration. Each POST can either
contain the PID as a suffix like `../PID` or with the parameter `pid`. The parameter `pidFilter`
might contain an additional filter expression.
 For the action to execute, the following options are tested, one after the other. As soon
as one is executed, the request is processed.
+
 #### Create
 
 If the parameter `create`is sent, a new configuration with the PID is created. The value
of the parameter is not evaluated.
@@ -314,12 +315,26 @@ If the parameter `apply` is sent, the co
 The parameter `factoryPid` might contain the factory pid.
 The parameter `propertyList` contains a comma-separated list of all configuration property
names that will be changed by this POST. For each name, the value of the corresponding request
parameter is used to set the value. If such a parameter is missing, the property is not changed.
 
+For example to use `curl` to apply a configuration the following command line can be used:
+
+    curl -u admin:admin -X POST -d "apply=true" -d "propertylist=foo,bar" -d "foo=51" -d
"bar=hello" http://localhost:8080/system/console/configMgr/com.acme.MyPid
+
+To create a factory configuration, the special PID `[Temporary PID replaced by real PID upon
save]` must be used, URL encoded. So to create a new factory configuration 
+for a factoryPid `com.acme.MyFactoryPid` the following can be used:
+
+    curl -u admin:admin -X POST -d "apply=true" -d "propertylist=name" -d "name=mycfg" -d
"factoryPid=com.acme.MyFactoryPid" http://localhost:8080/system/console/configMgr/%5BTemporary%20PID%20replaced%20by%20real%20PID%20upon%20save%5D
+
 #### Delete
 
 If the parameters `apply` and `delete` are sent, the configuration is removed. The values
of the parameters is not evaluated.
 
+Example using `curl`:
+
+curl -u admin:admin  -X POST -d "apply=true" -d "delete=true" http://localhost:8080/system/console/configMgr/com.acme.MyPid
+
 #### Unbind
 
 If the parameter `unbind` is sent, the configuration is unbind.
 
 
+



Mime
View raw message