Bolt schedules and metadata API

Paradime provides an handy API to be able to include Bolt runs within your existing data pipeline, by providing two endpoints - one to trigger a schedule run and one to check the status of a run within Paradime.

Requirements

To trigger runs and check the status of a running schedules using the Bolt API you will need:

  • API Key

  • API Secret

  • API Endpoint

pageGenerate API keys

Paradime python SDK & CLI

API endpoints

Trigger Bolt schedule

This graphQL endpoint will enable you to trigger a run by passing a schedule name set in your paradime_schedules.yml.

mutation TriggerBoltRun {
    triggerBoltRun(scheduleName: "daily") {
        runId
    }
}

Trigger Bolt schedule with a modified command for a run

This graphQL endpoint will enable you to trigger a Bolt run with a custom command and overwrite the actual commands defined in the schedule for that particular run. This only modifies the command for the triggered Bolt run and not the commands defined in the schedule.

mutation TriggerBoltRun {
    triggerBoltRun(scheduleName: "daily", commands: ["dbt compile", "dbt test"]) {
        runId
    }
}

Trigger Bolt schedule with a custom git commit

This graphQL endpoint will enable you to trigger a Bolt run with a custom git commit and overwrite the branch name defined in the schedule configuration. This only modifies the commit for the triggered Bolt run and not the branch name defined in the schedule.

mutation TriggerBoltRun {
    triggerBoltRun(scheduleName: "daily", branch: "e987a71966bf68c79c7fdcb4c4c19babdaf9b258") {
        runId
    }
}

Cancel Bolt run

This graphQL endpoint will enable you to cancel a schedule run by passing the runID of a Bolt schedule.

mutation CancelBoltRun {
    cancelBoltRun(scheduleRunId: 76033) {
        ok
    }
}

Get Bolt run status

This graphQL endpoint will enable you to check the status of a schedule run by passing the runID of a Bolt schedule.

The state returned of a Bolt run can be one of:

  • RUNNING

  • SUCCESS

  • ERROR

  • FAILED

  • CANCELED

query BoltRunStatus {
    boltRunStatus(runId: 76035) {
        ok
        state
        commands {
            id
            command
            startDttm
            endDttm
            stdout
            stderr
            returnCode
        }
    }
}

Get Bolt command details

This graphQL endpoint will enable you extract for a given command all the related details including raw error logs by passing a commandId. This is normally used in conjunction with the Paradime Webhooks.

query BoltCommand {
    boltCommand(commandId: 243281) {
        command
        startDttm
        endDttm
        stdout
        stderr
        returnCode
        scheduleRunId
        resources {
            id
            path
        }
        ok
    }
}

Get Bolt command resource URL

This graphQL endpoint will enable you extract for a given command the related resource generated by the execution of the command, for example the run_results.json or the manifest.json by passing a resourceId. This is normally used in conjunction with the Paradime Webhooks.

query BoltResourceUrl {
    boltResourceUrl(resourceId: 2023484) {
        ok
        url
    }
}

List schedule

This graphQL endpoint will return the Bolt schedules in your workspace.

query ListBoltSchedules {
    listBoltSchedules(offset: 0, limit: 10, showInactive: false) {
        schedules {
            name
            schedule
            owner
            lastRunAt
            lastRunState
            nextRunAt
            id
            uuid
            source
            turboCi {
                enabled
                deferredScheduleName
                successfulRunOnly
            }
            deferredSchedule {
                deferredScheduleName
                enabled
                successfulRunOnly
            }
            commands
            gitBranch
            slackOn
            slackNotify
            emailOn
            emailNotify
        }
        totalCount
    }
}

Get schedule details

This graphQL endpoint will enable you to check the status of a schedule by passing the scheduleName of a Bolt schedule.

query BoltScheduleName {
    boltScheduleName(scheduleName: "daily") {
        ok
        latestRunId
        commands
        owner
        schedule
        uuid
        source
    }
}

Last updated