)]}'
{"doc/source/searchlightapi.rst":[{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"7fc77a0d909abf4516e8ee3fc59189bedc5bb36a","unresolved":false,"context_lines":[{"line_number":194,"context_line":"subtle differences, but some common examples are shown here."},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"Restricting document index or type"},{"line_number":197,"context_line":"**********************************"},{"line_number":198,"context_line":"To restrict a query to Glance image and metadef information only (both"},{"line_number":199,"context_line":"``index`` and ``type`` can be arrays or a single string)::"},{"line_number":200,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"1a4dcd0f_a63f2cd5","line":197,"updated":"2015-08-05 04:57:40.000000000","message":"I think the title of this section should be Restricting Resource Types","commit_id":"bddf58eb78b510da50e9101c1873a185f3df53ff"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"144afa5fd2578ad8c896109595a97da9607ec579","unresolved":false,"context_lines":[{"line_number":194,"context_line":"subtle differences, but some common examples are shown here."},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"Restricting document index or type"},{"line_number":197,"context_line":"**********************************"},{"line_number":198,"context_line":"To restrict a query to Glance image and metadef information only (both"},{"line_number":199,"context_line":"``index`` and ``type`` can be arrays or a single string)::"},{"line_number":200,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"1a4dcd0f_8ed955f5","line":197,"in_reply_to":"1a4dcd0f_a63f2cd5","updated":"2015-08-07 14:41:50.000000000","message":"Agreed, will do","commit_id":"bddf58eb78b510da50e9101c1873a185f3df53ff"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"7fc77a0d909abf4516e8ee3fc59189bedc5bb36a","unresolved":false,"context_lines":[{"line_number":202,"context_line":"        \"query\": {"},{"line_number":203,"context_line":"            \"match_all\": {}"},{"line_number":204,"context_line":"        },"},{"line_number":205,"context_line":"        \"resource_type\": [\"OS::Glance::Image\", \"OS::Glance::Metadefs\"]"},{"line_number":206,"context_line":"    }"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"If ``index`` or ``type`` are not provided they will default to covering as"}],"source_content_type":"text/x-rst","patch_set":1,"id":"1a4dcd0f_863c70e3","line":205,"updated":"2015-08-05 04:57:40.000000000","message":"Just realizing that this change will make some of the ease of testing queries more difficult. The reason I say this is that I have several time switched from the sense UI to our REST API, copy pasting queries and it was rather helpful to be able to do that.  Given that this is still possible as long as I add the resource_type field when hitting searchlight.\n\nAlso, we may find that there are existing ES UI\u0027s / tools that will mostly work sitting on top of searchlight (just would need to add a token).\n\nAll of that said, I do continue to think that an abstraction over the underlying structure will be beneficial to our API stability over time. But there is some other weirdness here that happens.\n\nIf I do a search like this:\n\n{\n    \"index_name\": \"glance\",\n    \"type\": \"image\",\n      \"query\": {\n        \"match_all\": {}\n      },\n    \"limit\": 1000\n}\n\nThis actually results in me getting results for metadefs, images, etc, because the code in here will think there are no resource_type (s) in the search request and then will add back in all the indexes and types in the request it makes.  \n\nSo, let\u0027s talk about how to best handle that.  My first inclination is that either we pass it through OR we have to also look for those fields and backwards match them to the resource type (reverse lookup on index and type).","commit_id":"bddf58eb78b510da50e9101c1873a185f3df53ff"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"144afa5fd2578ad8c896109595a97da9607ec579","unresolved":false,"context_lines":[{"line_number":202,"context_line":"        \"query\": {"},{"line_number":203,"context_line":"            \"match_all\": {}"},{"line_number":204,"context_line":"        },"},{"line_number":205,"context_line":"        \"resource_type\": [\"OS::Glance::Image\", \"OS::Glance::Metadefs\"]"},{"line_number":206,"context_line":"    }"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"If ``index`` or ``type`` are not provided they will default to covering as"}],"source_content_type":"text/x-rst","patch_set":1,"id":"1a4dcd0f_8e94f58a","line":205,"in_reply_to":"1a4dcd0f_863c70e3","updated":"2015-08-07 14:41:50.000000000","message":"Yeah, this is an issue - i think allowing both makes sense. We\u0027re not really trying to abstract, and allowing the enabled_plugins endpoint to do the discovery allows configurable settings.\n\nWe need to define rules on what the results of combinations are. Currently, if doctype names overlap you can\u0027t easily ask for specific resources. Expanding resource_type to index,type would at least give the same behavior as now.","commit_id":"bddf58eb78b510da50e9101c1873a185f3df53ff"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"7fc77a0d909abf4516e8ee3fc59189bedc5bb36a","unresolved":false,"context_lines":[{"line_number":204,"context_line":"        },"},{"line_number":205,"context_line":"        \"resource_type\": [\"OS::Glance::Image\", \"OS::Glance::Metadefs\"]"},{"line_number":206,"context_line":"    }"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"If ``index`` or ``type`` are not provided they will default to covering as"},{"line_number":209,"context_line":"wide a range of results as possible."},{"line_number":210,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"1a4dcd0f_d1bd5069","line":207,"updated":"2015-08-05 04:57:40.000000000","message":"One side effect to this is that a search across types is no longer directly identifiable in the results.  For example, a match all will return results across resource types and the _type field will be the internal type, not our resource type.\n\n\"_type\": \"metadef\",\n\"_type\": \"image\",\n\nI cringe heavily at the idea of processing all results on the way out just to add that information.  Is this something we should be adding in the document metadata at indexing time?","commit_id":"bddf58eb78b510da50e9101c1873a185f3df53ff"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"144afa5fd2578ad8c896109595a97da9607ec579","unresolved":false,"context_lines":[{"line_number":204,"context_line":"        },"},{"line_number":205,"context_line":"        \"resource_type\": [\"OS::Glance::Image\", \"OS::Glance::Metadefs\"]"},{"line_number":206,"context_line":"    }"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"If ``index`` or ``type`` are not provided they will default to covering as"},{"line_number":209,"context_line":"wide a range of results as possible."},{"line_number":210,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"1a4dcd0f_4e702d40","line":207,"in_reply_to":"1a4dcd0f_d1bd5069","updated":"2015-08-07 14:41:50.000000000","message":"Yeah, i\u0027d had the same thought. I don\u0027t believe you can add document metadata (i.e. alongisde _type and _id) but we can add a field to _source representing it. I\u0027ll have a rummage to see if there\u0027s a better solution.","commit_id":"bddf58eb78b510da50e9101c1873a185f3df53ff"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"7fc77a0d909abf4516e8ee3fc59189bedc5bb36a","unresolved":false,"context_lines":[{"line_number":206,"context_line":"    }"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"If ``index`` or ``type`` are not provided they will default to covering as"},{"line_number":209,"context_line":"wide a range of results as possible."},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"Retrieving an item by id"},{"line_number":212,"context_line":"************************"}],"source_content_type":"text/x-rst","patch_set":1,"id":"1a4dcd0f_662284bb","line":209,"updated":"2015-08-05 04:57:40.000000000","message":"Should say \"resource_type\"","commit_id":"bddf58eb78b510da50e9101c1873a185f3df53ff"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"3e5ce720d03064b8453faa9867cd7a68cd671648","unresolved":false,"context_lines":[{"line_number":51,"context_line":"Document access is defined by each document type, for instance:"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"* If the current user is the resource owner OR"},{"line_number":54,"context_line":"* If the resource is marked public"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"Some resources may have additional rules. Administrators have access to all resources."},{"line_number":57,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"fa1b9901_9a42943d","line":54,"updated":"2015-08-19 00:39:56.000000000","message":"This line is actually only specific to images and metadefs. Other resource types may not have the same notion as of visibility or public.  I\u0027d probably say,\n\n for example, with images and metadefs:","commit_id":"85f9ed827dee2005af2139a59c9c3562c34f1043"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"eac008d9b60dc86aa028ba2fc24c3cc82b6a260e","unresolved":false,"context_lines":[{"line_number":51,"context_line":"Document access is defined by each document type, for instance:"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"* If the current user is the resource owner OR"},{"line_number":54,"context_line":"* If the resource is marked public"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"Some resources may have additional rules. Administrators have access to all resources."},{"line_number":57,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"fa1b9901_be2f2187","line":54,"in_reply_to":"fa1b9901_9a42943d","updated":"2015-08-19 16:02:01.000000000","message":"Done","commit_id":"85f9ed827dee2005af2139a59c9c3562c34f1043"},{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"3e5ce720d03064b8453faa9867cd7a68cd671648","unresolved":false,"context_lines":[{"line_number":90,"context_line":"all indexed Glance images in Elasticsearch (assuming a server running on"},{"line_number":91,"context_line":"localhost) would therefore be a request such as::"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    curl http://localhost:9200/glance/OS::Glance::Image/_search"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"Running a search"},{"line_number":96,"context_line":"~~~~~~~~~~~~~~~~"}],"source_content_type":"text/x-rst","patch_set":3,"id":"fa1b9901_7ae30034","line":93,"updated":"2015-08-19 00:39:56.000000000","message":"The example URL is ES example URL, not a searchlight URL.  This is a little unclear since the above example is searchlight.  Maybe just clarify that slightly.","commit_id":"85f9ed827dee2005af2139a59c9c3562c34f1043"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"eac008d9b60dc86aa028ba2fc24c3cc82b6a260e","unresolved":false,"context_lines":[{"line_number":90,"context_line":"all indexed Glance images in Elasticsearch (assuming a server running on"},{"line_number":91,"context_line":"localhost) would therefore be a request such as::"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    curl http://localhost:9200/glance/OS::Glance::Image/_search"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"Running a search"},{"line_number":96,"context_line":"~~~~~~~~~~~~~~~~"}],"source_content_type":"text/x-rst","patch_set":3,"id":"fa1b9901_1e55edf8","line":93,"in_reply_to":"fa1b9901_7ae30034","updated":"2015-08-19 16:02:01.000000000","message":"Done","commit_id":"85f9ed827dee2005af2139a59c9c3562c34f1043"}],"searchlight/api/v1/search.py":[{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"7fc77a0d909abf4516e8ee3fc59189bedc5bb36a","unresolved":false,"context_lines":[{"line_number":270,"context_line":"                    LOG.error(_LE(\"Failed to retrieve RBAC filters \""},{"line_number":271,"context_line":"                                  \"from search plugin \""},{"line_number":272,"context_line":"                                  \"%(ext)s: %(e)s\") %"},{"line_number":273,"context_line":"                              {\u0027ext\u0027: plugin.name, \u0027e\u0027: e})"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"                if resource_type in resource_types:"},{"line_number":276,"context_line":"                    filter_query \u003d {"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_d1d1d058","line":273,"updated":"2015-08-05 04:57:40.000000000","message":"I know this isn\u0027t your patch, but now I\u0027m really wondering why we only log this error.  If there is an exception getting the RBAC filter, I\u0027d think this should fail or am I missing something?","commit_id":"bddf58eb78b510da50e9101c1873a185f3df53ff"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"144afa5fd2578ad8c896109595a97da9607ec579","unresolved":false,"context_lines":[{"line_number":270,"context_line":"                    LOG.error(_LE(\"Failed to retrieve RBAC filters \""},{"line_number":271,"context_line":"                                  \"from search plugin \""},{"line_number":272,"context_line":"                                  \"%(ext)s: %(e)s\") %"},{"line_number":273,"context_line":"                              {\u0027ext\u0027: plugin.name, \u0027e\u0027: e})"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"                if resource_type in resource_types:"},{"line_number":276,"context_line":"                    filter_query \u003d {"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_8e52b565","line":273,"in_reply_to":"1a4dcd0f_d1d1d058","updated":"2015-08-07 14:41:50.000000000","message":"No, I think it should fail. Error handling\u0027s a bit strange in some other places too.","commit_id":"bddf58eb78b510da50e9101c1873a185f3df53ff"}],"searchlight/elasticsearch/plugins/glance/images.py":[{"author":{"_account_id":8959,"name":"Lakshmi N Sampath","email":"lakshmi.sampath@hp.com","username":"lakshmi"},"change_message_id":"b6c270b7dadff03423f23159f0b3d9c9ade90899","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def get_index_name(self):"},{"line_number":37,"context_line":"        \"\"\"Index will be configurable.\"\"\""},{"line_number":38,"context_line":"        return \u0027glance\u0027"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def get_document_type(self):"},{"line_number":41,"context_line":"        return \u0027OS::Glance::Image\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a4dcd0f_329fc851","line":38,"updated":"2015-08-11 10:57:32.000000000","message":"Since the objective is to not allow the plugin developer to directly define the index name, the developer should not be allowed to provide an index name but instead derived/mapped from resource_type below","commit_id":"8c261810f723891a4511830449530e842c10afbd"},{"author":{"_account_id":8959,"name":"Lakshmi N Sampath","email":"lakshmi.sampath@hp.com","username":"lakshmi"},"change_message_id":"b6c270b7dadff03423f23159f0b3d9c9ade90899","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        return \u0027glance\u0027"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def get_document_type(self):"},{"line_number":41,"context_line":"        return \u0027OS::Glance::Image\u0027"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    def get_mapping(self):"},{"line_number":44,"context_line":"        return {"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a4dcd0f_72a2304d","line":41,"updated":"2015-08-11 10:57:32.000000000","message":"More meaningful name for this method could be get_resource_type.\nWe could extract the index/doc_type strings from this resource_type itself as \"OS::Glance\" for index and \"Image\" for doc_type or provide some internal mapping.","commit_id":"8c261810f723891a4511830449530e842c10afbd"},{"author":{"_account_id":8959,"name":"Lakshmi N Sampath","email":"lakshmi.sampath@hp.com","username":"lakshmi"},"change_message_id":"b6c270b7dadff03423f23159f0b3d9c9ade90899","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                        ]"},{"line_number":90,"context_line":"                    },"},{"line_number":91,"context_line":"                    {"},{"line_number":92,"context_line":"                        \u0027type\u0027: {"},{"line_number":93,"context_line":"                            \u0027value\u0027: self.get_document_type()"},{"line_number":94,"context_line":"                        }"},{"line_number":95,"context_line":"                    },"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a4dcd0f_9d77cd9e","line":92,"updated":"2015-08-11 10:57:32.000000000","message":"Plugin developer would still need to know the index name and doc_type associated with plugin which could be set by plugin manager on load with set_document_type() and set_index_name() methods based on how its mapped internal to the ES system.","commit_id":"8c261810f723891a4511830449530e842c10afbd"}],"searchlight/elasticsearch/plugins/glance/metadefs.py":[{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"7fc77a0d909abf4516e8ee3fc59189bedc5bb36a","unresolved":false,"context_lines":[{"line_number":25,"context_line":"        super(MetadefIndex, self).__init__()"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    def get_resource_type(self):"},{"line_number":28,"context_line":"        return \u0027OS::Glance::Metadefs\u0027"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def get_index_name(self):"},{"line_number":31,"context_line":"        return \u0027glance\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_91dee83d","line":28,"updated":"2015-08-05 04:57:40.000000000","message":"All the existing heat resource types are singular.  So this should be OS::Glance::Metadef","commit_id":"bddf58eb78b510da50e9101c1873a185f3df53ff"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"144afa5fd2578ad8c896109595a97da9607ec579","unresolved":false,"context_lines":[{"line_number":25,"context_line":"        super(MetadefIndex, self).__init__()"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    def get_resource_type(self):"},{"line_number":28,"context_line":"        return \u0027OS::Glance::Metadefs\u0027"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def get_index_name(self):"},{"line_number":31,"context_line":"        return \u0027glance\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_6e616904","line":28,"in_reply_to":"1a4dcd0f_91dee83d","updated":"2015-08-07 14:41:50.000000000","message":"Agreed, not sure why i did that","commit_id":"bddf58eb78b510da50e9101c1873a185f3df53ff"}],"searchlight/tests/unit/test_glance_metadefs_plugin.py":[{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"7fc77a0d909abf4516e8ee3fc59189bedc5bb36a","unresolved":false,"context_lines":[{"line_number":250,"context_line":"        self.assertEqual(\u0027metadef\u0027, self.plugin.get_document_type())"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"    def test_resource_type(self):"},{"line_number":253,"context_line":"        self.assertEqual(\u0027OS::Glance::Metadefs\u0027,"},{"line_number":254,"context_line":"                         self.plugin.get_resource_type())"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"    def test_complex_serialize(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_d1bb10e4","line":253,"updated":"2015-08-05 04:57:40.000000000","message":"Metadef","commit_id":"bddf58eb78b510da50e9101c1873a185f3df53ff"}],"searchlight/tests/unit/v1/test_search.py":[{"author":{"_account_id":7665,"name":"Travis Tripp","email":"os.travis.tripp@gmail.com","username":"travis.tripp"},"change_message_id":"7fc77a0d909abf4516e8ee3fc59189bedc5bb36a","unresolved":false,"context_lines":[{"line_number":277,"context_line":"        expected \u003d {"},{"line_number":278,"context_line":"            \"plugins\": ["},{"line_number":279,"context_line":"                {\"resource_type\": \"OS::Glance::Image\"},"},{"line_number":280,"context_line":"                {\"resource_type\": \"OS::Glance::Metadefs\"}"},{"line_number":281,"context_line":"            ]"},{"line_number":282,"context_line":"        }"},{"line_number":283,"context_line":"        self.assertEqual(expected,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_91834804","line":280,"updated":"2015-08-05 04:57:40.000000000","message":"Metadef","commit_id":"bddf58eb78b510da50e9101c1873a185f3df53ff"}]}
