https://issues.rudder.io/https://issues.rudder.io/themes/rudder7/favicon/favicon.ico?17096450182015-02-03T09:20:21ZIssue TrackerRudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=358852015-02-03T09:20:21ZFrançois ARMANDfrancois.armand@rudder.io
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/35885/diff?detail_id=44122">diff</a>)</li></ul><p>The json structure is organized like that:</p>
<pre><code>"select" : mandatory value, "node" or "nodeAndPolicyServer" <br /> "composition": either "and" or "or". Optionnal, default to "and" <br /> "where": an array of json objects composed of:<br /> "objectType": the kind of object to look for. They are all defined in <a class="external" href="https://github.com/Normation/rudder/blob/branches/rudder/3.0/rudder-core/src/main/scala/com/normation/rudder/domain/queries/DitQueryData.scala">https://github.com/Normation/rudder/blob/branches/rudder/3.0/rudder-core/src/main/scala/com/normation/rudder/domain/queries/DitQueryData.scala</a> around line #280 (def objectTypes = Map... ). Some interesting ones:<br /> node : for all the OS, RAM, etc<br /> environmentVariable<br /> software<br /> "attribute": the name of the attribute to lookup for the given object. The possible names are defined in DitQueryData to: it's the huge list of "ObjectCriterion". Problem: most use name defined elsewhere in the form of "A_OS_VERSION" etc. The name are defined in one the two files:<br /> <a class="external" href="https://github.com/Normation/ldap-inventory/blob/branches/rudder/3.0/inventory-repository/src/main/scala/com/normation/inventory/ldap/core/LDAPConstants.scala">https://github.com/Normation/ldap-inventory/blob/branches/rudder/3.0/inventory-repository/src/main/scala/com/normation/inventory/ldap/core/LDAPConstants.scala</a><br /> <a class="external" href="https://github.com/Normation/rudder/blob/branches/rudder/3.0/rudder-core/src/main/scala/com/normation/rudder/domain/RudderLDAPConstants.scala">https://github.com/Normation/rudder/blob/branches/rudder/3.0/rudder-core/src/main/scala/com/normation/rudder/domain/RudderLDAPConstants.scala</a><br /> "comparator": the kind of comparator to use:<br /> exits / notExists: only check the presence of that kind of attribute for the object in the node<br /> eq: equals<br /> notEq: not equals<br /> gt / gteq: greater than / greater or equals<br /> lt / lteq : lesser than / lesser or equals<br /> regex: match the given pattern. The authorized regex are the Java one, as defined in <a class="external" href="http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html">http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html</a><br /> notRegex : all entries not matching the given regex<br /> and there is a special syntax for key=value objects, like "environmentVariable". For them, you use the attribute "name.value", the comparator to use, with a new one:<br /> hasKey: to only check for the key part equals the given value<br /> else, the comparison is done on "key=value", and you can do almost anything with regex<br /> Ex: {"select":"nodeAndPolicyServer","composition":"And","where":[{"objectType":"environmentVariable","attribute":"name.value","comparator":"regex","value":".*NAME=r[o]{2}t"}]}</code></pre>
<p>There is example in the tests for query:<br /><a class="external" href="https://github.com/Normation/rudder/blob/branches/rudder/3.0/rudder-core/src/test/scala/com/normation/rudder/services/queries/TestJsonQueryLexing.scala">https://github.com/Normation/rudder/blob/branches/rudder/3.0/rudder-core/src/test/scala/com/normation/rudder/services/queries/TestJsonQueryLexing.scala</a><br /><a class="external" href="https://github.com/Normation/rudder/blob/branches/rudder/3.0/rudder-core/src/test/scala/com/normation/rudder/services/queries/TestQueryProcessor.scala">https://github.com/Normation/rudder/blob/branches/rudder/3.0/rudder-core/src/test/scala/com/normation/rudder/services/queries/TestQueryProcessor.scala</a></p>
<p>So, if you read until hear, you now see that the current format is quite ad-hoc - or more preciselly, it reflects far to much the underlying storage format.<br />A more versatile version is think about, based on the JSON format of the node details returned by the API and a XPATH kind of query. But well, it's not for now, and the current language is already in the nature, so it will be supported :)<br />At least, in 3.1 we are going to try to normalize object and attribute names so that they match the names in the node details returned by the API.</p> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=362132015-02-05T16:37:44ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>2.10.10</i> to <i>2.10.11</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=370502015-03-05T20:50:25ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>2.10.11</i> to <i>2.10.12</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=390872015-03-16T12:03:19ZFrançois ARMANDfrancois.armand@rudder.io
<ul><li><strong>Category</strong> changed from <i>API</i> to <i>Documentation</i></li><li><strong>Reproduced</strong> set to <i>No</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=392302015-03-19T17:33:22ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>2.10.12</i> to <i>2.10.13</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=406322015-04-10T08:19:04ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>2.10.13</i> to <i>2.10.14</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=417152015-05-19T10:01:27ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>2.10.14</i> to <i>2.10.15</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=437412015-07-07T20:28:26ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>2.10.15</i> to <i>2.10.16</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=446152015-08-12T08:42:04ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>2.10.16</i> to <i>2.10.17</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=458372015-09-22T12:21:29ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>2.10.17</i> to <i>2.10.18</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=466352015-10-16T12:59:11ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>2.10.18</i> to <i>2.10.19</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=471922015-10-27T14:44:06ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>2.10.19</i> to <i>2.10.20</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=491642015-12-09T15:55:49ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>2.10.20</i> to <i>277</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=493612015-12-09T15:57:09ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>277</i> to <i>2.11.18</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=511522016-01-20T22:33:08ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>2.11.18</i> to <i>2.11.19</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=523622016-03-01T14:44:39ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>2.11.19</i> to <i>2.11.20</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=537192016-04-08T14:50:51ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>2.11.20</i> to <i>2.11.21</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=553022016-05-24T21:48:16ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>2.11.21</i> to <i>2.11.22</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=562272016-06-02T16:21:16ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>2.11.22</i> to <i>2.11.23</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=584042016-07-29T13:16:52ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>2.11.23</i> to <i>2.11.24</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=594422016-08-27T10:03:48ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>2.11.24</i> to <i>308</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=607782016-09-12T09:59:55ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>308</i> to <i>3.1.14</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=622412016-09-28T20:51:51ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>3.1.14</i> to <i>3.1.15</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=627442016-10-03T10:14:51ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>3.1.15</i> to <i>3.1.16</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=638562016-10-11T13:13:15ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>3.1.16</i> to <i>3.1.17</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=679342016-12-05T14:21:16ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>3.1.17</i> to <i>3.1.18</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=711382017-02-17T22:21:26ZVincent MEMBRÉvme@rudder.io
<ul><li><strong>Target version</strong> changed from <i>3.1.18</i> to <i>3.1.19</i></li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=722742017-03-03T10:09:17ZAlexis Moussetalexis.mousset@rudder.io
<ul><li><strong>Has duplicate</strong> <i><a class="issue tracker-2 status-16 priority-16 priority-default closed" href="/issues/10299">User story #10299</a>: API Doc missing possibilities of New Group's query syntax</i> added</li></ul> Rudder - Bug #6221: Format of the query to update groups via API is not documentedhttps://issues.rudder.io/issues/6221?journal_id=722772017-03-03T10:10:14ZAlexis Moussetalexis.mousset@rudder.io
<ul><li><strong>Status</strong> changed from <i>In progress</i> to <i>Rejected</i></li></ul><p>Duplicate of <a class="issue tracker-2 status-16 priority-16 priority-default closed" title="User story: API Doc missing possibilities of New Group's query syntax (Resolved)" href="https://issues.rudder.io/issues/10299">#10299</a>.</p>