@@ -27,9 +27,9 @@ class AskDatabaseResult(MyBaseModel):
27
27
28
28
29
29
class InstanceInfo (MyBaseModel ):
30
- instance_id : Any = Field (description = "Unique instance identifier in DMS" , default = None )
31
- host : Any = Field (description = "The hostname of the database instance" , default = None )
32
- port : Any = Field (description = "The connection port number" , default = None )
30
+ InstanceId : Any = Field (description = "Unique instance identifier in DMS" , default = None )
31
+ Host : Any = Field (description = "The hostname of the database instance" , default = None )
32
+ Port : Any = Field (description = "The connection port number" , default = None )
33
33
34
34
35
35
class InstanceDetail (MyBaseModel ):
@@ -154,7 +154,13 @@ async def add_instance(
154
154
req .real_login_user_uid = mcp .state .real_login_uid
155
155
try :
156
156
resp = client .simply_add_instance (req )
157
- return InstanceInfo (** resp .body .to_map ()) if resp and resp .body else InstanceInfo ()
157
+
158
+ if resp and resp .body :
159
+ body_dict = resp .body .to_map ()
160
+ return InstanceInfo (** (body_dict ['Instance' ] if 'Instance' in body_dict else body_dict ))
161
+ else :
162
+ return InstanceInfo ()
163
+
158
164
except Exception as e :
159
165
logger .error (f"Error in add_instance: { e } " )
160
166
raise
@@ -380,7 +386,7 @@ async def create_data_change_order(
380
386
req .param = param
381
387
try :
382
388
resp = client .create_data_correct_order (req )
383
- return resp .body
389
+ return resp .body . to_map ()
384
390
except Exception as e :
385
391
logger .error (f"Error in create_data_change_order: { e } " )
386
392
raise
@@ -395,7 +401,7 @@ async def get_order_base_info(
395
401
req .order_id = order_id
396
402
try :
397
403
resp = client .get_order_base_info (req )
398
- return resp .body
404
+ return resp .body . to_map ()
399
405
except Exception as e :
400
406
logger .error (f"Error in get_order_base_info: { e } " )
401
407
raise
@@ -410,7 +416,7 @@ async def submit_order_approval(
410
416
req .order_id = order_id
411
417
try :
412
418
resp = client .submit_order_approval (req )
413
- return resp .body
419
+ return resp .body . to_map ()
414
420
except Exception as e :
415
421
logger .error (f"Error in submit_order_approval: { e } " )
416
422
raise
0 commit comments