File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ python setup.py install --user
2525
2626(or ` sudo python setup.py install ` to install the package for all users)
2727
28- ### Usage ###
28+ ### Basic Usage ###
2929
3030``` python
3131from __future__ import print_function
@@ -65,3 +65,25 @@ if __name__ == '__main__':
6565 print (" Exception when calling ECSApi->run_instances: %s \n " % e)
6666
6767```
68+ ### Configuration Usage ###
69+ 步骤一:启动时初始化,配置 Configuration 全局默认参数
70+ ``` python
71+ configuration = volcenginesdkcore.Configuration()
72+ configuration.client_side_validation = True # 客户端是否进行参数校验
73+ configuration.schema = " http" # https or http
74+ configuration.debug = False # 是否开启调试
75+ configuration.logger_file = " sdk.log"
76+
77+ volcenginesdkcore.Configuration.set_default(configuration)
78+ ```
79+ 步骤二:获取 Client
80+ ``` python
81+ def get_client (ak , sk , region ):
82+ # 包含默认属性
83+ configuration = volcenginesdkcore.Configuration()
84+ configuration.ak = ak
85+ configuration.sk = sk
86+ configuration.region = region
87+ client = volcenginesdkautoscaling.AUTOSCALINGApi(volcenginesdkcore.ApiClient(configuration))
88+ return client
89+ ```
You can’t perform that action at this time.
0 commit comments