invoke: Invoke QBit

View source: R/invoke.R

invokeR Documentation

Invoke QBit

Description

QBit workspaces can be completely controlled via API including not only code executions but also tasks like file upload/download, workspace export, etc. Note, that this function is intended for internal use only.

Usage

invoke(
  qbit_id,
  event_type,
  event_input = NULL,
  stateful = FALSE,
  apikey = getOption("QKEY"),
  verbose = getOption("verbose")
)

Arguments

qbit_id

character; Name of the QBit function.

event_type

character; Event type to be used. Can be one of the following:

  • qbit-run: Run selected code in qbit.

  • qbit-fork: Create a new QBit from template

  • qbit-remove: Remove QBit

  • qbit-render: Render markdown document.

  • qbit-packages-install: Install packages in qbit

  • qbit-packages-remove: Remove packages from QBit

  • qbit-fetch-result: Fetch result from QBit

  • state-reset: Remove console outputs from QBit

  • qbit-update-state

  • qbit-download-workspace

  • upload-request

  • upload-finished

  • file-delete

event_input

list;

stateful

logical; Specify if changes to the environment (and console output) shall be saved.

apikey

character; API Key used to invoke QBit API endpoint. After creating an account at https://www.quantargo.com the API key is available in the user settings https://www.quantargo.com/dashboard.

verbose

logical; Show intermediary console outputs.

Examples

## Not run: 
  options(QKEY = "<YOUR-API-KEY>")
  qbit:::invoke("qbit-template-r-base", "qbit-run", list(code = "1+1"))
  qbitnew <- qbit:::invoke("qbit-template-r-base", "qbit-fork",
  list(qbitId = "qbit-template-r-base", qbitName = "TEST QBit"))
  qbit:::invoke(qbitnew$newQbitId, "qbit-run", list(code = "1+1"))
  qbit:::invoke(qbitnew$newQbitId, "qbit-remove", list(qbitId = qbitnew$newQbitId))
  qbitnew$newQbitId

## End(Not run)

quantargo/qbit documentation built on March 20, 2022, 10:35 a.m.