[openstack-dev] [Congress] Push Type Driver implementation

Eric K ekcs.openstack at gmail.com
Fri Mar 25 02:49:19 UTC 2016


I got the same behavior Tim Hinrichs did using DoctorDriver.

The problem when listing datasources does not occur with the basic
PushDriver in progress, but it has other issues when pushing and listing
data. See 

From:  Tim Hinrichs <tim at styra.com>
Reply-To:  "OpenStack Development Mailing List (not for usage questions)"
<openstack-dev at lists.openstack.org>
Date:  Thursday, March 24, 2016 at 10:34 AM
To:  "OpenStack Development Mailing List (not for usage questions)"
<openstack-dev at lists.openstack.org>
Subject:  Re: [openstack-dev] [Congress] Push Type Driver implementation

> I tried the doctorDriver again.  This time I was successful!  I'm still
> getting an error when listing the datasources though.  I tried updating and
> installing my client, but no change.
> 
> // Create the datasource
> $ openstack congress datasource create doctor doctor
> +-------------+--------------------------------------+
> | Field       | Value                                |
> +-------------+--------------------------------------+
> | config      | None                                 |
> | description | None                                 |
> | driver      | doctor                               |
> | enabled     | True                                 |
> | id          | 3717095c-25a7-4fe2-8f18-25d845b11c60 |
> | name        | doctor                               |
> | type        | None                                 |
> +-------------+--------------------------------------+
> 
> // Push data
> $ curl -g -i -X PUT
> http://localhost:1789/v1/data-sources/3717095c-25a7-4fe2-8f18-25d845b11c60/tab
> les/events/rows -H "User-Agent: python-congressclient" -H "Content-Type:
> application/json" -H "Accept: application/json" -d  '[
>> >       {
>> >         "id": "0123-4567-89ab",
>> >         "time": "2016-02-22T11:48:55Z",
>> >         "type": "compute.host.down",
>> >         "details": {
>> >             "hostname": "compute1",
>> >             "status": "down",
>> >             "monitor": "zabbix1",
>> >             "monitor_event_id": "111"
>> >         }
>> >       }
>> >     ]'
> HTTP/1.1 200 OK
> Content-Type: application/json; charset=UTF-8
> Content-Length: 0
> X-Openstack-Request-Id: req-47c6dfdf-74cd-4101-829a-657b6aea1e2c
> Date: Thu, 24 Mar 2016 18:28:31 GMT
> 
> 
> // Ask for contents of table that we pushed
> $ openstack congress datasource row list doctor events
> +----------------+------------------+------------------+----------+--------+--
> -------+------------------+
> | id             | time             | type             | hostname | status |
> monitor | monitor_event_id |
> +----------------+------------------+------------------+----------+--------+--
> -------+------------------+
> | 0123-4567-89ab | 2016-02-22T11:48 | compute.host.dow | compute1 | down   |
> zabbix1 | 111              |
> |                | :55Z             | n                |          |        |
> |                  |
> +----------------+------------------+------------------+----------+--------+--
> -------+------------------+
> 
> 
> // List the datasources
> $ openstack congress datasource list
> 'NoneType' object has no attribute 'items'
> 
> Tim
> 
> 
> On Thu, Mar 17, 2016 at 5:56 PM Tim Hinrichs <tim at styra.com> wrote:
>> I tried the doctor driver out.  I just added the file to
>> congress/datasources, and set up /etc/congress/congress.conf to include
>> congress.datasources.doctor_driver.DoctorDriver.
>> 
>> I could create a new doctor driver, but afterwards I couldn't list all the
>> datasources, and I couldn't push any data to it.  See transcript below.
>> 
>> $ openstack congress datasource create doctor doctor
>> +-------------+--------------------------------------+
>> | Field       | Value                                |
>> +-------------+--------------------------------------+
>> | config      | None                                 |
>> | description | None                                 |
>> | driver      | doctor                               |
>> | enabled     | True                                 |
>> | id          | 906c6327-15f1-4f3c-aa51-1590540c06b9 |
>> | name        | doctor                               |
>> | type        | None                                 |
>> +-------------+--------------------------------------+
>> 
>> $ openstack congress datasource list
>> 'NoneType' object has no attribute 'items'
>> 
>> The other problem I saw was that the schema was fixed for the doctor driver.
>> So I tried to create a push driver that would accept any collection of
>> tuples.  This wouldn't allow the user to push arbitrary JSON, but they could
>> push any tuples they'd like.  While experimenting, I fixed the problem
>> mentioned above by adding a single (unnecessary) configuration option.  Then
>> I ran into a Datasource not found problem.  I pushed the code to review so we
>> can all take a look.
>> 
>> https://review.openstack.org/294348
>> 
>> $ curl -g -i -X PUT
>> http://localhost:1789/v1/data-sources/push/tables/data/rows -H "User-Agent:
>> python-congressclient" -H "Content-Type: application/json" -H "Accept:
>> application/json" -d '[[1]]'
>> HTTP/1.1 404 Not Found
>> Content-Type: application/json; charset=UTF-8
>> Content-Length: 102
>> X-Openstack-Request-Id: req-23432974-b107-4657-9bbc-c2e05fd25a98
>> Date: Thu, 17 Mar 2016 21:13:03 GMT
>> 
>> {"error": {"message": "Not Found::Datasource not found push", "error_data":
>> null, "error_code": 404}}
>> 
>> Masahito: do you know what the Datasource Not Found problem is? If not, could
>> you look into it? I ran into it with the Doctor Driver too.
>> 
>> Tim
>> 
>> 
>> On Thu, Mar 17, 2016 at 2:31 AM Masahito MUROI <muroi.masahito at lab.ntt.co.jp>
>> wrote:
>>> Hi folks,
>>> 
>>> This[1] is the driver I mentioned at meeting. It is used for OPNFV
>>> Doctor[2]. So I plan to push it into master in Newton release, since
>>> feature freeze for Mitaka was passed and the schema of its translator is
>>> under the discussion.
>>> 
>>> If it's worth to push it in current release to test push driver, I don't
>>> mind doing it.
>>> 
>>> [1]
>>> https://github.com/muroi/congress/blob/doctor-poc/congress/datasources/docto
>>> r_driver.py
>>> [2] https://wiki.opnfv.org/doctor
>>> 
>>> --
>>> 室井 雅仁(Masahito MUROI)
>>> Software Innovation Center, NTT
>>> Tel: +81-422-59-4539
>>> 
>>> 
>>> 
>>> __________________________________________________________________________
>>> OpenStack Development Mailing List (not for usage questions)
>>> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
>>> <http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe>
>>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions) Unsubscribe:
> OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20160324/85c6a07f/attachment.html>


More information about the OpenStack-dev mailing list