Description of problem: When trying to query the pools for an owner, I am allowed to set an activeon parameter so that I can get the pools on a particular date/time. However, the API seems to fail to recognize the ISO 8601 format when a time zone is included. Version-Release number of selected component (if applicable): [root@jsefler-onprem-62candlepin proxy]# git branch 0.3 * master [root@jsefler-onprem-62candlepin proxy]# git show-ref | grep master 1be84d3971b32d03aea4d4ab363902e3ef4f377a refs/heads/master 1be84d3971b32d03aea4d4ab363902e3ef4f377a refs/remotes/origin/master How reproducible: Steps to Reproduce: deploy a candlepin server with TESTDATA=1 # curl -k -u admin:admin --request GET https://jsefler-onprem-62candlepin.usersys.redhat.com:8443/candlepin/owners/admin/pools?activeon=2011-06-10T00%3A00%3A00.000%2B0000 | python -mjson.tool % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 59 0 59 0 0 319 0 --:--:-- --:--:-- --:--:-- 1966 { "displayMessage": "Invalid date, must use ISO 8601 format" } ^^^^ I did not expect this invalid date error Note... I am properly URL encoding the ISO 8601 date format... URLEncode("2011-06-10T00:00:00.000+0000","UTF-8") gives me: 2011-06-10T00%3A00%3A00.000%2B0000 ^^^^^^^ This is the encoded time zone corresponding to +0000 Now watch when I make the same curl call with the time zone stripped off... # curl -k -u admin:admin --request GET https://jsefler-onprem-62candlepin.usersys.redhat.com:8443/candlepin/owners/admin/pools?activeon=2011-06-10T00%3A00%3A00.000 | python -mjson.tool | grep startDate % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 4524 100 4524 0 0 25326 0 --:--:-- --:--:-- --:--:-- 39339 "startDate": "2011-06-10T04:00:00.000+0000", "startDate": "2011-06-10T04:00:00.000+0000", "startDate": "2011-06-10T04:00:00.000+0000", "startDate": "2011-06-10T04:00:00.000+0000", ^^^^ When the time zone is excluded from the activeon parameter, candlepin returns pools. Actual results: /candlepin/owners/$owner/pools?activeon=2011-06-10T00%3A00%3A00.000 PASS /candlepin/owners/$owner/pools?activeon=2011-06-10T00%3A00%3A00.000%2B0000 FAILS /candlepin/owners/$owner/pools?activeon=2011-06-10T00%3A00%3A00.000%2B0400 FAILS So the problem is that I can't accurately query the pools for a precise and valid ISO 8601 date if I can't supply a time zone. Additional info:
/candlepin/owners/$owner/pools?activeon=2011-06-10T00%3A00%3A00.000-0400 FAILS
It is currently accepting xsd:date format. Lemme ask around. http://books.xmlschemata.org/relaxng/ch19-77049.html
Looking a bit more, ISO 8601 requires a : in the timezone: curl -k -u admin:admin https://localhost:8443/candlepin/owners/admin/pools?activeon=2011-06-10T00%3A00%3A00.000%2B00:00
Thank you Bryan for figuring this out. Yes - as indicated in http://books.xmlschemata.org/relaxng/ch19-77049.html a colon appears to be required in the date format. The following url encoded calls are working against candlepin with and without a url encoding for the colon in the timezone... with the timezone colon urlencoded(":")=%3A ... [root@jsefler-onprem-62server tmp]# curl -k -u admin:admin https://jsefler-onprem-62candlepin.usersys.redhat.com:8443/candlepin/owners/admin/pools?activeon=2012-12-31T00%3A00%3A00.000%2B00%3A00 | python -mjson.tool | grep startDate "startDate": "2012-07-13T00:00:00.000+0000", "startDate": "2012-07-13T00:00:00.000+0000", "startDate": "2012-07-13T00:00:00.000+0000", without the timezone colon urlencoded ... [root@jsefler-onprem-62server tmp]# curl -k -u admin:admin https://jsefler-onprem-62candlepin.usersys.redhat.com:8443/candlepin/owners/admin/pools?activeon=2012-12-31T00%3A00%3A00.000%2B00:00 | python -mjson.tool | grep startDate "startDate": "2012-07-13T00:00:00.000+0000", "startDate": "2012-07-13T00:00:00.000+0000", "startDate": "2012-07-13T00:00:00.000+0000", Additional Note: Existing automated ExpirationTests have been updated to include a urlencoding of the colon in the activeon parameter when querying for pools on a specific date.