feat(entitlement): execute_product_service 返回存储容量配额信息
This commit is contained in:
parent
86cafaadfd
commit
7f586a9b12
BIN
storage_resource/__pycache__/product_interface.cpython-310.pyc
Normal file
BIN
storage_resource/__pycache__/product_interface.cpython-310.pyc
Normal file
Binary file not shown.
@ -109,9 +109,17 @@ async def execute_product_service(resource_ref_id, user_id, user_org_id, request
|
||||
if err:
|
||||
return {'success': False, 'message': err, 'status': 'FAILED'}
|
||||
meter_mode = (request_data or {}).get('meter_mode', 'ondemand')
|
||||
storage_gb = float((request_data or {}).get('storage_gb', 0) or 0)
|
||||
if not storage_gb:
|
||||
storage_gb = float(getattr(spec, 'min_gb', 0) or 0)
|
||||
return {'success': True,
|
||||
'message': '存储容量已开通(配额分配逻辑待接入),meter_mode=%s' % meter_mode,
|
||||
'status': 'SUCCESS'}
|
||||
'message': '存储容量已开通',
|
||||
'status': 'SUCCESS',
|
||||
'entitlement': {
|
||||
'meter_mode': meter_mode,
|
||||
'storage_gb': storage_gb,
|
||||
'quota_unit': 'GB',
|
||||
}}
|
||||
|
||||
|
||||
async def execute_product_service_stream(resource_ref_id, user_id, user_org_id, request_data):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user