Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

调用请求 报 product 找不到 #524

Closed
nsdont opened this issue Dec 29, 2023 · 1 comment
Closed

调用请求 报 product 找不到 #524

nsdont opened this issue Dec 29, 2023 · 1 comment

Comments

@nsdont
Copy link

nsdont commented Dec 29, 2023

  • Python Version: 2.7.18
  • aliyunsdkcore Version: 2.14.0
  • API: DescribeVpcsRequest

可复现代码

from aliyunsdkcore import client
from aliyunsdkcore.profile import region_provider
from aliyunsdkecs.request.v20140526 import DescribeVpcsRequest

# global config
orId = ""
region_id = ''  
access_key = ''  
access_secret = ''
endpoint = ''

# product config
product_name = 'ECS'

region_provider.modify_point(product_name, region_id, endpoint)
clt = client.AcsClient(access_key, access_secret, region_id, debug=True)

# setup request
request = DescribeVpcsRequest.DescribeVpcsRequest()
request.set_accept_format('json')
request.add_header("x-acs-organizationid", orId)

# get response
response = clt.do_action_with_exception(request)
print(response)

执行报错:

aliyunsdkcore.acs_exception.exceptions.ServerException: HTTP Status: 500 Error:SDK.UnknownServerError ServerResponseBody: {"eagleEyeTraceId":"...","asapiSuccess":false,"product":"asapi","code":"asapi.server.request.parameter.product.not.found","cost":0,"suggestion":"建议API调用方检查调用参数中是否含有必填的API所属产品参数(Product),详情可参照开发文档中ASAPI相关调用方法。","errorCode":"asapi.server.request.parameter.product.not.found","asapiVersion":"v4","message":"参数无效: 当前请求中缺少公共参数Product!","extInfo":{},"serverRole":"asapi.ApiServer#","asapiRequestId":"...","innerCall":true,"success":false,"asapiErrorMessage":"参数无效: 当前请求中缺少公共参数Product!","domain":"...","diagnose":"","api":"null:DescribeInstances:2014-05-26","asapiErrorCode":"asapi.server.request.parameter.product.not.found"} RequestID: None

手动在 aliyunsdkcore/request.py 第 320 行增加代码 self.add_query_param("product", "ecs"),就行了,
image

@JacksonTian
Copy link
Contributor

专有云不在支持之列。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants