Understanding TR-369 GetInstances and GetInstances Response Messages
Within the TR-369 USP (User Services Platform) specification, efficient data retrieval and mapping of Multi-Instance Objects are essential for effective communication between Controllers and Agents.
The GetInstances Message serves as a powerful tool for Controllers to request the Agent to provide a quick map of the existing instances of an object, including any Multi-Instance Sub-Objects.
In this post, we will delve into the purpose and functionality of GetInstances Messages and their corresponding GetInstancesResp Messages.
Let's see the GetInstances message proto-buff definition from the official usp proto-buffer file:
GetInstances Messages: The GetInstances Message allows Controllers to request the Agent to provide information about the instances of a specific object, including Multi-Instance Sub-Objects. It serves as a means to quickly map the Multi-Instance Objects (such as tables) represented by the Agent and their unique key parameters.
By specifying the object path of an object in the GetInstances Message, Controllers can retrieve all instances of that object currently present in the Agent's Instantiated Data Model. The GetInstances Message also supports a flag called "first_level_only," which determines whether the response should include all sub-objects or only the data for the specified object. This flexibility allows Controllers to retrieve the desired level of detail.
Let's see the GetInstancesResp message proto-buff definition from the official usp proto-buffer file:
GetInstancesResp Message: Upon receiving a GetInstances Message, the Agent responds with a GetInstancesResp Message. This response message contains the Object Instance Paths and unique key parameters of the matched instances. It allows Controllers to understand the structure and unique keys of the Multi-Instance Objects within the Agent's data model.
Handling Errors: In case of any errors during the GetInstances operation, the GetInstancesResp Message includes an "err_code" field, indicating the type of error encountered. A value of 0 signifies a successful read operation, while other values correspond to specific error codes. Additionally, the "err_msg" field provides additional information about the cause of the error.
Instance Mapping with CurrInstance: The GetInstancesResp Message contains a "curr_insts" field, which holds a message of type CurrInstance for each instance of the matched objects. The CurrInstance message includes the Object Instance Path and a map of key/value pairs representing the unique key parameters of the object. This mapping provides Controllers with a comprehensive overview of the Multi-Instance Objects and their associated key parameters.
Permissions and Read Access: Controllers must ensure they have the necessary Read permission for the object or parameters specified in the GetInstances request. If the Controller lacks the required permissions, the corresponding objects or parameters will not be returned in the GetInstancesResp message.
Conclusion: USP GetInstances Messages play a crucial role in mapping Multi-Instance Objects and retrieving instance information from Agents within the USP ecosystem. By utilizing the GetInstances Message, Controllers can efficiently navigate and manipulate data within the Agent's Instantiated Data Model. The corresponding GetInstancesResp Message provides comprehensive mapping, including Object Instance Paths and unique key parameters. Understanding the functionality and structure of these messages empowers developers and implementers to harness the full potential of USP for effective data management.