Saturday, 2019-11-02

*** markinhsv has joined #ara17:06
markinhsvI am running ara api server and ara-web and it's working well, however I don't seem to have the CLI client.  What did I do wrong?17:06
dmsimardmarkinhsv: there is an "ara-manage" command in 1.x but there isn't a CLI to query the API a bit like in 0.x20:24
markinhsvThat explains it.  I thought I was going crazy.20:48
markinhsvA note in the docs would be very helpful, only if something short like "This is obsolete, please see this instead"20:49
markinhsvHow does one go about deleting playbooks now?  I was able to do it using postman but I found it hard to construct a mysql query that would do it.20:49
markinhsvI didn't see any way to do it in ara-web, maybe I missed it though, it's been known to happen :)20:51
*** Glandos has quit IRC20:52
*** Glandos has joined #ara20:53
dmsimardmarkinhsv: https://github.com/ansible-community/ara/issues/31 mentions tooling to make it easier to prune old records20:56
dmsimardDeletion isn't implemented in either web interfaces but it could be a good addition20:57
markinhsvThanks, yeah, I think so, do you have already have a canned mysql query that can do it for a time range.  If not, I think I will try to do something with a script with curl using cron.20:59
dmsimardThe API interface has a delete button when querying a specific item (ex: /api/v1/playbooks/<id>) but it shouldn't be the only way20:59
markinhsvI saw that once but was never able to get it to reappear, I thought I was imagining it.21:00
dmsimardOnly in detailed item views, not in list views21:00
markinhsvOh, ok, I'll try to get to see if I can get it to come up again.  It might be handy for one-offs.21:01
dmsimardI don't have a canned MySQL query right now21:01
markinhsvIt's okay, I would have worked it out myself but it looks like it would be a complicated query to ensure that all the dependent rows were deleted first.21:02
markinhsvIt's probably easier to do with the api anyway21:02
dmsimardIf you can do a bit of python you can check the API clients https://ara.readthedocs.io/en/latest/api-usage.html21:03
markinhsvMy python is ok, but not great.  I'll look at it.  It might be easier than cobbling together a shell script to do it.21:03
dmsimardSupport for searching by dates isn't available on the API side yet but you can probably do that client side21:04
dmsimardhttps://github.com/ansible-community/ara/issues/30 is the issue for API search by date21:04
markinhsvIf there is a date, I can manually match all the ones that match greater than n days ago into a collection and then loop over them.21:05
markinhsvokay, I'll try it.21:05
dmsimardSince there's no search by date (yet), you'd probably need to iterate over the playbooks, retrieve the "ended" field and compare that against local date21:06
dmsimardThe client has a .delete method21:06
markinhsvI'm just being pushed by management to get this online but I know at some point they are going to ask me how to delete them, I need to be proactive and have a solution already in place.21:06
markinhsvThat sounds doable.21:07
dmsimardWould be happy to help review :)21:08
markinhsvOk, once I have some code I'll send it to you.21:08
markinhsvthanks21:08
markinhsvsorry to bother you on Saturday, go out and enjoy the rest of your day :)21:08
dmsimardnp, have fun21:15
*** markinhsv has quit IRC23:00
*** markinhsv has joined #ara23:18

Generated by irclog2html.py 2.15.3 by Marius Gedminas - find it at mg.pov.lt!