Get a list of actions that can be invoked on the subscription group
Returns the form that can be used to update the subscription group.
URL
/subscription/{group-id}
Method
GET
URL Params
action=show Required
Returns action Forms for this resource
See Common URL parameters
Data Params
None
Success Response
HTTP_OK(200), see HTTP Status codes
Example Response
<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head> <title>Subscription Listing</title> <base href="http://localhost/subscription/"/>
</head> <body> <div class="state">
<form method="delete" action="4" id="unsubscribe-group">
</form>
<form method="delete" action="4/rw/system/energy" id="unsubscribe-resource">
</form>
<form method="put" action="4" id="update-resource-priority">
<fieldset class="sub-resource">
<input type="checkbox" name="resources" value="1"/>
<input class="res" type="text" name="1" maxlength="500" value="/rw/system/energy" disabled="disabled"/>
<select class="priority" name="1-p">
<option value="0">
</option>
<option value="1" selected="selected">
</option>
</select>
</fieldset>
</form>
<form method="put" action="4" id="update-group">
<fieldset class="sub-resource">
<input type="checkbox" name="resources" value="2"/>
<input class="res" type="text" name="2" maxlength="500" value=""/>
<select class="priority" name="2-p">
<option value="0" selected="selected">
</option>
<option value="1">
</option>
</select>
</fieldset>
</form>
</div>
</body>
</html>
Actions
- unsubscribe-group
- unsubscribe-resource
- update-group
- resources=[numeric] Required, the subscription resource identifier
- *<identifier>=[alphanumeric] Required , the resource URI
- *<identifier>-p=[numeric] Required , the new priority associated with the susbcription resource
- update-resource-priority
- resources=[numeric] Required, the subscription resource identifier
- *<identifier>=[alphanumeric] Required , the resource URI
- *<identifier>-p=[numeric] Required , the new priority associated with the susbcription resource
Error Response
BAD_REQUEST(400) See Robot controller return codes
Sample Call
curl --digest -u "Default User":robotics "http://localhost/subscription/1?action=show"
Notes
The form body is in standard form data format and consists of three name-value pairs per resource.
- 1st pair - resources=<identifier> e.g. resources=1
- 2nd pair - <identifier>=<subscription-resource> e.g. 1=/rw/iosystem/signals/Virtual1/Board1/do1;state
- 3rd pair - <identifier>-p=<0|1|2> 1-p=1
In the above, <identifier> can be any value but it is recommended to use integer values such as 1, 2,3 etc.
An example payload to subscribe on a single resource "/rw/iosystem/signals/Virtual1/Board1/do1;state" and associate priority "2" (High priority subscription) to the resource is shown below:
resources=1&1=/rw/iosystem/signals/Virtual1/Board1/do1;state&1-p=2
Similarly, the payload for subscribing on two resources (first resource on Medium priority and second resource on Low priority subscription)
"/rw/iosystem/signals/Virtual1/Board1/do1;state" and "/rw/iosystem/signals/Virtual1/Board1/do2;state"
resources=1&1=/rw/iosystem/signals/Virtual1/Board1/do1;state&1-p=1& resources=2&2=/rw/iosystem/signals/Virtual1/Board1/do2;state&2-p=0
maximum 1000 resources can be subscribed per group
Not supported in bootserver mode