- auth functions
- github functions
- hooks functions
- index functions
- notify functions
- object functions
- purge_cache functions
- queue functions
add_task_dependencyazure_queue_countazure_queue_deleteazure_queue_delete_expiredazure_queue_getazure_queue_putazure_queue_updatecancel_taskcheck_task_claimclaim_taskcreate_queue_artifactcreate_task_projiddelete_queue_artifactdelete_queue_provisionerdelete_queue_worker_typeensure_task_groupexpire_queue_workersexpire_task_dependenciesexpire_task_groupsexpire_task_queuesexpire_tasksget_dependent_tasksget_queue_artifactget_queue_artifacts_paginatedget_queue_worker_tqidget_queue_workers_tqidget_task_groupget_task_projidget_task_queueget_task_queuesget_tasks_by_task_group_projidis_task_blockedis_task_group_activemark_task_ever_resolvedquarantine_queue_workerqueue_artifact_presentqueue_worker_seenqueue_worker_task_seenreclaim_taskremove_taskremove_task_dependencyrerun_taskresolve_taskresolve_task_at_deadlinesatisfy_task_dependencyschedule_tasktask_queue_seenupdate_queue_artifact_2
- secrets functions
- web_server functions
- worker_manager functions
create_workercreate_worker_poolcreate_worker_pool_errordelete_workerdelete_worker_pooldelete_worker_pool_errorexpire_worker_pool_errorsexpire_worker_poolsexpire_workersget_non_stopped_workers_quntilget_worker_2get_worker_pool_errorget_worker_pool_errors_for_worker_poolget_worker_pool_with_capacityget_worker_pools_with_capacityget_workers_without_provider_dataremove_worker_pool_previous_provider_idupdate_worker_2update_worker_pool_provider_dataupdate_worker_pool_with_capacity
create_clientdelete_clientexpire_clientsget_clientget_clientsget_rolesmodify_rolesupdate_clientupdate_client_last_used
- Mode: write
- Arguments:
client_id_in textdescription_in textencrypted_access_token_in jsonbexpires_in timestamptzdisabled_in booleanscopes_in jsonbdelete_on_expiration_in boolean
- Returns:
void - Last defined on version: 41
Create a new client. The created and last_.. timestamps are all initialized to the current time. If the row exists but scopes, description, and expires match, disabled is false, and it was created in the last 15 minutes, then nothing is changed. Otherwise, a UNIQUE_VIOLATION is raised.
- Mode: write
- Arguments:
client_id_in text
- Returns:
void - Last defined on version: 41
Delete the given client. If the client does not exist, nothing happens.
- Mode: write
- Arguments:
- Returns:
integer - Last defined on version: 41
Delete all clients with an 'expires' in the past and with 'delete_on_expiration' set.
- Mode: read
- Arguments:
client_id_in text
- Returns:
tableclient_id textdescription textencrypted_access_token jsonbexpires timestamptzdisabled booleanscopes jsonbcreated timestamptzlast_modified timestamptzlast_date_used timestamptzlast_rotated timestamptzdelete_on_expiration boolean
- Last defined on version: 41
Get a client. Returns an empty set if the client does not exist.
- Mode: read
- Arguments:
prefix_in textpage_size_in integerpage_offset_in integer
- Returns:
tableclient_id textdescription textencrypted_access_token jsonbexpires timestamptzdisabled booleanscopes jsonbcreated timestamptzlast_modified timestamptzlast_date_used timestamptzlast_rotated timestamptzdelete_on_expiration boolean
- Last defined on version: 41
Get clients, ordered by client_id. If specified, only clients with
client_id beginning with prefix are returned. If the pagination
arguments are both NULL, all rows are returned. Otherwise, page_size
rows are returned at offset page_offset.
- Mode: read
- Arguments:
- Returns:
tablerole_id textscopes jsonbcreated timestamptzdescription textlast_modified timestamptzetag uuid
- Last defined on version: 25
Get the full set of roles. Each result row has an etag, but all such etags will be the same, representing the etag for the most recent modification of the table. Results are sorted by role_id.
- Mode: write
- Arguments:
roles_in jsonbold_etag_in uuid
- Returns:
void - Last defined on version: 25
Replace the current set of roles entirely with the given set of roles, if the current etag matches the existing etag.
The role objects are specified with underscore spelling (role_id).
If the etag has changed, this returns P0004 signalling that the caller should fetch a fresh set of roles and try again.
If there are no existing roles, then the old etag is not used.
- Mode: write
- Arguments:
client_id_in textdescription_in textencrypted_access_token_in jsonbexpires_in timestamptzdisabled_in booleanscopes_in jsonbdelete_on_expiration_in boolean
- Returns:
tableclient_id textdescription textencrypted_access_token jsonbexpires timestamptzdisabled booleanscopes jsonbcreated timestamptzlast_modified timestamptzlast_date_used timestamptzlast_rotated timestamptzdelete_on_expiration boolean
- Last defined on version: 41
Update an existing client, returning the updated client or, if no such client exists, an empty set. This does not implement optimistic concurrency: any non-null arguments to this function will overwrite existing values. The last_modified column is updated automatically, as is last_rotated if the access token is set.
- Mode: write
- Arguments:
client_id_in text
- Returns:
void - Last defined on version: 41
Indicate that this client has been recently used, updating its last_date_used field. Does nothing if the client does not exist.
create_github_buildcreate_github_checkdelete_github_buildget_github_buildget_github_buildsget_github_check_by_task_idget_github_integrationget_github_integrationsset_github_build_stateupsert_github_integration
- Mode: write
- Arguments:
organization_in textrepository_in textsha_in texttask_group_id_in textstate_in textcreated_in timestamptzupdated_in timestamptzinstallation_id_in integerevent_type_in textevent_id_in text
- Returns:
void - Last defined on version: 23
Create a new github build. Raises UNIQUE_VIOLATION if the pool already exists.
- Mode: write
- Arguments:
task_group_id_in texttask_id_in textcheck_suite_id_in textcheck_run_id_in text
- Returns:
void - Last defined on version: 58
Upsert a single check.
- Mode: write
- Arguments:
task_group_id_in text
- Returns:
void - Last defined on version: 23
Delete a github build.
- Mode: read
- Arguments:
task_group_id_in text
- Returns:
tableorganization textrepository textsha texttask_group_id textstate textcreated timestamptzupdated timestamptzinstallation_id integerevent_type textevent_id textetag uuid
- Last defined on version: 49
Get a github build. The returned table will have one or zero rows.
- Mode: read
- Arguments:
page_size_in integerpage_offset_in integerorganization_in textrepository_in textsha_in text
- Returns:
tableorganization textrepository textsha texttask_group_id textstate textcreated timestamptzupdated timestamptzinstallation_id integerevent_type textevent_id textetag uuid
- Last defined on version: 49
Get github builds.
- Mode: read
- Arguments:
task_id_in text
- Returns:
tabletask_group_id texttask_id textcheck_suite_id textcheck_run_id text
- Last defined on version: 37
Get a single check from a task_id.
- Mode: read
- Arguments:
owner_in text
- Returns:
tableowner textinstallation_id integer
- Last defined on version: 36
Get a single integration by owner.
- Mode: read
- Arguments:
page_size_in integerpage_offset_in integer
- Returns:
tableowner textinstallation_id integer
- Last defined on version: 36
Get a list of integrations.
- Mode: write
- Arguments:
task_group_id_in textstate_in text
- Returns:
void - Last defined on version: 49
Only update the state of a build and update the updated timestamp
- Mode: write
- Arguments:
owner_in textinstallation_id_in integer
- Returns:
void - Last defined on version: 36
Create a single integration.
create_hookcreate_hooks_queuecreate_last_firedelete_hookdelete_hooks_queuedelete_last_firesexpire_last_firesget_hookget_hooksget_hooks_queuesget_last_fireget_last_firesupdate_hookupdate_hooks_queue_bindings
- Mode: write
- Arguments:
hook_group_id_in texthook_id_in textmetadata_in jsonbtask_in jsonbbindings_in jsonbschedule_in jsonbencrypted_trigger_token_in jsonbencrypted_next_task_id_in jsonbnext_scheduled_date_in timestamptztrigger_schema_in jsonb
- Returns:
tablehook_group_id texthook_id textmetadata jsonbtask jsonbbindings jsonbschedule jsonbencrypted_trigger_token jsonbencrypted_next_task_id jsonbnext_scheduled_date timestamptztrigger_schema jsonb
- Last defined on version: 35
Create a new hook. Raises UNIQUE_VIOLATION if the artifact already exists. Returns the newly created hook.
- Mode: write
- Arguments:
hook_group_id_in texthook_id_in textqueue_name_in textbindings_in jsonb
- Returns:
uuid - Last defined on version: 49
Create a new hooks queue. Raises UNIQUE_VIOLATION if the hook already exists.
- Mode: write
- Arguments:
hook_group_id_in texthook_id_in textfired_by_in texttask_id_in texttask_create_time_in timestamptzresult_in texterror_in text
- Returns:
uuid - Last defined on version: 49
Create a new hook last fire. Raises UNIQUE_VIOLATION if the hook already exists.
- Mode: write
- Arguments:
hook_group_id_in texthook_id_in text
- Returns:
void - Last defined on version: 35
Delete a hook.
- Mode: write
- Arguments:
hook_group_id_in texthook_id_in text
- Returns:
void - Last defined on version: 49
Delete a hooks queue.
- Mode: write
- Arguments:
hook_group_id_in texthook_id_in text
- Returns:
void - Last defined on version: 32
Delete last fires that match a given hook_group_id and hook_id.
- Mode: write
- Arguments:
- Returns:
integer - Last defined on version: 32
Expire last fires that are older than a year. Returns a count of rows that have been deleted.
- Mode: read
- Arguments:
hook_group_id_in texthook_id_in text
- Returns:
tablehook_group_id texthook_id textmetadata jsonbtask jsonbbindings jsonbschedule jsonbencrypted_trigger_token jsonbencrypted_next_task_id jsonbnext_scheduled_date timestamptztrigger_schema jsonb
- Last defined on version: 35
Get a hook. The returned table will have one or zero rows.
- Mode: read
- Arguments:
hook_group_id_in textnext_scheduled_date_in timestamptzpage_size_in integerpage_offset_in integer
- Returns:
tablehook_group_id texthook_id textmetadata jsonbtask jsonbbindings jsonbschedule jsonbencrypted_trigger_token jsonbencrypted_next_task_id jsonbnext_scheduled_date timestamptztrigger_schema jsonb
- Last defined on version: 35
Get existing hooks filtered by the optional hook_group_id,
ordered by the hook_group_id and hook_id.
If the pagination arguments are both NULL, all rows are returned.
Otherwise, page_size rows are returned at offset page_offset.
- Mode: read
- Arguments:
page_size_in integerpage_offset_in integer
- Returns:
tablehook_group_id texthook_id textqueue_name textbindings jsonbetag uuid
- Last defined on version: 49
Get hooks queues ordered by hook_group_id and hook_id.
If the pagination arguments are both NULL, all rows are returned.
Otherwise, page_size rows are returned at offset page_offset.
- Mode: read
- Arguments:
hook_group_id_in texthook_id_in texttask_id_in text
- Returns:
tablehook_group_id texthook_id textfired_by texttask_id texttask_create_time timestamptzresult texterror textetag uuid
- Last defined on version: 49
Get a hook last fire.
- Mode: read
- Arguments:
hook_group_id_in texthook_id_in textpage_size_in integerpage_offset_in integer
- Returns:
tablehook_group_id texthook_id textfired_by texttask_id texttask_create_time timestamptzresult texterror textetag uuid
- Last defined on version: 49
Get hooks last fires filtered by the hook_group_id and hook_id arguments,
ordered by hook_group_id, hook_id, and worker_id.
If the pagination arguments are both NULL, all rows are returned.
Otherwise, page_size rows are returned at offset page_offset.
- Mode: write
- Arguments:
hook_group_id_in texthook_id_in textmetadata_in jsonbtask_in jsonbbindings_in jsonbschedule_in jsonbencrypted_trigger_token_in jsonbencrypted_next_task_id_in jsonbnext_scheduled_date_in timestamptztrigger_schema_in jsonb
- Returns:
tablehook_group_id texthook_id textmetadata jsonbtask jsonbbindings jsonbschedule jsonbencrypted_trigger_token jsonbencrypted_next_task_id jsonbnext_scheduled_date timestamptztrigger_schema jsonb
- Last defined on version: 35
Update a queue artifact. Returns the up-to-date hook row that have the same hook group id and hook id.
- Mode: write
- Arguments:
hook_group_id_in texthook_id_in textbindings_in jsonb
- Returns:
tablehook_group_id texthook_id textqueue_name textbindings jsonbetag uuid
- Last defined on version: 49
Update bindings of a hooks queue. If no such queue exists, the return value is an empty set.
create_index_namespacecreate_indexed_taskdelete_indexed_taskexpire_index_namespacesexpire_indexed_tasksget_index_namespaceget_index_namespacesget_indexed_taskget_indexed_tasksupdate_index_namespaceupdate_indexed_task
- Mode: write
- Arguments:
parent_in textname_in textexpires_in timestamptz
- Returns:
tableparent textname textexpires timestamptz
- Last defined on version: 26
Create a new namespace. Raises UNIQUE_VIOLATION if the namespace already exists. Returns the newly created namespace.
- Mode: write
- Arguments:
namespace_in textname_in textrank_in integertask_id_in textdata_in jsonbexpires_in timestamptz
- Returns:
tablenamespace textname textrank integertask_id textdata jsonbexpires timestamptz
- Last defined on version: 26
Create a new indexed task. Raises UNIQUE_VIOLATION if the indexed task already exists. Returns the newly created indexed task.
- Mode: write
- Arguments:
namespace_in textname_in text
- Returns:
void - Last defined on version: 65
Delete the named task from the index. Returns succesfully even if the named task does not exist.
- Mode: write
- Arguments:
- Returns:
integer - Last defined on version: 26
Expire index_namespaces that come before the current time. Returns a count of rows that have been deleted.
- Mode: write
- Arguments:
- Returns:
integer - Last defined on version: 26
Expire indexed tasks that come before the current time. Returns a count of rows that have been deleted.
- Mode: read
- Arguments:
parent_in textname_in text
- Returns:
tableparent textname textexpires timestamptz
- Last defined on version: 26
Get a namespace. The returned table will have one or zero rows.
- Mode: read
- Arguments:
parent_in textname_in textpage_size_in integerpage_offset_in integer
- Returns:
tableparent textname textexpires timestamptz
- Last defined on version: 26
Get existing index_namespaces filtered by the optional arguments,
ordered by the parent and name.
If the pagination arguments are both NULL, all rows are returned.
Otherwise, page_size rows are returned at offset page_offset.
- Mode: read
- Arguments:
namespace_in textname_in text
- Returns:
tablenamespace textname textrank integertask_id textdata jsonbexpires timestamptz
- Last defined on version: 26
Get an indexed task. The returned table will have one or zero rows.
- Mode: read
- Arguments:
namespace_in textname_in textpage_size_in integerpage_offset_in integer
- Returns:
tablenamespace textname textrank integertask_id textdata jsonbexpires timestamptz
- Last defined on version: 26
Get existing indexed tasks filtered by the optional arguments,
ordered by the namespace and name.
If the pagination arguments are both NULL, all rows are returned.
Otherwise, page_size rows are returned at offset page_offset.
- Mode: write
- Arguments:
parent_in textname_in textexpires_in timestamptz
- Returns:
tableparent textname textexpires timestamptz
- Last defined on version: 26
Update a namespace. Returns the up-to-date namespace row that have the same parent and name. If the row is not found then an exception with code 'P0002' is thrown.
- Mode: write
- Arguments:
namespace_in textname_in textrank_in integertask_id_in textdata_in jsonbexpires_in timestamptz
- Returns:
tablenamespace textname textrank integertask_id textdata jsonbexpires timestamptz
- Last defined on version: 26
Update an indexed task. Returns the up-to-date indexed task row that have the same namespace and name.
- Mode: write
- Arguments:
notification_type_in textnotification_address_in text
- Returns:
void - Last defined on version: 49
If the denylist address already exists, this is a no-op. Otherwise, add the denylist address for the taskcluster-notify service, with a new random etag.
- Mode: read
- Arguments:
page_size_in integerpage_offset_in integer
- Returns:
tablenotification_type textnotification_address text
- Last defined on version: 17
List all denylist addresses for the taskcluster-notify service.
- Mode: write
- Arguments:
notification_type_in textnotification_address_in text
- Returns:
integer - Last defined on version: 17
Delete a denylist address for the taskcluster-notify service. Returns number of rows deleted (0 or 1).
- Mode: read
- Arguments:
notification_type_in textnotification_address_in text
- Returns:
boolean - Last defined on version: 17
Returns a boolean indicating whether the denylist type/address exists.
add_object_hashescreate_object_for_uploaddelete_objectget_expired_objectsget_object_hashesget_object_with_uploadobject_upload_complete
- Mode: write
- Arguments:
name_in texthashes_in jsonb
- Returns:
void - Last defined on version: 67
Add the given hashes, of the form {algorithm: hash}, to the named
object. The named object must already exist. If any of the given
algorithms already exist in the table, then the hash must match exactly.
This function raises a CHECK_VIOLATION if the object's upload has been
finished (upload_id is null) or FOREIGN_KEY_VIOLATION if the object does
not exist.
- Mode: write
- Arguments:
name_in textproject_id_in textbackend_id_in textupload_id_in textupload_expires_in timestamptzdata_in jsonbexpires_in timestamptz
- Returns:
void - Last defined on version: 56
Create an object record ready for upload.
This method is idempotent, and will succeed if called multiple times with
the same parameters, as long as upload_id is still set (that is, until
the upload is completed). Otherwise it will raise a UNIQUE_VIOLATION
exception. upload_expires_in is excluded from this comparison.
- Mode: write
- Arguments:
name_in text
- Returns:
void - Last defined on version: 54
Delete an object.
- Mode: read
- Arguments:
limit_in integerstart_at_in text
- Returns:
tablename textdata jsonbproject_id textbackend_id textexpires timestamptz
- Last defined on version: 56
Get objects with an expiration before the current time. If given, only
objects with a name greater than start_at_in are returned. The
limit_in argument limits the number of results returned. This returns
both expired objects (expires < now) and expired uploads (upload_expires
< now).
- Mode: read
- Arguments:
name_in text
- Returns:
tablealgorithm texthash text
- Last defined on version: 67
Get all hashes for the named object. If the given object has no hashes, or doesn't exist, this function returns an empty result.
- Mode: read
- Arguments:
name_in text
- Returns:
tablename textdata jsonbproject_id textbackend_id textupload_id textupload_expires timestamptzexpires timestamptz
- Last defined on version: 56
Get an object by name, or an empty set if no such object exists.
- Mode: write
- Arguments:
name_in textupload_id_in text
- Returns:
void - Last defined on version: 56
Mark an object as uploaded and ready for download.
This method is idempotent, and will succeed if the object is already ready for download.
- Mode: read
- Arguments:
page_size_in integerpage_offset_in integer
- Returns:
tableworker_pool_id textcache_name textbefore timestamptz
- Last defined on version: 50
View all active purge requests.
- Mode: write
- Arguments:
expires_in timestamptz
- Returns:
integer - Last defined on version: 9
Expire cache purges that come before expires_in.
Returns a count of rows that have been deleted.
- Mode: write
- Arguments:
worker_pool_id_in textcache_name_in textbefore_in timestamptzexpires_in timestamptz
- Returns:
void - Last defined on version: 50
Publish a request to purge caches with name cache_name_in
on provisioner_id_in/worker_type_in workers.
- Mode: read
- Arguments:
worker_pool_id_in text
- Returns:
tableworker_pool_id textcache_name textbefore timestamptz
- Last defined on version: 50
List the caches for this provisioner_id_in/worker_type_in.
add_task_dependencyazure_queue_countazure_queue_deleteazure_queue_delete_expiredazure_queue_getazure_queue_putazure_queue_updatecancel_taskcheck_task_claimclaim_taskcreate_queue_artifactcreate_task_projiddelete_queue_artifactdelete_queue_provisionerdelete_queue_worker_typeensure_task_groupexpire_queue_workersexpire_task_dependenciesexpire_task_groupsexpire_task_queuesexpire_tasksget_dependent_tasksget_queue_artifactget_queue_artifacts_paginatedget_queue_worker_tqidget_queue_workers_tqidget_task_groupget_task_projidget_task_queueget_task_queuesget_tasks_by_task_group_projidis_task_blockedis_task_group_activemark_task_ever_resolvedquarantine_queue_workerqueue_artifact_presentqueue_worker_seenqueue_worker_task_seenreclaim_taskremove_taskremove_task_dependencyrerun_taskresolve_taskresolve_task_at_deadlinesatisfy_task_dependencyschedule_tasktask_queue_seenupdate_queue_artifact_2
- Mode: write
- Arguments:
dependent_task_id_in textrequired_task_id_in textrequires_in task_requiresexpires_in timestamptz
- Returns:
void - Last defined on version: 49
Create an un-satisfied task dependency between the two tasks, with the given requirement style and expiration. If the dependency already exists, nothing happens.
- Mode: read
- Arguments:
queue_name text
- Returns:
integer - Last defined on version: 6
Count non-expired messages in the named queue.
- Mode: write
- Arguments:
queue_name textmessage_id uuidpop_receipt uuid
- Returns:
void - Last defined on version: 3
Delete the message identified by the given queue_name, message_id and
pop_receipt.
- Mode: write
- Arguments:
- Returns:
void - Last defined on version: 3
Delete all expired messages. This is a maintenance task that should occur about once an hour.
- Mode: write
- Arguments:
queue_name textvisible timestampcount integer
- Returns:
tablemessage_id uuidmessage_text textpop_receipt uuid
- Last defined on version: 5
Get up to count messages from the given queue, setting the visible
column of each to the given value. Returns a message_id and
pop_receipt for each one, for use with azure_queue_delete and
azure_queue_update.
- Mode: write
- Arguments:
queue_name textmessage_text textvisible timestampexpires timestamp
- Returns:
void - Last defined on version: 3
Put the given message into the given queue. The message will not be visible until after the visible timestamp, and will disappear after the expires timestamp.
- Mode: write
- Arguments:
queue_name textmessage_text textmessage_id uuidpop_receipt uuidvisible timestamp
- Returns:
void - Last defined on version: 3
Update the message identified by the given queue_name, message_id and
pop_receipt, setting its visible and message_text properties as
given.
- Mode: write
- Arguments:
task_id textreason text
- Returns:
tableretries_left integerruns jsonbtaken_until timestamptz
- Last defined on version: 28
If the current run is pending or running, mark it as exception with the given reason. If the task is unscheduled, a run with that status is created to represent the cancellation. This returns the task's updated status, or nothing if the current status was not as expected.
- Mode: write
- Arguments:
task_id textrun_id inttaken_until_in timestamptz
- Returns:
tableretries_left integerruns jsonbtaken_until timestamptz
- Last defined on version: 28
Check the given task for a claim on the given run expiring at the given time. If the run is still running, it is marked as claim-expired and a retry scheduled (if retries_left).
This returns the task's updated status, or nothing if the current status was not as expected.
- Mode: write
- Arguments:
task_id textrun_id intworker_group textworker_id texthint_id texttaken_until_in timestamptz
- Returns:
tableretries_left integerruns jsonbtaken_until timestamptz
- Last defined on version: 28
Claim the given run of the given task for the given worker. The hint is recorded in the run, for comparison when the claim expires. This returns the task's updated status, or nothing if the current status was not as expected.
- Mode: write
- Arguments:
task_id_in textrun_id_in integername_in textstorage_type_in textcontent_type_in textdetails_in jsonbpresent_in booleanexpires_in timestamptz
- Returns:
tabletask_id textrun_id integername textstorage_type textcontent_type textdetails jsonbpresent booleanexpires timestamptz
- Last defined on version: 24
Create a new artifact. Raises UNIQUE_VIOLATION if the artifact already exists. Returns the newly created artifact.
- Mode: write
- Arguments:
task_id texttask_queue_id textscheduler_id textproject_id texttask_group_id textdependencies jsonbrequires task_requiresroutes jsonbpriority task_priorityretries integercreated timestamptzdeadline timestamptzexpires timestamptzscopes jsonbpayload jsonbmetadata jsonbtags jsonbextra jsonb
- Returns:
void - Last defined on version: 63
Create a new task, without scheduling it, and with empty values for the status information.
- Mode: write
- Arguments:
task_id_in textrun_id_in integername_in text
- Returns:
void - Last defined on version: 24
Delete a queue artifact.
- Mode: write
- Arguments:
provisioner_id textstability textdescription text
- Returns:
void - Last defined on version: 45
Delete a queue provisioner.
- Mode: write
- Arguments:
provisioner_id textworker_type textstability textdescription text
- Returns:
void - Last defined on version: 44
Delete a queue worker type.
- Mode: write
- Arguments:
task_group_id_in textscheduler_id_in textexpires_in timestamptz
- Returns:
void - Last defined on version: 49
Ensure that the given task group exists, has the matching scheduler_id, and has an expiration greater than the given expiration. Expiration is bumped by an hour at a time to avoid unnecessary updates. This returns 23505 (UNIQUE_VIOLATION) when the group exists with a different scheduler_id.
- Mode: write
- Arguments:
expires_in timestamptz
- Returns:
integer - Last defined on version: 43
Expire non-quarantined queue workers that come before expires_in.
Returns a count of rows that have been deleted.
- Mode: write
- Arguments:
expires_in timestamptz
- Returns:
integer - Last defined on version: 28
Delete task dependencies with expiration dates before expires_in.
Returns a count of rows that have been deleted.
- Mode: write
- Arguments:
expires_in timestamptz
- Returns:
integer - Last defined on version: 28
Delete task groups with expiration dates before expires_in.
Returns a count of rows that have been deleted.
- Mode: write
- Arguments:
expires_in timestamptz
- Returns:
integer - Last defined on version: 53
Expire task queues that come before expires_in.
Returns a count of rows that have been deleted.
- Mode: write
- Arguments:
expires_in timestamptz
- Returns:
integer - Last defined on version: 28
Delete tasks with expiration dates before expires_in.
Returns a count of rows that have been deleted.
- Mode: read
- Arguments:
required_task_id_in textsatisfied_in booleantasks_after_in textpage_size_in integerpage_offset_in integer
- Returns:
tabledependent_task_id textrequires task_requiressatisfied boolean
- Last defined on version: 46
Get the un-expired tasks that depend on this one, limiting to only (un)satisfied
dependencies if satisfied_in is not null.
Only dependencies with dependent_task_id > tasks_after_in are returned.
This supports paginated queries that are not susceptible to rows being
added or removed. Typically only one of page_offset_in and
tasks_after_in are non-null.
- Mode: read
- Arguments:
task_id_in textrun_id_in integername_in text
- Returns:
tabletask_id textrun_id integername textstorage_type textcontent_type textdetails jsonbpresent booleanexpires timestamptz
- Last defined on version: 24
Get a queue artifact. The returned table will have one or zero row.
- Mode: read
- Arguments:
task_id_in textrun_id_in integerexpires_in timestamptzpage_size_in integerafter_task_id_in textafter_run_id_in integerafter_name_in text
- Returns:
tabletask_id textrun_id integername textstorage_type textcontent_type textdetails jsonbpresent booleanexpires timestamptz
- Last defined on version: 57
Get existing queue artifacts, filtered by the optional arguments, ordered
by the task_id, run_id, and name. The after_* arguments specify
where the page of results should begin, and must all be specified if any
are specified. Typically these values would be drawn from the last item
in the previous page.
- Mode: read
- Arguments:
task_queue_id_in textworker_group_in textworker_id_in textexpires_in timestamptz
- Returns:
tabletask_queue_id textworker_group textworker_id textquarantine_until timestamptzexpires timestamptzfirst_claim timestamptzrecent_tasks jsonbetag uuid
- Last defined on version: 53
Get a non-expired queue worker by task_queue_id, worker_group, and worker_id. Workers are not considered expired until after their quarantine date expires.
- Mode: read
- Arguments:
task_queue_id_in textexpires_in timestamptzpage_size_in integerpage_offset_in integer
- Returns:
tabletask_queue_id textworker_group textworker_id textquarantine_until timestamptzexpires timestamptzfirst_claim timestamptzrecent_tasks jsonbetag uuid
- Last defined on version: 53
Get non-expired queue workers ordered by task_queue_id, worker_group, and worker_id. Workers are not considered expired until after their quarantine date expires. If the pagination arguments are both NULL, all rows are returned. Otherwise, page_size rows are returned at offset page_offset.
- Mode: read
- Arguments:
task_group_id_in text
- Returns:
tabletask_group_id textscheduler_id textexpires timestamptz
- Last defined on version: 28
Get a task group.
- Mode: read
- Arguments:
task_id_in text
- Returns:
tabletask_id texttask_queue_id textscheduler_id textproject_id texttask_group_id textdependencies jsonbrequires task_requiresroutes jsonbpriority task_priorityretries integerretries_left intcreated timestamptzdeadline timestamptzexpires timestamptzscopes jsonbpayload jsonbmetadata jsonbtags jsonbextra jsonbruns jsonbtaken_until timestamptz
- Last defined on version: 63
Get all properties of a task. Note that all properties but runs,
retries_left, and taken_until are immutable.
- Mode: read
- Arguments:
task_queue_id_in textexpires_in timestamptz
- Returns:
tabletask_queue_id textexpires timestamptzlast_date_active timestamptzdescription textstability textetag uuid
- Last defined on version: 53
Get a non-expired task queue by task_queue_id.
- Mode: read
- Arguments:
task_queue_id_in textexpires_in timestamptzpage_size_in integerpage_offset_in integer
- Returns:
tabletask_queue_id textexpires timestamptzlast_date_active timestamptzdescription textstability textetag uuid
- Last defined on version: 53
Get task queues ordered by task_queue_id.
If the pagination arguments are both NULL, all rows are returned.
Otherwise, page_size rows are returned at offset page_offset.
- Mode: read
- Arguments:
task_group_id_in textpage_size_in integerpage_offset_in integer
- Returns:
tabletask_id texttask_queue_id textscheduler_id textproject_id texttask_group_id textdependencies jsonbrequires task_requiresroutes jsonbpriority task_priorityretries integerretries_left intcreated timestamptzdeadline timestamptzexpires timestamptzscopes jsonbpayload jsonbmetadata jsonbtags jsonbextra jsonbruns jsonbtaken_until timestamptz
- Last defined on version: 63
Get all properties of all tasks in the given task group.
- Mode: read
- Arguments:
dependent_task_id_in text
- Returns:
boolean - Last defined on version: 28
Return true if the task has remaining un-satisfied dependencies.
- Mode: read
- Arguments:
task_group_id_in text
- Returns:
boolean - Last defined on version: 28
temp, removed in next commit
- Mode: write
- Arguments:
task_id_in text
- Returns:
void - Last defined on version: 28
temp, removed in next commit
- Mode: write
- Arguments:
task_queue_id_in textworker_group_in textworker_id_in textquarantine_until_in timestamptz
- Returns:
tabletask_queue_id textworker_group textworker_id textquarantine_until timestamptzexpires timestamptzfirst_claim timestamptzrecent_tasks jsonb
- Last defined on version: 64
Update the quarantine_until date for a worker. The Queue service interprets a date in the past as "not quarantined". This function also "bumps" the expiration of the worker so that un-quarantined workers do not immediately expire. Returns the worker row just as get_queue_worker would, or no rows if no such worker exists.
- Mode: write
- Arguments:
task_id_in textrun_id_in integername_in text
- Returns:
tabletask_id textrun_id integername textstorage_type textcontent_type textdetails jsonbpresent booleanexpires timestamptz
- Last defined on version: 68
Mark the given queue artifact as present, returning the updated artifact. Returns nothing if no such artifact exists.
- Mode: write
- Arguments:
task_queue_id_in textworker_group_in textworker_id_in textexpires_in timestamptz
- Returns:
void - Last defined on version: 64
Recognize that a worker has been seen by the queue, creating it if necessary. This is called when workers claim or re-claim work. The expiration time is not allowed to move backward.
This function always writes to the DB, so calls should be suitably rate-limited at the client side.
- Mode: write
- Arguments:
task_queue_id_in textworker_group_in textworker_id_in texttask_run_in jsonb
- Returns:
void - Last defined on version: 64
Update the worker record to indicate that this task run was seen there. The
task run should be a JSON object with keys taskId and runId. This will
add the task to recent_tasks, keeping the most recent 20 tasks. This
will do nothing, but not fail, if the worker does not exist, as it is
unusual for a nonexistent worker to claim work.
- Mode: write
- Arguments:
task_id textrun_id inttaken_until_in timestamptz
- Returns:
tableretries_left integerruns jsonbtaken_until timestamptz
- Last defined on version: 28
Relaim the given run of the given task run, until the new taken_until time. This returns the task's updated status, or nothing if the current status was not as expected.
- Mode: write
- Arguments:
task_id text
- Returns:
void - Last defined on version: 28
Remove the given task, regardless of its expiration status. This is typically used when task creation has failed.
- Mode: write
- Arguments:
dependent_task_id_in textrequired_task_id_in text
- Returns:
void - Last defined on version: 28
Mark the given dependency as satisfied. If the dependency does not exist, nothing happens.
- Mode: write
- Arguments:
task_id text
- Returns:
tableretries_left integerruns jsonbtaken_until timestamptz
- Last defined on version: 28
Ensure that no run is currently running or pending, and then create a new
pending run with the given reason. This also resets the retries_left
column to retries (unless the sanity-check maximum runs has been
reached). This returns the task's updated status, or nothing if the
current status was not as expected.
- Mode: write
- Arguments:
task_id textrun_id intstate textreason textretry_reason text
- Returns:
tableretries_left integerruns jsonbtaken_until timestamptz
- Last defined on version: 28
Resolve the given run with the given state and reason, setting
run.resolved and resetting taken_until. If retry_reason is not null
and there are retries_left, a new pending run is added, and
retries_left is decremented. This returns the task's updated status,
or nothing if the current status was not as expected.
- Mode: write
- Arguments:
task_id text
- Returns:
tableretries_left integerruns jsonbtaken_until timestamptz
- Last defined on version: 28
The given task has reached its deadline, so mark it as resolved, adding a run if necessary. This returns the task's updated status, or nothing if the current status was not as expected.
- Mode: write
- Arguments:
dependent_task_id_in textrequired_task_id_in text
- Returns:
void - Last defined on version: 28
Mark the given dependency as satisfied. If the dependency does not exist, nothing happens.
- Mode: write
- Arguments:
task_id textreason_created text
- Returns:
tableretries_left integerruns jsonbtaken_until timestamptz
- Last defined on version: 28
Schedule the initial run for a task, moving the task from "unscheduled" to "pending". This returns the task's updated status, or nothing if the current status was not as expected.
- Mode: write
- Arguments:
task_queue_id_in textexpires_in timestamptzdescription_in textstability_in text
- Returns:
void - Last defined on version: 64
Recognize that a task queue has been seen, creating it if necessary, updating its properties if not null, and in any case bumping its last seen time time. The expiration time is not allowed to move backward.
This function always writes to the DB, so calls should be suitably rate-limited at the client side.
- Mode: write
- Arguments:
task_id_in textrun_id_in integername_in textstorage_type_in textdetails_in jsonbexpires_in timestamptz
- Returns:
tabletask_id textrun_id integername textstorage_type textcontent_type textdetails jsonbpresent booleanexpires timestamptz
- Last defined on version: 62
Update a queue artifact, including its storageType. Returns the up-to-date artifact row that have the same task id, run id, and name.
- Mode: write
- Arguments:
name_in text
- Returns:
void - Last defined on version: 42
Delete a secret entirely
- Mode: write
- Arguments:
- Returns:
integer - Last defined on version: 42
Delete all secrets with an 'expires' in the past.
- Mode: read
- Arguments:
name_in text
- Returns:
tablename textencrypted_secret jsonbexpires timestamptz
- Last defined on version: 42
Get a single secret (including secret content and expiration)
- Mode: read
- Arguments:
page_size_in integerpage_offset_in integer
- Returns:
tablename text
- Last defined on version: 42
Get many secrets at once. This only includes names. Fetch an individual secret to get the contents
- Mode: write
- Arguments:
name_in textencrypted_secret_in jsonbexpires_in timestamptz
- Returns:
void - Last defined on version: 42
Store an encrypted secret whether it is new or being updated
add_github_access_tokencreate_access_tokencreate_authorization_codeexpire_access_tokensexpire_authorization_codesexpire_sessionsget_access_tokenget_authorization_codeload_github_access_tokensession_addsession_loadsession_removesession_touch
- Mode: write
- Arguments:
user_id_in textencrypted_access_token_in jsonb
- Returns:
void - Last defined on version: 27
Sets the encrypted access token for user_id_in to
encrypted_access_token_in.
If no access token is currently set for user_id_in, a new row is
inserted, otherwise the existing row's encrypted access token is updated
to encrypted_access_token_in.
- Mode: write
- Arguments:
hashed_access_token_in textencrypted_access_token_in jsonbclient_id_in textredirect_uri_in textidentity_in textidentity_provider_id_in textexpires_in timestamptzclient_details_in jsonb
- Returns:
tablehashed_access_token textencrypted_access_token jsonbclient_id textredirect_uri textidentity textidentity_provider_id textexpires timestamptzclient_details jsonb
- Last defined on version: 40
Create an access token entry.
- Mode: write
- Arguments:
code_in textclient_id_in textredirect_uri_in textidentity_in textidentity_provider_id_in textexpires_in timestamptzclient_details_in jsonb
- Returns:
tablecode textclient_id textredirect_uri textidentity textidentity_provider_id textexpires timestamptzclient_details jsonb
- Last defined on version: 39
Create an authorization code.
- Mode: write
- Arguments:
expires_in timestamptz
- Returns:
integer - Last defined on version: 40
Delete access token entries that expireq before the current time. Returns a count of rows that have been deleted.
- Mode: write
- Arguments:
expires_in timestamptz
- Returns:
integer - Last defined on version: 39
Delete authorization codes that expire before expires_in.
Returns a count of rows that have been deleted.
- Mode: write
- Arguments:
- Returns:
integer - Last defined on version: 38
Delete sessions that expire before the current time. Returns a count of rows that have been deleted.
- Mode: read
- Arguments:
hashed_access_token_in text
- Returns:
tablehashed_access_token textencrypted_access_token jsonbclient_id textredirect_uri textidentity textidentity_provider_id textexpires timestamptzclient_details jsonb
- Last defined on version: 40
Get an access token entry.
- Mode: read
- Arguments:
code_in text
- Returns:
tablecode textclient_id textredirect_uri textidentity textidentity_provider_id textexpires timestamptzclient_details jsonb
- Last defined on version: 39
Get an authorization code entry given a code.
- Mode: read
- Arguments:
user_id_in text
- Returns:
tableencrypted_access_token jsonb
- Last defined on version: 27
Returns the encrypted github access token for a given user.
- Mode: write
- Arguments:
hashed_session_id_in textencrypted_session_id_in jsonbdata_in jsonbexpires_in timestamptz
- Returns:
void - Last defined on version: 38
Set a session.
If no session exists with hashed session id hashed_session_id_in,
a new row is inserted, otherwise the existing session's data is replaced
with the data in data_in.
- Mode: read
- Arguments:
hashed_session_id_in text
- Returns:
tablehashed_session_id textencrypted_session_id jsonbdata jsonbexpires timestamptz
- Last defined on version: 38
Returns the session for a given hashed session id.
- Mode: write
- Arguments:
hashed_session_id_in text
- Returns:
void - Last defined on version: 38
Removes a web session
- Mode: write
- Arguments:
hashed_session_id_in textdata_in jsonbexpires_in timestamptz
- Returns:
void - Last defined on version: 38
Touch a given session given a hashed session id and session data.
If the hashed session id does not exist, then an error code P0002 will be thrown.
create_workercreate_worker_poolcreate_worker_pool_errordelete_workerdelete_worker_pooldelete_worker_pool_errorexpire_worker_pool_errorsexpire_worker_poolsexpire_workersget_non_stopped_workers_quntilget_worker_2get_worker_pool_errorget_worker_pool_errors_for_worker_poolget_worker_pool_with_capacityget_worker_pools_with_capacityget_workers_without_provider_dataremove_worker_pool_previous_provider_idupdate_worker_2update_worker_pool_provider_dataupdate_worker_pool_with_capacity
- Mode: write
- Arguments:
worker_pool_id_in textworker_group_in textworker_id_in textprovider_id_in textcreated_in timestamptzexpires_in timestamptzstate_in textprovider_data_in jsonbcapacity_in integerlast_modified_in timestamptzlast_checked_in timestamptz
- Returns:
uuid - Last defined on version: 12
Create a new worker. Raises UNIQUE_VIOLATION if the worker already exists. Returns the etag of the newly created worker.
- Mode: write
- Arguments:
worker_pool_id_in textprovider_id_in textprevious_provider_ids_in jsonbdescription_in textconfig_in jsonbcreated_in timestamptzlast_modified_in timestamptzowner_in textemail_on_error_in booleanprovider_data_in jsonb
- Returns:
void - Last defined on version: 10
Create a new worker pool. Raises UNIQUE_VIOLATION if the pool already exists.
- Mode: write
- Arguments:
error_id_in textworker_pool_id_in textreported_in timestamptzkind_in texttitle_in textdescription_in textextra_in jsonb
- Returns:
uuid - Last defined on version: 29
Create a new worker pool error. Raises UNIQUE_VIOLATION if the error already exists.
- Mode: write
- Arguments:
worker_pool_id_in textworker_group_in textworker_id_in text
- Returns:
void - Last defined on version: 12
Delete a worker.
- Mode: write
- Arguments:
worker_pool_id_in text
- Returns:
void - Last defined on version: 10
Delete a worker pool immediately.
- Mode: write
- Arguments:
error_id_in textworker_pool_id_in text
- Returns:
void - Last defined on version: 29
Delete a worker pool error immediately.
- Mode: write
- Arguments:
expires_in timestamptz
- Returns:
integer - Last defined on version: 29
Expire worker pool errors reported before expires_in.
Returns a count of rows that have been deleted.
- Mode: write
- Arguments:
- Returns:
tableworker_pool_id text
- Last defined on version: 10
Expire worker pools, deleting those which have provider-id null-provider and no previous_provider_ids. Returns the worker pool ids that it deletes.
- Mode: write
- Arguments:
expires_in timestamptz
- Returns:
integer - Last defined on version: 12
Expire workers that come before expires_in.
Returns a count of rows that have been deleted.
- Mode: read
- Arguments:
worker_pool_id_in textworker_group_in textworker_id_in textpage_size_in integerpage_offset_in integer
- Returns:
tableworker_pool_id textworker_group textworker_id textprovider_id textcreated timestamptzexpires timestamptzstate textprovider_data jsonbcapacity integerlast_modified timestamptzlast_checked timestamptzsecret jsonbetag uuidquarantine_until timestamptz
- Last defined on version: 66
Get non-stopped workers filtered by the optional arguments,
ordered by worker_pool_id, worker_group, and worker_id.
If the pagination arguments are both NULL, all rows are returned.
Otherwise, page_size rows are returned at offset page_offset.
The quaratine_until contains NULL or a date in the past if the
worker is not quarantined, otherwise the date until which it is
quaratined.
- Mode: read
- Arguments:
worker_pool_id_in textworker_group_in textworker_id_in text
- Returns:
tableworker_pool_id textworker_group textworker_id textprovider_id textcreated timestamptzexpires timestamptzstate textprovider_data jsonbcapacity integerlast_modified timestamptzlast_checked timestamptzsecret jsonbetag uuid
- Last defined on version: 14
Get an existing worker. The returned table will have one or (if no such worker is defined) zero rows.
- Mode: read
- Arguments:
error_id_in textworker_pool_id_in text
- Returns:
tableerror_id textworker_pool_id textreported timestamptzkind texttitle textdescription textextra jsonb
- Last defined on version: 29
Get an existing worker pool error. The returned table will have one or (if no such worker pool error is defined) zero rows.
- Mode: read
- Arguments:
error_id_in textworker_pool_id_in textpage_size_in integerpage_offset_in integer
- Returns:
tableerror_id textworker_pool_id textreported timestamptzkind texttitle textdescription textextra jsonb
- Last defined on version: 31
Get existing worker pool errors filtered by worker_pool_id and error_id,
ordered by reported.
If the pagination arguments are both NULL, all rows are returned.
Otherwise, page_size rows are returned at offset page_offset.
- Mode: read
- Arguments:
worker_pool_id_in text
- Returns:
tableworker_pool_id textprovider_id textprevious_provider_ids jsonbdescription textconfig jsonbcreated timestamptzlast_modified timestamptzowner textemail_on_error booleanprovider_data jsonbcurrent_capacity integer
- Last defined on version: 13
Get an existing worker pool. The returned table will have one or (if no such worker pool is defined) zero rows.
- Mode: read
- Arguments:
page_size_in integerpage_offset_in integer
- Returns:
tableworker_pool_id textprovider_id textprevious_provider_ids jsonbdescription textconfig jsonbcreated timestamptzlast_modified timestamptzowner textemail_on_error booleanprovider_data jsonbcurrent_capacity integer
- Last defined on version: 13
Get existing worker pools, ordered by worker_pool_id. If the pagination arguments are both NULL, all rows are returned.
Otherwise, page_size rows are returned at offset page_offset.
- Mode: read
- Arguments:
worker_pool_id_in textworker_group_in textworker_id_in textstate_in textpage_size_in integerpage_offset_in integer
- Returns:
tableworker_pool_id textworker_group textworker_id textprovider_id textcreated timestamptzexpires timestamptzstate textcapacity integerlast_modified timestamptzlast_checked timestamptz
- Last defined on version: 48
Get existing workers (without their provider_data) filtered by the optional arguments,
ordered by worker_pool_id, worker_group, and worker_id.
If the pagination arguments are both NULL, all rows are returned.
Otherwise, page_size rows are returned at offset page_offset.
- Mode: write
- Arguments:
worker_pool_id_in textprovider_id_in text
- Returns:
void - Last defined on version: 10
Remove the given provider_id from the worker pool's previous_provider_ids. It is not an error if the worker pool does not exist, or if the provider_id is not in the previous_provider_ids set.
- Mode: write
- Arguments:
worker_pool_id_in textworker_group_in textworker_id_in textprovider_id_in textcreated_in timestamptzexpires_in timestamptzstate_in textprovider_data_in jsonbcapacity_in integerlast_modified_in timestamptzlast_checked_in timestamptzetag_in uuidsecret_in jsonb
- Returns:
tableworker_pool_id textworker_group textworker_id textprovider_id textcreated timestamptzexpires timestamptzstate textprovider_data jsonbcapacity integerlast_modified timestamptzlast_checked timestamptzetag uuidsecret jsonb
- Last defined on version: 14
Update a worker. Returns the up-to-date worker row that have the same worker_pool_id, worker_group, and worker_id. If the etag argument is empty then the update will overwrite the matched row. Else, the function will fail if the etag is out of date. This is useful for concurency handling.
- Mode: write
- Arguments:
worker_pool_id_in textprovider_id_in textprovider_data_in jsonb
- Returns:
void - Last defined on version: 10
Update the provider_data for the given provider_id in this worker pool. Note that this sets the provider_data property unconditionally, and it is up to the service to ensure that concurrent modifications do not occur. It is not an error if the worker pool does not exist.
- Mode: write
- Arguments:
worker_pool_id_in textprovider_id_in textdescription_in textconfig_in jsonblast_modified_in timestamptzowner_in textemail_on_error_in boolean
- Returns:
tableworker_pool_id textprovider_id textdescription textconfig jsonbcreated timestamptzlast_modified timestamptzowner textemail_on_error booleanprevious_provider_id textcurrent_capacity integer
- Last defined on version: 13
Update API-accessible columns on an existig worker pool. All fields are overridden, but if the provider_id changes, then the existing provider_id is added to previous_provider_ids. The return value contains values required for an API response and previous_provider_id (singular) containing the provider_id found before the update. If no such worker pool exists, the return value is an empty set.