)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9d086ed0eea1207a77207ae2aa58979771941764","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Simple tenant usage pagination"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Spec to add optional parameters \u0027limit\u0027 and \u0027marker\u0027 to the"},{"line_number":10,"context_line":"os-simple-tenant-usage enpoints for pagination."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"  /os-simple-tenant-usage?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":13,"context_line":"  /os-simple-tenant-usage/{tenant_id}?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa6399be_831c04c3","line":10,"range":{"start_line":10,"start_character":23,"end_line":10,"end_character":31},"updated":"2016-10-17 15:57:03.000000000","message":"endpoints","commit_id":"f36fa7a679e776a6b94a887483e5eeba56f439c1"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"444b8ba4f28812659629f296234012c604186e64","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Simple tenant usage pagination"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Spec to add optional parameters \u0027limit\u0027 and \u0027marker\u0027 to the"},{"line_number":10,"context_line":"os-simple-tenant-usage enpoints for pagination."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"  /os-simple-tenant-usage?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":13,"context_line":"  /os-simple-tenant-usage/{tenant_id}?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa6399be_954a7354","line":10,"range":{"start_line":10,"start_character":23,"end_line":10,"end_character":31},"in_reply_to":"fa6399be_831c04c3","updated":"2016-10-17 17:51:45.000000000","message":"Done","commit_id":"f36fa7a679e776a6b94a887483e5eeba56f439c1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9d086ed0eea1207a77207ae2aa58979771941764","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"  /os-simple-tenant-usage?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":13,"context_line":"  /os-simple-tenant-usage/{tenant_id}?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: Ie9dc4f1c62180175433786fcf37d758762a457f0"},{"line_number":16,"context_line":"blueprint: paginate-simple-tenant-usage"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa6399be_43690c25","line":14,"updated":"2016-10-17 15:57:03.000000000","message":"Since this is an API change you need the APIImpact tag in the commit message.","commit_id":"f36fa7a679e776a6b94a887483e5eeba56f439c1"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"444b8ba4f28812659629f296234012c604186e64","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"  /os-simple-tenant-usage?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":13,"context_line":"  /os-simple-tenant-usage/{tenant_id}?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: Ie9dc4f1c62180175433786fcf37d758762a457f0"},{"line_number":16,"context_line":"blueprint: paginate-simple-tenant-usage"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa6399be_b547774a","line":14,"in_reply_to":"fa6399be_43690c25","updated":"2016-10-17 17:51:45.000000000","message":"Done","commit_id":"f36fa7a679e776a6b94a887483e5eeba56f439c1"}],"specs/ocata/approved/paginate-simple-tenant-usage.rst":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9d086ed0eea1207a77207ae2aa58979771941764","unresolved":false,"context_lines":[{"line_number":174,"context_line":"rather than by `tenant_id` in the outer `tenant_usages` list. The `marker` is"},{"line_number":175,"context_line":"the last instance UUID from the previous page."},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"The the simple tenant usage endpoints will also include the conventional"},{"line_number":178,"context_line":"\"next\" links: `tenant_usages_links` in the case of `index` and"},{"line_number":179,"context_line":"`tenant_usage_links` in the `show` case."},{"line_number":180,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"fa6399be_0eb49bcf","line":177,"range":{"start_line":177,"start_character":0,"end_line":177,"end_character":7},"updated":"2016-10-17 15:57:03.000000000","message":"s/The the/The/","commit_id":"f36fa7a679e776a6b94a887483e5eeba56f439c1"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"c3894bd23368b1eb14b9723c5812a60763194e0a","unresolved":false,"context_lines":[{"line_number":174,"context_line":"rather than by `tenant_id` in the outer `tenant_usages` list. The `marker` is"},{"line_number":175,"context_line":"the last instance UUID from the previous page."},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"The the simple tenant usage endpoints will also include the conventional"},{"line_number":178,"context_line":"\"next\" links: `tenant_usages_links` in the case of `index` and"},{"line_number":179,"context_line":"`tenant_usage_links` in the `show` case."},{"line_number":180,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"fa6399be_f442d867","line":177,"range":{"start_line":177,"start_character":0,"end_line":177,"end_character":7},"in_reply_to":"fa6399be_0eb49bcf","updated":"2016-10-17 16:07:31.000000000","message":"Done","commit_id":"f36fa7a679e776a6b94a887483e5eeba56f439c1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9d086ed0eea1207a77207ae2aa58979771941764","unresolved":false,"context_lines":[{"line_number":175,"context_line":"the last instance UUID from the previous page."},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"The the simple tenant usage endpoints will also include the conventional"},{"line_number":178,"context_line":"\"next\" links: `tenant_usages_links` in the case of `index` and"},{"line_number":179,"context_line":"`tenant_usage_links` in the `show` case."},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"::"},{"line_number":182,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"fa6399be_6e76f707","line":179,"range":{"start_line":178,"start_character":14,"end_line":179,"end_character":40},"updated":"2016-10-17 15:57:03.000000000","message":"Do we have any other APIs that have different marker links based on show vs index? I\u0027m just wondering if this is a new special unicorn type case and if so, if it\u0027s better to just have a consistent link key name.","commit_id":"f36fa7a679e776a6b94a887483e5eeba56f439c1"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"c3894bd23368b1eb14b9723c5812a60763194e0a","unresolved":false,"context_lines":[{"line_number":175,"context_line":"the last instance UUID from the previous page."},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"The the simple tenant usage endpoints will also include the conventional"},{"line_number":178,"context_line":"\"next\" links: `tenant_usages_links` in the case of `index` and"},{"line_number":179,"context_line":"`tenant_usage_links` in the `show` case."},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"::"},{"line_number":182,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"fa6399be_d44dd49a","line":179,"range":{"start_line":178,"start_character":14,"end_line":179,"end_character":40},"in_reply_to":"fa6399be_6e76f707","updated":"2016-10-17 16:07:31.000000000","message":"The response container names already differ (\"tenant_usages\" vs. \"tenant_usage\"). I\u0027m just appending \"_links\" to each of them. I did originally just have \"usage_links\" for both, but I thought that was more unicorn-y.","commit_id":"f36fa7a679e776a6b94a887483e5eeba56f439c1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9d086ed0eea1207a77207ae2aa58979771941764","unresolved":false,"context_lines":[{"line_number":220,"context_line":"Alternatives"},{"line_number":221,"context_line":"------------"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"None"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"Data model impact"},{"line_number":226,"context_line":"-----------------"}],"source_content_type":"text/x-rst","patch_set":2,"id":"fa6399be_0e481b87","line":223,"updated":"2016-10-17 15:57:03.000000000","message":"For index, why not page by tenant, and for show, page by instance?\n\nFor example, if there are 3 instances in 3 tenants, and my limit is 2, for index then I get back 2 tenants, 6 instances, with the marker being the 2nd tenant.\n\nUsing the same data set, for show I\u0027d get back 1 tenant and 2 instances, and my marker is the 2nd instance in the first tenant.\n\nI imagine the reason for paging on the instances, even if it goes across tenants, is to keep the DB API code simpler since we can already page by instances. Furthermore, in the case of index, tenant_id isn\u0027t provided so if we wanted to page on tenant we\u0027d have to first get all tenants that have instances that fall within the given window, and then start paging those, which makes things pretty clunky.\n\nLooking at the project \u003e compute \u003e overview page for Horizon, there is a table of instances, so paging on instances probably does make the most sense in that case. Horizon should be doing a show on your tenant usages and then displaying those instances in a table, which you can page through. Given the default quota for instances is 10 I\u0027d expect at most 10 instances per page from Horizon, but I guess it could also get the quota limits for the given tenant and then use that for the limit.\n\nThe more interesting case is the admin user that can list usage for all tenants. In that case the table shows the project name and aggregate usage. It looks like that view code is here:\n\nhttps://github.com/openstack/horizon/blob/10.0.0/openstack_dashboard/dashboards/admin/overview/views.py\n\nAnd the code that fills the \u0027global overview\u0027 table is here:\n\nhttps://github.com/openstack/horizon/blob/10.0.0/openstack_dashboard/usage/base.py#L255\n\nSo that gets all tenants and all instances with server_usages (detailed\u003d1) and then fills the table.\n\nThe thing that bothers me is how the admin global usage overview page can page on instances at all, since that will throw off the usage that\u0027s reported, which is why I was thinking paging on tenant would make more sense in that case. If you have 100 tenants using your cloud, then you can page through them like 10 at a time, but the usages within those tenants need to be accurate, which they wouldn\u0027t be if your limit ends up only processing part of the total number of instances in that tenant.\n\nSo the use cases are different in my mind.","commit_id":"f36fa7a679e776a6b94a887483e5eeba56f439c1"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"234dc02c4b47de016e349a525ab838cd319890d7","unresolved":false,"context_lines":[{"line_number":220,"context_line":"Alternatives"},{"line_number":221,"context_line":"------------"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"None"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"Data model impact"},{"line_number":226,"context_line":"-----------------"}],"source_content_type":"text/x-rst","patch_set":2,"id":"fa6399be_4f692d25","line":223,"in_reply_to":"fa6399be_0e481b87","updated":"2016-10-17 16:19:49.000000000","message":"I originally understood this task to be about paging by tenant, which is what I implemented at first.\n\nBut then it was pointed out to me that the goal is actually to solve the \"few tenants, tons of instances\" case, not the \"many tenants, with a few instances each\" case.\n\nIt was suggested by Dan Smith that I take this naive approach, requiring API consumers to stitch the results back together (if need be).\n\nThis is why paging is done on the inner \"server_usages\" list, and not the outer \"tenant_usages\" list.\n\nI hope that answers your initial \"why\".","commit_id":"f36fa7a679e776a6b94a887483e5eeba56f439c1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9d086ed0eea1207a77207ae2aa58979771941764","unresolved":false,"context_lines":[{"line_number":257,"context_line":"Performance Impact"},{"line_number":258,"context_line":"------------------"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"Horizon consumes these API enpoints which are currently slow with a large"},{"line_number":261,"context_line":"memory profile when there are a lot of instances."},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"Other deployer impact"}],"source_content_type":"text/x-rst","patch_set":2,"id":"fa6399be_145cacec","line":260,"range":{"start_line":260,"start_character":27,"end_line":260,"end_character":35},"updated":"2016-10-17 15:57:03.000000000","message":"endpoints","commit_id":"f36fa7a679e776a6b94a887483e5eeba56f439c1"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"c3894bd23368b1eb14b9723c5812a60763194e0a","unresolved":false,"context_lines":[{"line_number":257,"context_line":"Performance Impact"},{"line_number":258,"context_line":"------------------"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"Horizon consumes these API enpoints which are currently slow with a large"},{"line_number":261,"context_line":"memory profile when there are a lot of instances."},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"Other deployer impact"}],"source_content_type":"text/x-rst","patch_set":2,"id":"fa6399be_345d3049","line":260,"range":{"start_line":260,"start_character":27,"end_line":260,"end_character":35},"in_reply_to":"fa6399be_145cacec","updated":"2016-10-17 16:07:31.000000000","message":"Done","commit_id":"f36fa7a679e776a6b94a887483e5eeba56f439c1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9d086ed0eea1207a77207ae2aa58979771941764","unresolved":false,"context_lines":[{"line_number":287,"context_line":""},{"line_number":288,"context_line":"- Create a new API microversion for simple tenant usage pagination."},{"line_number":289,"context_line":"- Update python-novaclient to be able to take advantage of these changes."},{"line_number":290,"context_line":"- Communicate these changes to the Horizon team."},{"line_number":291,"context_line":""},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"Dependencies"}],"source_content_type":"text/x-rst","patch_set":2,"id":"fa6399be_d42f943c","line":290,"range":{"start_line":290,"start_character":2,"end_line":290,"end_character":48},"updated":"2016-10-17 15:57:03.000000000","message":"I think we need buy-in from Horizon before we land this spec and start making changes, given the different use cases pointed out above. I\u0027d like to know that their requirements, if there are any, are satisfied with this.","commit_id":"f36fa7a679e776a6b94a887483e5eeba56f439c1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9d086ed0eea1207a77207ae2aa58979771941764","unresolved":false,"context_lines":[{"line_number":298,"context_line":"Testing"},{"line_number":299,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":300,"context_line":""},{"line_number":301,"context_line":"Needs functional and unit tests. Perhaps also a Tempest test?"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"Documentation Impact"},{"line_number":304,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":2,"id":"fa6399be_74196822","line":301,"range":{"start_line":301,"start_character":33,"end_line":301,"end_character":61},"updated":"2016-10-17 15:57:03.000000000","message":"This doesn\u0027t involve other services so I think in-tree unit and functional testing is sufficient.","commit_id":"f36fa7a679e776a6b94a887483e5eeba56f439c1"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"c3894bd23368b1eb14b9723c5812a60763194e0a","unresolved":false,"context_lines":[{"line_number":298,"context_line":"Testing"},{"line_number":299,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":300,"context_line":""},{"line_number":301,"context_line":"Needs functional and unit tests. Perhaps also a Tempest test?"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"Documentation Impact"},{"line_number":304,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":2,"id":"fa6399be_ef076116","line":301,"range":{"start_line":301,"start_character":33,"end_line":301,"end_character":61},"in_reply_to":"fa6399be_74196822","updated":"2016-10-17 16:07:31.000000000","message":"Done","commit_id":"f36fa7a679e776a6b94a887483e5eeba56f439c1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9d086ed0eea1207a77207ae2aa58979771941764","unresolved":false,"context_lines":[{"line_number":311,"context_line":""},{"line_number":312,"context_line":"Bug that describes the problem:"},{"line_number":313,"context_line":""},{"line_number":314,"context_line":"[1] https://bugs.launchpad.net/nova/+bug/1421471"},{"line_number":315,"context_line":""},{"line_number":316,"context_line":"Proof of concept:"},{"line_number":317,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"fa6399be_94d7dcec","line":314,"range":{"start_line":314,"start_character":4,"end_line":314,"end_character":48},"updated":"2016-10-17 15:57:03.000000000","message":"I\u0027ve added comments to this bug, but I think it\u0027s been more or less resolved with bug 1485025 which landed in liberty.","commit_id":"f36fa7a679e776a6b94a887483e5eeba56f439c1"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"7e7303b2c950017de65022115f3bb917cbc11468","unresolved":false,"context_lines":[{"line_number":311,"context_line":""},{"line_number":312,"context_line":"Bug that describes the problem:"},{"line_number":313,"context_line":""},{"line_number":314,"context_line":"[1] https://bugs.launchpad.net/nova/+bug/1421471"},{"line_number":315,"context_line":""},{"line_number":316,"context_line":"Proof of concept:"},{"line_number":317,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"fa6399be_6bf41e87","line":314,"range":{"start_line":314,"start_character":4,"end_line":314,"end_character":48},"in_reply_to":"fa6399be_94d7dcec","updated":"2016-10-17 18:42:48.000000000","message":"Yes, before proposing pagination for these endpoints I spent some time profiling the current queries generated by the simple tenant usage endpoints, and can confirm that they were significantly improved since this bug was initially reported.\n\nThat said, 1 tenant with 20,000+ instances is still going to be problematic without paging of some kind unless the server_usages details (via detailed\u003d1) are removed from the API response and the aggregation is moved to the SQL (with a GROUP BY tenant_id clause). \n\nAs of stable/newton, the query generated looks like this (note: I replaced the individual fields with stars for brevity):\n\n    SELECT instances.*, instance_extra.*\n    FROM instances\n    LEFT OUTER JOIN instance_extra ON instance_extra.instance_uuid \u003d instances.uuid \n    WHERE (instances.terminated_at IS NULL OR instances.terminated_at \u003e \u00272016-09-28 21:02:51\u0027) AND instances.launched_at \u003c \u00272016-09-28 21:02:51\u0027;","commit_id":"f36fa7a679e776a6b94a887483e5eeba56f439c1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7599a6137a2cbf6dab7c66322633d7a505c24ea6","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                        \"hours\": 1"},{"line_number":165,"context_line":"                    }"},{"line_number":166,"context_line":"                ],"},{"line_number":167,"context_line":"                \"tenant_id\": \"instance-uuid-2\","},{"line_number":168,"context_line":"                \"total_hours\": 1"},{"line_number":169,"context_line":"            },"},{"line_number":170,"context_line":"        ]"}],"source_content_type":"text/x-rst","patch_set":6,"id":"ba5da102_bc47bbba","line":167,"range":{"start_line":167,"start_character":30,"end_line":167,"end_character":45},"updated":"2016-11-02 14:52:18.000000000","message":"tenant-uuid-2","commit_id":"a442a60f5ea43d3bf5f5b9bd6e35bc11cdee25fa"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7599a6137a2cbf6dab7c66322633d7a505c24ea6","unresolved":false,"context_lines":[{"line_number":306,"context_line":"Testing"},{"line_number":307,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"Needs functional and unit tests."},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"Documentation Impact"},{"line_number":312,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":6,"id":"ba5da102_bc7fbba9","line":309,"updated":"2016-11-02 14:52:18.000000000","message":"There are tests in Tempest for this API:\n\nhttp://git.openstack.org/cgit/openstack/tempest/tree/tempest/api/compute/admin/test_simple_tenant_usage.py\n\nBut since we aren\u0027t changing the response I don\u0027t think we need to test this microversion in Tempest as really nothing is going to change for the coverage in Tempest - and we can test the request side limit/marker validation using functional tests within nova.","commit_id":"a442a60f5ea43d3bf5f5b9bd6e35bc11cdee25fa"},{"author":{"_account_id":6650,"name":"Eric Peterson","email":"ejpetey@gmail.com","username":"ericpeterson-l"},"change_message_id":"1701904ddd9b3546287757f0b67c65a1bba2b4f4","unresolved":false,"context_lines":[{"line_number":16,"context_line":"::"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"    GET /os-simple-tenant-usage?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":19,"context_line":"    GET /os-simple-tenant-usage/{tenant_id}?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Problem description"},{"line_number":22,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":7,"id":"ba5da102_2af18bcd","line":19,"updated":"2016-11-02 22:05:38.000000000","message":"so can an admin in project A list the resources of project B?   Will that work ok?   Or does this only work if the tenant you are asking for also matches the token\u0027s project.    Need clarification for horizon usage in admin screens.","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":6650,"name":"Eric Peterson","email":"ejpetey@gmail.com","username":"ericpeterson-l"},"change_message_id":"952ab3edb90ca4ac3d4f15a1e78637f91ab29c72","unresolved":false,"context_lines":[{"line_number":16,"context_line":"::"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"    GET /os-simple-tenant-usage?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":19,"context_line":"    GET /os-simple-tenant-usage/{tenant_id}?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Problem description"},{"line_number":22,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":7,"id":"ba5da102_2ac8ab73","line":19,"in_reply_to":"ba5da102_2af18bcd","updated":"2016-11-02 22:06:51.000000000","message":"Done - I see the reply in review comments now","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"70cd6aec6d810fbd0544aa759b3e4bfcc868d214","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"The simple tenant usage API can return extremely large amounts of data and"},{"line_number":25,"context_line":"provides no way to paginate the results. Because the API does not use the"},{"line_number":26,"context_line":"pagination code, it doesn\u0027t even respect the \"max results\" sanity limit."},{"line_number":27,"context_line":"Because it can query a ton of data, it also causes the api workers to inflate"},{"line_number":28,"context_line":"their memory footprint to the size of the DB result set, which is large."},{"line_number":29,"context_line":"Since horizon queries this by default, most users are affected unless their"}],"source_content_type":"text/x-rst","patch_set":7,"id":"ba5da102_e55e8f11","line":26,"range":{"start_line":26,"start_character":17,"end_line":26,"end_character":71},"updated":"2016-11-04 18:33:27.000000000","message":"Just to be clear, I assume you are going to add the implementation to add the max results limit here? I don\u0027t see that explicitly called out in the proposed changes below.\n\nI wonder if we should also add that to the old microversion, and you get an invalid request 400 error if you request something over the limit?","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"ebb52013e770605a11b9f07d76b08c8f251da79b","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"The simple tenant usage API can return extremely large amounts of data and"},{"line_number":25,"context_line":"provides no way to paginate the results. Because the API does not use the"},{"line_number":26,"context_line":"pagination code, it doesn\u0027t even respect the \"max results\" sanity limit."},{"line_number":27,"context_line":"Because it can query a ton of data, it also causes the api workers to inflate"},{"line_number":28,"context_line":"their memory footprint to the size of the DB result set, which is large."},{"line_number":29,"context_line":"Since horizon queries this by default, most users are affected unless their"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a629dbe_ec4ffcba","line":26,"range":{"start_line":26,"start_character":17,"end_line":26,"end_character":71},"in_reply_to":"ba5da102_8071417a","updated":"2016-11-09 13:48:25.000000000","message":"Oops, I missed that. Thanks.","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"bf88c05559349d756d8f7ddb5d52ada2d62a39a3","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"The simple tenant usage API can return extremely large amounts of data and"},{"line_number":25,"context_line":"provides no way to paginate the results. Because the API does not use the"},{"line_number":26,"context_line":"pagination code, it doesn\u0027t even respect the \"max results\" sanity limit."},{"line_number":27,"context_line":"Because it can query a ton of data, it also causes the api workers to inflate"},{"line_number":28,"context_line":"their memory footprint to the size of the DB result set, which is large."},{"line_number":29,"context_line":"Since horizon queries this by default, most users are affected unless their"}],"source_content_type":"text/x-rst","patch_set":7,"id":"ba5da102_8071417a","line":26,"range":{"start_line":26,"start_character":17,"end_line":26,"end_character":71},"in_reply_to":"ba5da102_e55e8f11","updated":"2016-11-04 18:59:20.000000000","message":"Yes, from later in this spec: \"Older versions of the `os-simple-tenant usage` endpoints will not accept these new paging query parameters, but they will start to silently limit by `CONF.osapi_max_limit` to encourage the adoption of this new microversion, and circumvent the existing possibility DoS-like usage requests on systems with thousands of instances.\"","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"389eeac5c70298505daaa07a2e805a5660557396","unresolved":false,"context_lines":[{"line_number":28,"context_line":"their memory footprint to the size of the DB result set, which is large."},{"line_number":29,"context_line":"Since horizon queries this by default, most users are affected unless their"},{"line_number":30,"context_line":"ops team is extremely diligent about purging deleted instances (which are"},{"line_number":31,"context_line":"returned by the API by design)."},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"Use Cases"},{"line_number":34,"context_line":"---------"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a629dbe_ef352eda","line":31,"updated":"2016-11-09 13:50:47.000000000","message":"Just to be clear, this is a very strange experience in horizon, as tenants appear multiple times on different pages.\n\nAlthough it does give us a brute force \"make it work\" thing.","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5c97112b2d29106979d899efff57d260a7a36be7","unresolved":false,"context_lines":[{"line_number":28,"context_line":"their memory footprint to the size of the DB result set, which is large."},{"line_number":29,"context_line":"Since horizon queries this by default, most users are affected unless their"},{"line_number":30,"context_line":"ops team is extremely diligent about purging deleted instances (which are"},{"line_number":31,"context_line":"returned by the API by design)."},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"Use Cases"},{"line_number":34,"context_line":"---------"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a629dbe_efe8ce12","line":31,"in_reply_to":"9a629dbe_ef352eda","updated":"2016-11-09 13:52:59.000000000","message":"I am calling that a Nit.","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"70cd6aec6d810fbd0544aa759b3e4bfcc868d214","unresolved":false,"context_lines":[{"line_number":172,"context_line":""},{"line_number":173,"context_line":"Paging is done on the inner `server_usages` list (sorted by `Instance.id ASC`)"},{"line_number":174,"context_line":"rather than by `tenant_id` in the outer `tenant_usages` list. The `marker` is"},{"line_number":175,"context_line":"the last instance UUID from the previous page."},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"The simple tenant usage endpoints will also include the conventional \"next\""},{"line_number":178,"context_line":"links: `tenant_usages_links` in the case of `index` and `tenant_usage_links`"}],"source_content_type":"text/x-rst","patch_set":7,"id":"ba5da102_e5ff6fa8","line":175,"updated":"2016-11-04 18:33:27.000000000","message":"I think this largely answers alex_xu\u0027s questions.","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"fefb88fa9d3d22c0d7ea50e32cd8f46a3cc59053","unresolved":false,"context_lines":[{"line_number":172,"context_line":""},{"line_number":173,"context_line":"Paging is done on the inner `server_usages` list (sorted by `Instance.id ASC`)"},{"line_number":174,"context_line":"rather than by `tenant_id` in the outer `tenant_usages` list. The `marker` is"},{"line_number":175,"context_line":"the last instance UUID from the previous page."},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"The simple tenant usage endpoints will also include the conventional \"next\""},{"line_number":178,"context_line":"links: `tenant_usages_links` in the case of `index` and `tenant_usage_links`"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a629dbe_6adb5e7c","line":175,"in_reply_to":"9a629dbe_0f17c2ed","updated":"2016-11-11 17:52:52.000000000","message":"++ to sorting by (project_id, uuid)","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"e380c76fd7df88d667b18b640880ef1ff6330455","unresolved":false,"context_lines":[{"line_number":172,"context_line":""},{"line_number":173,"context_line":"Paging is done on the inner `server_usages` list (sorted by `Instance.id ASC`)"},{"line_number":174,"context_line":"rather than by `tenant_id` in the outer `tenant_usages` list. The `marker` is"},{"line_number":175,"context_line":"the last instance UUID from the previous page."},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"The simple tenant usage endpoints will also include the conventional \"next\""},{"line_number":178,"context_line":"links: `tenant_usages_links` in the case of `index` and `tenant_usage_links`"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a629dbe_cbe0d5cf","line":175,"in_reply_to":"9a629dbe_6adb5e7c","updated":"2016-11-13 16:14:06.000000000","message":"Done, changed sort to be by instance.project_id, followed by instance.id.","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"395460f494e38799b848689d1b76cbc45c8444de","unresolved":false,"context_lines":[{"line_number":172,"context_line":""},{"line_number":173,"context_line":"Paging is done on the inner `server_usages` list (sorted by `Instance.id ASC`)"},{"line_number":174,"context_line":"rather than by `tenant_id` in the outer `tenant_usages` list. The `marker` is"},{"line_number":175,"context_line":"the last instance UUID from the previous page."},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"The simple tenant usage endpoints will also include the conventional \"next\""},{"line_number":178,"context_line":"links: `tenant_usages_links` in the case of `index` and `tenant_usage_links`"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a629dbe_0f17c2ed","line":175,"in_reply_to":"ba5da102_0e4e3bc1","updated":"2016-11-09 13:55:39.000000000","message":"Hmm, so a good suggestion here.\n\nCould we just sort by tenant_id, then instance.id, and still use the uuid.\n\nIt means you might get three pages all for the same tenant-id, but thats better than always having mixes of random tenant-ids.","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"3424a5239f888aca0615c9b15207349bdf3253ce","unresolved":false,"context_lines":[{"line_number":172,"context_line":""},{"line_number":173,"context_line":"Paging is done on the inner `server_usages` list (sorted by `Instance.id ASC`)"},{"line_number":174,"context_line":"rather than by `tenant_id` in the outer `tenant_usages` list. The `marker` is"},{"line_number":175,"context_line":"the last instance UUID from the previous page."},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"The simple tenant usage endpoints will also include the conventional \"next\""},{"line_number":178,"context_line":"links: `tenant_usages_links` in the case of `index` and `tenant_usage_links`"}],"source_content_type":"text/x-rst","patch_set":7,"id":"ba5da102_0e4e3bc1","line":175,"in_reply_to":"ba5da102_0e771b03","updated":"2016-11-05 11:05:34.000000000","message":"the above example I wrote is for limit\u003d2...","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"44daed2e491b42317190a3d289d7c7684e04c39c","unresolved":false,"context_lines":[{"line_number":172,"context_line":""},{"line_number":173,"context_line":"Paging is done on the inner `server_usages` list (sorted by `Instance.id ASC`)"},{"line_number":174,"context_line":"rather than by `tenant_id` in the outer `tenant_usages` list. The `marker` is"},{"line_number":175,"context_line":"the last instance UUID from the previous page."},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"The simple tenant usage endpoints will also include the conventional \"next\""},{"line_number":178,"context_line":"links: `tenant_usages_links` in the case of `index` and `tenant_usage_links`"}],"source_content_type":"text/x-rst","patch_set":7,"id":"ba5da102_0e771b03","line":175,"in_reply_to":"ba5da102_e0bafd09","updated":"2016-11-05 11:03:36.000000000","message":"apologize for missing those.. yes, this answer my question. But how about we sort by the \u0027tenant_id\u0027 first, then the \u0027id\u0027. I\u0027m thinking about this case:\n\ninstance_id_1, tennat_id1\ninstance_id_2, tenant_id2\ninstance_id_3, tenant_id1\ninstance_id_4, tenant_id2 \n\nThen the api response of first page will be:\n\n{\n     \u0027tenant_usages\u0027: [\n             {\n                    \u0027tenant_id\u0027: \u0027tenant_id1\u0027\n                    \u0027server_usage\u0027: {\n                            \u0027instance_id\u0027: \u0027instance_id_1\u0027\n                     }\n              },\n              {\n                    \u0027tenant_id\u0027: \u0027tenant_id2\u0027\n                    \u0027server_usage\u0027: {\n                            \u0027instance_id\u0027: \u0027instance_id_2\u0027\n                     }\n              }\n     ]\n     \"tenant_usages_links\": .....\n}\n\n\nThen the second page also include two tenants usage.\n\nIf we sort with tenant_id first. Then the first page will only include the usage for tenant_id1.\n\nIf we think this is good idea, we need to add index for (tenant_id, id) also.\n\nAlso please correct me if i miss-understand something again.....","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"bf88c05559349d756d8f7ddb5d52ada2d62a39a3","unresolved":false,"context_lines":[{"line_number":172,"context_line":""},{"line_number":173,"context_line":"Paging is done on the inner `server_usages` list (sorted by `Instance.id ASC`)"},{"line_number":174,"context_line":"rather than by `tenant_id` in the outer `tenant_usages` list. The `marker` is"},{"line_number":175,"context_line":"the last instance UUID from the previous page."},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"The simple tenant usage endpoints will also include the conventional \"next\""},{"line_number":178,"context_line":"links: `tenant_usages_links` in the case of `index` and `tenant_usage_links`"}],"source_content_type":"text/x-rst","patch_set":7,"id":"ba5da102_e0bafd09","line":175,"in_reply_to":"ba5da102_e5ff6fa8","updated":"2016-11-04 18:59:20.000000000","message":"Yes, the results will be sorted by `id` ASC using the `sort_keys` argument to `paginate_query`:\n\n    query \u003d sqlalchemyutils.paginate_query(\n        query, models.Instance, limit, [\u0027id\u0027], marker\u003dmarker)","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"70cd6aec6d810fbd0544aa759b3e4bfcc868d214","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        ],"},{"line_number":194,"context_line":"        \"tenant_usages_links\": ["},{"line_number":195,"context_line":"            {"},{"line_number":196,"context_line":"                \"href\": \"/os-simple-tenant-usage?detailed\u003d1\u0026limit\u003d{limit}\u0026marker\u003d{marker}\","},{"line_number":197,"context_line":"                \"rel\": \"next\""},{"line_number":198,"context_line":"            }"},{"line_number":199,"context_line":"        ]"}],"source_content_type":"text/x-rst","patch_set":7,"id":"ba5da102_ca051a15","line":196,"updated":"2016-11-04 18:33:27.000000000","message":"Don\u0027t we also need to explicitly include the \"now()\" time value here, so the list says the same as you page through? Otherwise the marker is a bit meaningless?","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"e380c76fd7df88d667b18b640880ef1ff6330455","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        ],"},{"line_number":194,"context_line":"        \"tenant_usages_links\": ["},{"line_number":195,"context_line":"            {"},{"line_number":196,"context_line":"                \"href\": \"/os-simple-tenant-usage?detailed\u003d1\u0026limit\u003d{limit}\u0026marker\u003d{marker}\","},{"line_number":197,"context_line":"                \"rel\": \"next\""},{"line_number":198,"context_line":"            }"},{"line_number":199,"context_line":"        ]"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a629dbe_ebe599dc","line":196,"in_reply_to":"9a629dbe_cc85d8ad","updated":"2016-11-13 16:14:06.000000000","message":"Done. Added note clarifying that the next links need to preserve the other query parameters.","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"ebb52013e770605a11b9f07d76b08c8f251da79b","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        ],"},{"line_number":194,"context_line":"        \"tenant_usages_links\": ["},{"line_number":195,"context_line":"            {"},{"line_number":196,"context_line":"                \"href\": \"/os-simple-tenant-usage?detailed\u003d1\u0026limit\u003d{limit}\u0026marker\u003d{marker}\","},{"line_number":197,"context_line":"                \"rel\": \"next\""},{"line_number":198,"context_line":"            }"},{"line_number":199,"context_line":"        ]"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a629dbe_cc85d8ad","line":196,"in_reply_to":"ba5da102_a03645e5","updated":"2016-11-09 13:48:25.000000000","message":"OK, cool, this was my main concern.\n\nIts really a nit thats its not covered in here. Since we are all agreed, lets fix that in a follow up, if we feel thats needed.","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"bf88c05559349d756d8f7ddb5d52ada2d62a39a3","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        ],"},{"line_number":194,"context_line":"        \"tenant_usages_links\": ["},{"line_number":195,"context_line":"            {"},{"line_number":196,"context_line":"                \"href\": \"/os-simple-tenant-usage?detailed\u003d1\u0026limit\u003d{limit}\u0026marker\u003d{marker}\","},{"line_number":197,"context_line":"                \"rel\": \"next\""},{"line_number":198,"context_line":"            }"},{"line_number":199,"context_line":"        ]"}],"source_content_type":"text/x-rst","patch_set":7,"id":"ba5da102_a03645e5","line":196,"in_reply_to":"ba5da102_ca051a15","updated":"2016-11-04 18:59:20.000000000","message":"For clarify, I omitted the additional query parameters, but yes they need to be preserved.\n\nAn actual example (from the proof of concept implementation [1]) would look more like this.\n\n    \"tenant_usages_links\": [\n        {\n            \"href\": \"http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/os-simple-tenant-usage?detailed\u003d1\u0026end\u003d2016-10-12+18%3A22%3A04.868106\u0026limit\u003d1\u0026marker\u003d1f1deceb-17b5-4c04-84c7-e0d4499c8fe0\u0026start\u003d2016-10-12+18%3A22%3A04.868106\",\n            \"rel\": \"next\"\n        }\n    ]\n\n[1] https://review.openstack.org/#/c/386093/3/doc/api_samples/os-simple-tenant-usage/v2.39/simple-tenant-usage-get-detail.json","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"9ddd62e696ea27e66423a17efdfc6837d49e772f","unresolved":false,"context_lines":[{"line_number":237,"context_line":""},{"line_number":238,"context_line":"::"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    GET /os-simple-tenant-usage?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":241,"context_line":"    GET /os-simple-tenant-usage/{tenant_id}?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"Older versions of the `os-simple-tenant-usage` endpoints will not accept these"}],"source_content_type":"text/x-rst","patch_set":7,"id":"ba5da102_0c8747d8","line":240,"range":{"start_line":240,"start_character":4,"end_line":240,"end_character":68},"updated":"2016-11-04 08:34:43.000000000","message":"So this should only works with \u0027detail\u003d1\u0027, right? If the detail\u003d0, what is we expected return? return fault?","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"6289388351329524eb6493cccdc462eed35673a5","unresolved":false,"context_lines":[{"line_number":237,"context_line":""},{"line_number":238,"context_line":"::"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    GET /os-simple-tenant-usage?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":241,"context_line":"    GET /os-simple-tenant-usage/{tenant_id}?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"Older versions of the `os-simple-tenant-usage` endpoints will not accept these"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a629dbe_64dc8e46","line":240,"range":{"start_line":240,"start_character":4,"end_line":240,"end_character":68},"in_reply_to":"9a629dbe_01edceee","updated":"2016-11-11 06:31:11.000000000","message":"The case for dashboard is similar to the current dashboard after you login with admin user, and at the page Admin-\u003eSystem-\u003eOverview. In the Usage section, you will see there are a list of tenants\u0027s usage info. If only use the \u0027get\u0027, how the dashboard to know what tenant in the Nova. So it still need to use \u0027list\u0027, to list the tenants which known by Nova.","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"b69a2688eeb75e8ea83b5da3c8635f97f215327f","unresolved":false,"context_lines":[{"line_number":237,"context_line":""},{"line_number":238,"context_line":"::"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    GET /os-simple-tenant-usage?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":241,"context_line":"    GET /os-simple-tenant-usage/{tenant_id}?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"Older versions of the `os-simple-tenant-usage` endpoints will not accept these"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a629dbe_672f8cf6","line":240,"range":{"start_line":240,"start_character":4,"end_line":240,"end_character":68},"in_reply_to":"9a629dbe_11863213","updated":"2016-11-09 12:20:38.000000000","message":"@Diana, yea, that is good point. I\u0027m also think about how the dashboard can use this pagination. So the dashboard may want to implement pagination also. Each page shows 5 tenant usage. If we only sort by instance_id, the dashboard still needs to iterate all the pages from Nova API to get the first 5 tenant in the first page. So I guess that is waste, and very slow to show the web page for the end user.\n\nBut if we sort by tenant_id first, then instance_id, there still have chance one tenant may separate into different pages.\n\nSo for dashboard developer consume this API easy, how about this:\n\ntenant_1:\n     instance1 ~ instance3\ntenant_2\n     instance4 ~ instance10\n\nFor the first page \"GET /simple_tenant_usage?limit\u003d5\", the response only includes the tenant_1. The next page link\u0027s marker is instance3\u0027s id.\n\nFor the second page \"GET /simple_tenant_usage?limit\u003d5\u0026marker\u003dinstance3_id\", the response include the sum of instance4 ~ instance 9. And one more new field \u0027paged\u003dTrue\u0027 to indicate this tenant usage info is paged. For get full usage of this tenant, the api user needs to get the next page.\n\nThis makes the API consumer more easy to implement the pagination in the web page.\n\nOf course, if the user put all the instance into one tenant, that still needs to iterate all the pages.\n\nBut this maybe over complex, looking for more feedback from other reviewers.","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"0233c1a28fa76600d3660dc5e622fe80ae787f7e","unresolved":false,"context_lines":[{"line_number":237,"context_line":""},{"line_number":238,"context_line":"::"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    GET /os-simple-tenant-usage?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":241,"context_line":"    GET /os-simple-tenant-usage/{tenant_id}?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"Older versions of the `os-simple-tenant-usage` endpoints will not accept these"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a629dbe_6aff4c67","line":240,"range":{"start_line":240,"start_character":4,"end_line":240,"end_character":68},"in_reply_to":"9a629dbe_4f08da91","updated":"2016-11-09 14:35:51.000000000","message":"how about this:\n\"GET /simple_tenant_usage?limit\u003d5\"\n\n{\n    \"tenant_usages\": [\n        {\n            \"tenant_id\": \"tenant_1\",\n            ....\n            \"server_usages\": [\n                {\n                   instance_id: instance_1\n                },\n                {\n                   instance_id: instance_2\n                }\n            ]\n            links: [\n                {\n                     \"herf\": \"/simple_tenant_usage?limit\u003d5\u0026marker\u003dinstance_2\"\n                     \"ref\": \"next_tenant\"\n                }\n            ]\n        },\n        {\n            \"tenant_id\": \"tenant_2\",\n            ....\n            \"server_usages\": [\n                {\n                   {\n                   instance_id: instance_3\n                },\n                ..........\n                {\n                   instance_id: instance_5\n                }         \n            ]\n            links: [\n                {\n                     \"herf\": \"/simple_tenant_usage?limit\u003d5\u0026marker\u003dinstance_5\"\n                     \"ref\": \"next\"\n                },\n                {\n                    \"herf\": \"/simple_tenant_usage?limit\u003d5\u0026marker\u003dinstance_10\"\n                     \"ref\": \"next_tenant\"\n                }\n            ]\n        }\n    ]\n}\n\n\nFor the dashboard only show one tenant, the \"GET /simple_tenant_usage?limit\u003d5\" return tenant_1 usage and part of tenant_2 usage. The dashboard will know the tenant_1 usage is finished, due to there isn\u0027t \u0027next\u0027 link. And the dashboard can easy to build next web page link to get next tenant usage from the \u0027next_tenant\u0027 link.","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"1ab38a90cc3be72b89e78ee2fdd3d1821dde4613","unresolved":false,"context_lines":[{"line_number":237,"context_line":""},{"line_number":238,"context_line":"::"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    GET /os-simple-tenant-usage?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":241,"context_line":"    GET /os-simple-tenant-usage/{tenant_id}?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"Older versions of the `os-simple-tenant-usage` endpoints will not accept these"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a629dbe_4f08da91","line":240,"range":{"start_line":240,"start_character":4,"end_line":240,"end_character":68},"in_reply_to":"9a629dbe_672f8cf6","updated":"2016-11-09 14:00:34.000000000","message":"I think its simpler to just put the first 5, and split the tenant across two pages.\n\nMaybe we add a link in the tenant_2 pointing to the next page, so it knows there is more for that tenant on the next page?\n\nWe can leave horizon to decide how to deal with all that splitting, as makes sense for the user.","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"c1d12aae9ba3867c01141323b037fa41250c3f8a","unresolved":false,"context_lines":[{"line_number":237,"context_line":""},{"line_number":238,"context_line":"::"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    GET /os-simple-tenant-usage?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":241,"context_line":"    GET /os-simple-tenant-usage/{tenant_id}?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"Older versions of the `os-simple-tenant-usage` endpoints will not accept these"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a629dbe_01edceee","line":240,"range":{"start_line":240,"start_character":4,"end_line":240,"end_character":68},"in_reply_to":"9a629dbe_6aff4c67","updated":"2016-11-09 17:31:27.000000000","message":"If the dashboard (or any API consumer) wants easy tenant boundaries, I think they should use the os-simple-tenant-usage `get` endpoint rather than the `list` endpoint.\n\n    for tenant_id in tenants:\n        GET os-simple-tenant-usage/{tenant_id}?limit\u003d10\n        loop over the tenant-scoped next links","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"70cd6aec6d810fbd0544aa759b3e4bfcc868d214","unresolved":false,"context_lines":[{"line_number":237,"context_line":""},{"line_number":238,"context_line":"::"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    GET /os-simple-tenant-usage?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":241,"context_line":"    GET /os-simple-tenant-usage/{tenant_id}?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"Older versions of the `os-simple-tenant-usage` endpoints will not accept these"}],"source_content_type":"text/x-rst","patch_set":7,"id":"ba5da102_aa5aa64e","line":240,"range":{"start_line":240,"start_character":4,"end_line":240,"end_character":68},"in_reply_to":"ba5da102_0c8747d8","updated":"2016-11-04 18:33:27.000000000","message":"It should work, it just seems odd that you need to sum up different totals for the different tenants from different pages, but I guess thats just how this works.","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"bf88c05559349d756d8f7ddb5d52ada2d62a39a3","unresolved":false,"context_lines":[{"line_number":237,"context_line":""},{"line_number":238,"context_line":"::"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    GET /os-simple-tenant-usage?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":241,"context_line":"    GET /os-simple-tenant-usage/{tenant_id}?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"Older versions of the `os-simple-tenant-usage` endpoints will not accept these"}],"source_content_type":"text/x-rst","patch_set":7,"id":"ba5da102_c52eeba4","line":240,"range":{"start_line":240,"start_character":4,"end_line":240,"end_character":68},"in_reply_to":"ba5da102_0c8747d8","updated":"2016-11-04 18:59:20.000000000","message":"The `detailed` flag only changes what is displayed in the response (not the calulations). Regardless of the value (zero or one), only the limited number of instances will be included in the usage calculations. That is, the aggregate totals will reflect the usage summary of up to a maximum of 1000 instance per page whether the detailed `server_usages` are requested or not.","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"99eeaa470fd7000f9e600a35797770aa00701bb6","unresolved":false,"context_lines":[{"line_number":237,"context_line":""},{"line_number":238,"context_line":"::"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    GET /os-simple-tenant-usage?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":241,"context_line":"    GET /os-simple-tenant-usage/{tenant_id}?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"Older versions of the `os-simple-tenant-usage` endpoints will not accept these"}],"source_content_type":"text/x-rst","patch_set":7,"id":"ba5da102_ceda83e9","line":240,"range":{"start_line":240,"start_character":4,"end_line":240,"end_character":68},"in_reply_to":"ba5da102_ae5e2f74","updated":"2016-11-05 11:17:24.000000000","message":"After rethinking, I\u0027m ok with this also, due to think about the case detail\u003d1, it have same problem, even with sort with tenant_id first then id. So probably the API user need to care about that in their code","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"44daed2e491b42317190a3d289d7c7684e04c39c","unresolved":false,"context_lines":[{"line_number":237,"context_line":""},{"line_number":238,"context_line":"::"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    GET /os-simple-tenant-usage?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":241,"context_line":"    GET /os-simple-tenant-usage/{tenant_id}?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"Older versions of the `os-simple-tenant-usage` endpoints will not accept these"}],"source_content_type":"text/x-rst","patch_set":7,"id":"ba5da102_ae5e2f74","line":240,"range":{"start_line":240,"start_character":4,"end_line":240,"end_character":68},"in_reply_to":"ba5da102_c52eeba4","updated":"2016-11-05 11:03:36.000000000","message":"Emm...when we have the case in the previous comment.\n\nIn the first page, you will get the aggregate total for tenant_id1 and tenant_id1, but only sum with part of instances. A little strange for the user.","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"fd004f40cc47a80fee075a6d9c20da6d55214642","unresolved":false,"context_lines":[{"line_number":237,"context_line":""},{"line_number":238,"context_line":"::"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    GET /os-simple-tenant-usage?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":241,"context_line":"    GET /os-simple-tenant-usage/{tenant_id}?limit\u003d{limit}\u0026marker\u003d{instance_uuid}"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"Older versions of the `os-simple-tenant-usage` endpoints will not accept these"}],"source_content_type":"text/x-rst","patch_set":7,"id":"9a629dbe_11863213","line":240,"range":{"start_line":240,"start_character":4,"end_line":240,"end_character":68},"in_reply_to":"ba5da102_ceda83e9","updated":"2016-11-08 17:12:12.000000000","message":"Yup, I also considered sorting first by tenant id, followed by instance id, but I then I worried that API consumers might not notice that they need to stitch the totals back together if it appears to \"just work\" 95% of the time, and that they\u0027ll get caught off guard having to quickly fix their code once they finally notice rather than noticing early and doing the work up front. By \"just work\", I mean all instances for a given tenant happening to fit on the same page (like testing on devstack with only a couple of instances). Either way, API consumers are going to need to write code that loops over the next links, stitching the aggregate totals back up (if they they care about them \u0026 aren\u0027t just using the raw `server_usages`). I think it\u0027s best to not obscure that reality. But! I\u0027m still open to sorting by tenant_id; mostly just noting my original reasoning. We just need deterministic sorting: I\u0027m otherwise open to suggestions.\n\nThanks for the reviews!","commit_id":"9dbd76d48d864fc4a3dda4fdf130a49b1f5ca10b"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ad8e56bf1663d8eb28f5ba95f4986159167457db","unresolved":false,"context_lines":[{"line_number":172,"context_line":"    }"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"Paging is done on the inner `server_usages` list (sorted by"},{"line_number":175,"context_line":"`Instance.project_id ASC`, followed by `Instance.id ASC`). The `marker` is"},{"line_number":176,"context_line":"the last instance UUID from the previous page."},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"The simple tenant usage endpoints will also include the conventional \"next\""}],"source_content_type":"text/x-rst","patch_set":8,"id":"9a629dbe_0b71ede0","line":175,"updated":"2016-11-13 16:36:32.000000000","message":"Diana, I think this needs to be (instance.project_id, instance.uuid). instance.id is an autoincrementing integer that is only unique within the cell database. Also, if the output results are sorted by a field/key that the user doesn\u0027t know, they will be confused by what order the results will be in...\n\nThis likely means that we will want to add the instances.uuid column to the existing index on project_id.","commit_id":"f735cf4902eee32f76d09f249ff2294720ad61dc"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"55f96432362bf4a74ab04596c5da1627c2625123","unresolved":false,"context_lines":[{"line_number":172,"context_line":"    }"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"Paging is done on the inner `server_usages` list (sorted by"},{"line_number":175,"context_line":"`Instance.project_id ASC`, followed by `Instance.id ASC`). The `marker` is"},{"line_number":176,"context_line":"the last instance UUID from the previous page."},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"The simple tenant usage endpoints will also include the conventional \"next\""}],"source_content_type":"text/x-rst","patch_set":8,"id":"9a629dbe_81cdc788","line":175,"in_reply_to":"9a629dbe_0b71ede0","updated":"2016-11-14 13:31:55.000000000","message":"I don\u0027t think sorting by instance id (scoped by tenant) will cause confusion. To the user, it will appear as though the results are sorted by instance creation time (which they effectively are).","commit_id":"f735cf4902eee32f76d09f249ff2294720ad61dc"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"034007dd7db6624303e0679fddec4636c5bb9f36","unresolved":false,"context_lines":[{"line_number":172,"context_line":"    }"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"Paging is done on the inner `server_usages` list (sorted by"},{"line_number":175,"context_line":"`Instance.project_id ASC`, followed by `Instance.id ASC`). The `marker` is"},{"line_number":176,"context_line":"the last instance UUID from the previous page."},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"The simple tenant usage endpoints will also include the conventional \"next\""}],"source_content_type":"text/x-rst","patch_set":8,"id":"9a629dbe_76c952ac","line":175,"in_reply_to":"9a629dbe_73afa47d","updated":"2016-11-14 14:38:45.000000000","message":"Ahhhh.... True :)\n\nI\u0027m still looking into sqlalchemyutils.paginate_query and the implications of sorting by uuid where insertions don\u0027t happen at the end of the list when new instances are created, but rather randomly anywhere. I\u0027ll circle back when I know more. Thanks for pointing out the cells-gotchas; I totally didn\u0027t take those into account. \n\nPerhaps I\u0027ll just change the spec to something vague like \"sorting will be deterministic\" :)","commit_id":"f735cf4902eee32f76d09f249ff2294720ad61dc"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"0638075dc0dfa354853127c72495e847940b2242","unresolved":false,"context_lines":[{"line_number":172,"context_line":"    }"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"Paging is done on the inner `server_usages` list (sorted by"},{"line_number":175,"context_line":"`Instance.project_id ASC`, followed by `Instance.id ASC`). The `marker` is"},{"line_number":176,"context_line":"the last instance UUID from the previous page."},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"The simple tenant usage endpoints will also include the conventional \"next\""}],"source_content_type":"text/x-rst","patch_set":8,"id":"9a629dbe_48302708","line":175,"in_reply_to":"9a629dbe_76c952ac","updated":"2016-11-14 16:47:39.000000000","message":"Added to the \"data model impact\" section:\n\n\"Sorting will need to be added to the query that returns the instances in the `server_usages` list. The sort order will need to be deterministic across cell databases, and we may need to modify/add a new database index as a result.\"","commit_id":"f735cf4902eee32f76d09f249ff2294720ad61dc"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"7d517fd34516fa1b25a8dfccd8926f4e67179dc0","unresolved":false,"context_lines":[{"line_number":172,"context_line":"    }"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"Paging is done on the inner `server_usages` list (sorted by"},{"line_number":175,"context_line":"`Instance.project_id ASC`, followed by `Instance.id ASC`). The `marker` is"},{"line_number":176,"context_line":"the last instance UUID from the previous page."},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"The simple tenant usage endpoints will also include the conventional \"next\""}],"source_content_type":"text/x-rst","patch_set":8,"id":"9a629dbe_73afa47d","line":175,"in_reply_to":"9a629dbe_81cdc788","updated":"2016-11-14 14:29:10.000000000","message":"@diana_clarke: that would certainly be the case in a single cell environment. However, in a multi-cell environment, the instance IDs would be duplicative and not necessarily line up along sorted creation times.","commit_id":"f735cf4902eee32f76d09f249ff2294720ad61dc"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"70ca7ec418a30e9e71e5b2b8fd0cf72e130f1bd0","unresolved":false,"context_lines":[{"line_number":38,"context_line":"Proposed change"},{"line_number":39,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"Add an API microversion that allows for pagination of the simple tenant usage"},{"line_number":42,"context_line":"results using Nova\u0027a existing approach to pagination (optional `limit` and"},{"line_number":43,"context_line":"`marker` query parameters)."},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"Pagination would be made available for both the \"all tenants\" (`index`) and"},{"line_number":46,"context_line":"\"specific tenant\" (`show`) cases."}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_d02a447e","line":43,"range":{"start_line":41,"start_character":0,"end_line":43,"end_character":27},"updated":"2016-11-14 20:39:54.000000000","message":"what is being counted towards the limit? Your examples show that the marker is an instance_uuid, so I\u0027m assuming that limit\u003d10 means only return info for 10 instances.\n\nIf that is the case, what is the expected behavior if tenant A has 15 instances? Will the first page show the first 10? And what will be reported in total_hours? Just the sum of those first 10? Or the total hours for that tenant?","commit_id":"52b64319250e7a1498bb85c459cd24fb0960dd40"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"bd127696f67b1638ebf3dc114b7aa64425f1e510","unresolved":false,"context_lines":[{"line_number":38,"context_line":"Proposed change"},{"line_number":39,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"Add an API microversion that allows for pagination of the simple tenant usage"},{"line_number":42,"context_line":"results using Nova\u0027a existing approach to pagination (optional `limit` and"},{"line_number":43,"context_line":"`marker` query parameters)."},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"Pagination would be made available for both the \"all tenants\" (`index`) and"},{"line_number":46,"context_line":"\"specific tenant\" (`show`) cases."}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_9806271f","line":43,"range":{"start_line":41,"start_character":0,"end_line":43,"end_character":27},"in_reply_to":"7a77a97e_704970d0","updated":"2016-11-15 04:41:54.000000000","message":"OK, then spell that out and I\u0027m +1 on this.","commit_id":"52b64319250e7a1498bb85c459cd24fb0960dd40"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"a03b9024debe7fd9b0d7261aedecee77cef9d1fd","unresolved":false,"context_lines":[{"line_number":38,"context_line":"Proposed change"},{"line_number":39,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"Add an API microversion that allows for pagination of the simple tenant usage"},{"line_number":42,"context_line":"results using Nova\u0027a existing approach to pagination (optional `limit` and"},{"line_number":43,"context_line":"`marker` query parameters)."},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"Pagination would be made available for both the \"all tenants\" (`index`) and"},{"line_number":46,"context_line":"\"specific tenant\" (`show`) cases."}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_c6ad0333","line":43,"range":{"start_line":41,"start_character":0,"end_line":43,"end_character":27},"in_reply_to":"7a77a97e_9806271f","updated":"2016-11-15 15:53:23.000000000","message":"Done. I added the following to the example response later on in the spec.\n\n\"Note that the totals on the first page of results only reflect 2 of the 3 instances for tenant-uuid-1, and that the tenant-uuid-1 totals on the second page of results only reflect the remaining instance for tenant-uuid-1. API consumers would need to manually add these totals back up if they want the totals to reflect all 3 instances for tenant-uuid-1.\"","commit_id":"52b64319250e7a1498bb85c459cd24fb0960dd40"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"e96a2f87d9609b1f66dc8e03169bd2c488129547","unresolved":false,"context_lines":[{"line_number":38,"context_line":"Proposed change"},{"line_number":39,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"Add an API microversion that allows for pagination of the simple tenant usage"},{"line_number":42,"context_line":"results using Nova\u0027a existing approach to pagination (optional `limit` and"},{"line_number":43,"context_line":"`marker` query parameters)."},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"Pagination would be made available for both the \"all tenants\" (`index`) and"},{"line_number":46,"context_line":"\"specific tenant\" (`show`) cases."}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_704970d0","line":43,"range":{"start_line":41,"start_character":0,"end_line":43,"end_character":27},"in_reply_to":"7a77a97e_d02a447e","updated":"2016-11-14 21:00:57.000000000","message":"Yes, the limit applies to the number of instances used to calculate the totals. On page 1, you would see a summary for the first 10 instances, and on page 2 you would see the totals for the remaining 5 instances. If you wants totals for all 15 instances, you would need to add those totals back up in the consumer code.","commit_id":"52b64319250e7a1498bb85c459cd24fb0960dd40"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"70ca7ec418a30e9e71e5b2b8fd0cf72e130f1bd0","unresolved":false,"context_lines":[{"line_number":57,"context_line":"`total_hours`) which is the sum of the `hours` for each instance in a"},{"line_number":58,"context_line":"specific time window, grouped by tenant."},{"line_number":59,"context_line":""},{"line_number":60,"context_line":".. note:: For clarify, I\u0027ve removed all other usage response fields from the"},{"line_number":61,"context_line":"          examples."},{"line_number":62,"context_line":""},{"line_number":63,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_258978cb","line":60,"range":{"start_line":60,"start_character":14,"end_line":60,"end_character":21},"updated":"2016-11-14 20:39:54.000000000","message":"s/clarify/clarity","commit_id":"52b64319250e7a1498bb85c459cd24fb0960dd40"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"e96a2f87d9609b1f66dc8e03169bd2c488129547","unresolved":false,"context_lines":[{"line_number":57,"context_line":"`total_hours`) which is the sum of the `hours` for each instance in a"},{"line_number":58,"context_line":"specific time window, grouped by tenant."},{"line_number":59,"context_line":""},{"line_number":60,"context_line":".. note:: For clarify, I\u0027ve removed all other usage response fields from the"},{"line_number":61,"context_line":"          examples."},{"line_number":62,"context_line":""},{"line_number":63,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_90460cbe","line":60,"range":{"start_line":60,"start_character":14,"end_line":60,"end_character":21},"in_reply_to":"7a77a97e_258978cb","updated":"2016-11-14 21:00:57.000000000","message":"Done","commit_id":"52b64319250e7a1498bb85c459cd24fb0960dd40"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"70ca7ec418a30e9e71e5b2b8fd0cf72e130f1bd0","unresolved":false,"context_lines":[{"line_number":218,"context_line":"    }"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":""},{"line_number":221,"context_line":".. note:: For clarify, I omitted the additional query parameters (like start"},{"line_number":222,"context_line":"          \u0026 end) from the next links, but they need to be preserved. An actual"},{"line_number":223,"context_line":"          next link would look more like this."},{"line_number":224,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_a5490891","line":221,"range":{"start_line":221,"start_character":14,"end_line":221,"end_character":21},"updated":"2016-11-14 20:39:54.000000000","message":"s/clarify/clarity","commit_id":"52b64319250e7a1498bb85c459cd24fb0960dd40"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"e96a2f87d9609b1f66dc8e03169bd2c488129547","unresolved":false,"context_lines":[{"line_number":218,"context_line":"    }"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":""},{"line_number":221,"context_line":".. note:: For clarify, I omitted the additional query parameters (like start"},{"line_number":222,"context_line":"          \u0026 end) from the next links, but they need to be preserved. An actual"},{"line_number":223,"context_line":"          next link would look more like this."},{"line_number":224,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"7a77a97e_d016c4a6","line":221,"range":{"start_line":221,"start_character":14,"end_line":221,"end_character":21},"in_reply_to":"7a77a97e_a5490891","updated":"2016-11-14 21:00:57.000000000","message":"Done","commit_id":"52b64319250e7a1498bb85c459cd24fb0960dd40"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"7b5c5b063c9a9a4e67a853541af76365aaa2ec05","unresolved":false,"context_lines":[{"line_number":313,"context_line":"----------"},{"line_number":314,"context_line":""},{"line_number":315,"context_line":"- Create a new API microversion for simple tenant usage pagination."},{"line_number":316,"context_line":"- Update python-novaclient to be able to take advantage of these changes."},{"line_number":317,"context_line":"- Communicate these changes to the Horizon team."},{"line_number":318,"context_line":""},{"line_number":319,"context_line":""}],"source_content_type":"text/x-rst","patch_set":10,"id":"7a77a97e_82e7973f","line":316,"range":{"start_line":316,"start_character":9,"end_line":316,"end_character":26},"updated":"2016-11-15 01:36:28.000000000","message":"Hmmm... it just occurred to me that I\u0027ll have to update python-openstackclient too, correct?\n\nhttps://github.com/openstack/python-openstackclient/blob/master/openstackclient/compute/v2/usage.py","commit_id":"ec7308f288b2f6190e813bf17fea39c2565eea53"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"db07342873740e29e0071af07b7e96369fa4194e","unresolved":false,"context_lines":[{"line_number":139,"context_line":"        ],"},{"line_number":140,"context_line":"        \"tenant_usages_links\": ["},{"line_number":141,"context_line":"            {"},{"line_number":142,"context_line":"                \"href\": \"/os-simple-tenant-usage?detailed\u003d1\u0026limit\u003d2\u0026marker\u003dinstance-uuid-2\","},{"line_number":143,"context_line":"                \"rel\": \"next\""},{"line_number":144,"context_line":"            }"},{"line_number":145,"context_line":"        ]"}],"source_content_type":"text/x-rst","patch_set":11,"id":"7a77a97e_50ea4a10","line":142,"updated":"2016-11-16 17:46:21.000000000","message":"That makes me wonder how that could hit the cellsv2 world where we would then squash all the instances coming from various cells, but I guess it\u0027s not a rationale for that spec here.","commit_id":"5e10df903dbdebf9dab227a8bce6e60575298ac8"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f5e34023614e8d1994de7dc19911f9559d5498e7","unresolved":false,"context_lines":[{"line_number":139,"context_line":"        ],"},{"line_number":140,"context_line":"        \"tenant_usages_links\": ["},{"line_number":141,"context_line":"            {"},{"line_number":142,"context_line":"                \"href\": \"/os-simple-tenant-usage?detailed\u003d1\u0026limit\u003d2\u0026marker\u003dinstance-uuid-2\","},{"line_number":143,"context_line":"                \"rel\": \"next\""},{"line_number":144,"context_line":"            }"},{"line_number":145,"context_line":"        ]"}],"source_content_type":"text/x-rst","patch_set":11,"id":"7a77a97e_0daec997","line":142,"in_reply_to":"7a77a97e_50ea4a10","updated":"2016-11-17 15:22:58.000000000","message":"If it\u0027s a link we can change this later to include more information for ourselves to continue the iteration I think.","commit_id":"5e10df903dbdebf9dab227a8bce6e60575298ac8"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"db07342873740e29e0071af07b7e96369fa4194e","unresolved":false,"context_lines":[{"line_number":319,"context_line":""},{"line_number":320,"context_line":"- Create a new API microversion for simple tenant usage pagination."},{"line_number":321,"context_line":"- Update python-novaclient to be able to take advantage of these changes."},{"line_number":322,"context_line":"- Communicate these changes to the Horizon team."},{"line_number":323,"context_line":""},{"line_number":324,"context_line":""},{"line_number":325,"context_line":"Dependencies"}],"source_content_type":"text/x-rst","patch_set":11,"id":"7a77a97e_f03d16bc","line":322,"updated":"2016-11-16 17:46:21.000000000","message":"Not sure that\u0027s really a work item but whatever...","commit_id":"5e10df903dbdebf9dab227a8bce6e60575298ac8"},{"author":{"_account_id":16907,"name":"Diana Clarke","email":"diana.joan.clarke@gmail.com","username":"diana-clarke"},"change_message_id":"7b9bfb11c0b1533182987e7012f191f23bea1bd6","unresolved":false,"context_lines":[{"line_number":319,"context_line":""},{"line_number":320,"context_line":"- Create a new API microversion for simple tenant usage pagination."},{"line_number":321,"context_line":"- Update python-novaclient to be able to take advantage of these changes."},{"line_number":322,"context_line":"- Communicate these changes to the Horizon team."},{"line_number":323,"context_line":""},{"line_number":324,"context_line":""},{"line_number":325,"context_line":"Dependencies"}],"source_content_type":"text/x-rst","patch_set":11,"id":"7a77a97e_f09fd64d","line":322,"in_reply_to":"7a77a97e_f03d16bc","updated":"2016-11-16 17:59:33.000000000","message":"Cross team collaboration for the win!\n\nI am actively working with 2 developers on the horizon team for a horizon usage POC. As first consumers of these API changes, I think it\u0027s a useful exercise to gather their feedback and adjust accordingly (if possible).\n\nI realize this is still not the ideal solution from the Horizon point of view, but I do think cross team collaboration on this intermediate step can result in improvements for both Nova \u0026 Horizon.","commit_id":"5e10df903dbdebf9dab227a8bce6e60575298ac8"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f5e34023614e8d1994de7dc19911f9559d5498e7","unresolved":false,"context_lines":[{"line_number":319,"context_line":""},{"line_number":320,"context_line":"- Create a new API microversion for simple tenant usage pagination."},{"line_number":321,"context_line":"- Update python-novaclient to be able to take advantage of these changes."},{"line_number":322,"context_line":"- Communicate these changes to the Horizon team."},{"line_number":323,"context_line":""},{"line_number":324,"context_line":""},{"line_number":325,"context_line":"Dependencies"}],"source_content_type":"text/x-rst","patch_set":11,"id":"7a77a97e_cd7f71de","line":322,"in_reply_to":"7a77a97e_f09fd64d","updated":"2016-11-17 15:22:58.000000000","message":"The (valid) point is that this isn\u0027t really what we would normally have as a work item in here. This item will not turn into a patch or series.","commit_id":"5e10df903dbdebf9dab227a8bce6e60575298ac8"}]}
