Live controller delivery and message long poll#

PropertyValue
Servicecrossfire
OperationfleetControl
MethodGET
Path/api/fleets/{fleetId}/control
Authenticationfleet
Success status200
Response dataUnpaginated value
Request formatjson
Maximum request body2097152 bytes (service default)
Permission codesNone declared

Listed permission codes are alternatives, not token scopes. The service also checks access to the requested records and rejects stale revisions or controller generations.

Path parameters#

Your HTTP client substitutes these values into the placeholders in the URL path.

object; fields below; unknown fields rejected

Field pathRepresentation and constraints
fleetIdlowercase opaque UUID

Validation#

This TypeScript is the server’s validation code, reproduced from its contract. It describes the accepted format; client applications do not need to run or import it.

check.object({ fleetId: check.identifier })

Referenced definitions:

Query parameters#

Your HTTP client supplies these values in the URL query string.

custom validation: controlQuery ; see function below

Accepted query parameters: connectionId, revision, waitMs.

Query parameters are URL text. The validation function below specifies their format, defaults and combinations. Pagination applies only to operations that use it.

Additional checks#

The following checks apply in addition to the field limits.

Constraint on value:

export function controlQuery(input: unknown) {
    const values = listQuery(['connectionId', 'revision', 'waitMs'])(input);
    if (!values.ok)
        return values;
    const connectionId = check.identifier(values.value.get('connectionId'));
    const revision = queryInteger(values.value.get('revision'), 0, Number.MAX_SAFE_INTEGER);
    const waitMs = queryInteger(values.value.get('waitMs'), 0, 10000);
    if (!connectionId.ok)
        return connectionId;
    if (!values.value.has('revision') || !revision.ok || !values.value.has('waitMs') || !waitMs.ok)
        return failure('invalid', 'A revision and bounded waitMs are required');
    return success({ connectionId: connectionId.value, revision: revision.value, waitMs: waitMs.value });
}

Validation#

This TypeScript is the server’s validation code, reproduced from its contract. It describes the accepted format; client applications do not need to run or import it.

fleetControl.controlQuery

Referenced definitions:

Request body#

Your HTTP client supplies these fields as the JSON request body when the operation takes input. A no-input operation does not require JSON. This is protocol input, not text to send in a Matrix room.

empty object; unknown fields rejected

Validation#

This TypeScript is the server’s validation code, reproduced from its contract. It describes the accepted format; client applications do not need to run or import it.

check.empty

Referenced definitions:

Response data#

The service produces these fields inside data in its response. They are output for the client to read, not input for the caller to submit.

object; fields below; unknown fields rejected; constraint: Invalid fleet control snapshot ( fleetControlSnapshot )

Field pathRepresentation and constraints
fleetIdlowercase opaque UUID
revisionexact JSON integer; 0…9007199254740991
deliveryEnabledboolean
connectionobject; fields below; unknown fields rejected
connection.statusonline or offline
connection.lastSeenAtexact JSON integer; 0…9007199254740991; JSON null permitted
agentIdsarray; 0–100 entries; item: lowercase opaque UUID
messagesarray; 0–1 entries; item: object; fields below; unknown fields rejected ( fleetMessageCommand )
messages[].messageIdlowercase opaque UUID
messages[].fleetIdlowercase opaque UUID
messages[].bodyplain-text string; at most 16384 UTF-8 bytes; allowed whitespace controls only; constraint: Expected a fleet message of 1–4096 characters ( messageBody )
messages[].createdAtexact JSON integer; 0…9007199254740991
messages[].expiresAtexact JSON integer; 0…9007199254740991
messages[].senderobject; fields below; unknown fields rejected; constraint: Invalid fleet message sender
messages[].sender.kindhuman or controller
messages[].sender.backendUserIdopaque backend user ID; 1–255 UTF-16 units, well-formed Unicode without control characters; JSON null permitted
messages[].agentIdsarray; 0–100 entries; item: lowercase opaque UUID
runtimeOperationsarray; 0–1 entries; item: object; fields below; unknown fields rejected; constraint: Invalid session operation outcome ( runtimeOperation )
runtimeOperations[].operationIdlowercase opaque UUID
runtimeOperations[].fleetIdlowercase opaque UUID
runtimeOperations[].agentIdlowercase opaque UUID; JSON null permitted
runtimeOperations[].actionstart or stop or reset ( runtimeAction )
runtimeOperations[].expectedRevisionexact JSON integer; 0…9007199254740991
runtimeOperations[].statuspending or running or succeeded or failed
runtimeOperations[].createdAtexact JSON integer; 0…9007199254740991
runtimeOperations[].completedAtexact JSON integer; 0…9007199254740991; JSON null permitted
runtimeOperations[].errorMessagestring; 1–4096 UTF-16 units; well-formed Unicode; no C0/DEL controls; JSON null permitted

Additional checks#

The following checks apply in addition to the field limits.

Constraint on object:

snapshot => new Set(snapshot.agentIds).size === snapshot.agentIds.length && snapshot.messages.every(message => message.fleetId === snapshot.fleetId
    && message.expiresAt > message.createdAt && new Set(message.agentIds).size === message.agentIds.length)
    && snapshot.runtimeOperations.every(operation => operation.fleetId === snapshot.fleetId && (operation.status === 'pending' || operation.status === 'running'))

Constraint on messages[].body:

body => !!body.trim() && body.length <= 4096

Constraint on messages[].sender:

sender => (sender.kind === 'human') === (sender.backendUserId !== null)

Constraint on runtimeOperations[]:

value => (value.status === 'succeeded' || value.status === 'failed') === (value.completedAt !== null)
    && (value.status === 'failed') === (value.errorMessage !== null)

Validation#

This TypeScript is the server’s validation code, reproduced from its contract. It describes the accepted format; client applications do not need to run or import it.

fleetControl.fleetControlSnapshot

Referenced definitions:

Response envelope#

This JSON illustrates a response returned by the service, not a request to send. The service fills data with the operation result and meta with request metadata. The string below marks where the actual response data appears; it is not an example record. Errors contain error instead of data.

{
  "data": "<value matching the response-data validator>",
  "meta": {
    "requestId": "00000000-0000-0000-0000-000000000001"
  }
}