Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • export=

Index

Properties

apiUrl

apiUrl: any

balena

balena: BalenaSDK

logger

logger: { info: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void }; log: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void }; status: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void } }

Type declaration

  • info: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void }
      • (...data: any[]): void
      • (message?: any, ...optionalParams: any[]): void
      • Parameters

        • Rest ...data: any[]

        Returns void

      • Prints to stdout with newline.

        Parameters

        • Optional message: any
        • Rest ...optionalParams: any[]

        Returns void

  • log: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void }
      • (...data: any[]): void
      • (message?: any, ...optionalParams: any[]): void
      • Parameters

        • Rest ...data: any[]

        Returns void

      • Prints to stdout with newline.

        Parameters

        • Optional message: any
        • Rest ...optionalParams: any[]

        Returns void

  • status: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void }
      • (...data: any[]): void
      • (message?: any, ...optionalParams: any[]): void
      • Parameters

        • Rest ...data: any[]

        Returns void

      • Prints to stdout with newline.

        Parameters

        • Optional message: any
        • Rest ...optionalParams: any[]

        Returns void

pine

pine: Pine

sshConfig

sshConfig: { host: any; port: any }

Type declaration

  • host: any
  • port: any

helper Methods

checkLogsContain

  • checkLogsContain(uuid: string, contains: string, _start?: number, _end?: number): boolean
  • Parameters

    • uuid: string

      The UUID of the target device

    • contains: string

      The string to look for in the logs

    • _start: number = null

      (optional) start the search from this log

    • _end: number = null

      (optional) end the search at this log

    Returns boolean

    If device logs contain the string

createApplication

  • createApplication(name: string, deviceType: string, appConfig: any): Promise<void>
  • Creates application for a devicetype with the required config

    Parameters

    • name: string

      Name of the application that needs to be created

    • deviceType: string

      The device type for which application needs to be created

    • appConfig: any

    Returns Promise<void>

executeCommandInContainer

  • executeCommandInContainer(command: string, containerName: string, uuid: string): string
  • Executes the command in the targetted container of a device

    Parameters

    • command: string

      The command to be executed

    • containerName: string

      The name of the service/container to run the command in

    • uuid: string

      The UUID of the target device

    Returns string

    output of the command that is executed on the targetted container of the device

executeCommandInHostOS

  • executeCommandInHostOS(command: string, device: string, timeout?: { interval: number; tries: number }): string
  • Executes command-line operations in the host OS of the DUT. Assuming the DUT is a managed device.

    Parameters

    • command: string

      command to be executed on the DUT

    • device: string

      local UUID of the DUT, example:${UUID}.local

    • timeout: { interval: number; tries: number } = ...

      object containing details of how many times the command needs to be retried and the intervals between each command execution

      • interval: number
      • tries: number

    Returns string

    Output of the command that was exected on hostOS of the DUT

fetchOS

  • fetchOS(versionOrRange?: string, deviceType: any, osType?: string): Promise<any>
  • Downloads provided version of balenaOS for the provided deviceType using balenaSDK

    remark

    Stores the downloaded image in leviathan.downloads directory,

    throws

    Rejects promise if download fails. Retries thrice to download an image before giving up.

    Parameters

    • versionOrRange: string = 'latest'

      The semver compatible balenaOS version that will be downloaded, example: 2.80.3+rev1. Default value: latest where latest development variant of balenaOS will be downloaded.

    • deviceType: any

      The device type for which balenaOS needs to be downloaded

    • osType: string = 'default'

      Can be one of 'default', 'esr' or null to include all types

    Returns Promise<any>

getSupervisorVersion

  • getSupervisorVersion(uuid: string): Promise<string>

pushReleaseToApp

  • pushReleaseToApp(application: string, directory: string): string
  • Pushes a release to an application from a given directory for managed devices

    Parameters

    • application: string

      The balena application name to push the release to

    • directory: string

      The path to the directory containing the docker-compose/Dockerfile for the application and the source files

    Returns string

    returns release commit after balena push is complete

removeSSHKey

  • removeSSHKey(label: string): Promise<string | void>

waitUntilServicesRunning

  • waitUntilServicesRunning(uuid: string, services: any, commit: string, retries?: number): boolean
  • Waits until all given services are running on the device on the provided commit

    Parameters

    • uuid: string

      The UUID of the device

    • services: any

      An array of the service names

    • commit: string

      The release commit hash that services should be on

    • retries: number = 50

      (optional) The number of attempts to retry. Retries are spaced 30s apart

    Returns boolean

    returns true if all services in the release commit are running on the device

Generated using TypeDoc