Skip to content

Commit c663431

Browse files
committed
add machine id to get cloud metadata
1 parent ef17c0d commit c663431

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

src/viam/robot/client.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@
5353
LOGGER = logging.getLogger(__name__)
5454

5555

56+
@dataclass
57+
class CloudMetadata:
58+
"""App-related information about the robot"""
59+
60+
primary_org_id: str
61+
location_id: str
62+
machine_id: str
63+
machine_part_id: str
64+
65+
5666
class RobotClient:
5767
"""gRPC client for a Robot. This class should be used for all interactions with a robot.
5868
@@ -779,7 +789,7 @@ async def log(self, name: str, level: str, time: datetime, log: str, stack: str)
779789
# Get Cloud Metadata #
780790
######################
781791

782-
async def get_cloud_metadata(self) -> GetCloudMetadataResponse:
792+
async def get_cloud_metadata(self) -> CloudMetadata:
783793
"""
784794
Get app-related information about the robot.
785795
@@ -788,4 +798,11 @@ async def get_cloud_metadata(self) -> GetCloudMetadataResponse:
788798
"""
789799

790800
request = GetCloudMetadataRequest()
791-
return await self._client.GetCloudMetadata(request)
801+
resp: GetCloudMetadataResponse = await self._client.GetCloudMetadata(request)
802+
803+
return CloudMetadata(
804+
primary_org_id=resp.primary_org_id,
805+
location_id=resp.location_id,
806+
machine_id=resp.machine_id,
807+
machine_part_id=resp.machine_part_id,
808+
)

0 commit comments

Comments
 (0)