Skip to content

Commit

Permalink
[JBPM-5220] kie-server: add few examples of containers filtering (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
psiroky authored and csadilek committed Aug 10, 2016
1 parent 5d7d972 commit 62df8a8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
22 changes: 22 additions & 0 deletions shared/KieServer/JavaClientAPI-section.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,28 @@ public void listContainers() {
}
----

It is also possible to list the containers based on specific ReleaseId (and its individual parts) or status:

.Listing Kie Containers with custom filter
[example]

[source,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<KieContainerResource> kieContainers = containersList.getContainers();
System.out.println("Available containers: ");
for (KieContainerResource container : kieContainers) {
System.out.println("\t" + container.getContainerId() + " (" + container.getReleaseId() + ")");
}
}
----

== Managing Containers


Expand Down
8 changes: 7 additions & 1 deletion shared/KieServer/RestAPI-section.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ The commands itself can be found in the `org.kie.server.api.commands` package.

== [GET] /containers


Returns a list of containers that have been created on this Execution Server.

.Example Server Response
Expand All @@ -77,6 +76,13 @@ Returns a list of containers that have been created on this Execution Server.
----
====

The endpoint supports also filtering based on `ReleaseId` and `container status`. Examples:

* `/containers?groupId=org.example` - returns only containers with the specified groupId
* `/containers?groupId=org.example&artifactId=project1&version=1.0.0.Final` - returns only containers with the specified `ReleaseId`
* `/containers?status=started,failed` - returns containers which are either started or failed


== ⁠[GET] /containers/{id}


Expand Down

0 comments on commit 62df8a8

Please sign in to comment.