<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://reviewboard.asterisk.org/r/3025/">https://reviewboard.asterisk.org/r/3025/</a>
     </td>
    </tr>
   </table>
   <br />










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On November 21st, 2013, 12:59 a.m. UTC, <b>Paul Belanger</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://reviewboard.asterisk.org/r/3025/diff/1/?file=48553#file48553line11" style="color: black; font-weight: bold; text-decoration: underline;">branches/12/rest-api/api-docs/device_states.json</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">11</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb">   </span><span class="tb">  </span><span class="tb">  </span><span class="nt">"path"</span><span class="p">:</span> <span class="s2">"/device_states/{deviceName}"</span><span class="p">,</span></pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Hmm, not a fan of this URL schema.  At first glance, what about just /states.

Additionally, I know within asterisk it is a device state however from ARI we don't actually have a device, we have endpoints.  So, that in itself is confusing.

I think the snake_case here is the issue, since most everything else has moved to camelCase.   Consistency FTW!</pre>
 </blockquote>





</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I completely disagree with changing this to /states. That's not descriptive enough and is completely generic, which the API itself is not. If I'm a developer looking at that the first question I'd ask would be "states for what? channels?". Having something else with it (even if not device) gives immediate information and makes it much clearer.</pre>
<br />




<p>- Joshua</p>


<br />
<p>On November 20th, 2013, 10:25 p.m. UTC, Kevin Harwell wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Asterisk Developers, David Lee and Matt Jordan.</div>
<div>By Kevin Harwell.</div>


<p style="color: grey;"><i>Updated Nov. 20, 2013, 10:25 p.m.</i></p>







<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="https://issues.asterisk.org/jira/browse/ASTERISK-22838">ASTERISK-22838</a>


</div>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
Asterisk
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Created a data model and implemented functionality for an ARI device state resource.  The following operations have been added that allow a user to manipulate an ARI controlled device:

PUT    /device-states/{deviceName}&{deviceState} - Create/Change the state of an ARI controlled device
GET    /device-states/{deviceName} - Retrieve the current state of a device
DELETE /device-states/{deviceName} - Destroy a device-state controlled by ARI

The ARI controlled device must begin with 'Stasis:'.  An example controlled device name would be Stasis:Example.

A 'DeviceStateChanged' event has also been added so that an application can subscribe and receive device change events.  Any device state, ARI controlled or not, can be subscribed to.

While adding the event, the underlying subscription control mechanism was refactored so that all current and future resource subscriptions would be the same.  Each event resource must now register itself in order to be able to properly handle [un]subscribes.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Some basic testing done using the swagger framework and a websocket connection.  Testing adding, changing, and removing device state with regards to an ARI controlled device were successful.  Also tested [un]subscribing to the events from device with success.  Planning on writing some testsuite test cases as well.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>branches/12/rest-api/resources.json <span style="color: grey">(402915)</span></li>

 <li>branches/12/rest-api/api-docs/events.json <span style="color: grey">(402915)</span></li>

 <li>branches/12/rest-api/api-docs/device_states.json <span style="color: grey">(PRE-CREATION)</span></li>

 <li>branches/12/rest-api/api-docs/applications.json <span style="color: grey">(402915)</span></li>

 <li>branches/12/res/stasis/app.c <span style="color: grey">(402915)</span></li>

 <li>branches/12/res/res_stasis_device_state.exports.in <span style="color: grey">(PRE-CREATION)</span></li>

 <li>branches/12/res/res_stasis_device_state.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>branches/12/res/res_stasis.c <span style="color: grey">(402915)</span></li>

 <li>branches/12/res/res_ari_device_states.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>branches/12/res/ari/resource_device_states.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>branches/12/res/ari/resource_device_states.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>branches/12/res/ari/resource_applications.h <span style="color: grey">(402915)</span></li>

 <li>branches/12/res/ari/ari_model_validators.c <span style="color: grey">(402915)</span></li>

 <li>branches/12/res/ari/ari_model_validators.h <span style="color: grey">(402915)</span></li>

 <li>branches/12/res/ari.make <span style="color: grey">(402915)</span></li>

 <li>branches/12/main/devicestate.c <span style="color: grey">(402915)</span></li>

 <li>branches/12/include/asterisk/stasis_app_device_state.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>branches/12/include/asterisk/stasis_app.h <span style="color: grey">(402915)</span></li>

 <li>branches/12/include/asterisk/devicestate.h <span style="color: grey">(402915)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/3025/diff/" style="margin-left: 3em;">View Diff</a></p>







  </td>
 </tr>
</table>








  </div>
 </body>
</html>