A subscription API for Blazar events

Registered by Lakmal Silva

Summary
========

Provide APIs for external clients to subscribe specific Blazar
events like lease start and end.

Problem description
================

Blazar uses oslo_messaging.Notifier class[2] for notification.
Users can be notified Blazar events by subscribing the
message queue. However, there should be more easy to
subscribe mechanism.

Use Cases
---------------
- Subscribe/Notify resource reservation event. (OPNFV
  Promise requirements[3]).

Proposed change
==============

TBD

Alternatives
-----------------
TBD

Data model impact
--------------------------
TBD

REST API impact
------------------------
TBD

Security impact
----------------------
TBD

Notifications impact
----------------------------
TBD

Other end user impact
--------------------------------
TBD

Performance impact
-----------------------------
None.

Other deployer impact
--------------------------------
TBD

Developer impact
---------------------------
TBD

Dependencies
===========

TBD

Testing
======
TBD

Documentation impact
==================
TBD

References
=========

[1] https://github.com/openstack/nova-specs/blob/master/specs/pike-template.rst
[2] http://docs.openstack.org/developer/oslo.messaging/notifier.html
[3] http://artifacts.opnfv.org/promise/docs/requirements/index.html#general-features

Note: this form is based on the nova-specs template[1].

Blueprint information

Status:
Complete
Approver:
None
Priority:
Low
Drafter:
Lakmal Silva
Direction:
Needs approval
Assignee:
None
Definition:
Obsolete
Series goal:
None
Implementation:
Not started
Milestone target:
None
Completed by
Pierre Riteau

Related branches

Sprints

Whiteboard

History:

There was notification mechanism just implemented in Blazar - don't you think it's enough? If no, what use cases are you targeting for us to understand what should we work on?

====

[lakmal]

This BP is more about giving the clients the option to subscribe to notifications. For instance by expanding the climate API to include subscription information such as client end points, the notifications are sent to the client's end point.

In the following example, there are 2 client end points registered for resource lease_foo, so when a notification is emitted for lease_foo, that notification will be sent to end points identified by 10.0.01 and 192.168.10.1.

{
   "name":"lease_foo",
   "start_date":"1234",
   "end_date":"2345",
   "subscriptions":[
      {
         "notify_endpoint":{
            "ip_address":"10.0.0.1",
            "port":8217
         }
      },
      {
         "notify_endpoint":{
            "ip_address":"192.168.10.1",
            "port":8000
         }
      }
   ],
   "reservations":[
      {
         "resource_id":"1234-1234-1234",
         "resource_type":"virtual:instance"
      }
   ],
   "events":[

   ]
}

I have been checking the following BPs and the climate API but coudn't figure it out if this capability exists in climate today.

https://blueprints.launchpad.net/climate/+spec/before-end-notification-crud
https://blueprints.launchpad.net/climate/+spec/notifications

==

[db] Ive added Cristian Sanchez to this BP who was working on these features, may you please contact with him and discuss it?

==
[casanch1] The implementation of this BP https://blueprints.launchpad.net/climate/+spec/notifications enables notifications in Climate but differently. With the current implementation Climate sends notifications using oslo.messaging to a configured message queue.

Messages are sent at CRUD operation for all leases. And when a lease starts, is about to end and when it ends. So, if you want to accomplish your needs, you'll need to subscribe to the message queue and consume the messages from there. The only downside is that clients will receive notifications for all leases or if the message queue supports it, clients can also subscribe using some query for the content of the message.

==
[lakmal] Isn't oslo.messaging sort of the backend side of openstack? I think it would be beneficial and attractive for climate to provide a REST API subscribe / unsubscribe to the events.

Down the road this can be also used to provide role based notifications to clients. For instance, as a tenant admin I want to receive all climate notifications and as a tenant, I only want to receive notifications of resources that belongs to me.

==
[lakmal] hi, any updates on this? I tried to join the IRC channel few weeks including last week but didn't see any meeting in #openstack-climate. I hope I was in the correct room. Let me know if I've been on the wrong room :-)

==
[pafuent] Please join us at #openstack-blazar (we change our name from climate to blazar)

==
[lakmal] Thanks for the info pafuent. Is it possible to discuss about this BP on 12-06-2014 meeting? Do I need to do something to include the discussion to the agenda?

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.