@@ -27,9 +27,9 @@ class AskDatabaseResult(MyBaseModel):
2727
2828
2929class 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 )
3333
3434
3535class InstanceDetail (MyBaseModel ):
@@ -154,7 +154,13 @@ async def add_instance(
154154 req .real_login_user_uid = mcp .state .real_login_uid
155155 try :
156156 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+
158164 except Exception as e :
159165 logger .error (f"Error in add_instance: { e } " )
160166 raise
@@ -380,7 +386,7 @@ async def create_data_change_order(
380386 req .param = param
381387 try :
382388 resp = client .create_data_correct_order (req )
383- return resp .body
389+ return resp .body . to_map ()
384390 except Exception as e :
385391 logger .error (f"Error in create_data_change_order: { e } " )
386392 raise
@@ -395,7 +401,7 @@ async def get_order_base_info(
395401 req .order_id = order_id
396402 try :
397403 resp = client .get_order_base_info (req )
398- return resp .body
404+ return resp .body . to_map ()
399405 except Exception as e :
400406 logger .error (f"Error in get_order_base_info: { e } " )
401407 raise
@@ -410,7 +416,7 @@ async def submit_order_approval(
410416 req .order_id = order_id
411417 try :
412418 resp = client .submit_order_approval (req )
413- return resp .body
419+ return resp .body . to_map ()
414420 except Exception as e :
415421 logger .error (f"Error in submit_order_approval: { e } " )
416422 raise
0 commit comments