API: Scheduled Queries

API: Scheduled Queries

Following is an example for creating Scheduled Queries

scheduledquery.json

{
"name": "Test query scheduled 10",
"type": "scheduled",
"description": "demo query",
"query": "SELECT pid FROM processes where upt_server_time between :from and :to LIMIT 10",
"executionType": "all",
"custom": true,
"destinations": [
{
"id": "295c2d91-4dd8-4d42-a953-36f438a28127"
}
],
"querySchedule": {
"intervalSeconds": 80,
"enabled": true
}
}

Note : Use upt_server_time in the where clause instead of upt_time to make sure we capture all data - even when there is a delay in backend processing.


To create Scheduled Query

urestapi -k authcode/allinone_admin.json -m POST -a /queries -D scheduledquery.json




    • Related Articles

    • Provisioning roles using API

      Overview Starting with Uptycs portal release 46025, Uptycs provides entity level granular user permissions through roles. This document outlines the process to create roles using API - with examples. Procedure -- Create a new role $ urestapi -k ...
    • How to check Audit logs under upi_api_audit_logs

      The article contains useful queries about how to use the upt_api_audit_logs to capture audit log events. The api_name column in the table suggests how the api call was made. the following are the different values that can be present: Api call Query ...
    • Uptycs Alert Triggers API Call

      This python module can be run to trigger Uptycs API calls from Uptycs alerts.  Example: An alert is configured to fire when asset location is not in USA (possible GDPR issue). This python can then be run to automatically make an API call to disable ...
    • Python helper module for Uptycs API

      The attached helper module (uptapi.py) and demo program (uptdemo.py) show how to access Uptycs API from Python 3. 
    • Delete duplicate assets using the API

      Duplicate asset (hostname) on Uptycs platform could be a result of particular asset being in rotation or being used a a loaner laptop in which case, uuid of the asset remains the same and the asset is recorded under different hostnames. Following ...