Changes between Version 9 and Version 10 of NewTestbedAPISpec


Ignore:
Timestamp:
Jul 26, 2013 10:57:22 AM (11 years ago)
Author:
faber
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • NewTestbedAPISpec

    v9 v10  
    229229A notification is a short message from another user or the testbed asking a user to take an action (add someone to a project, update a password before expiration) or communicating other information to the user (testbed downtime, etc).  A web interface will want to present these to a user.
    230230
     231Each notification has a set of flags that define its state.  Currently there are 2
     232
     233 * '''READ''' bit 0 (low order bit) true if the user has read the notification
     234 * '''URGENT''' bit 1 true if the testbed considers this urgent information
     235
     236The user is free to change this state using the markNotifications call.  Note that notifications are per-user.  A user who clears the READ or URGENT bit does not clear the bit for other recipients of the notification.
     237
    231238 
    232239 * '''Service:''' Users
     
    236243   * FirstDate - an optional date.  If present only show notifications after that date
    237244   * LastDate - an optional date.  If present only show notifications before that date
    238    * OnlyUnread - a flag. If true, show only unread notifications
     245   * Flags - a 32-bit integer of flags. Only notifications that match the flags state after the mask is applied are returned
     246   * Mask - A 32-bit mask of the bits to consider in the flags field.
    239247 * '''Return Values:'''
    240248   * A list of responses each containing
    241249     * ID - a 64-bit integer identifying the notification
    242      * IsRead - a flag indicating that the message has been read by this user
     250     * Flags - the message state
    243251     * Sent - the date the notification was issued
    244252     * Text - the text of the notification
    245253
    246 The filtering variables are all applied if given.  If OnlyUnread is true and FirstDate and LastDate are both given, only unread notifications between those dates are returned.
    247 
    248  * '''Service:''' Users
    249  * '''Operation:''' markNotificationsRead
     254The filtering variables are all applied if given.
     255
     256The mask and flags variable define the state a user is searching for.  If a bit is set in both mask and flags, only messages with that bit set are returned.  Similarly if a bit is clear in flags and set in mask, only messages with that bit clear will be returned.
     257
     258To be concrete: a user who wants to retrieve all unread messages (urgent or not) should send a flags field with the READ bit clear and a mask with the READ bit set.  To retrieve only unread urgent messages, the flags should have READ clear and URGENT set, and both READ and URGENT set in the mask.
     259
     260
     261 * '''Service:''' Users
     262 * '''Operation:''' markNotifications
    250263 * '''Input Parameters:'''
    251264   * Userid - the user's identity to gather notifications
    252    * Notifications - an array of 64-bit integers, the notifications to mark read
     265   * Ids - an array of 64-bit integers, the identifiers of the notifications to mark
     266   * Flags - a 32-bit integer of flags to change. Notifications will have their flags field set to the value in this field if the corresponding mask bit is set.
     267   * Mask - A 32-bit mask of the bits to consider in the flags field.
     268 * '''Return Values:'''
     269   * None
     270
     271Administrators can send notifications, for example to announce testbed events.  The call to do so is:
     272
     273 * '''Service:''' Users
     274 * '''Operation:''' sendNotifications
     275 * '''Input Parameters:'''
     276   * Users - a list of uids to receive the notification
     277   * Projects - a list of projects to receive the notification.  All users in the project will receive it
     278   * Flags - the initial notification state for each user
     279   * Text - the content of the notification
    253280 * '''Return Values:'''
    254281   * None