Hi Yujun,

Regards your questions :
For example, let's say you have 2 packages for your datasources named : 
yujun.ds.snmp ,  yujun.ds.my_alerts

1. For proprietary datasources: 
        a. You need that your datasource packages would be in the python path 
or installed in your python site-packages 
           (.e.g in RHEL 7 : under /usr/lib/python2.7/site-packages/)
        b. You need to edit the path value pf datasource section in 
vitrage.conf to include the base path of your datasource. 
                In our example, you need to edit under [datasource] section, 
the path value to: vitrage.datasources, yujun.ds
        c. You need to have in each __init__.py of your datasources an OPTS for 
transformer and driver. See vitrage/vitrage/datasources/aodh/__init__.py for 
example.

2.   The type of datasource can be anything. 
       Best practice is declare it as Constant in the __init__.py of the 
package as some string. For example SNMP=’snmp’.
       And use that Constant as the sync_type in make_pickleable, and as 
entity_type= in the transformer while creating vertex.
       Anyway in  `/etc/vitrage/datasource_values/ you need to put file with 
the same name as the type (string) in the entity_type of the vertex that 
created in the transformer.
       In this example, create `/etc/vitrage/datasource_values/snmp.yaml

3. Can be a lot of datasource types. ALARM/RESOURCE are Entity Category, and 
there are no more categories yet. (see vitrage.common.constants.EntityCategory)
4.  I will let Alexy Weyl to explain about that.
5. What do you mean in API format ? In your driver python class, you need to 
inherit from DriverBase and implement all the abstract methods.
     You can see a lot of examples in current code.
     The Datasource itself (the external system) can use any API, and your 
driver need to communicate with the datasource in the API that the datasource 
support (for example SNMP protocol if it is SNMP datasource)

Hopes that my answers helps you...

BR

Eylon
        

From: Yujun Zhang [mailto:zhangyujun+...@gmail.com] 
Sent: Tuesday, August 09, 2016 12:07 PM
To: OpenStack Development Mailing List (not for usage questions) 
<openstack-dev@lists.openstack.org>
Subject: Re: [openstack-dev] [vitrage] spec for datasource

Hi, Eylon,

It is not decided yet what datasources will be required. But we may assume 
there will be both open and proprietary ones.

The example of the former could be include service status of nova host in the 
topology (currently only host, instance and zone are found in the code).

For proprietary datasource, I'm considering to adapt the api to common 
protocol/interface, e.g. RESTful, SNMP and etc and I wish to know how to add 
support for these interface.

At the moment, I'm making an evaluation on the extensibility of vitrage 
architecture and estimate the workload for new datasource. Any idea how I can 
proceed?

--
Yujun

On Tue, Aug 9, 2016 at 4:34 PM Malin, Eylon (Nokia - IL) 
<eylon.ma...@nokia.com> wrote:
Hi,

There are different instruction for datasource that are part of openstack 
vitrage upstream, and for propriety datasource.
So for better understanding the case, do you want to add new datasource that 
would be contributed to openstack, or is it propriety one ?
I'm meaning do you plan to push the new datasource to vitrage upstream or leave 
it private ?

Eylon


From: Yujun Zhang [mailto:zhangyujun+...@gmail.com]
Sent: Tuesday, August 09, 2016 10:22 AM
To: OpenStack Development Mailing List (not for usage questions) 
<openstack-dev@lists.openstack.org>
Subject: [openstack-dev] [vitrage] spec for datasource

Dear all,

Is there a guide on how to understand the design of datasource? I want to 
extend the existing one and also try to create a custom datasource from scratch.

Some documents are found in https://github.com/openstack/vitrage-specs and 
datasource seems to be related to synchronizer but I didn't find a dedicated 
spec.

Currently I have the following questions
1. How do I register a new datasource in an existing system?
2. Is the type of datasource (ALARM/RESOURCE) configured in 
`/etc/vitrage/datasource_values/<datasource>.yaml` ?
3. Is there any other datasource type besides ALARM/RESOURCE?
4. What does `aggregated values` and `priority` mean
5. What is the required data format for the datasource driver api? The inline 
comments give some brief description but didn't specify the api signature.
Many thanks.

--
Yujun
__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@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-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to