Session Utilities API Reference - ni/grpc-device GitHub Wiki

The purpose of this page is to document the API functions defined for the SessionUtilities service via the session_utilities.proto file. The functions defined by the SessionUtilities service allow a client to manage reservations, reset the server state and enumerate devices. For Python examples demonstrating the use of this API click here.


EnumerateDevices(EnumerateDevicesRequest)

Provides a list of devices or chassis connected locally to the server. The NI System Configuration API must be installed on the server machine to use this function.

  • EnumerateDevicesRequest : An empty request message.

  • EnumerateDevicesResponse : A response message containing the list of devices.

    • DeviceProperties: Properties that describe the enumerated device.
      • name: The device name.
      • model: The device model.
      • vendor: The device vendor.
      • serial_number: The device serial number.
      • product_id: The device produce ID.
  • Status :

    • NOT_FOUND : The System Configuration library was not found.
    • INTERNAL : A System Configuration API operation failed.
    • OK : No errors occurred.

EnumerateInstalledSoftware(EnumerateInstalledSoftwareRequest)

Provides a list of NI software installed on the server. The NI System Configuration API must be installed on the server machine to use this function.

  • EnumerateInstalledSoftwareRequest : The request message to get the set of NI installed software.

    • include_hidden_packages: A Boolean to indicate whether to include hidden packages or not in the list of software. If omitted, defaults to false.
  • EnumerateInstalledSoftwareResponse : A response message containing the list of installed NI software.

    • SoftwareProperties: Properties that describe the installed software.
      • package_id: The package id.
      • package_version: The package version.
      • product_name: The product name.
  • Status :

    • NOT_FOUND : The System Configuration library was not found.
    • UNKNOWN : A System Configuration API operation failed.
    • OK : No errors occurred.

IsReservedByClient(IsReservedByClientRequest)

Determines if a set of client-defined resources is currently reserved by a specific client.

  • IsReservedByClientRequest : The request message to check whether a set of client-defined resources is currently reserved by a specific client.

    • reservation_id: A client-defined string representing a set of reservable resources.
    • client_id: A client-defined identifier for a specific client.
  • IsReservedByClientResponse : A response message containing a boolean indicating whether the set of client-defined resources is reserved by the specified client.

    • is_reserved : true if the set of client-defined resources is reserved by the specified client and false otherwise.
  • Status :

    • CANCELLED : The client requested cancellation.
    • OK : No errors occurred.

Reserve(ReserveRequest)

Reserves a set of client-defined resources for exclusive use. If the requested reservation is held by a different client then this call will block until the reservation is released.

  • ReserveRequest : The request message to reserve a set of client-defined resources.

    • reservation_id: A client-defined string representing a set of reservable resources.
    • client_id: A client-defined identifier for a specific client.
  • ReserveResponse : A response message containing a boolean indicating whether the reservation request succeeded.

    • is_reserved : true if the set of client-defined resources was reserved and false otherwise.
  • Status :

    • INVALID_ARGUMENT : The reservation_id or client_id is empty.
    • ABORTED : Another server operation call like ResetServer changed the server state while waiting to acquire the reservation.
    • CANCELLED : The client requested cancellation.
    • FAILED_PRECONDITION : The provided client_id already holds the reservation.
    • OK : No errors occurred.

ResetServer(ResetServerRequest)

Resets the server to a default state with no reservations and no open sessions. Any clients waiting for a reservation will return with the reservation request aborted.

  • ResetServerRequest : An empty request message.

  • ResetServerResponse : A response message containing a boolean indicating whether the all of the server's reservations were released and all of the server's sessions were closed.

    • is_server_reset : true all of the server's reservations were released and all of the server's sessions were closed. Otherwise,false.
  • Status :

    • CANCELLED : The client requested cancellation.
    • OK : No errors occurred.

Unreserve(UnreserveRequest)

Unreserves a previously reserved set of client-defined resources.

  • UnreserveRequest : The request message to unreserve a set of client-defined resources.

    • reservation_id: A client-defined string representing a set of reservable resources.
    • client_id: A client-defined identifier for a specific client.
  • UnreserveResponse : A response message containing a boolean indicating whether the set of client-defined resources was released.

    • is_unreserved : true if the set of client-defined resources were released and false otherwise.
  • Status :

    • CANCELLED : The client requested cancellation.
    • OK : No errors occurred.