<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"><<a href="mailto:lgao@redhat.com" target="_blank">lgao@redhat.com</a>></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>
> From: "James Perkins" <<a href="mailto:jperkins@redhat.com">jperkins@redhat.com</a>><br>
> To: "Lin Gao" <<a href="mailto:lgao@redhat.com">lgao@redhat.com</a>><br>
> Cc: <a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a><br>
> Sent: Wednesday, November 23, 2016 6:11:21 AM<br>
> Subject: Re: [wildfly-dev] Improve query() operation for complex attributes?<br>
><br>
> The second case worked for me without an issue.<br>
> [standalone@localhost:9990 /]<br>
> /deployment=batch-chunk.war/<wbr>subsystem=jaxrs/rest-resource=<wbr>*:query(select=["rest-<wbr>resource-paths"])<br>
> {<br>
> "outcome" => "success",<br>
> "result" => [{<br>
> "address" => [<br>
> ("deployment" => "batch-chunk.war"),<br>
> ("subsystem" => "jaxrs"),<br>
> ("rest-resource" =><br>
> "org.jboss.example.batch.rest.<wbr>BatchResource")<br>
> ],<br>
> "outcome" => "success",<br>
> "result" => {"rest-resource-paths" => [<br>
> {<br>
> "resource-path" => "batch/jobs",<br>
> "consumes" => undefined,<br>
> "produces" => ["application/json"],<br>
> "java-method" => "javax.ws.rs.core.Response<br>
> org.jboss.example.batch.rest.<wbr>BatchResource.listBatchJobs()"<wbr>,<br>
> "resource-methods" => ["GET /batch-chunk/rest/batch/jobs"]<br>
> },<br>
> {<br>
> "resource-path" => "batch/jobs/{status}",<br>
> "consumes" => undefined,<br>
> "produces" => ["application/json"],<br>
> "java-method" => "javax.ws.rs.core.Response<br>
> org.jboss.example.batch.rest.<wbr>BatchResource.listBatchJobs(@<wbr>PathParam<br>
> java.lang.String status)",<br>
> "resource-methods" => ["GET<br>
> /batch-chunk/rest/batch/jobs/{<wbr>status}"]<br>
> }<br>
> ]}<br>
> }]<br>
> }<br>
<br>
</div></div>You just listed all 'rest-resource-paths' without any filtering, if you have over 100 REST endpoints in 'batch-chunk.war', it will be difficult to find the one which provides "resource-path" => "batch/jobs".<br>
<br>
Let'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=["rest-<wbr>resource-paths"], where={"rest-resource-paths.<wbr>resource-path"=>"batch/jobs"})<br>
<br>
here the 'rest-resource-paths.resource-<wbr>path' is the attribute name in enhanced syntax.<br>
<span class=""><br>
> 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 'query()' operation is that it can filter resources by conditions specified by 'where' 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>
"outcome" => "success",<br>
"result" => [{<br>
"address" => [<br>
</span> ("subsystem" => "datasources"),<br>
("jdbc-driver" => "h2")<br>
<span class=""> ],<br>
"outcome" => "success",<br>
</span> "result" => {"driver-xa-datasource-class-<wbr>name" => "org.h2.jdbcx.JdbcDataSource"}<br>
}]<br>
}<br>
<br>
It would be good if the 'query()' 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=["rest-<wbr>resource-paths"], where={"rest-resource-paths.<wbr>resource-path"=>"batch/jobs"})<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>
> On Tue, Nov 22, 2016 at 12:51 AM, Lin Gao <<a href="mailto:lgao@redhat.com">lgao@redhat.com</a>> wrote:<br>
><br>
> > Hi,<br>
> ><br>
> > Each management resource has an operation named 'query()' to filter<br>
> > resources according to the condition passed by 'selector' and 'where'<br>
> > parameters, however it does not work for complex attributes.<br>
> ><br>
> > 2 example of complex attributes:<br>
> ><br>
> > - 'query()' operation cannot find which 'possible-capabilities'<br>
> > provides the capability with name 'org.wildfly.data-source'<br>
> > - It cannot find which 'rest-resource-paths' provides the REST<br>
> > endpoint 'resource-path=/helloworld' in jaxrs subsystem of a war deployment<br>
> > either.<br>
> ><br>
> > Especially for the second case in above examples, it will be helpful for<br>
> > users when doing troubleshooting in case of large deployment.<br>
> ><br>
> > Actually, it does not limit to the complex attributes, it would be good<br>
> > to be able to filter resources by condition specified by attribute value of<br>
> > nested child resources(not only by the first level of child resource).<br>
> ><br>
> > WDYT?<br>
> ><br>
> > Best Regards<br>
> ><br>
> > --<br>
> > Lin Gao<br>
> > Software Engineer<br>
> > JBoss by Red Hat<br>
> > ______________________________<wbr>_________________<br>
> > wildfly-dev mailing list<br>
> > <a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a><br>
> > <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>
> ><br>
><br>
><br>
><br>
> --<br>
> James R. Perkins<br>
> JBoss by Red Hat<br>
><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>