UNPKG

balena-cli

Version:

The official balena Command Line Interface

50 lines (49 loc) 1.39 kB
import type * as Stream from 'stream'; import Logger = require('../logger'); export interface DeviceResponse { [key: string]: any; status: 'success' | 'failed'; message?: string; } export interface DeviceInfo { deviceType: string; arch: string; } export interface Status { appState: 'applied' | 'applying'; overallDownloadProgress: null | number; containers: Array<{ status: string; serviceName: string; appId: number; imageId: number; serviceId: number; containerId: string; createdAt: string; }>; images: Array<{ name: string; appId: number; serviceName: string; imageId: number; dockerImageId: string; status: string; downloadProgress: null | number; }>; } export declare class DeviceAPI { private logger; private deviceAddress; constructor(logger: Logger, addr: string, port?: number); setTargetState(state: any): Promise<void>; getTargetState(): Promise<any>; getDeviceInformation(): Promise<DeviceInfo>; getContainerId(serviceName: string): Promise<string>; ping(): Promise<void>; getVersion(): Promise<string>; getStatus(): Promise<Status>; getLogStream(): Promise<Stream.Readable>; private getUrlForAction; private static promisifiedRequest; } export default DeviceAPI;