Class: Executions
repositories.Executions
Executions repository.
The Executions class allows the user to manage executions and their properties.
Hierarchy
-
Repository
↳
Executions
Implements
-
IBundle
<SDKExecution
>
Table of contents
Constructors
Methods
Constructors
constructor
• new Executions(agent
)
Creates an instance of Repository.
Parameters
Name | Type |
---|---|
agent |
PeerAgent |
Inherited from
Methods
create
▸ create(payload
): Promise
<SDKExecution
>
Creates a new execution.
Example
const execution = await dl.executions.create({
functionName: 'My Function',
serviceName: 'My Service',
input: { dataset_id: 'datasetId-123', name: 'My first input' },
})
-
To receive updates on the execution status, subscribe to the
DlEvent.EXECUTION_STATUS
event, which is triggered upon creation, success, and failure.await dl.on(DlEvent.EXECUTION_STATUS, (payload: { execution: SDKExecution, status: 'created' | 'success' | 'failed' }) => { console.log(`Execution ${payload.execution.id} status: ${payload.status}`) console.log(`Execution output`, payload.execution.output) })
Parameters
Name | Type | Description |
---|---|---|
payload |
SDKExecutionPayload |
An object containing the execution's payload. |
Returns
Promise
<SDKExecution
>
- A promise that resolves to the created execution.
get
▸ get(executionId
): Promise
<SDKExecution
>
Retrieves an execution.
Example
const execution = await dl.executions.get('executionId-123')
Parameters
Name | Type | Description |
---|---|---|
executionId |
string |
The execution's id. |
Returns
Promise
<SDKExecution
>
- A promise that resolves to the execution.