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

2016-10-04 Thread milanisko k
Guys,

thanks for the input!
I've just reported an rfe-issue on dateutils[1]. I'm proposing an
"?finished_at=ISO/ISO" format of time interval for the Inspector[2], let's
see where the reviews are going to get us.

Thanks again!
milan

[1] https://github.com/dateutil/dateutil/issues/295
[2]
https://review.openstack.org/#/c/375045/5/specs/list-introspection-statuses.rst@69

čt 29. 9. 2016 v 19:05 odesílatel Julien Danjou  napsal:

On Tue, Sep 27 2016, milanisko k wrote:

> I'd like to ask whether other projects need to parse time intervals and/or
> how do they achieve that.

We kind of do that in Gnocchi, but we do with 2 fields: one ISO8601
timestamp and a timestamp field, which we parse using pytimeparse, you
(can check gnocchi.utils.to_timespan).

--
Julien Danjou
/* Free Software hacker
   https://julien.danjou.info */
__
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


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

2016-09-29 Thread Julien Danjou
On Tue, Sep 27 2016, milanisko k wrote:

> I'd like to ask whether other projects need to parse time intervals and/or
> how do they achieve that.

We kind of do that in Gnocchi, but we do with 2 fields: one ISO8601
timestamp and a timestamp field, which we parse using pytimeparse, you
(can check gnocchi.utils.to_timespan).

-- 
Julien Danjou
/* Free Software hacker
   https://julien.danjou.info */


signature.asc
Description: PGP signature
__
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


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

2016-09-29 Thread Kevin L. Mitchell
On Thu, 2016-09-29 at 12:07 -0400, Doug Hellmann wrote:
> Excerpts from milanisko k's message of 2016-09-29 09:48:40 +:
[snip]
> > > 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?
> 
> Have you talked with the dateutils maintainers about adding support
> there?  It would still be better to contribute to dateutil than to
> put the function in a library not meant for anyone else outside of
> OpenStack to use.

You might also want to look at the timestring library…
-- 
Kevin L. Mitchell 


signature.asc
Description: This is a digitally signed message part
__
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


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

2016-09-29 Thread Doug Hellmann
Excerpts from milanisko k's message of 2016-09-29 09:48:40 +:
> út 27. 9. 2016 v 18:05 odesílatel Doug Hellmann 
> napsal:
> 
> > Excerpts from milanisko k's message of 2016-09-27 12:30:09 +:
> > > 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?

Have you talked with the dateutils maintainers about adding support
there?  It would still be better to contribute to dateutil than to
put the function in a library not meant for anyone else outside of
OpenStack to use.

Doug

__
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


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

2016-09-29 Thread milanisko k
út 27. 9. 2016 v 18:05 odesílatel Doug Hellmann 
napsal:

> Excerpts from milanisko k's message of 2016-09-27 12:30:09 +:
> > 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-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


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

2016-09-27 Thread Doug Hellmann
Excerpts from milanisko k's message of 2016-09-27 12:30:09 +:
> 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

__
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-dev] [all][oslo] Parse ISO8601 (open) time intervals

2016-09-27 Thread milanisko k
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
__
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