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

[JBPM-5220] kie-server: add few examples of containers filtering #131

Merged
merged 1 commit into from
Aug 10, 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: 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