Aliyun Console Bench SDK Library for Python
Project description
企业工作台 python sdk
基本原理
在官网 SDK 的基础上,对 Client进行重写,满足企业工作台的调用逻辑,同时完全兼容官网 SDK,这样就形成了 企业工作台定制 Client + 官网 SDK 提供 APIMETA 的模式。
环境要求
- 找阿里云企业工作台团队,提供 OpenAPI 访问凭证(consoleKey、consoleSecret)
SDK 获取与安装
使用 pip 安装(推荐)
pip install aliyun-console-bench-python-sdk
快速使用
企业工作台的业务模式分为 工作台托管、聚石塔自管 两种模式,因此API调用也有针对性区分。
工作台托管 SDK 调用示例
from one_sdk.client import OneClient
from aliyunsdkecs.request.v20140526.DescribeInstancesRequest import DescribeInstancesRequest
def test_client_api():
client = OneClient(${consoleKey}, ${consoleSecret}, ${regionId})
client.set_endpoint('console-bench.aliyuncs.com')
client.add_query_param('AliUid', 'xxx') # OneConsole传递的主账号id
req = DescribeInstancesRequest()
req.set_VpcId('xxx')
res = client.do_action_with_exception(req)
print(res)
说明:
- endpoint: 测试环境下需要 host 绑定 114.55.202.134 console-bench.aliyuncs.com
聚石塔托管 SDK 调用示例
from one_sdk.client import OneClient
from aliyunsdkecs.request.v20140526.DescribeInstancesRequest import DescribeInstancesRequest
def test_client_api():
client = OneClient(${consoleKey}, ${consoleSecret}, ${regionId})
client.set_endpoint('console-bench.aliyuncs.com')
client.add_query_param('IdToken', 'xxx') # Oauth授权后获取的身份信息
req = DescribeInstancesRequest()
req.set_VpcId('xxx')
res = client.do_action_with_exception(req)
print(res)
说明:
- endpoint: 测试环境下需要 host 绑定 114.55.202.134 console-bench.aliyuncs.com
许可证
Copyright (c) 2009-present, Alibaba Cloud All rights reserved.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for aliyun-console-bench-python-sdk-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed4300ea010f3a926e75cc31cd740f6965a6a22ebf94d2564ce824703d279cfd |
|
MD5 | b66ff13440cdfccea5031e0d8f6dc517 |
|
BLAKE2b-256 | 90a8c2aba20bbd141f0c45f0e78ef89ed3dcd1684a036ac7e3f38700a7ff9459 |