Skip to content

Commit a15e312

Browse files
authored
add sys data to properties (Azure#34549)
1 parent c083eab commit a15e312

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

sdk/ml/azure-ai-ml/azure/ai/ml/entities/_endpoint/online_endpoint.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,23 @@ def _from_rest_object(cls, obj: OnlineEndpointData) -> "OnlineEndpoint":
222222
identity = IdentityConfiguration._from_online_endpoint_rest_object(obj.identity) if obj.identity else None
223223

224224
endpoint: Any = KubernetesOnlineEndpoint()
225+
226+
if obj.system_data:
227+
properties_dict = {
228+
"createdBy": obj.system_data.created_by,
229+
"createdAt": obj.system_data.created_at.strftime("%Y-%m-%dT%H:%M:%S.%f%z"),
230+
"lastModifiedAt": obj.system_data.last_modified_at.strftime("%Y-%m-%dT%H:%M:%S.%f%z"),
231+
}
232+
properties_dict.update(obj.properties.properties)
233+
else:
234+
properties_dict = obj.properties.properties
235+
225236
if obj.properties.compute:
226237
endpoint = KubernetesOnlineEndpoint(
227238
id=obj.id,
228239
name=obj.name,
229240
tags=obj.tags,
230-
properties=obj.properties.properties,
241+
properties=properties_dict,
231242
compute=obj.properties.compute,
232243
auth_mode=auth_mode,
233244
description=obj.properties.description,
@@ -244,7 +255,7 @@ def _from_rest_object(cls, obj: OnlineEndpointData) -> "OnlineEndpoint":
244255
id=obj.id,
245256
name=obj.name,
246257
tags=obj.tags,
247-
properties=obj.properties.properties,
258+
properties=properties_dict,
248259
auth_mode=auth_mode,
249260
description=obj.properties.description,
250261
location=obj.location,

0 commit comments

Comments
 (0)