Class DataClient

Constructors

  • Parameters

    • serviceHost: string
    • grpcOptions: RpcOptions

    Returns DataClient

Properties

dataService: DataServiceClient
dataSyncService: DataSyncServiceClient
datasetService: DatasetServiceClient

Methods

  • Add BinaryData to the provided dataset.

    Parameters

    • ids: dataApi.BinaryID.AsObject[]

      The IDs of binary data to add to dataset

    • datasetId: string

      The ID of the dataset to be added to

    Returns Promise<void>

  • Add bounding box to an image.

    Parameters

    • id: dataApi.BinaryID.AsObject
    • label: string

      A label for the bounding box

    • xMinNormalized: number

      The min X value of the bounding box normalized from 0 to 1

    • yMinNormalized: number

      The min Y value of the bounding box normalized from 0 to 1

    • xMaxNormalized: number

      The max X value of the bounding box normalized from 0 to 1

    • yMaxNormalized: number

      The max Y value of the bounding box normalized from 0 to 1

    Returns Promise<string>

    The bounding box ID

  • Add tags to binary data, specified by filter.

    Parameters

    • tags: string[]

      The tags to add to the data

    • Optional filter: Filter

      Optional pb.Filter specifying binary data to add tags to. No filter implies all binary data.

    Returns Promise<void>

  • Add tags to binary data, specified by ID.

    Parameters

    • tags: string[]

      The list of tags to add to specified binary data. Must be non-empty.

    • ids: dataApi.BinaryID.AsObject[]

      The IDs of the data to be tagged. Must be non-empty.

    Returns Promise<void>

  • Filter and get a page of binary data. The returned metadata might be empty if the metadata index of the data is out of the bounds of the returned metadata list. The data will be paginated into pages of limit items, and the pagination ID will be included in the returned tuple.

    Parameters

    • Optional filter: Filter

      Optional pb.Filter specifying binary data to retrieve. No filter implies all binary data.

    • Optional limit: number

      The maximum number of entries to include in a page. Defaults to 50 if unspecfied

    • Optional sortOrder: Order

      The desired sort order of the data

    • last: string = ''

      Optional string indicating the ID of the last-returned data. If provided, the server will return the next data entries after the last ID.

    • includeBinary: boolean = true

      Whether to include binary file data with each retrieved file

    • countOnly: boolean = false

      Whether to return only the total count of entries

    • includeInternalData: boolean = false

      Whether to retun internal data. Internal data is used for Viam-specific data ingestion, like cloud SLAM. Defaults to false.

    Returns Promise<{
        count: number;
        data: dataApi.BinaryData.AsObject[];
        last: string;
    }>

    An array of data objects, the count (number of entries), and the last-returned page ID.

  • Uploads the content and metadata for binary data.

    Upload binary data collected on a robot through a specific component (e.g., a motor) along with the relevant metadata to app.viam.com. binary data can be found under the "Sensors" subtab of the Data tab on app.viam.com.

    Parameters

    • binaryData: Uint8Array

      The data to be uploaded, represented in bytes

    • partId: string

      The part ID of the component used to capture the data

    • componentType: string

      The type of the component used to capture the data (e.g., "movementSensor")

    • componentName: string

      The name of the component used to capture the data

    • methodName: string

      The name of the method used to capture the data.

    • fileExtension: string

      The file extension of binary data including the period, e.g. .jpg, .png, .pcd. The backend will route the binary to its corresponding mime type based on this extension. Files with a .jpeg, .jpg, or .png extension will be saved to the images tab.

    • Optional tags: string[]

      The list of tags to allow for tag-based filtering when retrieving data

    • Optional dataRequestTimes: [Date, Date]

      Tuple containing Date objects denoting the times this data was requested[0] by the robot and received[1] from the appropriate sensor.

    Returns Promise<string>

    The file ID of the uploaded data

  • Get a list of bounding box labels using a Filter.

    Parameters

    • Optional filter: Filter

      Optional pb.Filter specifying what data to get tags from. No filter implies all labels.

    Returns Promise<string[]>

    The list of bounding box labels

  • Configure a database user for the Viam organization's MongoDB Atlas Data Federation instance. It can also be used to reset the password of the existing database user.

    Parameters

    • orgId: string

      The ID of the organization

    • password: string

      The password of the user

    Returns Promise<void>

  • Create a new dataset.

    Parameters

    • name: string

      The name of the new dataset

    • orgId: string

      The ID of the organization the dataset is being created in

    Returns Promise<string>

    The ID of the dataset

  • Filter and delete binary data.

    Parameters

    • Optional filter: Filter

      Optional pb.Filter specifying binary data to delete. No filter implies all binary data.

    • includeInternalData: boolean = true

      Whether or not to delete internal data. Default is true

    Returns Promise<number>

    The number of items deleted

  • Delete binary data, specified by ID.

    Parameters

    Returns Promise<number>

    The number of items deleted

  • Delete a dataset.

    Parameters

    • id: string

      The ID of the dataset.

    Returns Promise<void>

  • Delete tabular data older than a specified number of days.

    Parameters

    • orgId: string

      The ID of organization to delete data from

    • deleteOlderThanDays: number

      Delete data that was captured more than this many days ago. For example if deleteOlderThanDays is 10, this deletes any data that was captured more than 10 days ago. If it is 0, all existing data is deleted.

    Returns Promise<number>

    The number of items deleted

  • Get a connection to access a MongoDB Atlas Data federation instance.

    Parameters

    • orgId: string

    Returns Promise<string>

    Hostname of the federated database

  • List all of the datasets specified by the given dataset IDs.

    Parameters

    • ids: string[]

      The list of IDs of the datasets

    Returns Promise<Dataset[]>

    The list of datasets

  • List all of the datasets for an organization.

    Parameters

    • orgId: string

      The ID of the organization

    Returns Promise<Dataset[]>

    The list of datasets in the organization

  • Remove BinaryData from the provided dataset.

    Parameters

    • ids: dataApi.BinaryID.AsObject[]

      The IDs of the binary data to remove from dataset

    • datasetId: string

      The ID of the dataset to be removed from

    Returns Promise<void>

  • Remove a bounding box from an image.

    Parameters

    • binId: dataApi.BinaryID.AsObject

      The ID of the image to remove the bounding box from

    • bboxId: string

      The ID of the bounding box to remove

    Returns Promise<void>

  • Remove tags from binary data, specified by filter.

    Parameters

    • tags: string[]

      List of tags to remove from specified binary data. Must be non-empty.

    • Optional filter: Filter

      Optional pb.Filter specifying binary data to add tags to. No filter implies all binary data.

    Returns Promise<number>

    The number of items deleted

  • Remove tags from binary data, specified by ID.

    Parameters

    • tags: string[]

      List of tags to remove from specified binary data. Must be non-empty.

    • ids: dataApi.BinaryID.AsObject[]

      The IDs of the data to be edited. Must be non-empty.

    Returns Promise<number>

    The number of items deleted

  • Rename a dataset.

    Parameters

    • id: string

      The ID of the dataset

    • name: string

      The new name of the dataset

    Returns Promise<void>

  • Filter and get a page of tabular data. The returned metadata might be empty if the metadata index of the data is out of the bounds of the returned metadata list. The data will be paginated into pages of limit items, and the pagination ID will be included in the returned tuple.

    Parameters

    • Optional filter: Filter

      Optional pb.Filter specifying tabular data to retrieve. No filter implies all tabular data.

    • Optional limit: number

      The maximum number of entries to include in a page. Defaults to 50 if unspecfied

    • Optional sortOrder: Order

      The desired sort order of the data

    • last: string = ''

      Optional string indicating the ID of the last-returned data. If provided, the server will return the next data entries after the last ID.

    • countOnly: boolean = false

      Whether to return only the total count of entries

    • includeInternalData: boolean = false

      Whether to retun internal data. Internal data is used for Viam-specific data ingestion, like cloud SLAM. Defaults to false.

    Returns Promise<{
        count: number;
        data: TabularData[];
        last: string;
    }>

    An array of data objects, the count (number of entries), and the last-returned page ID.

  • Obtain unified tabular data and metadata, queried with MQL.

    Parameters

    • organizationId: string

      The ID of the organization that owns the data

    • query: Uint8Array[]

      The MQL query to run as a list of BSON documents

    Returns Promise<{
        [key: string]: JavaScriptValue;
    }[]>

    An array of data objects

  • Obtain unified tabular data and metadata, queried with SQL.

    Parameters

    • organizationId: string

      The ID of the organization that owns the data

    • query: string

      The SQL query to run

    Returns Promise<{
        [key: string]: JavaScriptValue;
    }[]>

    An array of data objects

  • Uploads the content and metadata for tabular data.

    Upload tabular data collected on a robot through a specific component (e.g., a motor) along with the relevant metadata to app.viam.com. Tabular data can be found under the "Sensors" subtab of the Data tab on app.viam.com.

    Parameters

    • tabularData: Record<string, JavaScriptValue>[]

      The list of data to be uploaded, represented tabularly as an array.

    • partId: string

      The part ID of the component used to capture the data

    • componentType: string

      The type of the component used to capture the data (e.g., "movementSensor")

    • componentName: string

      The name of the component used to capture the data

    • methodName: string

      The name of the method used to capture the data.

    • Optional tags: string[]

      The list of tags to allow for tag-based filtering when retrieving data

    • Optional dataRequestTimes: [Date, Date][]

      Array of Date tuples, each containing two Date objects denoting the times this data was requested[0] by the robot and received[1] from the appropriate sensor. Passing a list of tabular data and Timestamps with length n > 1 will result in n datapoints being uploaded, all tied to the same metadata.

    Returns Promise<string>

    The file ID of the uploaded data

  • Get a list of tags using a filter.

    Parameters

    • Optional filter: Filter

      Optional pb.Filter specifying what data to get tags from. No filter implies all data.

    Returns Promise<string[]>

    The list of tags

Generated using TypeDoc