jdcloud-api / jdcloud-sdk-python Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
from jdcloud_sdk.core.credential import Credential
from jdcloud_sdk.services.billing.client.BillingClient import BillingClient
from jdcloud_sdk.services.billing.apis.QueryBillSummaryRequest
import QueryBillSummaryParameters,QueryBillSummaryRequest
access_key = ''
secret_key = ''
credential = Credential(access_key, secret_key)
client = BillingClient(credential)
try:
parameters = QueryBillSummaryParameters('cn-north-1','2019-10-01','2019-10-31')
request = QueryBillSummaryRequest(parameters)
resp = client.send(request)
if resp.error is not None:
print("code:",resp.error.code, "message:",resp.error.message)
print(str(resp.error.message,encoding='utf-8'))
print(resp.result)
except Exception as e:
print(e)
# 错误处理
得到的结果是
code: 500 message: 内部错误
是参数填写错误吗?有具体的例子不?
我用用DescribeInstanceTypesRequest方法正常返回, 用DescribeInstancesRequest 方法的时候报错, 返回结果如下,
b'{"error":{"message":"sign result is not same [gw]","status":"ACCESS_ERROR","code":401},"requestId":"bwvnrhmbv42j8f4ctwkedo0atdkgc35f"}\n'
我们的服务器是在云鼎,
我测试过,按照示例,只有instanceType 的可以获得返回,其他都是空的,获取不不到任何信息
$ python -c "import jdcloud_sdk.services.ipanti.models.CertInfo"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "jdcloud_sdk/services/ipanti/models/CertInfo.py", line 22
def __init__(self, domain=None, from=None, to=None, user=None, sigAlgName=None, issuer=None):
^
SyntaxError: invalid syntax
针对 https://docs.jdcloud.com/cn/cdn/faq 相关的API包含在SDK中吗,具体在哪个模块?
没有看到指定短信模版ID的接口
现在的使用方式是:
from jdcloud_sdk.services.billing.models.ResourceOrderQueryCondition import ResourceOrderQueryCondition
from jdcloud_sdk.services.jdro.apis.DeleteStackRequest import DeleteStackRequest
希望改为
from jdcloud_sdk.services.billing.models import ResourceOrderQueryCondition
from jdcloud_sdk.services.jdro.apis import DeleteStackRequest
python setup.py install has a error
with open(path.join(here, 'README'), encoding='utf-8') as f:
long_description = f.read()
it should be
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
no such README file
建议使用 six
来处理python2-3 的兼容性:https://six.readthedocs.io/
` access_key = 'E'
secret_key = '0'
credential = Credential(access_key, secret_key)
client = VmClient(credential)
try:
parameters = DescribeInstancesParameters('cn-north-1')
request = DescribeInstancesRequest(parameters)
resp = client.send(request)
if resp.error is not None:
print(resp.error.code, resp.error.message)
print(resp.result)
except Exception as e:
print(e)
`
raise ValueError("check_hostname requires server_hostname") ValueError: check_hostname requires server_hostname
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.