ELisA REST protocol details v3.0

NEW in v3.0! All the HTTP requests below can be preceded by the logbook name parameter, in which case the request will be addressed to that specific logbook. If no logbook name is given in the request, ATLAS logbook will be used.

Get single message

HTTP Request:

GET

URL:

/messages/200006


/Logbook_Name/messages/200006 - if Logbook_Name is not specified, ATLAS is used by default.

Header:

Accept:  application/xml | application/json

On success:

HTTP Response:

HTTP 1.1 200 OK

Header:

Content-Type: application/xml

Body:

<message>


  <author>John Do</author>

  <username>jhon</username>

  <subject>Hello world </subject>

  <date>2012-01-03T00:00:00+01:00</date>

  <body>TEXT 6</body>

  <message_type>Shift Summary</message_type>


  <systems_affected>

    <count> 2 </count>

    <system_affected>DAQ</system_affected>

    <system_affected>HLT</system_affected>

  </systems_affected>


  <id>200006</id>

  <logbook>Logbook_ID</logbook>

  <encoding>3</encoding>

  <has_attachments>0</has_attachments>

  <has_replies>1</has_replies>

  <reply_to>200006</reply_to>

  <thread_head>200002</thread_head>

  <valid>valid</valid>

  <status>open</status>


  <attachments>

    <count>1</count>

    <attachment>

      <filename>foto.jpg</filename>

      <ID>0</ID>

      <link>http://example.com/elisa.api/api/messages/200006/attachment/0</link>

    </attachment>

  </attachments>


  <options>

    <count>1</count>

    <option>

      <name> Option1 </name>

      <value> value </value>

      <options>

        <count>1</count>

        <option>

          <name> inner_option1 </name>

          <value> value </value>

        <option>

      <options>

    </option>


  </options>

</message>

Get list of messages

HTTP Request:

GET

URL:

/messages

Header:

Accept:  application/xml | application/json

On success:

HTTP Response:

HTTP 1.1 200 OK

Header:

Content-Type: application/xml

Body:

 <messages>

 <count>100</count>

   <message>


     <author>John Do</author>

     <username>jhon</username>

     <subject>Hello world </subject>

     <date>2012-01-03T00:00:00+01:00</date>

     <body>TEXT 6</body>

     <message_type>Shift Summary</message_type>


     <systems_affected>

       <count> 2 </count>

       <system_affected>DAQ</system_affected>

       <system_affected>HLT</system_affected>

     </systems_affected>


     <id>200006</id>

     <logbook>70</logbook>

     <encoding>3</encoding>

     <has_attachments>0</has_attachments>

     <has_replies>1</has_replies>

     <reply_to>200006</reply_to>

     <thread_head>200002</thread_head>

     <valid>valid</valid>

     <status>open</status>

   </message>

   <message> ... </message>

   <message> ... </message>

   ...

</messages>

Search parameters are supported as HTTP query parameters to filter messages as specified in the server documentation section.

WARNING

When retrieving a list of messages no metadata about additional options (the <options> element) and attachments (the <attchments> element) are returned as message attributes. Ask for message by ID to retrieve a complete message representation.

Create a new message

HTTP Request:

POST

URL:

/messages/

Header:

Content-type: application/xml | application/json

Body:

<input_message>

  <subject>Test message</subject>

  <body> message insertion with first and second level options</body>

  <message_type>Trigger</message_type>

  <systems_affected>

    <count> 2 </count>

    <system_affected>DAQ</system_affected>

    <system_affected>HLT</system_affected>

  </systems_affected>

  <options>

    <option>

      <name>Trigger_Area</name>

      <value>Trigger Group</value>

      <options>

        <option>

          <name>Trigger_Group</name>

          <value>Calo</value>

        </option>

      </options>

    </option>

  </options>

</input_message>

On success:

HTTP Response:

HTTP 1.1 201 CREATED

Header:

Content-Type: application/xml Location: http://example.com/elisa.api/api/messages/200006

Body:

<message>

...

<message>

Create message with one or more attachment

HTTP Request:

POST

URL:

/messages

Header:

Content-type: multipart/mixed;  boundary=ARCFormBoundaryvgrvnph55ewmi

Body:

--ARCFormBoundaryvgrvnph55ewmi

   Content-Disposition: form-data; name="message";

   Content-Type: application/xml;


   <input_message>

     <subject>Test message</subject>

     <body> message insertion with attachment</body>

     <message_type>Trigger</message_type>

     <system_affected>DAQ</system_affected>

   </input_message>

--ARCFormBoundaryvgrvnph55ewmi


    Content-Disposition: form-data; name="filename"

    Content-Type: application/jpeg (or the mime type of the file)``

    image bytes...

--ARCFormBoundaryvgrvnph55ewmi--

On success:

HTTP Response:

HTTP 1.1 201 CREATED

Header:

Content-Type: application/xml Location: http://example.com/elisa.api/api/messages/200006/attachments/0

