R Sessions

These resources manage the stateful R sessions living in the R server. Some operations may be limited depending on the user role.

List

GET /r/sessions[?subject=(string: user_name)]

List the R sessions.

This entry point requires Authentication of a user. Users with administrator or manager role will be able to list other users sessions. Regular users can only list own R sessions.

Example requests

Using cURL

curl --user administrator:password https://rock-demo.obiba.org/r/sessions

Using R (rockr)

library(rockr)
conn <- rockr.connect(username="administrator", password="password", url = "https://rock-demo.obiba.org")
rockr.sessions(conn)

Example response

HTTP/1.1 200 OK
Content-Type: application/json

[
  {
    "id": "810cfda6-d0f5-472e-8796-0ce6905499d8",
    "subject": "user",
    "busy": false,
    "createdDate": "2021-02-24 09:11:08",
    "lastAccessDate": "2021-02-24 09:11:15"
  }
]
Query Parameters
  • subject (string) – To filter sessions by their subject (owner of the session). Ignored when user does not have administrator or manager role.

Response JSON Object
  • id (string) – R session unique ID.

  • subject (string) – User name owning the R session.

  • busy (boolean) – Whether an R operation is being executed.

  • createdDate (date) – Date of creation.

  • lastAccessDate (date) – Last time the R session was accessed, used to garbage collect sessions after some timeout.

Request Headers
Response Headers
Status Codes

Remove

DELETE /r/sessions

Terminate all the R sessions.

This entry point requires Authentication of a user with administrator or manager role.

Example requests

Using cURL

curl --user administrator:password -X DELETE https://rock-demo.obiba.org/r/sessions
Request Headers
Status Codes

Create

POST /r/sessions

Create a R session, which will be associated to the requesting user.

This entry point requires Authentication of a user with administrator or user role.

Example requests

Using cURL

curl --user user:password -X POST https://rock-demo.obiba.org/r/sessions

Using R (rockr)

library(rockr)
conn <- rockr.connect(username="user", password="password", url = "https://rock-demo.obiba.org")
rockr.open(conn)

Example response

HTTP/1.1 201 Created
Content-Type: application/json
Location: http://rock-demo.obiba.org/r/session/810cfda6-d0f5-472e-8796-0ce6905499d8

{
  "id": "810cfda6-d0f5-472e-8796-0ce6905499d8",
  "subject": "user",
  "busy": false,
  "createdDate": "2021-02-24 09:11:08",
  "lastAccessDate": "2021-02-24 09:11:15"
}
Response JSON Object
  • id (string) – R session unique ID.

  • subject (string) – User name owning the R session.

  • busy (boolean) – Whether an R operation is being executed.

  • createdDate (date) – Date of creation.

  • lastAccessDate (date) – Last time the R session was accessed, used to garbage collect sessions after some timeout.

Request Headers
Status Codes