niphlod / ssis_dash

SSISDB monitoring
Other
18 stars 2 forks source link

Rest API #3

Open chadgallagher opened 8 years ago

chadgallagher commented 8 years ago

Is the API currently available in the current release? I am looking to schedule checks, that call on the API, so people can be notified if a ETL fails or is running for a long period of time.

niphlod commented 8 years ago

pretty much everything is ready, in fact the frontend is heavily decoupled and calls already a REST-like endpoint. The missing part would be to connect the authentication part and the calls to the backend methods, if the setup you choose is going to be "protected" rather than "public".

niphlod commented 8 years ago

BTW: people can already use the RSS feed to get notified about executions.

chadgallagher commented 8 years ago

For some reason, I have been able to get the RSS feed working. Keeps giving me a error. Do you have any documentation on the API?

niphlod commented 8 years ago

"I have been able" clashes with "keeps giving me an error" .... if there is one, what's the error ?

Methods of the API are pretty much self-documented (see controllers/rest_data.py). They take "parameters" that are specified on the path in the same form of the frontend (i.e. /app/rest_data/par1/par2/par3/etc) .

The most useful for details about executions is package_list. Parameters are "folder", "project", "status", "package" which you can pass as

/app/rest_data/folder//project//status//package/

Feel free to ask for details, as ATM there are no specific docs on it nor there are methods that are not called from the frontend part. I'm open to discussion about implementing some useful patterns if they're not already available ^_^

chadgallagher commented 8 years ago

It just gives me a internal error and that it created a ticket. The URL it is pointing to is http://10.1.15.86:8000/init/console/overview/{Name}. I do not see a link to the xml

niphlod commented 8 years ago

strange, it should create a link like /init/subscriptions/feed/parameters/etc etc etc. Are you using "public" or "protected" mode ?

chadgallagher commented 8 years ago

I am using public mode. Now I do not have a email address in there as of yet as well

niphlod commented 8 years ago

when you click on the rss icon you should be redirected to something like

/init/subscriptions/feed/parameters....?user=default&signature=a_long_string

if you want you can send me the generated ticket so I can see what is happening, it doesn't contain sensitive data. Just zip the "errors" folder and send it to niphlod at gmail dot com

chadgallagher commented 8 years ago

If I look at the file in the error folder I see this at the top. I do not get directed to a link like you posted above

S"<type 'exceptions.IOError'> [Errno 2] No such file or directory: 'c:\web2py\applications\init\private\temp_feeds\295a1900af3dfe402689db3be85e5bb1.rss.__lock'"

chadgallagher commented 8 years ago

A great option would be to email out to a group/list is there is a error flag from one of the ETL's. Helps stop surprises in the morning

niphlod commented 8 years ago

huh. that's pretty helpful, you found a bug... to solve it quickly, go ahead and create the temp_feeds folder inside /init/private. I'll push a new release fixing the bug ASAP.

chadgallagher commented 8 years ago

Perfect, adding that folder worked

niphlod commented 8 years ago

latest 0.0.34 pushed seconds ago fixes the issue if the folder does not exist. thanks for spotting!

as for the mail feature: the rationale behind feeds over mails is that if people is interested, feeds get generated accordingly. If nobody is interested, app is "at rest" and SSISDB doesn't get queried. In my enterprise I have nearly a hundred SSISDB instances with a total sum of 30k executions per day. Developers and controllers come and go: maintaining a list of "interested" recipients would be a nightmare. With RSS feeds, I'm able to "compute" exactly what is needed and when is needed, without the maintenance burden and lots of "spam" with eventual bounces to inspect. Anyway, it won't be that hard to provide such a feature hooking up with the packages_list API: if the feature gets traction I'll be glad to include it or to accept a PR.