Deleting a ClientSet by using a REST Administration API

System administrators can delete a ClientSet by using the Eclipse Amlen REST API DELETE method.

A client set is a group of client IDs. You can delete a client set by using the Eclipse Amlen REST API DELETE method. You might want to delete clients from a server so that you can remove servers from a cluster in order to reduce cost when you have spare capacity. You can enter a regular expression to describe the set of client IDs and another regular expression that describes the set of retained messages to delete. All ClientIDs and retained messages that match the specified regular expressions are deleted.

To delete a client set, use the Eclipse Amlen REST API DELETE method with the following Eclipse Amlen service URI:

http://<admin-endpoint-IP:Port>/ima/v1/service/ClientSet?ClientID=<ClientID>&Retain=<RetainName>

Where:

ClientID
Required.
Specifies a regular expression for ClientID matching.
The type is REGEX.
The maximum length is 1024.
RetainName
Required.
Specifies a regular expression for topics to delete retained messages from.
The type is REGEX.
Note:

If you want to delete all client sets, you can specify a value of ^ for ClientID and RetainName. In REGEX, ^ specifies the start of a string.

The delete is only performed on the server that is specified in the URI of the REST API DELETE method. If a client is explicitly connected to multiple servers, the delete command must be sent to each server, even if all the servers are in the same cluster. In an HA environment, the delete command only needs to be sent to the primary of an HA pair.

The following example demonstrates deleting all client sets by using cURL.

curl -X DELETE http://127.0.0.1:9089/ima/v1/service/ClientSet?ClientID=^&Retain=^

The following example shows an example response to the DELETE method:


{ 
    "Version":"v1",
    "Code":"CWLNA6197",
    "Message":"The request is complete. Clients found: 2, Clients deleted: 2, Deletion errors: 0" 
}