Body:

<message>

...

<message>

Reply to a message

HTTP Request:

POST

URL:

/messages/200006

Header:

Content-type: application/xml | application/json

Body:

<input_message>

  <subject>Reply to message 200006</subject>

  <body> message insertion with first and second level options</body>

  <message_type>Trigger</message_type>

  <system_affected>DAQ </system_affected> <!--if not specified the same as the original message -->

  <options>

    <option> <!-- if not specified the same as the replied message -->

      <name>Trigger_Area</name>

      <value>Trigger Group</value>

      <options>

        <option>

          <name>Trigger_Group</name>

          <value>Calo</value>

        </option>

      </options>

    </option>

  </options>

</input_message>

On success:

HTTP Response:

HTTP 1.1 201 CREATED

Header:

Content-Type: application/xml Location: http://example.com/elisa.api/api/messages/200006

Body:

<message>

...

<message>

Reply to a message with attachment

HTTP Request:

POST

URL:

/messages/200006

Header:

Content-type: multipart/mixed;  boundary=ARCFormBoundaryvgrvnph55ewmi

Body:

--ARCFormBoundaryvgrvnph55ewmi

   Content-Disposition: form-data; name="message";

   Content-Type: application/xml;


   <input_message>

     <subject>Test message</subject>

     <body> message insertion with attachment</body>

     <message_type>Trigger</message_type>

     <system_affected>DAQ</system_affected>

   </input_message>

--ARCFormBoundaryvgrvnph55ewmi


    Content-Disposition: form-data; name="filename"

    Content-Type: application/jpeg (or the mime type of the file)``

    image bytes...

--ARCFormBoundaryvgrvnph55ewmi--

On success:

HTTP Response:

HTTP 1.1 201 CREATED

Header:

Content-Type: application/xml Location: http://example.com/elisa.api/api/messages/200006/attachments/0

Body:

<message>

...

<message>

Get attachment list

HTTP Request:

GET

URL:

/messages/200006/attachments

Header:

Accept:  application/xml | application/json

On success:

HTTP Response:

HTTP 1.1 200 OK

Header:

Content-Type: application/xml

Body:

<attachments>

  <count>1</count>

  <attachment>

    <filename>foto.jpg</filename>

    <ID>0</ID>

    <link>http://example.com/elisa.api/api/messages/200006/attachment/0</link>

  </attachment>

</attachments>

Get attachment

HTTP Request:

GET

URL:

/messages/200006/attachments/0

Header:

Accept:  application/xml | application/json

On success:

HTTP Response:

HTTP/1.1 302 Found

Header:

Content-Type: image/jpeg Content-Length: 10685

Body:

image bytes...

On failure:

HTTP Response:

HTTP/1.1 404 Not Found

Header:

Content-Type: application/xml Content-Length: 376

Body:

<error_report>

  <error>

    <entry key="status">NOT_FOUND</entry>

    <entry key="code">404</entry>

    <entry key="message">Attachment not found for message: 200006.</entry>

    <entry key="developerMessage">Attachment not found for message: 200006.</entry>

    <entry key="moreInfoUrl">mailto:luca.magnoni@cern.ch</entry>

  </error>

</error_report>

Create attachment

HTTP Request:

POST

URL:

/messages/200006/attachments

Header:

Content-type: multipart/form-data ``Accept:  application/xml | application/json

Body:

Content-Disposition: form-data; name="file" ``Content-Type: application/jpeg (or the mime type of the file) image bytes...

On success:

HTTP Response:

HTTP 1.1 201 CREATED

Header:

Content-Type: application/xml Location: http://example.com/elisa.api/api/messages/200006/attachments/0

Get message body

HTTP Request:

GET

URL:

/messages/200006/body

Header:

Accept:  application/xml | application/json

On success:

HTTP Response:

HTTP 1.1 200 OK

Header:

Content-Type: application/xml

Body:

<message_body>

  <body>TEXT 6</body>

 </message_body>

Update message body (actually append to existing body)

HTTP Request:

PUT

URL:

/messages/200006/body

Header:

Content-type:  application/xml | application/json Accept:  application/xml | application/json

Body:

<message_body>

 <body> SOME MORE TEXT </body>

</message_body>

On success:

HTTP Response:

HTTP 1.1 201 CREATED

Header:

Content-Type: application/xml

Body:

<message>

...

<message>

Update message body with attachment (actually append to existing body)

HTTP Request:

POST

URL:

/messages

Header:

Content-type: multipart/mixed;  boundary=ARCFormBoundaryvgrvnph55ewmi

Body:

--ARCFormBoundaryvgrvnph55ewmi

   Content-Disposition: form-data; name="body";

   Content-Type: application/xml;


 <message_body>

   <body>TEXT 6

     [DATE] Edited by (user)

     SOME MORE TEXT

   </body>

  </message_body>

