ni.datastore.metadata

Public API for accessing the NI Metadata Store.

Classes

MetadataStoreClient

Metadata store client for publishing and reading metadata.

Alias

Represents an alias for metadata.

AliasTargetType

Represents the type of target that an alias can reference.

ExtensionSchema

Represents an extension schema stored in the system.

HardwareItem

Represents the metadata of a hardware item used to take measurements.

MetadataItems

Represents a collection of metadata items created from a JSON document.

Operator

Represents the metadata of the operator that took the test step.

SoftwareItem

Represents the metadata of the software item used to take measurements.

Test

Represents the metadata of a test.

TestAdapter

Represents a test adapter or mechanical setup.

TestDescription

Represents the metadata of a test description.

TestStation

Represents the metadata of a test station.

Uut

Represents the metadata of a Unit Under Test (UUT).

UutInstance

Represents the metadata of a UUT instance.

Package Contents

class ni.datastore.metadata.MetadataStoreClient(discovery_client=None, grpc_channel=None, grpc_channel_pool=None)

Metadata store client for publishing and reading metadata.

Initialize the MetadataStoreClient.

Parameters:
  • discovery_client (ni.measurementlink.discovery.v1.client.DiscoveryClient | None) – An optional discovery client (recommended).

  • grpc_channel (grpc.Channel | None) – An optional metadata store gRPC channel. Providing this channel will bypass discovery service resolution of the metadata store.

  • grpc_channel_pool (ni_grpc_extensions.channelpool.GrpcChannelPool | None) – An optional gRPC channel pool (recommended).

