From 2aafea88beefab565031a989e9e79352afbfef6f Mon Sep 17 00:00:00 2001 From: jingrow Date: Tue, 29 Jul 2025 22:15:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?UTF-8?q?=E7=BB=AD=E8=B4=B9api=E7=AB=AF=E7=82=B9=E5=8F=8A=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jcloud/api/aliyun_server_light.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/jcloud/api/aliyun_server_light.py b/jcloud/api/aliyun_server_light.py index e765647..f7ab0db 100644 --- a/jcloud/api/aliyun_server_light.py +++ b/jcloud/api/aliyun_server_light.py @@ -183,15 +183,14 @@ class AliyunLightServerManager: jingrow.log_error("升级实例失败", f"升级实例 {instance_id} 时发生错误: {str(e)}") return {'success': False, 'error': str(e), 'message': '实例升级失败'} - def renew_instance(self, instance_id, period=1, period_unit='Month', region_id='cn-shanghai'): + def renew_instance(self, instance_id, period=1, region_id='cn-shanghai'): """续费实例""" client = self._get_client(region_id) try: request = swas__open20200601_models.RenewInstanceRequest( region_id=region_id, instance_id=instance_id, - period=period, - period_unit=period_unit + period=period ) runtime = util_models.RuntimeOptions() response = client.renew_instance_with_options(request, runtime) @@ -527,10 +526,10 @@ def upgrade_aliyun_instance(instance_id, plan_id, region_id='cn-shanghai'): return manager.upgrade_instance(instance_id, plan_id, region_id) @jingrow.whitelist() -def renew_aliyun_instance(instance_id, period=1, period_unit='Month', region_id='cn-shanghai'): +def renew_aliyun_instance(instance_id, period=1, region_id='cn-shanghai'): """续费实例""" manager = _get_manager() - return manager.renew_instance(instance_id, period, period_unit, region_id) + return manager.renew_instance(instance_id, period, region_id) @jingrow.whitelist() def reset_aliyun_instance_system(instance_id, image_id=None, password=None, region_id='cn-shanghai'):