Skip to content

Commit a564ba6

Browse files
committed
feat: update readme
1 parent 4060bc1 commit a564ba6

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff 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
3131
from __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+
```

0 commit comments

Comments
 (0)