Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.5.x] [JBPM-5250] kie-server: add few examples of containers filtering #132

Merged
merged 1 commit into from
Aug 11, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion shared/KieServer/JavaClientAPI.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,27 @@ public class DecisionServerTest {
System.out.println("\t" + container.getContainerId() + " (" + container.getReleaseId() + ")");
}
}</programlisting></para>
</example></para>
</example>
It is also possible to list the containers based on specific <code>ReleaseId</code> (and its individual parts) or container status:
<example>
<title>Listing Kie Containers with custom filter</title>

<para><programlisting language="java">public void listContainersWithFilter() {
// the following filter will match only containers with ReleaseId "org.example:contatner:1.0.0.Final" and status FAILED
KieContainerResourceFilter filter = new KieContainerResourceFilter.Builder()
.releaseId("org.example", "container", "1.0.0.Final")
.status(KieContainerStatus.FAILED)
.build();
KieContainerResourceList containersList = kieServicesClient.listContainers(filter).getResult();
List&lt;KieContainerResource&gt; kieContainers = containersList.getContainers();
System.out.println("Available containers: ");
for (KieContainerResource container : kieContainers) {
System.out.println("\t" + container.getContainerId() + " (" + container.getReleaseId() + ")");
}
}</programlisting></para>
</example>
</para>

</section>

<section>
Expand Down
9 changes: 9 additions & 0 deletions shared/KieServer/RestAPI.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@
&lt;/kie-containers>
&lt;/response></programlisting>
</example>
<para>
The endpoint supports also filtering based on <code>ReleaseId</code> and container status. Examples:
<itemizedlist>
<listitem><code>/containers?groupId=org.example</code> - returns only containers with the specified groupId</listitem>
<listitem><code>/containers?groupId=org.example&amp;artifactId=project1&amp;version=1.0.0.Final</code>
- returns only containers with the specified <code>ReleaseId</code></listitem>
<listitem><code>/containers?status=started,failed</code> - returns containers which are either started or failed</listitem>
</itemizedlist>
</para>
</section>

<section>
Expand Down