__slots__ = ('_closed', '_discovery_client', '_grpc_channel', '_grpc_channel_pool',...
__enter__()[source]

Enter the runtime context of the metadata store client.

Return type:

Self

__exit__(exc_type, exc_val, traceback)[source]

Exit the runtime context of the metadata store client.

Parameters:
Return type:

None

close()[source]

Close the metadata store client and clean up resources that it owns.

Return type:

None

create_uut_instance(uut_instance)[source]

Create a new UUT instance in the metadata store.

Parameters:

uut_instance (ni.datastore.metadata._types._uut_instance.UutInstance) – The metadata of the UUT instance to be created.

Returns:

The identifier of the created UUT instance.

Return type:

str

get_uut_instance(uut_instance_id)[source]

Get the UUT instance associated with the given identifier.

Parameters:

uut_instance_id (str) – The identifier of the desired UUT instance.

Returns:

The metadata of the requested UUT instance.

Return type:

UutInstance

query_uut_instances(odata_query='')[source]

Perform an OData query on UUT instances.

Parameters:

odata_query (str) – An OData query string. Example: “$filter=name eq ‘Value’”. $expand is not supported.

Returns:

The list of UUT instances that match the

query.

Return type:

Sequence[UutInstance]

create_uut(uut)[source]

Create a new UUT in the metadata store.

Parameters:

uut (ni.datastore.metadata._types._uut.Uut) – The metadata of the UUT to be created.

Returns:

The identifier of the created UUT.

Return type:

str

get_uut(uut_id)[source]

Get the UUT associated with the given identifier.

Parameters:

uut_id (str) – The identifier of the desired UUT.

Returns:

The metadata of the requested UUT.

Return type:

Uut

query_uuts(odata_query='')[source]

Perform an OData query on UUTs.

Parameters:

odata_query (str) – An OData query string. Example: “$filter=name eq ‘Value’”. $expand is not supported.

Returns:

The list of UUTs that match the query.

Return type:

Sequence[Uut]

create_operator(operator)[source]

Create a new operator in the metadata store.

Parameters:

operator (ni.datastore.metadata._types._operator.Operator) – The metadata of the operator to be created.

Returns:

The identifier of the created operator.

Return type:

str

get_operator(operator_id)[source]

Get the operator associated with the given identifier.

Parameters:

operator_id (str) – The identifier of the desired operator.

Returns:

The metadata of the requested operator.

Return type:

Operator

query_operators(odata_query='')[source]

Perform an OData query on operators.

Parameters:

odata_query (str) – An OData query string. Example: “$filter=name eq ‘Value’”. $expand is not supported.

Returns:

The list of operators that match the query.

Return type:

Sequence[Operator]

create_test_description(test_description)[source]

Create a test description in the metadata store.

Parameters:

test_description (ni.datastore.metadata._types._test_description.TestDescription) – The metadata of the test description to be created.

Returns:

The identifier of the created test description.

Return type:

str

get_test_description(test_description_id)[source]

Get a test description from the metadata store.

Parameters:

test_description_id (str) – The identifier of the desired test description.

Returns:

The metadata of the requested test description.

Return type:

TestDescription

query_test_descriptions(odata_query='')[source]

Query test descriptions from the metadata store.

Parameters:

odata_query (str) – An OData query string. Example: “$filter=name eq ‘Value’”. $expand is not supported.

Returns:

The list of test descriptions that match

the query.

Return type:

Sequence[TestDescription]

create_test(test)[source]

Create a test in the metadata store.

Parameters:

test (ni.datastore.metadata._types._test.Test) – The metadata of the test to be created.

Returns:

The identifier of the created test.

Return type:

str

get_test(test_id)[source]

Get a test from the metadata store.

Parameters:

test_id (str) – The identifier of the desired test.

Returns:

The metadata of the requested test.

Return type:

Test

query_tests(odata_query='')[source]

Query tests from the metadata store.

Parameters:

odata_query (str)

Return type:

collections.abc.Sequence[ni.datastore.metadata._types._test.Test]

create_test_station(test_station)[source]

Create a test station in the metadata store.

Parameters:

test_station (ni.datastore.metadata._types._test_station.TestStation) – The metadata of the test station to be created.

Returns:

The identifier of the created test station.

Return type:

str

get_test_station(test_station_id)[source]

Get a test station from the metadata store.

Parameters:

test_station_id (str) – The identifier of the desired test station.

Returns:

The metadata of the requested test station.

Return type:

TestStation

query_test_stations(odata_query='')[source]

Query test stations from the metadata store.

Parameters:

odata_query (str)

Return type:

collections.abc.Sequence[ni.datastore.metadata._types._test_station.TestStation]

create_hardware_item(hardware_item)[source]

Create a hardware item in the metadata store.

Parameters:

hardware_item (ni.datastore.metadata._types._hardware_item.HardwareItem) – The metadata of the hardware item to be created.

Returns:

The identifier of the created hardware item.

Return type:

str

get_hardware_item(hardware_item_id)[source]

Get a hardware item from the metadata store.

Parameters:

hardware_item_id (str) – The identifier of the desired hardware item.

Returns:

The metadata of the requested hardware item.

Return type:

HardwareItem

query_hardware_items(odata_query='')[source]

Query hardware items from the metadata store.

Parameters:

odata_query (str)

Return type:

collections.abc.Sequence[ni.datastore.metadata._types._hardware_item.HardwareItem]

create_software_item(software_item)[source]

Create a software item in the metadata store.

Parameters:

software_item (ni.datastore.metadata._types._software_item.SoftwareItem) – The metadata of the software item to be created.

Returns:

The identifier of the created software item.

Return type:

str

get_software_item(software_item_id)[source]

Get a software item from the metadata store.

Parameters:

software_item_id (str) – The identifier of the desired software item.

Returns:

The metadata of the requested software item.

Return type:

SoftwareItem

query_software_items(odata_query='')[source]

Query software items from the metadata store.

Parameters:

odata_query (str)

Return type:

collections.abc.Sequence[ni.datastore.metadata._types._software_item.SoftwareItem]

create_test_adapter(test_adapter)[source]

Create a test adapter in the metadata store.

Parameters:

test_adapter (ni.datastore.metadata._types._test_adapter.TestAdapter) – The metadata of the test adapter to be created.

Returns:

The identifier of the created test adapter.

Return type:

str

get_test_adapter(test_adapter_id)[source]

Get a test adapter from the metadata store.

Parameters:

test_adapter_id (str) – The identifier of the desired test adapter.

Returns:

The metadata of the requested test adapter.

Return type:

TestAdapter

query_test_adapters(odata_query='')[source]

Query test adapters from the metadata store.

Parameters:

odata_query (str)

Return type:

collections.abc.Sequence[ni.datastore.metadata._types._test_adapter.TestAdapter]

register_schema_from_file(schema_file_path)[source]

Register a schema obtained from the specified file in the metadata store.

Parameters:

schema_file_path (pathlib.Path | str) – The path at which the schema file is located

Raises:

FileNotFoundError – If the schema file does not exist.

Return type:

str

register_schema(schema_contents)[source]

Register a schema in the metadata store.

Once a schema has been published, it cannot be modified or removed.

Parameters:

schema_contents (str) – The contents of the JSON or TOML schema. This should be a well-formed JSON or TOML schema. Validation will be performed, and an error will be returned if the schema is not valid.

Returns:

The ID of the schema.

Return type:

str

list_schemas()[source]

List the schemas that have been previously registered.

Returns:

The list of registered schemas.

Return type:

Sequence[ExtensionSchema]

get_alias(alias_name)[source]

Get an alias and its target (the underlying metadata it represents).

Parameters:

alias_name (str) – The name of the alias to retrieve.

Returns:

The alias containing the alias name, target type, and

target ID of the underlying metadata.

Return type:

Alias

query_aliases(odata_query='')[source]

Perform an OData query on the registered aliases.

Parameters:

odata_query (str) – An OData query string. Example: “$filter=name eq ‘Value’”. $expand is not supported.

Returns:

The list of aliases that match the query.

Return type:

Sequence[Alias]

create_alias(alias_name, alias_target)[source]

Create (register) an alias of the specified metadata.

The specified metadata must have already been created prior to the alias registration. This method may be called with an already registered alias name in order to update the target mapped for that existing alias.

Parameters:
  • alias_name (str) – The alias name to register.

  • alias_target (ni.datastore.metadata._types._uut_instance.UutInstance | ni.datastore.metadata._types._uut.Uut | ni.datastore.metadata._types._hardware_item.HardwareItem | ni.datastore.metadata._types._software_item.SoftwareItem | ni.datastore.metadata._types._operator.Operator | ni.datastore.metadata._types._test_description.TestDescription | ni.datastore.metadata._types._test.Test | ni.datastore.metadata._types._test_adapter.TestAdapter | ni.datastore.metadata._types._test_station.TestStation) – The metadata instance to alias. The metadata instance to alias must have already been created in the metadata store in order to register an alias for it.

Returns:

The created alias containing the alias name, target type,

and target ID.

Return type:

Alias

delete_alias(alias_name)[source]

Remove a registered alias.

Parameters:

alias_name (str) – The name of the alias to unregister.

Returns:

Whether the action resulted in the specified alias becoming

unregistered. False if the alias does not exist.

Return type:

bool

create_from_json_file(metadata_file_path)[source]

Create metadata items from a JSON file.

Parameters:

metadata_file_path (pathlib.Path | str) – The path to the JSON file containing metadata definitions.

Returns:

A collection of metadata items created from the JSON document.

Return type:

MetadataItems

Raises:

FileNotFoundError – If the JSON file does not exist.

create_from_json(metadata_file_contents)[source]

Create metadata items from a JSON document.

Parameters:

metadata_file_contents (str) – The JSON document content containing metadata definitions.

Returns:

A collection of metadata items created from the JSON document.

Return type:

MetadataItems

class ni.datastore.metadata.Alias(*, name='', target_type=AliasTargetType.UNSPECIFIED, target_id='')

Represents an alias for metadata.

An alias provides a user-friendly name that maps to a specific metadata instance, containing the alias name, the type of the aliased metadata instance, and the unique identifier for the aliased metadata instance.

Initialize an Alias instance.

Parameters:
  • name (str) – The registered alias name for the aliased metadata instance.

  • target_type (ni.datastore.metadata._types._alias_target_type.AliasTargetType) – The type of the aliased metadata instance.

  • target_id (str) – The unique identifier for the aliased metadata instance.

__slots__ = ('name', 'target_type', 'target_id')
name = ''
target_type
target_id = ''
static from_protobuf(alias_proto)[source]

Create an Alias instance from a protobuf Alias message.

Parameters:

alias_proto (ni.measurements.metadata.v1.metadata_store_pb2.Alias)

Return type:

Alias

to_protobuf()[source]

Convert this Alias to a protobuf Alias message.

Return type:

ni.measurements.metadata.v1.metadata_store_pb2.Alias

__eq__(other)[source]

Determine equality.

Parameters:

other (object)

Return type:

bool

__str__()[source]

Return a string representation of the Alias.

Return type:

str

class ni.datastore.metadata.AliasTargetType

Bases: enum.IntEnum

Represents the type of target that an alias can reference.

The AliasTargetType enum indicates what kind of metadata entity an alias is pointing to.

Initialize self. See help(type(self)) for accurate signature.

UNSPECIFIED

The alias target type is not specified or unknown.

UUT_INSTANCE

The alias targets a UUT instance.

UUT

The alias targets a UUT.

HARDWARE_ITEM

The alias targets a hardware item.

SOFTWARE_ITEM

The alias targets a software item.

OPERATOR

The alias targets an operator.

TEST_DESCRIPTION

The alias targets a test description.

TEST

The alias targets a test.

TEST_STATION

The alias targets a test station.

TEST_ADAPTER

The alias targets a test adapter.

classmethod from_protobuf(alias_target_type_proto)[source]

Create an AliasTargetType instance from a protobuf AliasTargetType value.

Parameters:

alias_target_type_proto (ni.measurements.metadata.v1.metadata_store_pb2.AliasTargetType.ValueType) – The protobuf AliasTargetType value.

Returns:

The corresponding AliasTargetType enum value.

Raises:

ValueError – If the protobuf value doesn’t correspond to a known AliasTargetType.

Return type:

AliasTargetType

to_protobuf()[source]

Convert this AliasTargetType instance to a protobuf AliasTargetType value.

Returns:

The corresponding protobuf AliasTargetType value.

Return type:

ni.measurements.metadata.v1.metadata_store_pb2.AliasTargetType.ValueType

class ni.datastore.metadata.ExtensionSchema(*, id='', schema='')

Represents an extension schema stored in the system.

An extension schema contains the schema ID and the schema definition itself, which can be used to validate extension data in metadata instances.

Initialize an ExtensionSchema instance.

Parameters:
  • id (str) – The ID of the schema.

  • schema (str) – The schema itself.

__slots__ = ('id', 'schema')
id = ''
schema = ''
static from_protobuf(extension_schema_proto)[source]

Create an ExtensionSchema instance from a protobuf ExtensionSchema message.

Parameters:

extension_schema_proto (ni.measurements.metadata.v1.metadata_store_pb2.ExtensionSchema)

Return type:

ExtensionSchema

to_protobuf()[source]

Convert this ExtensionSchema to a protobuf ExtensionSchema message.

Return type:

ni.measurements.metadata.v1.metadata_store_pb2.ExtensionSchema

__eq__(other)[source]

Determine equality.

Parameters:

other (object)

Return type:

bool

__str__()[source]

Return a string representation of the ExtensionSchema.

Return type:

str

class ni.datastore.metadata.HardwareItem(*, manufacturer='', model='', serial_number='', part_number='', asset_identifier='', calibration_due_date='', link='', extension=None, schema_id='')

Represents the metadata of a hardware item used to take measurements.

A hardware item contains information about physical test equipment including manufacturer, model, serial number, calibration dates, and asset tracking information.

Initialize a HardwareItem instance.

Parameters:
  • manufacturer (str) – The manufacturer of the hardware item.

  • model (str) – The model of the hardware item.

  • serial_number (str) – The serial number of the hardware item.

  • part_number (str) – The part number of the hardware item.

  • asset_identifier (str) – The asset identifier of the hardware item.

  • calibration_due_date (str) – The calibration due date of the hardware item.

  • link (str) – A link to a resource that describes the hardware item. This value is expected to be a valid URI.

  • extension (Mapping[str, str] | None) – Any extensions to be associated with the hardware item.

  • schema_id (str) – The unique identifier of the schema that applies to this instance’s extension. If any extension is associated with this instance, a schema_id must be provided, unless the hardware item is created within the context of a test result, in which case the test result must have a schema_id.

__slots__ = ('_id', 'manufacturer', 'model', 'serial_number', 'part_number', 'asset_identifier',...
property extension: MutableMapping[str, str]

The extension of the hardware item.

Return type:

MutableMapping[str, str]

property id: str

The string id of the hardware item.

Return type:

str

manufacturer = ''
model = ''
serial_number = ''
part_number = ''
asset_identifier = ''
calibration_due_date = ''
schema_id = ''
static from_protobuf(hardware_item_proto)[source]

Create a HardwareItem instance from a protobuf HardwareItem message.

Parameters:

hardware_item_proto (ni.measurements.metadata.v1.metadata_store_pb2.HardwareItem)

Return type:

HardwareItem

to_protobuf()[source]

Convert this HardwareItem to a protobuf HardwareItem message.

Return type:

ni.measurements.metadata.v1.metadata_store_pb2.HardwareItem

__eq__(other)[source]

Determine equality.

Parameters:

other (object)

Return type:

bool

__str__()[source]

Return a string representation of the HardwareItem.

Return type:

str

class ni.datastore.metadata.MetadataItems(*, uut_instances=(), uuts=(), operators=(), test_descriptions=(), tests=(), test_stations=(), hardware_items=(), software_items=(), test_adapters=())

Represents a collection of metadata items created from a JSON document.

This class contains the results of creating metadata items from a JSON document, organizing them by type for easy access.

Initialize a MetadataItems instance.

Parameters:
  • uut_instances (collections.abc.Sequence[ni.datastore.metadata._types._uut_instance.UutInstance]) – A sequence of UUT instances created from the JSON document.

  • uuts (collections.abc.Sequence[ni.datastore.metadata._types._uut.Uut]) – A sequence of UUTs created from the JSON document.

  • operators (collections.abc.Sequence[ni.datastore.metadata._types._operator.Operator]) – A sequence of operators created from the JSON document.

  • test_descriptions (collections.abc.Sequence[ni.datastore.metadata._types._test_description.TestDescription]) – A sequence of test descriptions created from the JSON document.

  • tests (collections.abc.Sequence[ni.datastore.metadata._types._test.Test]) – A sequence of tests created from the JSON document.

  • test_stations (collections.abc.Sequence[ni.datastore.metadata._types._test_station.TestStation]) – A sequence of test stations created from the JSON document.

  • hardware_items (collections.abc.Sequence[ni.datastore.metadata._types._hardware_item.HardwareItem]) – A sequence of hardware items created from the JSON document.

  • software_items (collections.abc.Sequence[ni.datastore.metadata._types._software_item.SoftwareItem]) – A sequence of software items created from the JSON document.

  • test_adapters (collections.abc.Sequence[ni.datastore.metadata._types._test_adapter.TestAdapter]) – A sequence of test adapters created from the JSON document.

__slots__ = ('uut_instances', 'uuts', 'operators', 'test_descriptions', 'tests', 'test_stations',...
uut_instances = ()
uuts = ()
operators = ()
test_descriptions = ()
tests = ()
test_stations = ()
hardware_items = ()
software_items = ()
test_adapters = ()
static from_protobuf(response)[source]

Create a MetadataItems instance from a protobuf CreateFromJsonDocumentResponse.

Parameters:

response (ni.measurements.metadata.v1.metadata_store_service_pb2.CreateFromJsonDocumentResponse) – The protobuf response containing the created metadata items.

Returns:

A new MetadataItems instance with all the created items.

Return type:

MetadataItems

__eq__(other)[source]

Determine equality between MetadataItems instances.

Parameters:

other (object)

Return type:

bool

__str__()[source]

Return a string representation of the MetadataItems.

Return type:

str

class ni.datastore.metadata.Operator(*, name='', role='', link='', extension=None, schema_id='')

Represents the metadata of the operator that took the test step.

An operator contains information about the person or entity responsible for conducting tests, including their name and role.

Initialize an Operator instance.

Parameters:
  • name (str) – The name of the operator.

  • role (str) – The role of the operator.

  • link (str) – A link to a resource that describes the operator. This value is expected to be a valid URI.

  • extension (Mapping[str, str] | None) – Any extensions to be associated with the operator.

  • schema_id (str) – The unique identifier of the schema that applies to this instance’s extension. If any extension is associated with this instance, a schema_id must be provided, unless the operator is created within the context of a test result, in which case the test result must have a schema_id.

__slots__ = ('_id', 'name', 'role', 'link', '_extension', 'schema_id')
property extension: MutableMapping[str, str]

The extension of the operator.

Return type:

MutableMapping[str, str]

property id: str

The string id of the operator.

Return type:

str

name = ''
role = ''
schema_id = ''
static from_protobuf(operator_proto)[source]

Create an Operator instance from a protobuf Operator message.

Parameters:

operator_proto (ni.measurements.metadata.v1.metadata_store_pb2.Operator)

Return type:

Operator

to_protobuf()[source]

Convert this Operator to a protobuf Operator message.

Return type:

ni.measurements.metadata.v1.metadata_store_pb2.Operator

__eq__(other)[source]

Determine equality.

Parameters:

other (object)

Return type:

bool

__str__()[source]

Return a string representation of the Operator.

Return type:

str

class ni.datastore.metadata.SoftwareItem(*, product='', version='', link='', extension=None, schema_id='')

Represents the metadata of the software item used to take measurements.

A software item contains information about the software product and version used during testing.

Initialize a SoftwareItem instance.

Parameters:
  • product (str) – The product name of the software item.

  • version (str) – The version of the software item.

  • link (str) – A link to a resource that describes the software item. This value is expected to be a valid URI.

  • extension (Mapping[str, str] | None) – Any extensions to be associated with the software item.

  • schema_id (str) – The unique identifier of the schema that applies to this instance’s extension. If any extension is associated with this instance, a schema_id must be provided, unless the software item is created within the context of a test result, in which case the test result must have a schema_id.

__slots__ = ('_id', 'product', 'version', 'link', '_extension', 'schema_id')
property extension: MutableMapping[str, str]

The extension of the software item.

Return type:

MutableMapping[str, str]

property id: str

The string id of the software item.

Return type:

str

product = ''
version = ''
schema_id = ''
static from_protobuf(software_item_proto)[source]

Create a SoftwareItem instance from a protobuf SoftwareItem message.

Parameters:

software_item_proto (ni.measurements.metadata.v1.metadata_store_pb2.SoftwareItem)

Return type:

SoftwareItem

to_protobuf()[source]

Convert this SoftwareItem to a protobuf SoftwareItem message.

Return type:

ni.measurements.metadata.v1.metadata_store_pb2.SoftwareItem

__eq__(other)[source]

Determine equality.

Parameters:

other (object)

Return type:

bool

__str__()[source]

Return a string representation of the SoftwareItem.

Return type:

str

class ni.datastore.metadata.Test(*, name='', description='', link='', extension=None, schema_id='')

Represents the metadata of a test.

A test contains information about a specific test procedure, including its name and description of what the test does.

Initialize a Test instance.

Parameters:
  • name (str) – The name of the test.

  • description (str) – A description of what the test does.

  • link (str) – A link to a resource that describes the test. This value is expected to be a valid URI.

  • extension (Mapping[str, str] | None) – Any extensions to be associated with the test.

  • schema_id (str) – The unique identifier of the schema that applies to this instance’s extension. If any extension is associated with this instance, a schema_id must be provided, unless the test is created within the context of a test result, in which case the test result must have a schema_id.

__slots__ = ('_id', 'name', 'description', 'link', '_extension', 'schema_id')
property extension: MutableMapping[str, str]

The extension of the test.

Return type:

MutableMapping[str, str]

property id: str

The string id of the test.

Return type:

str

name = ''
description = ''
schema_id = ''
static from_protobuf(test_proto)[source]

Create a Test instance from a protobuf Test message.

Parameters:

test_proto (ni.measurements.metadata.v1.metadata_store_pb2.Test)

Return type:

Test

to_protobuf()[source]

Convert this Test to a protobuf Test message.

Return type:

ni.measurements.metadata.v1.metadata_store_pb2.Test

__eq__(other)[source]

Determine equality.

Parameters:

other (object)

Return type:

bool

__str__()[source]

Return a string representation of the Test.

Return type:

str

class ni.datastore.metadata.TestAdapter(*, name='', manufacturer='', model='', serial_number='', part_number='', asset_identifier='', calibration_due_date='', link='', extension=None, schema_id='')

Represents a test adapter or mechanical setup.

This is a board or device that is used to hold, connect, or interface the UUT with the test system. Test adapters may also be referred to as test fixtures, interface boards, breakout boxes, mechanical fixtures, or connection adapters.

Initialize a TestAdapter instance.

Parameters:
  • name (str) – The name of the test adapter.

  • manufacturer (str) – The manufacturer of the test adapter.

  • model (str) – The model of the test adapter.

  • serial_number (str) – The serial number of the test adapter.

  • part_number (str) – The part number of the test adapter.

  • asset_identifier (str) – The asset identifier of the test adapter.

  • calibration_due_date (str) – The calibration due date of the test adapter.

  • link (str) – A link to a resource that describes the test adapter. This value is expected to be a valid URI.

  • extension (Mapping[str, str] | None) – Any extensions to be associated with the test adapter.

  • schema_id (str) – The unique identifier of the schema that applies to this instance’s extension. If any extension is associated with this instance, a schema_id must be provided, unless the test adapter is created within the context of a test result, in which case the test result must have a schema_id.

__slots__ = ('_id', 'name', 'manufacturer', 'model', 'serial_number', 'part_number', 'asset_identifier',...
property extension: MutableMapping[str, str]

The extension of the test adapter.

Return type:

MutableMapping[str, str]

property id: str

The string id of the test adapter.

Return type:

str

name = ''
manufacturer = ''
model = ''
serial_number = ''
part_number = ''
asset_identifier = ''
calibration_due_date = ''
schema_id = ''
static from_protobuf(test_adapter_proto)[source]

Create a TestAdapter instance from a protobuf TestAdapter message.

Parameters:

test_adapter_proto (ni.measurements.metadata.v1.metadata_store_pb2.TestAdapter)

Return type:

TestAdapter

to_protobuf()[source]

Convert this TestAdapter to a protobuf TestAdapter message.

Return type:

ni.measurements.metadata.v1.metadata_store_pb2.TestAdapter

__eq__(other)[source]

Determine equality.

Parameters:

other (object)

Return type:

bool

__str__()[source]

Return a string representation of the TestAdapter.

Return type:

str

class ni.datastore.metadata.TestDescription(*, uut_id='', name='', link='', extension=None, schema_id='')

Represents the metadata of a test description.

A test description contains information about a test procedure designed for a specific UUT, including the UUT ID and test description name.

Initialize a TestDescription instance.

Parameters:
  • uut_id (str) – The ID of the UUT associated with this test description. This value is expected to be a parsable GUID or an alias.

  • name (str) – The name of the test description.

  • link (str) – A link to a resource that describes the test description. This value is expected to be a valid URI.

  • extension (Mapping[str, str] | None) – Any extensions to be associated with the test description.

  • schema_id (str) – The unique identifier of the schema that applies to this instance’s extension. If any extension is associated with this instance, a schema_id must be provided, unless the test description is created within the context of a test result, in which case the test result must have a schema_id.

__slots__ = ('_id', 'uut_id', 'name', 'link', '_extension', 'schema_id')
property extension: MutableMapping[str, str]

The extension of the test description.

Return type:

MutableMapping[str, str]

property id: str

The string id of the test description.

Return type:

str

uut_id = ''
name = ''
schema_id = ''
static from_protobuf(test_description_proto)[source]

Create a TestDescription instance from a protobuf TestDescription message.

Parameters:

test_description_proto (ni.measurements.metadata.v1.metadata_store_pb2.TestDescription)

Return type:

TestDescription

to_protobuf()[source]

Convert this TestDescription to a protobuf TestDescription message.

Return type:

ni.measurements.metadata.v1.metadata_store_pb2.TestDescription

__eq__(other)[source]

Determine equality.

Parameters:

other (object)

Return type:

bool

__str__()[source]

Return a string representation of the TestDescription.

Return type:

str

class ni.datastore.metadata.TestStation(*, name='', asset_identifier='', link='', extension=None, schema_id='')

Represents the metadata of a test station.

A test station contains information about the physical location or setup where testing is performed, including its name and asset identifier for tracking and inventory purposes.

Initialize a TestStation instance.

Parameters:
  • name (str) – The name of the test station.

  • asset_identifier (str) – The asset identifier of the test station.

  • link (str) – A link to a resource that describes the test station. This value is expected to be a valid URI.

  • extension (Mapping[str, str] | None) – Any extensions to be associated with the test station.

  • schema_id (str) – The unique identifier of the schema that applies to this instance’s extension. If any extension is associated with this instance, a schema_id must be provided, unless the test station is created within the context of a test result, in which case the test result must have a schema_id.

__slots__ = ('_id', 'name', 'asset_identifier', 'link', '_extension', 'schema_id')
property extension: MutableMapping[str, str]

The extension of the test station.

Return type:

MutableMapping[str, str]

property id: str

The string id of the test station.

Return type:

str

name = ''
asset_identifier = ''
schema_id = ''
static from_protobuf(test_station_proto)[source]

Create a TestStation instance from a protobuf TestStation message.

Parameters:

test_station_proto (ni.measurements.metadata.v1.metadata_store_pb2.TestStation)

Return type:

TestStation

to_protobuf()[source]

Convert this TestStation to a protobuf TestStation message.

Return type:

ni.measurements.metadata.v1.metadata_store_pb2.TestStation

__eq__(other)[source]

Determine equality.

Parameters:

other (object)

Return type:

bool

__str__()[source]

Return a string representation of the TestStation.

Return type:

str

class ni.datastore.metadata.Uut(*, model_name='', family='', manufacturers=None, part_number='', link='', extension=None, schema_id='')

Represents the metadata of a Unit Under Test (UUT).

A UUT represents a model or type of device that can be tested, containing information like model name, family, manufacturers, and part number that describe the UUT type rather than specific instances.

Initialize a Uut instance.

Parameters:
  • model_name (str) – The name of the UUT model.

  • family (str) – The UUT family.

  • manufacturers (Iterable[str] | None) – List of manufacturers of the UUT.

  • part_number (str) – The part number of the UUT.

  • link (str) – A link to a resource that describes the UUT. This value is expected to be a valid URI.

  • extension (Mapping[str, str] | None) – Any extensions to be associated with the UUT.

  • schema_id (str) – The unique identifier of the schema that applies to this instance’s extension. If any extension is associated with this instance, a schema_id must be provided, unless the UUT is created within the context of a test result, in which case the test result must have a schema_id.

__slots__ = ('_id', 'model_name', 'family', '_manufacturers', 'part_number', 'link', '_extension', 'schema_id')
property manufacturers: MutableSequence[str]

The manufacturers of the UUT.

Return type:

MutableSequence[str]

property extension: MutableMapping[str, str]

The extension of the UUT.

Return type:

MutableMapping[str, str]

property id: str

The string id of the uut.

Return type:

str

model_name = ''
family = ''
part_number = ''
schema_id = ''
static from_protobuf(uut_proto)[source]

Create a Uut instance from a protobuf Uut message.

Parameters:

uut_proto (ni.measurements.metadata.v1.metadata_store_pb2.Uut)

Return type:

Uut

to_protobuf()[source]

Convert this Uut to a protobuf Uut message.

Return type:

ni.measurements.metadata.v1.metadata_store_pb2.Uut

__eq__(other)[source]

Determine equality.

Parameters:

other (object)

Return type:

bool

__str__()[source]

Return a string representation of the Uut.

Return type:

str

class ni.datastore.metadata.UutInstance(*, uut_id='', serial_number='', manufacture_date='', firmware_version='', hardware_version='', link='', extension=None, schema_id='')

Represents the metadata of a UUT instance.

A UUT instance represents a specific physical instance of a Unit Under Test, with properties like serial number, manufacture date, and firmware version that distinguish it from other instances of the same UUT model.

Initialize a UutInstance instance.

Parameters:
  • uut_id (str) – The ID of the UUT associated with this UUT instance. This value is expected to be a parsable GUID or an alias.

  • serial_number (str) – The serial number of the UUT instance.

  • manufacture_date (str) – The date the UUT instance was manufactured.

  • firmware_version (str) – Version of the firmware on the UUT instance.

  • hardware_version (str) – Hardware version of the UUT instance.

  • link (str) – A link to a resource that describes the UUT instance. This value is expected to be a valid URI.

  • extension (Mapping[str, str] | None) – Any extensions to be associated with the UUT instance.

  • schema_id (str) – The unique identifier of the schema that applies to this instance’s extension. If any extension is associated with this instance, a schema_id must be provided, unless the UUT instance is created within the context of a test result, in which case the test result must have a schema_id.

__slots__ = ('_id', 'uut_id', 'serial_number', 'manufacture_date', 'firmware_version', 'hardware_version',...
property extension: MutableMapping[str, str]

The extension of the UUT instance.

Return type:

MutableMapping[str, str]

property id: str

The string id of the uut instance.

Return type:

str

uut_id = ''
serial_number = ''
manufacture_date = ''
firmware_version = ''
hardware_version = ''
schema_id = ''
static from_protobuf(uut_instance_proto)[source]

Create a UutInstance from a protobuf UutInstance message.

Parameters:

uut_instance_proto (ni.measurements.metadata.v1.metadata_store_pb2.UutInstance)

Return type:

UutInstance

to_protobuf()[source]

Convert this UutInstance to a protobuf UutInstance message.

Return type:

ni.measurements.metadata.v1.metadata_store_pb2.UutInstance

__eq__(other)[source]

Determine equality.

Parameters:

other (object)

Return type:

bool

__str__()[source]

Return a string representation of the UutInstance.

Return type:

str