| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Arbiter.Servant
Description
Servant REST API for Arbiter job queue administration.
Includes endpoints for:
- Job management (list, get, cancel, promote)
- Dead letter queue operations (list, retry, delete)
- Queue statistics and monitoring
Quick Start
import Arbiter.Servant import Data.Proxy (Proxy(..)) main :: IO () main = do -- Create server config (creates its own pool and registers event triggers) config <- initArbiterServer (Proxy @MyRegistry) connStr "public" -- Start API server on port 8080 runArbiterAPI 8080 config
Synopsis
- arbiterServer :: forall (registry :: [(Symbol, Type)]). BuildServer registry registry => ArbiterServerConfig registry -> ServerT (ArbiterAPI registry) Handler
- arbiterApp :: forall (registry :: [(Symbol, Type)]). (BuildServer registry registry, HasServer (ArbiterAPI registry) ('[] :: [Type])) => ArbiterServerConfig registry -> Application
- runArbiterAPI :: forall (registry :: [(Symbol, Type)]). (BuildServer registry registry, HasServer (ArbiterAPI registry) ('[] :: [Type])) => Port -> ArbiterServerConfig registry -> IO ()
- data ArbiterServerConfig (registry :: k) = ArbiterServerConfig {}
- initArbiterServer :: forall (registry :: JobPayloadRegistry). AllQueuesUnique registry => Proxy registry -> ByteString -> Text -> IO (ArbiterServerConfig registry)
- class BuildServer (registry :: k) (reg :: [(Symbol, Type)]) where
- buildServer :: ArbiterServerConfig registry -> ServerT (RegistryToAPI reg) Handler
- type ArbiterAPI (registry :: [(Symbol, Type)]) = "api" :> ("v1" :> RegistryToAPI registry)
- type family RegistryToAPI (registry :: [(Symbol, Type)]) where ...
- data TableAPI payload (mode :: k) = TableAPI {}
- type EventsAPI = "stream" :> Raw
- data QueuesAPI (mode :: k) = QueuesAPI {
- listQueues :: mode :- Get '[JSON] QueuesResponse
- data JobsAPI payload (mode :: k) = JobsAPI {
- listJobs :: mode :- (QueryParam "limit" Int :> (QueryParam "offset" Int :> (QueryParam "group_key" Text :> (QueryParam "parent_id" Int64 :> (QueryParam "suspended" Bool :> Get '[JSON] (JobsResponse payload))))))
- insertJob :: mode :- (ReqBody '[JSON] (ApiJobWrite payload) :> Post '[JSON] (JobResponse payload))
- insertJobsBatch :: mode :- ("batch" :> (ReqBody '[JSON] (BatchInsertRequest payload) :> Post '[JSON] (BatchInsertResponse payload)))
- getJob :: mode :- (Capture "id" Int64 :> Get '[JSON] (JobResponse payload))
- getInFlightJobs :: mode :- ("in-flight" :> (QueryParam "limit" Int :> (QueryParam "offset" Int :> Get '[JSON] (JobsResponse payload))))
- cancelJob :: mode :- (Capture "id" Int64 :> DeleteNoContent)
- promoteJob :: mode :- (Capture "id" Int64 :> ("promote" :> PostNoContent))
- moveToDLQ :: mode :- (Capture "id" Int64 :> ("move-to-dlq" :> PostNoContent))
- pauseChildren :: mode :- (Capture "id" Int64 :> ("pause-children" :> PostNoContent))
- resumeChildren :: mode :- (Capture "id" Int64 :> ("resume-children" :> PostNoContent))
- suspendJob :: mode :- (Capture "id" Int64 :> ("suspend" :> PostNoContent))
- resumeJob :: mode :- (Capture "id" Int64 :> ("resume" :> PostNoContent))
- data DLQAPI payload (mode :: k) = DLQAPI {
- listDLQ :: mode :- (QueryParam "limit" Int :> (QueryParam "offset" Int :> (QueryParam "parent_id" Int64 :> (QueryParam "group_key" Text :> Get '[JSON] (DLQResponse payload)))))
- retryFromDLQ :: mode :- (Capture "id" Int64 :> ("retry" :> PostNoContent))
- deleteDLQ :: mode :- (Capture "id" Int64 :> DeleteNoContent)
- deleteDLQBatch :: mode :- ("batch-delete" :> (ReqBody '[JSON] BatchDeleteRequest :> Post '[JSON] BatchDeleteResponse))
- data StatsAPI (mode :: k) = StatsAPI {
- getStats :: mode :- Get '[JSON] StatsResponse
- data CronAPI (mode :: k) = CronAPI {
- listSchedules :: mode :- ("schedules" :> Get '[JSON] CronSchedulesResponse)
- updateSchedule :: mode :- ("schedules" :> (Capture "name" Text :> (ReqBody '[JSON] CronScheduleUpdate :> Patch '[JSON] CronScheduleRow)))
- newtype ApiJobWrite payload = ApiJobWrite {
- unApiJobWrite :: JobWrite payload
- data QueuesResponse = QueuesResponse {}
- data JobResponse payload = JobResponse {}
- data JobsResponse payload = JobsResponse {
- jobs :: [ApiJob payload]
- jobsTotal :: Int
- jobsOffset :: Int
- jobsLimit :: Int
- childCounts :: Map Int64 Int64
- pausedParents :: [Int64]
- dlqChildCounts :: Map Int64 Int64
- data DLQResponse payload = DLQResponse {}
- data StatsResponse = StatsResponse {
- stats :: QueueStats
- timestamp :: Text
- data CronSchedulesResponse = CronSchedulesResponse {}
- data CronScheduleRow = CronScheduleRow {}
- data CronScheduleUpdate = CronScheduleUpdate {}
Server
arbiterServer :: forall (registry :: [(Symbol, Type)]). BuildServer registry registry => ArbiterServerConfig registry -> ServerT (ArbiterAPI registry) Handler Source #
Complete Arbiter server at /api/v1/...
arbiterApp :: forall (registry :: [(Symbol, Type)]). (BuildServer registry registry, HasServer (ArbiterAPI registry) ('[] :: [Type])) => ArbiterServerConfig registry -> Application Source #
Convert to WAI Application
runArbiterAPI :: forall (registry :: [(Symbol, Type)]). (BuildServer registry registry, HasServer (ArbiterAPI registry) ('[] :: [Type])) => Port -> ArbiterServerConfig registry -> IO () Source #
Run the API server on a specific port.
Uses setTimeout 0 (no idle timeout) so that SSE streaming connections
are not killed by Warp.
data ArbiterServerConfig (registry :: k) Source #
Configuration for the API server
Constructors
| ArbiterServerConfig | |
Fields | |
initArbiterServer :: forall (registry :: JobPayloadRegistry). AllQueuesUnique registry => Proxy registry -> ByteString -> Text -> IO (ArbiterServerConfig registry) Source #
Create an ArbiterServerConfig with its own internal connection pool.
Note: Use runMigrationsForRegistry with
enableEventStreaming = True to set up the database triggers for SSE.
class BuildServer (registry :: k) (reg :: [(Symbol, Type)]) where Source #
Type class to build server implementations for registry entries
Methods
buildServer :: ArbiterServerConfig registry -> ServerT (RegistryToAPI reg) Handler Source #
Instances
| RegistryTables registry => BuildServer (registry :: JobPayloadRegistry) ('[] :: [(Symbol, Type)]) Source # | |
Defined in Arbiter.Servant.Server Methods buildServer :: ArbiterServerConfig registry -> ServerT (RegistryToAPI ('[] :: [(Symbol, Type)])) Handler Source # | |
| (JobPayload payload, KnownSymbol tableName, RegistryTables registry) => BuildServer (registry :: JobPayloadRegistry) '['(tableName, payload)] Source # | |
Defined in Arbiter.Servant.Server Methods buildServer :: ArbiterServerConfig registry -> ServerT (RegistryToAPI '['(tableName, payload)]) Handler Source # | |
| (BuildServer registry (nextTable ': moreRest), JobPayload payload, KnownSymbol tableName) => BuildServer (registry :: k) ('(tableName, payload) ': (nextTable ': moreRest)) Source # | |
Defined in Arbiter.Servant.Server Methods buildServer :: ArbiterServerConfig registry -> ServerT (RegistryToAPI ('(tableName, payload) ': (nextTable ': moreRest))) Handler Source # | |
API Types
type ArbiterAPI (registry :: [(Symbol, Type)]) = "api" :> ("v1" :> RegistryToAPI registry) Source #
Top-level Arbiter API
Routes are generated from the registry:
/api/v1/:tableName/jobs/...for each table in registry/api/v1/queues- list all available queues/api/v1/events/stream- real-time job updates (SSE)
type family RegistryToAPI (registry :: [(Symbol, Type)]) where ... Source #
Type family to build API routes from registry For registry '[ '("table1", Payload1), '("table2", Payload2) ] Generates: Capture "table1" :> NamedRoutes (TableAPI Payload1) :| Capture "table2" :> NamedRoutes (TableAPI Payload2) :| queues :| events
Equations
| RegistryToAPI ('[] :: [(Symbol, Type)]) = ("queues" :> NamedRoutes (QueuesAPI :: Type -> Type)) :<|> (("events" :> EventsAPI) :<|> ("cron" :> NamedRoutes (CronAPI :: Type -> Type))) | |
| RegistryToAPI '['(tableName, payload)] = (tableName :> NamedRoutes (TableAPI payload :: Type -> Type)) :<|> (("queues" :> NamedRoutes (QueuesAPI :: Type -> Type)) :<|> (("events" :> EventsAPI) :<|> ("cron" :> NamedRoutes (CronAPI :: Type -> Type)))) | |
| RegistryToAPI ('(tableName, payload) ': rest) = (tableName :> NamedRoutes (TableAPI payload :: Type -> Type)) :<|> RegistryToAPI rest |
data TableAPI payload (mode :: k) Source #
API routes for a specific table
Constructors
| TableAPI | |
Instances
| Generic (TableAPI payload mode) Source # | |||||
Defined in Arbiter.Servant.API Associated Types
| |||||
| type Rep (TableAPI payload mode) Source # | |||||
Defined in Arbiter.Servant.API type Rep (TableAPI payload mode) = D1 ('MetaData "TableAPI" "Arbiter.Servant.API" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "TableAPI" 'PrefixI 'True) (S1 ('MetaSel ('Just "jobs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- ("jobs" :> NamedRoutes (JobsAPI payload :: Type -> Type)))) :*: (S1 ('MetaSel ('Just "dlq") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- ("dlq" :> NamedRoutes (DLQAPI payload :: Type -> Type)))) :*: S1 ('MetaSel ('Just "stats") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- ("stats" :> NamedRoutes (StatsAPI :: Type -> Type))))))) | |||||
data QueuesAPI (mode :: k) Source #
Queues API routes - list available queues
Constructors
| QueuesAPI | |
Fields
| |
Instances
| Generic (QueuesAPI mode) Source # | |||||
Defined in Arbiter.Servant.API Associated Types
| |||||
| type Rep (QueuesAPI mode) Source # | |||||
Defined in Arbiter.Servant.API type Rep (QueuesAPI mode) = D1 ('MetaData "QueuesAPI" "Arbiter.Servant.API" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "QueuesAPI" 'PrefixI 'True) (S1 ('MetaSel ('Just "listQueues") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- Get '[JSON] QueuesResponse)))) | |||||
data JobsAPI payload (mode :: k) Source #
Jobs API routes - manage jobs in a specific table
Constructors
| JobsAPI | |
Fields
| |
Instances
| Generic (JobsAPI payload mode) Source # | |||||
Defined in Arbiter.Servant.API Associated Types
| |||||
| type Rep (JobsAPI payload mode) Source # | |||||
Defined in Arbiter.Servant.API type Rep (JobsAPI payload mode) = D1 ('MetaData "JobsAPI" "Arbiter.Servant.API" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "JobsAPI" 'PrefixI 'True) (((S1 ('MetaSel ('Just "listJobs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (QueryParam "limit" Int :> (QueryParam "offset" Int :> (QueryParam "group_key" Text :> (QueryParam "parent_id" Int64 :> (QueryParam "suspended" Bool :> Get '[JSON] (JobsResponse payload)))))))) :*: (S1 ('MetaSel ('Just "insertJob") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (ReqBody '[JSON] (ApiJobWrite payload) :> Post '[JSON] (JobResponse payload)))) :*: S1 ('MetaSel ('Just "insertJobsBatch") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- ("batch" :> (ReqBody '[JSON] (BatchInsertRequest payload) :> Post '[JSON] (BatchInsertResponse payload))))))) :*: (S1 ('MetaSel ('Just "getJob") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> Get '[JSON] (JobResponse payload)))) :*: (S1 ('MetaSel ('Just "getInFlightJobs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- ("in-flight" :> (QueryParam "limit" Int :> (QueryParam "offset" Int :> Get '[JSON] (JobsResponse payload)))))) :*: S1 ('MetaSel ('Just "cancelJob") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> DeleteNoContent)))))) :*: ((S1 ('MetaSel ('Just "promoteJob") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> ("promote" :> PostNoContent)))) :*: (S1 ('MetaSel ('Just "moveToDLQ") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> ("move-to-dlq" :> PostNoContent)))) :*: S1 ('MetaSel ('Just "pauseChildren") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> ("pause-children" :> PostNoContent)))))) :*: (S1 ('MetaSel ('Just "resumeChildren") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> ("resume-children" :> PostNoContent)))) :*: (S1 ('MetaSel ('Just "suspendJob") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> ("suspend" :> PostNoContent)))) :*: S1 ('MetaSel ('Just "resumeJob") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> ("resume" :> PostNoContent))))))))) | |||||
data DLQAPI payload (mode :: k) Source #
DLQ API routes - manage failed jobs in a specific table
Constructors
| DLQAPI | |
Fields
| |
Instances
| Generic (DLQAPI payload mode) Source # | |||||
Defined in Arbiter.Servant.API Associated Types
| |||||
| type Rep (DLQAPI payload mode) Source # | |||||
Defined in Arbiter.Servant.API type Rep (DLQAPI payload mode) = D1 ('MetaData "DLQAPI" "Arbiter.Servant.API" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "DLQAPI" 'PrefixI 'True) ((S1 ('MetaSel ('Just "listDLQ") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (QueryParam "limit" Int :> (QueryParam "offset" Int :> (QueryParam "parent_id" Int64 :> (QueryParam "group_key" Text :> Get '[JSON] (DLQResponse payload))))))) :*: S1 ('MetaSel ('Just "retryFromDLQ") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> ("retry" :> PostNoContent))))) :*: (S1 ('MetaSel ('Just "deleteDLQ") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- (Capture "id" Int64 :> DeleteNoContent))) :*: S1 ('MetaSel ('Just "deleteDLQBatch") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- ("batch-delete" :> (ReqBody '[JSON] BatchDeleteRequest :> Post '[JSON] BatchDeleteResponse))))))) | |||||
data StatsAPI (mode :: k) Source #
Stats API routes - queue statistics for a specific table
Constructors
| StatsAPI | |
Fields
| |
Instances
| Generic (StatsAPI mode) Source # | |||||
Defined in Arbiter.Servant.API Associated Types
| |||||
| type Rep (StatsAPI mode) Source # | |||||
Defined in Arbiter.Servant.API type Rep (StatsAPI mode) = D1 ('MetaData "StatsAPI" "Arbiter.Servant.API" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "StatsAPI" 'PrefixI 'True) (S1 ('MetaSel ('Just "getStats") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- Get '[JSON] StatsResponse)))) | |||||
data CronAPI (mode :: k) Source #
Cron API routes - manage cron schedules
Constructors
| CronAPI | |
Fields
| |
Instances
| Generic (CronAPI mode) Source # | |||||
Defined in Arbiter.Servant.API Associated Types
| |||||
| type Rep (CronAPI mode) Source # | |||||
Defined in Arbiter.Servant.API type Rep (CronAPI mode) = D1 ('MetaData "CronAPI" "Arbiter.Servant.API" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "CronAPI" 'PrefixI 'True) (S1 ('MetaSel ('Just "listSchedules") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- ("schedules" :> Get '[JSON] CronSchedulesResponse))) :*: S1 ('MetaSel ('Just "updateSchedule") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (mode :- ("schedules" :> (Capture "name" Text :> (ReqBody '[JSON] CronScheduleUpdate :> Patch '[JSON] CronScheduleRow))))))) | |||||
Request Types
newtype ApiJobWrite payload Source #
Write-side job type for REST API insertion.
Accepts payload, groupKey, priority, notVisibleUntil, dedupKey,
and maxAttempts. Fields like parentId, isRollup, and suspended are
managed internally and cannot be set through the REST API.
Constructors
| ApiJobWrite | |
Fields
| |
Instances
| FromJSON payload => FromJSON (ApiJobWrite payload) Source # | |
Defined in Arbiter.Servant.Types Methods parseJSON :: Value -> Parser (ApiJobWrite payload) parseJSONList :: Value -> Parser [ApiJobWrite payload] omittedField :: Maybe (ApiJobWrite payload) | |
| ToJSON payload => ToJSON (ApiJobWrite payload) Source # | |
Defined in Arbiter.Servant.Types Methods toJSON :: ApiJobWrite payload -> Value toEncoding :: ApiJobWrite payload -> Encoding toJSONList :: [ApiJobWrite payload] -> Value toEncodingList :: [ApiJobWrite payload] -> Encoding omitField :: ApiJobWrite payload -> Bool | |
| Show payload => Show (ApiJobWrite payload) Source # | |
Defined in Arbiter.Servant.Types Methods showsPrec :: Int -> ApiJobWrite payload -> ShowS # show :: ApiJobWrite payload -> String # showList :: [ApiJobWrite payload] -> ShowS # | |
| Eq payload => Eq (ApiJobWrite payload) Source # | |
Defined in Arbiter.Servant.Types Methods (==) :: ApiJobWrite payload -> ApiJobWrite payload -> Bool # (/=) :: ApiJobWrite payload -> ApiJobWrite payload -> Bool # | |
Response Types
data QueuesResponse Source #
Queues list response
Constructors
| QueuesResponse | |
Instances
data JobResponse payload Source #
Response wrapper for job operations
Constructors
| JobResponse | |
Instances
| FromJSON payload => FromJSON (JobResponse payload) Source # | |||||
Defined in Arbiter.Servant.Types Methods parseJSON :: Value -> Parser (JobResponse payload) parseJSONList :: Value -> Parser [JobResponse payload] omittedField :: Maybe (JobResponse payload) | |||||
| ToJSON payload => ToJSON (JobResponse payload) Source # | |||||
Defined in Arbiter.Servant.Types Methods toJSON :: JobResponse payload -> Value toEncoding :: JobResponse payload -> Encoding toJSONList :: [JobResponse payload] -> Value toEncodingList :: [JobResponse payload] -> Encoding omitField :: JobResponse payload -> Bool | |||||
| Generic (JobResponse payload) Source # | |||||
Defined in Arbiter.Servant.Types Associated Types
Methods from :: JobResponse payload -> Rep (JobResponse payload) x # to :: Rep (JobResponse payload) x -> JobResponse payload # | |||||
| Show payload => Show (JobResponse payload) Source # | |||||
Defined in Arbiter.Servant.Types Methods showsPrec :: Int -> JobResponse payload -> ShowS # show :: JobResponse payload -> String # showList :: [JobResponse payload] -> ShowS # | |||||
| Eq payload => Eq (JobResponse payload) Source # | |||||
Defined in Arbiter.Servant.Types Methods (==) :: JobResponse payload -> JobResponse payload -> Bool # (/=) :: JobResponse payload -> JobResponse payload -> Bool # | |||||
| type Rep (JobResponse payload) Source # | |||||
Defined in Arbiter.Servant.Types type Rep (JobResponse payload) = D1 ('MetaData "JobResponse" "Arbiter.Servant.Types" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "JobResponse" 'PrefixI 'True) (S1 ('MetaSel ('Just "job") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ApiJob payload)))) | |||||
data JobsResponse payload Source #
Response wrapper for multiple jobs
Constructors
| JobsResponse | |
Fields
| |
Instances
| FromJSON payload => FromJSON (JobsResponse payload) Source # | |||||
Defined in Arbiter.Servant.Types Methods parseJSON :: Value -> Parser (JobsResponse payload) parseJSONList :: Value -> Parser [JobsResponse payload] omittedField :: Maybe (JobsResponse payload) | |||||
| ToJSON payload => ToJSON (JobsResponse payload) Source # | |||||
Defined in Arbiter.Servant.Types Methods toJSON :: JobsResponse payload -> Value toEncoding :: JobsResponse payload -> Encoding toJSONList :: [JobsResponse payload] -> Value toEncodingList :: [JobsResponse payload] -> Encoding omitField :: JobsResponse payload -> Bool | |||||
| Generic (JobsResponse payload) Source # | |||||
Defined in Arbiter.Servant.Types Associated Types
Methods from :: JobsResponse payload -> Rep (JobsResponse payload) x # to :: Rep (JobsResponse payload) x -> JobsResponse payload # | |||||
| Show payload => Show (JobsResponse payload) Source # | |||||
Defined in Arbiter.Servant.Types Methods showsPrec :: Int -> JobsResponse payload -> ShowS # show :: JobsResponse payload -> String # showList :: [JobsResponse payload] -> ShowS # | |||||
| Eq payload => Eq (JobsResponse payload) Source # | |||||
Defined in Arbiter.Servant.Types Methods (==) :: JobsResponse payload -> JobsResponse payload -> Bool # (/=) :: JobsResponse payload -> JobsResponse payload -> Bool # | |||||
| type Rep (JobsResponse payload) Source # | |||||
Defined in Arbiter.Servant.Types type Rep (JobsResponse payload) = D1 ('MetaData "JobsResponse" "Arbiter.Servant.Types" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "JobsResponse" 'PrefixI 'True) ((S1 ('MetaSel ('Just "jobs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ApiJob payload]) :*: (S1 ('MetaSel ('Just "jobsTotal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "jobsOffset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) :*: ((S1 ('MetaSel ('Just "jobsLimit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "childCounts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map Int64 Int64))) :*: (S1 ('MetaSel ('Just "pausedParents") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Int64]) :*: S1 ('MetaSel ('Just "dlqChildCounts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map Int64 Int64)))))) | |||||
data DLQResponse payload Source #
Response wrapper for DLQ jobs
Constructors
| DLQResponse | |
Instances
| FromJSON payload => FromJSON (DLQResponse payload) Source # | |||||
Defined in Arbiter.Servant.Types Methods parseJSON :: Value -> Parser (DLQResponse payload) parseJSONList :: Value -> Parser [DLQResponse payload] omittedField :: Maybe (DLQResponse payload) | |||||
| ToJSON payload => ToJSON (DLQResponse payload) Source # | |||||
Defined in Arbiter.Servant.Types Methods toJSON :: DLQResponse payload -> Value toEncoding :: DLQResponse payload -> Encoding toJSONList :: [DLQResponse payload] -> Value toEncodingList :: [DLQResponse payload] -> Encoding omitField :: DLQResponse payload -> Bool | |||||
| Generic (DLQResponse payload) Source # | |||||
Defined in Arbiter.Servant.Types Associated Types
Methods from :: DLQResponse payload -> Rep (DLQResponse payload) x # to :: Rep (DLQResponse payload) x -> DLQResponse payload # | |||||
| Show payload => Show (DLQResponse payload) Source # | |||||
Defined in Arbiter.Servant.Types Methods showsPrec :: Int -> DLQResponse payload -> ShowS # show :: DLQResponse payload -> String # showList :: [DLQResponse payload] -> ShowS # | |||||
| Eq payload => Eq (DLQResponse payload) Source # | |||||
Defined in Arbiter.Servant.Types Methods (==) :: DLQResponse payload -> DLQResponse payload -> Bool # (/=) :: DLQResponse payload -> DLQResponse payload -> Bool # | |||||
| type Rep (DLQResponse payload) Source # | |||||
Defined in Arbiter.Servant.Types type Rep (DLQResponse payload) = D1 ('MetaData "DLQResponse" "Arbiter.Servant.Types" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "DLQResponse" 'PrefixI 'True) ((S1 ('MetaSel ('Just "dlqJobs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ApiDLQJob payload]) :*: S1 ('MetaSel ('Just "dlqTotal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "dlqOffset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "dlqLimit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))) | |||||
data StatsResponse Source #
Queue statistics response
Constructors
| StatsResponse | |
Fields
| |
Instances
| FromJSON StatsResponse Source # | |||||
Defined in Arbiter.Servant.Types | |||||
| ToJSON StatsResponse Source # | |||||
Defined in Arbiter.Servant.Types Methods toJSON :: StatsResponse -> Value toEncoding :: StatsResponse -> Encoding toJSONList :: [StatsResponse] -> Value toEncodingList :: [StatsResponse] -> Encoding omitField :: StatsResponse -> Bool | |||||
| Generic StatsResponse Source # | |||||
Defined in Arbiter.Servant.Types Associated Types
| |||||
| Show StatsResponse Source # | |||||
Defined in Arbiter.Servant.Types Methods showsPrec :: Int -> StatsResponse -> ShowS # show :: StatsResponse -> String # showList :: [StatsResponse] -> ShowS # | |||||
| Eq StatsResponse Source # | |||||
Defined in Arbiter.Servant.Types Methods (==) :: StatsResponse -> StatsResponse -> Bool # (/=) :: StatsResponse -> StatsResponse -> Bool # | |||||
| type Rep StatsResponse Source # | |||||
Defined in Arbiter.Servant.Types type Rep StatsResponse = D1 ('MetaData "StatsResponse" "Arbiter.Servant.Types" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "StatsResponse" 'PrefixI 'True) (S1 ('MetaSel ('Just "stats") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 QueueStats) :*: S1 ('MetaSel ('Just "timestamp") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) | |||||
data CronSchedulesResponse Source #
Cron schedules response
Constructors
| CronSchedulesResponse | |
Fields | |
Instances
| FromJSON CronSchedulesResponse Source # | |||||
Defined in Arbiter.Servant.Types Methods parseJSON :: Value -> Parser CronSchedulesResponse parseJSONList :: Value -> Parser [CronSchedulesResponse] | |||||
| ToJSON CronSchedulesResponse Source # | |||||
Defined in Arbiter.Servant.Types Methods toJSON :: CronSchedulesResponse -> Value toEncoding :: CronSchedulesResponse -> Encoding toJSONList :: [CronSchedulesResponse] -> Value toEncodingList :: [CronSchedulesResponse] -> Encoding | |||||
| Generic CronSchedulesResponse Source # | |||||
Defined in Arbiter.Servant.Types Associated Types
Methods from :: CronSchedulesResponse -> Rep CronSchedulesResponse x # to :: Rep CronSchedulesResponse x -> CronSchedulesResponse # | |||||
| Show CronSchedulesResponse Source # | |||||
Defined in Arbiter.Servant.Types Methods showsPrec :: Int -> CronSchedulesResponse -> ShowS # show :: CronSchedulesResponse -> String # showList :: [CronSchedulesResponse] -> ShowS # | |||||
| Eq CronSchedulesResponse Source # | |||||
Defined in Arbiter.Servant.Types Methods (==) :: CronSchedulesResponse -> CronSchedulesResponse -> Bool # (/=) :: CronSchedulesResponse -> CronSchedulesResponse -> Bool # | |||||
| type Rep CronSchedulesResponse Source # | |||||
Defined in Arbiter.Servant.Types type Rep CronSchedulesResponse = D1 ('MetaData "CronSchedulesResponse" "Arbiter.Servant.Types" "arbiter-servant-0.1.0.0-inplace" 'False) (C1 ('MetaCons "CronSchedulesResponse" 'PrefixI 'True) (S1 ('MetaSel ('Just "cronSchedules") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [CronScheduleRow]))) | |||||
data CronScheduleRow #
A row from the cron_schedules table.
Constructors
| CronScheduleRow | |
Fields
| |
Instances
| FromJSON CronScheduleRow | |||||
Defined in Arbiter.Core.CronSchedule Methods parseJSON :: Value -> Parser CronScheduleRow parseJSONList :: Value -> Parser [CronScheduleRow] | |||||
| ToJSON CronScheduleRow | |||||
Defined in Arbiter.Core.CronSchedule Methods toJSON :: CronScheduleRow -> Value toEncoding :: CronScheduleRow -> Encoding toJSONList :: [CronScheduleRow] -> Value toEncodingList :: [CronScheduleRow] -> Encoding omitField :: CronScheduleRow -> Bool | |||||
| Generic CronScheduleRow | |||||
Defined in Arbiter.Core.CronSchedule Associated Types
Methods from :: CronScheduleRow -> Rep CronScheduleRow x # to :: Rep CronScheduleRow x -> CronScheduleRow # | |||||
| Show CronScheduleRow | |||||
Defined in Arbiter.Core.CronSchedule Methods showsPrec :: Int -> CronScheduleRow -> ShowS # show :: CronScheduleRow -> String # showList :: [CronScheduleRow] -> ShowS # | |||||
| Eq CronScheduleRow | |||||
Defined in Arbiter.Core.CronSchedule Methods (==) :: CronScheduleRow -> CronScheduleRow -> Bool # (/=) :: CronScheduleRow -> CronScheduleRow -> Bool # | |||||
| FromRow CronScheduleRow | |||||
Defined in Arbiter.Core.CronSchedule Methods fromRow :: RowParser CronScheduleRow | |||||
| ToRow CronScheduleRow | |||||
Defined in Arbiter.Core.CronSchedule Methods toRow :: CronScheduleRow -> [Action] | |||||
| type Rep CronScheduleRow | |||||
Defined in Arbiter.Core.CronSchedule type Rep CronScheduleRow = D1 ('MetaData "CronScheduleRow" "Arbiter.Core.CronSchedule" "arbiter-core-0.1.0.0-inplace" 'False) (C1 ('MetaCons "CronScheduleRow" 'PrefixI 'True) (((S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "defaultExpression") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "defaultOverlap") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "overrideExpression") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "overrideOverlap") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))))) :*: ((S1 ('MetaSel ('Just "enabled") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "lastFiredAt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe UTCTime))) :*: (S1 ('MetaSel ('Just "lastCheckedAt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe UTCTime)) :*: (S1 ('MetaSel ('Just "createdAt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTCTime) :*: S1 ('MetaSel ('Just "updatedAt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTCTime)))))) | |||||
data CronScheduleUpdate #
Patch update for a cron schedule.
Each field uses Maybe (Maybe a):
Nothing= don't changeJust Nothing= reset to default (set column to NULL)Just (Just x)= set tox
Constructors
| CronScheduleUpdate | |
Instances
| FromJSON CronScheduleUpdate | Manual instance to distinguish missing keys from
| ||||
Defined in Arbiter.Core.CronSchedule Methods parseJSON :: Value -> Parser CronScheduleUpdate parseJSONList :: Value -> Parser [CronScheduleUpdate] | |||||
| ToJSON CronScheduleUpdate | |||||
Defined in Arbiter.Core.CronSchedule Methods toJSON :: CronScheduleUpdate -> Value toEncoding :: CronScheduleUpdate -> Encoding toJSONList :: [CronScheduleUpdate] -> Value toEncodingList :: [CronScheduleUpdate] -> Encoding omitField :: CronScheduleUpdate -> Bool | |||||
| Generic CronScheduleUpdate | |||||
Defined in Arbiter.Core.CronSchedule Associated Types
Methods from :: CronScheduleUpdate -> Rep CronScheduleUpdate x # to :: Rep CronScheduleUpdate x -> CronScheduleUpdate # | |||||
| Show CronScheduleUpdate | |||||
Defined in Arbiter.Core.CronSchedule Methods showsPrec :: Int -> CronScheduleUpdate -> ShowS # show :: CronScheduleUpdate -> String # showList :: [CronScheduleUpdate] -> ShowS # | |||||
| Eq CronScheduleUpdate | |||||
Defined in Arbiter.Core.CronSchedule Methods (==) :: CronScheduleUpdate -> CronScheduleUpdate -> Bool # (/=) :: CronScheduleUpdate -> CronScheduleUpdate -> Bool # | |||||
| type Rep CronScheduleUpdate | |||||
Defined in Arbiter.Core.CronSchedule type Rep CronScheduleUpdate = D1 ('MetaData "CronScheduleUpdate" "Arbiter.Core.CronSchedule" "arbiter-core-0.1.0.0-inplace" 'False) (C1 ('MetaCons "CronScheduleUpdate" 'PrefixI 'True) (S1 ('MetaSel ('Just "overrideExpression") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Maybe Text))) :*: (S1 ('MetaSel ('Just "overrideOverlap") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Maybe Text))) :*: S1 ('MetaSel ('Just "enabled") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool))))) | |||||