ECS: How to perform a time-bound query using JCASScript
Summary: How to perform a time-bound query using JCASScript.
This article applies to
This article does not apply to
This article is not tied to any specific product.
Not all product versions are identified in this article.
Instructions
JCASScript runs a time-bound query and generate the clips written during that time range.
To run this query, we would need the respective PEA file. See KB article ECS: How to perform basic CAS API operations on ECS using JCASScript.jar to find the bucket owner and how to get the respective PEA file.
Dell Support team requests the user to provide the respective PEA file if we do not have root access to ECS UI.
Using JCASScript from an ECS node:
- Log in to any node as admin user, Enter into the object-main container.
admin@ecsnode1:~> sudo dockobj
- Change to the castools directory.
ecsnode1:/ # cd /opt/storageos/tools/castools
- Create your PEA file:
ecsnode1:/opt/storageos/tools/castools # vi icoe_cas.pea
ecsnode1:/opt/storageos/tools/castools # cat icoe_cas.pea
<pea version="1.0.0">
<defaultkey name="icoe_cas_obusr">
<credential id="csp1.secret" enc="base64">UmJaVGNsb1Z1M0hxaHVDN3ZXTmE=</credential>
</defaultkey>
<key type="cluster" id="23a0767d-d6e7-3f41-bc1d-89d139549fe2" name="icoe_cas_obusr">
<credential id="csp1.secret" enc="base64">UmJaVGNsb1Z1M0hxaHVDN3ZXTmE=</credential>
</key>
</pea>
ecsnode1:/opt/storageos/tools/castools #
- Export castools to the "
$LD_LIBRARY_PATH":
ecsnode1:/opt/storageos/tools/castools # export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/storageos/tools/castools/
- Get IP addresses listening on the CAS port (3218):
ecsnode1:/opt/storageos/tools/castools # sudo ss -nap | grep :3218 | grep LISTEN | grep -oP "(?:[0-9]{1,3}\.){3}[0-9]{1,3}"
- Start "
JCASScript.jar" interactive CLI:
ecsnode1:/opt/storageos/tools/castools # java -jar JCASScript.jar
CASScript>
- Connect to the Pool:
# poolOpen <ipaddress>?<path to pea file>
In the example below, using localhost we may use the data IP returned in step above.
For example:
CASScript>po localhost?icoe_cas.pea
Attempting to connect to: localhost?icoe_cas.pea
Connected to: localhost?icoe_cas.pea
CASPool Properties:
Connection String: localhost?icoe_cas.pea
Cluster Time: 2020.07.30 02:06:39 GMT
Buffer Size: 16384
Prefetch Buffer Size: 32768
Connection Timeout: 120000
Multi-Cluster Failover Enabled: True
Collision Avoidance Enabled: False
CASScript>
- To start a time-bound query, we must set a lower bound and an upper bound.
querySetLower Bound Sets the start date of the query expression. The start date represents the lower bound of the query expression.
Syntax: querySetLower Bound startDate
querySetUpper Bound Sets the end date of the query expression. The end date represents the upper bound of the query expression
Syntax: querySetUpper Bound endTime
For example:
CASScript>querySetLowerBound "2020.07.29 00:00:00"
Query Expression Properties:
Start Time: 2020.07.29 00:00:00
End Time : UNBOUNDED
Type : EXISTING
CASScript>querySetUpperBound "2020.07.30 14:00:00"
Query Expression Properties:
Start Time: 2020.07.29 00:00:00
End Time : 2020.07.30 14:00:00
Type : EXISTING
- Run the query and save the clips to a file.
queryToFile(qtf) Queries the cluster based on the Query Expression object and stores the C-Clip IDs in the specified file. We can optionally set the maximum number of C-Clip IDs to be returned.
Syntax:
Syntax:
qtf clips
For example:
CASScript>qtf cliplist_30Jul2020
Performing clip query
Query Expression Properties:
Start Time: 2020.07.29 00:00:00
End Time : 2020.07.30 14:00:00
Type : EXISTING
Number of clips returned: 50
All results returned: True
Query results written to: cliplist_30Jul2020
CASScript>
- Get only a particular number of clips to be returned then use below option
Syntax: queryToFile fileName maxClipIDsToReturn
For example:
CASScript>qtf cliplist_30Jul2020_limited 25
Performing clip query
Query Expression Properties:
Start Time: 2020.07.29 00:00:00
End Time : 2020.07.30 14:00:00"querySetUpperBound "2020.07.30 14:00:00
Type : EXISTING
Number of clips returned: 25
All results returned: False
Point of incompletion: 2020.07.30 01:20:45 GMT
Query results written to: cliplist_30Jul2020_limited
CASScript>
- Verify the number of clips returned.
Exit from JCASScript
CASScript>exit
ecsnode1:/opt/storageos/tools/castools # wc -l cliplist_30Jul2020_limited
25 cliplist_30Jul2020_limited
ecsnode1:/opt/storageos/tools/castools #
ecsnode1:/opt/storageos/tools/castools # wc -l cliplist_30Jul2020
50 cliplist_30Jul2020
ecsnode1:/opt/storageos/tools/castools #
Additional Information
For more details on JCASScript usage, see the JCASScript guide in KB article ECS: How to perform basic CAS API operations on ECS using JCASScript.jar.
Affected Products
Elastic Cloud StorageProducts
ECS Appliance Hardware Series, ECS Appliance Software with Encryption, ECS Appliance Software without Encryption, Elastic Cloud StorageArticle Properties
Article Number: 000020612
Article Type: How To
Last Modified: 27 Aug 2025
Version: 5
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.