vanhecke/celmex/3.0.0

Unavailable. Nobody can download this version any more, with elm or with the Lamdera compiler: github.com/vanhecke/celmex is gone (deleted or private); Software Heritage not asked yet (this run's --swh-calls were used up); no fork with the same repo name found; no cached copy. Use another version.

Details

Cortex.Api.ScheduledQueries

Cortex scheduled XQL queries configured on the tenant.

type alias SearchArgs =
{ filters : List Filter
, sort : Maybe Sort
, range : Maybe Range
, timeframe : Maybe Timeframe
, extra : List ( String, Value )
}

Arguments to list. All fields are optional; pass defaultSearchArgs for an unfiltered request. extra is merged last into request_data and overrides any SDK-generated key on collision — the endpoint's extended_view and list_ids fields are reachable through it.

defaultSearchArgs : SearchArgs

A SearchArgs with no filters, sort, pagination, or timeframe.

type alias ScheduledQuery =
{ queryDefId : Maybe String
, queryDefinitionName : Maybe String
, xql : Maybe String
, enable : Maybe Bool
, schedule : Maybe Schedule
, timeframe : Maybe Value
, tenants : Maybe Value
}

One scheduled XQL query configured on the tenant.

type alias Schedule =
{ triggerType : Maybe String
, runDate : Maybe Int
, startDate : Maybe Int
, endDate : Maybe Int
, hour : Maybe String
, minute : Maybe String
, second : Maybe String
, dayOfWeek : Maybe String
, week : Maybe String
, month : Maybe String
}

Trigger schedule for a ScheduledQuery. All fields optional — only the subset relevant to the trigger type is populated. triggerType = "date" populates runDate; "cron" populates startDate / endDate / hour / minute / second / dayOfWeek / week / month.

{ data : List ScheduledQuery
, filterCount : Maybe Int
, totalCount : Maybe Int
}

Paginated envelope returned by list.

list : SearchArgs -> Request ScheduledQueriesResponse

POST /public_api/v1/scheduled_queries/list

Retrieve scheduled XQL queries currently configured on the tenant, with optional filters and pagination. Requires Instance Administrator permissions.

type alias InsertArgs =
{ queries : List QueryDefinition }

Arguments to insert. queries is the batch of definitions to send.

type alias QueryDefinition =
{ name : String
, xql : String
, relativeTimeMs : Int
, schedule : ScheduleSpec
}

One query definition to insert. relativeTimeMs is the rolling-window size that the query inspects on every run, in epoch-milliseconds (e.g. 86400000 for the last 24 hours).

= OneShot { runAtMs : Int }
| Cron CronSpec

Trigger schedule for an inserted query. OneShot runs the query a single time at runAtMs (epoch-milliseconds, must be in the future); Cron runs on a recurring crontab-style schedule.

type alias CronSpec =
{ startDate : Maybe Int
, endDate : Maybe Int
, hour : Maybe String
, minute : Maybe String
, second : Maybe String
, dayOfWeek : Maybe String
, week : Maybe String
, month : Maybe String
}

Cron-style trigger fields. Each Maybe String carries either a single value (e.g. "5") or a comma-separated list / * wildcard accepted by the Cortex scheduler. startDate / endDate bound the active window in epoch-milliseconds; the other fields are minute/hour/etc.

type alias InsertedQuery =
{ name : Maybe String
, xql : Maybe String
, timeframe : Maybe Value
, schedule : Maybe Schedule
}

The server-echoed definition returned in the InsertResult dict, keyed by the assigned query_id. timeframe stays opaque for the same reasons as ScheduledQuery.timeframe.

type alias InsertResult =
Dict String InsertedQuery

Outcome of an insert call: a Dict keyed by the assigned query_id (e.g. "qc_1683461522_18780") → the echoed definition. Empty for a request that was rejected before any item was processed.

insert : InsertArgs -> Request InsertResult

POST /public_api/v1/scheduled_queries/insert — insert a batch of scheduled XQL queries. The server assigns each query a fresh ID; consult the keys of the returned InsertResult to delete or manage them later.

type alias DeleteArgs =
{ ids : List String }

Arguments to delete. ids may be the assigned query_id strings or the human-readable query_definition_name values; the API accepts either.

= Deleted
| DeleteFailed String

Per-id outcome inside DeleteResult. Deleted is the server's true reply; DeleteFailed carries the human-readable rejection reason.

type alias DeleteResult =
Dict String DeleteOutcome

Outcome of a delete call: a Dict keyed by the same ids the caller submitted → success/failure.

delete : DeleteArgs -> Request DeleteResult

POST /public_api/v1/scheduled_queries/delete — remove scheduled queries by id or by name.