[openstack-dev] [all][oslo] Parse ISO8601 (open) time intervals

milanisko k vetrisko at gmail.com
Thu Sep 29 09:48:40 UTC 2016


út 27. 9. 2016 v 18:05 odesílatel Doug Hellmann <doug at doughellmann.com>
napsal:

> Excerpts from milanisko k's message of 2016-09-27 12:30:09 +0000:
> > Hello Stackers!
> >
> > The ironic inspector project keeps track of introspection finished_at
> time
> > stamps.
> > We're just discussing how to reasonably query time ranges over the API[1]
> > to serve matching introspection statuses to the user.
> > Wikipedia[2] mentions the ISO8601 time interval specification (and there
> > are open-interval extensions to that).
> > It would be nice to be able to specify a query like :
> >      /v1/introspection?finished_at=2016:09:27:14:17/PT1H
> > to fetch all introspection statuses that finished within 1hour around
> 14:17
> > Today,
> > or to be able to state an open-ended interval:
> >     /v1/introspection?finished_at=2016:09:27:14:17/
> > but oslo_utils.timeutils lacks parsing support for ISO8061 time
> intervals.
> >
> > I'd like to ask whether other projects need to parse time intervals
> and/or
> > how do they achieve that.
> >
> > Thanks!
> > milan
> >
> > [1]
> >
> https://review.openstack.org/#/c/375045/3/specs/list-introspection-statuses.rst
> > [2] https://en.wikipedia.org/wiki/ISO_8601#Time_intervals
>
> You may want to have a look at the dateutil library.
> https://dateutil.readthedocs.io/en/stable/
>
> Doug, I'm afraid that dateutil.parser.parse doesn't support intervals
either: http://paste.openstack.org/show/583452/
Is there any interest in oslo_utils.timeutils parsing ISO8601 time
intervals as in [2]?
What do OS projects use instead especially w/r http api queries?


> Doug
>
> __________________________________________________________________________
> 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/20160929/44ee9d6b/attachment.html>


More information about the OpenStack-dev mailing list