<div dir="ltr">Ah, I see. Sorry for the confusion. It might be possible with that dot notation. You could file a JIRA and someone can look at it when there is time. It does seem possible though.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 22, 2016 at 5:39 PM, Lin Gao <span dir="ltr">&lt;<a href="mailto:lgao@redhat.com" target="_blank">lgao@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">----- Original Message -----<br>
&gt; From: &quot;James Perkins&quot; &lt;<a href="mailto:jperkins@redhat.com">jperkins@redhat.com</a>&gt;<br>
&gt; To: &quot;Lin Gao&quot; &lt;<a href="mailto:lgao@redhat.com">lgao@redhat.com</a>&gt;<br>
&gt; Cc: <a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a><br>
&gt; Sent: Wednesday, November 23, 2016 6:11:21 AM<br>
&gt; Subject: Re: [wildfly-dev] Improve query() operation for complex attributes?<br>
&gt;<br>
&gt; The second case worked for me without an issue.<br>
&gt; [standalone@localhost:9990 /]<br>
&gt; /deployment=batch-chunk.war/<wbr>subsystem=jaxrs/rest-resource=<wbr>*:query(select=[&quot;rest-<wbr>resource-paths&quot;])<br>
&gt; {<br>
&gt;     &quot;outcome&quot; =&gt; &quot;success&quot;,<br>
&gt;     &quot;result&quot; =&gt; [{<br>
&gt;         &quot;address&quot; =&gt; [<br>
&gt;             (&quot;deployment&quot; =&gt; &quot;batch-chunk.war&quot;),<br>
&gt;             (&quot;subsystem&quot; =&gt; &quot;jaxrs&quot;),<br>
&gt;             (&quot;rest-resource&quot; =&gt;<br>
&gt; &quot;org.jboss.example.batch.rest.<wbr>BatchResource&quot;)<br>
&gt;         ],<br>
&gt;         &quot;outcome&quot; =&gt; &quot;success&quot;,<br>
&gt;         &quot;result&quot; =&gt; {&quot;rest-resource-paths&quot; =&gt; [<br>
&gt;             {<br>
&gt;                 &quot;resource-path&quot; =&gt; &quot;batch/jobs&quot;,<br>
&gt;                 &quot;consumes&quot; =&gt; undefined,<br>
&gt;                 &quot;produces&quot; =&gt; [&quot;application/json&quot;],<br>
&gt;                 &quot;java-method&quot; =&gt; &quot;javax.ws.rs.core.Response<br>
&gt; org.jboss.example.batch.rest.<wbr>BatchResource.listBatchJobs()&quot;<wbr>,<br>
&gt;                 &quot;resource-methods&quot; =&gt; [&quot;GET /batch-chunk/rest/batch/jobs&quot;]<br>
&gt;             },<br>
&gt;             {<br>
&gt;                 &quot;resource-path&quot; =&gt; &quot;batch/jobs/{status}&quot;,<br>
&gt;                 &quot;consumes&quot; =&gt; undefined,<br>
&gt;                 &quot;produces&quot; =&gt; [&quot;application/json&quot;],<br>
&gt;                 &quot;java-method&quot; =&gt; &quot;javax.ws.rs.core.Response<br>
&gt; org.jboss.example.batch.rest.<wbr>BatchResource.listBatchJobs(@<wbr>PathParam<br>
&gt; java.lang.String status)&quot;,<br>
&gt;                 &quot;resource-methods&quot; =&gt; [&quot;GET<br>
&gt; /batch-chunk/rest/batch/jobs/{<wbr>status}&quot;]<br>
&gt;             }<br>
&gt;         ]}<br>
&gt;     }]<br>
&gt; }<br>
<br>
</div></div>You just listed all &#39;rest-resource-paths&#39; without any filtering, if you have over 100 REST endpoints in &#39;batch-chunk.war&#39;, it will be difficult to find the one which provides &quot;resource-path&quot; =&gt; &quot;batch/jobs&quot;.<br>
<br>
Let&#39;s assume the following command can do the task:<br>
<br>
[standalone@localhost:9990 /] /deployment=batch-chunk.war/<wbr>subsystem=jaxrs/rest-resource=<wbr>*:query(select=[&quot;rest-<wbr>resource-paths&quot;], where={&quot;rest-resource-paths.<wbr>resource-path&quot;=&gt;&quot;batch/jobs&quot;})<br>
<br>
here the &#39;rest-resource-paths.resource-<wbr>path&#39; is the attribute name in enhanced syntax.<br>
<span class=""><br>
&gt; The read-resource operation really does the same thing though in this case.<br>
<br>
</span>Yes, it does, but I think the most important feature provided by &#39;query()&#39; operation is that it can filter resources by conditions specified by &#39;where&#39; parameter.<br>
<br>
It works only on simple attributes, like:<br>
<br>
[standalone@localhost:9990 /] /subsystem=datasources/jdbc-<wbr>driver=*:query(select=[driver-<wbr>xa-datasource-class-name], where={driver-name=h2})<br>
<span class="">{<br>
    &quot;outcome&quot; =&gt; &quot;success&quot;,<br>
    &quot;result&quot; =&gt; [{<br>
        &quot;address&quot; =&gt; [<br>
</span>            (&quot;subsystem&quot; =&gt; &quot;datasources&quot;),<br>
            (&quot;jdbc-driver&quot; =&gt; &quot;h2&quot;)<br>
<span class="">        ],<br>
        &quot;outcome&quot; =&gt; &quot;success&quot;,<br>
</span>        &quot;result&quot; =&gt; {&quot;driver-xa-datasource-class-<wbr>name&quot; =&gt; &quot;org.h2.jdbcx.JdbcDataSource&quot;}<br>
    }]<br>
}<br>
<br>
It would be good if the &#39;query()&#39; operation can filter the resources by specifying value of attributes which are inside the complex attribute, so that the following commands can work:<br>
<br>
[standalone@localhost:9990 /] /core-service=capability-<wbr>registry:query(select=[<wbr>possible-capabilities],where={<a href="http://possible-capabilities.name" rel="noreferrer" target="_blank"><wbr>possible-capabilities.name</a>=<wbr>org.wildfly.data-source})<br>
<br>
[standalone@localhost:9990 /] /deployment=batch-chunk.war/<wbr>subsystem=jaxrs/rest-resource=<wbr>*:query(select=[&quot;rest-<wbr>resource-paths&quot;], where={&quot;rest-resource-paths.<wbr>resource-path&quot;=&gt;&quot;batch/jobs&quot;})<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
Best Regards<br>
--<br>
Lin Gao<br>
Software Engineer<br>
JBoss by Red Hat<br>
<br>
&gt; On Tue, Nov 22, 2016 at 12:51 AM, Lin Gao &lt;<a href="mailto:lgao@redhat.com">lgao@redhat.com</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; Hi,<br>
&gt; &gt;<br>
&gt; &gt;   Each management resource has an operation named &#39;query()&#39; to filter<br>
&gt; &gt; resources according to the condition passed by &#39;selector&#39; and &#39;where&#39;<br>
&gt; &gt; parameters, however it does not work for complex attributes.<br>
&gt; &gt;<br>
&gt; &gt;   2 example of complex attributes:<br>
&gt; &gt;<br>
&gt; &gt;      - &#39;query()&#39; operation cannot find which &#39;possible-capabilities&#39;<br>
&gt; &gt; provides the capability with name &#39;org.wildfly.data-source&#39;<br>
&gt; &gt;      - It cannot find which &#39;rest-resource-paths&#39; provides the REST<br>
&gt; &gt; endpoint &#39;resource-path=/helloworld&#39; in jaxrs subsystem of a war deployment<br>
&gt; &gt; either.<br>
&gt; &gt;<br>
&gt; &gt;   Especially for the second case in above examples, it will be helpful for<br>
&gt; &gt; users when doing troubleshooting in case of large deployment.<br>
&gt; &gt;<br>
&gt; &gt;   Actually, it does not limit to the complex attributes, it would be good<br>
&gt; &gt; to be able to filter resources by condition specified by attribute value of<br>
&gt; &gt; nested child resources(not only by the first level of child resource).<br>
&gt; &gt;<br>
&gt; &gt;   WDYT?<br>
&gt; &gt;<br>
&gt; &gt; Best Regards<br>
&gt; &gt;<br>
&gt; &gt; --<br>
&gt; &gt; Lin Gao<br>
&gt; &gt; Software Engineer<br>
&gt; &gt; JBoss by Red Hat<br>
&gt; &gt; ______________________________<wbr>_________________<br>
&gt; &gt; wildfly-dev mailing list<br>
&gt; &gt; <a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a><br>
&gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/wildfly-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/wildfly-dev</a><br>
&gt; &gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; James R. Perkins<br>
&gt; JBoss by Red Hat<br>
&gt;<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>James R. Perkins</div><div>JBoss by Red Hat</div></div></div></div></div>
</div>