增加获取指定实例可升级的套餐列表的api端点
This commit is contained in:
parent
5e9cda9bee
commit
40967ea9e9
@ -399,6 +399,21 @@ class AliyunLightServerManager:
|
|||||||
jingrow.log_error("获取实例详细信息失败", f"获取实例详细信息时发生错误: {str(e)}")
|
jingrow.log_error("获取实例详细信息失败", f"获取实例详细信息时发生错误: {str(e)}")
|
||||||
return {'success': False, 'error': str(e), 'message': '获取实例详细信息失败'}
|
return {'success': False, 'error': str(e), 'message': '获取实例详细信息失败'}
|
||||||
|
|
||||||
|
def get_instance_upgrade_plans(self, instance_id, region_id='cn-shanghai'):
|
||||||
|
"""获取指定实例可升级的套餐列表"""
|
||||||
|
client = self._get_client(region_id)
|
||||||
|
try:
|
||||||
|
request = swas__open20200601_models.ListInstancePlansModificationRequest(
|
||||||
|
region_id=region_id,
|
||||||
|
instance_id=instance_id
|
||||||
|
)
|
||||||
|
runtime = util_models.RuntimeOptions()
|
||||||
|
response = client.list_instance_plans_modification_with_options(request, runtime)
|
||||||
|
return {'success': True, 'data': self._convert_response_to_dict(response.body), 'message': '获取可升级套餐列表成功'}
|
||||||
|
except Exception as e:
|
||||||
|
jingrow.log_error("获取可升级套餐列表失败", f"获取实例 {instance_id} 可升级套餐时发生错误: {str(e)}")
|
||||||
|
return {'success': False, 'error': str(e), 'message': '获取可升级套餐列表失败'}
|
||||||
|
|
||||||
|
|
||||||
# 全局管理器实例
|
# 全局管理器实例
|
||||||
_aliyun_manager = None
|
_aliyun_manager = None
|
||||||
@ -734,6 +749,12 @@ def get_aliyun_instance_details(instance_ids, region_id='cn-shanghai'):
|
|||||||
manager = _get_manager()
|
manager = _get_manager()
|
||||||
return manager.get_instance_details(instance_ids, region_id)
|
return manager.get_instance_details(instance_ids, region_id)
|
||||||
|
|
||||||
|
@jingrow.whitelist()
|
||||||
|
def get_aliyun_instance_upgrade_plans(instance_id, region_id='cn-shanghai'):
|
||||||
|
"""获取指定实例可升级的套餐列表"""
|
||||||
|
manager = _get_manager()
|
||||||
|
return manager.get_instance_upgrade_plans(instance_id, region_id)
|
||||||
|
|
||||||
|
|
||||||
# 服务器订单和创建相关
|
# 服务器订单和创建相关
|
||||||
|
|
||||||
|
|||||||
@ -25,6 +25,7 @@
|
|||||||
"bandwidth",
|
"bandwidth",
|
||||||
"public_ip",
|
"public_ip",
|
||||||
"image_id",
|
"image_id",
|
||||||
|
"support_platform",
|
||||||
"ssh_section",
|
"ssh_section",
|
||||||
"ssh_user",
|
"ssh_user",
|
||||||
"ssh_port",
|
"ssh_port",
|
||||||
@ -185,7 +186,6 @@
|
|||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"default": "22",
|
|
||||||
"fieldname": "password",
|
"fieldname": "password",
|
||||||
"fieldtype": "Password",
|
"fieldtype": "Password",
|
||||||
"label": "服务器密码"
|
"label": "服务器密码"
|
||||||
@ -199,11 +199,16 @@
|
|||||||
"fieldname": "plan_price",
|
"fieldname": "plan_price",
|
||||||
"fieldtype": "Int",
|
"fieldtype": "Int",
|
||||||
"label": "套餐价格(元/月)"
|
"label": "套餐价格(元/月)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "support_platform",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"label": "支持平台"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2025-07-29 18:37:36.194789",
|
"modified": "2025-07-30 22:05:00.093363",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Jcloud",
|
"module": "Jcloud",
|
||||||
"name": "Jsite Server",
|
"name": "Jsite Server",
|
||||||
|
|||||||
@ -33,6 +33,7 @@ class JsiteServer(Document):
|
|||||||
ssh_port: DF.Int
|
ssh_port: DF.Int
|
||||||
ssh_user: DF.Data | None
|
ssh_user: DF.Data | None
|
||||||
status: DF.Literal["Pending", "Starting", "Running", "Stopping", "Stopped", "Resetting", "Upgrading", "Disabled"]
|
status: DF.Literal["Pending", "Starting", "Running", "Stopping", "Stopped", "Resetting", "Upgrading", "Disabled"]
|
||||||
|
support_platform: DF.Data | None
|
||||||
system: DF.Data | None
|
system: DF.Data | None
|
||||||
team: DF.Link | None
|
team: DF.Link | None
|
||||||
title: DF.Data | None
|
title: DF.Data | None
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user