Viam SDK
    Preparing search index...

    Class DataManagerClient

    Implements

    Index

    Constructors

    Properties

    callOptions: CallOptions = ...
    name: string

    The name of the resource.

    Methods

    • Send/Receive arbitrary commands to the resource.

      Parameters

      • command: Struct | Record<string, JsonValue>

        The command to execute. Accepts either a Struct or a plain object, which will be converted automatically.

      • callOptions: CallOptions = ...

      Returns Promise<JsonValue>

      // Plain object (recommended)
      const result = await resource.doCommand({
      myCommand: { key: 'value' },
      });

      // Struct (still supported)
      import { Struct } from '@viamrobotics/sdk';

      const result = await resource.doCommand(Struct.fromJson({ myCommand: { key: 'value' } }));
    • Do a command on the data manager.

      Parameters

      • callOptions: CallOptions = ...

        Call options for the command.

      Returns Promise<JsonValue>

      const dataManager = new VIAM.DataManagerClient(machine, 'my_data_manager');
      await dataManager.doCommand(new Struct({ cmd: 'test', data1: 500 }));

      For more information, see Data Manager API.

    • Sync data stored on the machine to the cloud.

      Parameters

      • extra: {} = {}

        Extra arguments to pass to the sync request.

      • callOptions: CallOptions = ...

        Call options for the sync request.

      Returns Promise<void>

      const dataManager = new VIAM.DataManagerClient(machine, 'my_data_manager');
      await dataManager.sync();

      For more information, see Data Manager API.

    • Uploads binary data to specified datasets.

      Parameters

      • binaryData: Uint8Array

        The binary data to upload.

      • tags: string[]

        Tags to associate with the binary data.

      • datasetIds: string[]

        IDs of the datasets to associate the binary data with.

      • mimeType: MimeType

        The MIME type of the binary data.

      • extra: {} = {}

        Extra arguments to pass to the upload request.

      • callOptions: CallOptions = ...

        Call options for the upload request.

      Returns Promise<void>

      const dataManager = new VIAM.DataManagerClient(machine, 'my_data_manager');
      await dataManager.uploadBinaryDataToDatasets(
      new Uint8Array([1, 2, 3]),
      ['tag1', 'tag2'],
      ['datasetId1', 'datasetId2'],
      MimeType.MIME_TYPE_JPEG,
      );