--ARCFormBoundaryvgrvnph55ewmi


    Content-Disposition: form-data; name="filename"

    Content-Type: application/jpeg (or the mime type of the file)``

    image bytes...

--ARCFormBoundaryvgrvnph55ewmi--

On success:

HTTP Response:

HTTP 1.1 201 CREATED

Header:

Content-Type: application/xml Location: http://example.com/elisa.api/api/messages/200006/attachments/0

Body:

<message>

...

<message>

Get the list of possible system affected

HTTP Request:

GET

URL:

/sa

Header:

Accept:  application/xml | application/json

On success:

HTTP Response:

HTTP/1.1 200 OK

Header:

Content-Type: application/xml

Body:

<systems_affected>

  <count>36</count>

  <system_affected>ALFA (RPO)</system_affected>

  <system_affected>BCM</system_affected>

  <system_affected>Beam Conditions</system_affected>

  ...

<systems_affected>

Get the list of possible message types

HTTP Request:

GET

URL:

/mt

Header:

Accept:  application/xml | application/json

On success:

HTTP Response:

HTTP/1.1 200 OK

Header:

Content-Type: application/xml

Body:

<message_types>

  <count>20</count>

  <message_type>Default Message Type</message_type>

  <message_type>Shift Summary</message_type>

  <message_type>Shift Leader</message_type>

  ...

<message_types>

Get the system affected preset for a message type

HTTP Request:

GET

URL:

/mt/Online/sa

Header:

Accept:  application/xml | application/json

On success:

HTTP Response:

HTTP/1.1 200 OK

Header:

Content-Type: application/xml

Body:

<systems_affected>

  <count>3</count>

  <system_affected>ALFA (RPO)</system_affected>

  <system_affected>BCM</system_affected>

  <system_affected>Beam Conditions</system_affected>

<systems_affected>

On failure (i.e. no preset for the specified message type):

HTTP Response:

HTTP/1.1 404 Not Found

Header:

Content-Type: application/xml

Body:

<error_report>

  <error>

    <entry key="status">NOT_FOUND</entry>

    <entry key="code">404</entry>

    <entry key="message"> No system affected preset found for the message type: Online </entry>

    <entry key="developerMessage"> No system affected preset found for the message type: Online </entry>

    <entry key="moreInfoUrl">mailto:luca.magnoni@cern.ch</entry>

  </error>

</error_report>

Get optional attributes for a message type

(Returning comprehensive list of both level 1 and inner level 2 options)

HTTP Request:

GET

URL:

/mt/Trigger/opt

Header:

Accept:  application/xml | application/json

On success:

HTTP Response:

HTTP/1.1 200 OK

Header:

Content-Type: application/xml

Body:

<options_metadata>

  <count>1</count>

  <option_metada>

    <name>Trigger_Area</name>

    <type>SINGLEVALUE</type>

    <possible_values>Online,Offline,Trigger Group</possible_values>

    <comment>Choose one among the possible values</comment>

    <options_metadata>

      <count>1</count>

      <option_metadata>

        <name>Trigger_Group</name>

        <type>MULTIPLEVALUE</type>

        <possible_values> Calo,ID,Egamma,Muon,B-Jet,Jet,Tau,MissingET,MinBiass,Bphys </possible_values>

        <comment> Choose one or more among the possible values , in a comma separated string</comment>

      </option_metadata>

    </options_metadata>

  </option_metadata>

</options_metadata>

Get attribute details

HTTP Request:

GET

URL:

/mt/Trigger/opt/Trigger_Area

Header:

Accept:  application/xml | application/json

On success:

HTTP Response:

HTTP/1.1 200 OK

Header:

Content-Type: application/xml

Body:

<option>

  <name>Trigger_Area</name>

  <type>SINGLEVALUE</type>

  <possible_values>Online,Offline,Trigger Group</possible_values>

  <comment>Choose one among the possible values</comment>

  <options>

  <count>1</count>

    <option>

      <name>Trigger_Group</name>

      <type>MULTIPLEVALUE</type>

      <possible_values>Calo,ID,Egamma,Muon,B-Jet,Jet,Tau,MissingET,MinBiass,Bphys</possible_values>

      <comment>Choose one or more among the possible values , in a comma separated string</comment>

    </option>

  </options>

</option>

Get inner attribute details

HTTP Request:

GET

URL:

/mt/Trigger/opt/Trigger_Area/Trigger%20Group

Header:

Accept:  application/xml | application/json

On success:

HTTP Response:

HTTP/1.1 200 OK

Header:

Content-Type: application/xml

Body:

<option>

  <name>Trigger_Group</name>

  <type>MULTIPLEVALUE</type>

  <possible_values> Calo,ID,Egamma,Muon,B-Jet,Jet,Tau,MissingET,MinBiass,Bphys</possible_values>

  <comment> Choose one or more among the possible values , in a comma separated string</comment>

</option>


Table Of Contents


© Copyright 2012, Magnoni Luca. Created using Sphinx 1.1.3.