iac-code 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. iac_code/__init__.py +2 -0
  2. iac_code/acp/__init__.py +97 -0
  3. iac_code/acp/convert.py +423 -0
  4. iac_code/acp/http_sse.py +448 -0
  5. iac_code/acp/mcp.py +54 -0
  6. iac_code/acp/metrics.py +71 -0
  7. iac_code/acp/server.py +662 -0
  8. iac_code/acp/session.py +446 -0
  9. iac_code/acp/slash_registry.py +125 -0
  10. iac_code/acp/state.py +99 -0
  11. iac_code/acp/tools.py +112 -0
  12. iac_code/acp/types.py +13 -0
  13. iac_code/acp/version.py +26 -0
  14. iac_code/agent/__init__.py +19 -0
  15. iac_code/agent/agent_loop.py +640 -0
  16. iac_code/agent/agent_tool.py +269 -0
  17. iac_code/agent/agent_types.py +87 -0
  18. iac_code/agent/message.py +153 -0
  19. iac_code/agent/system_prompt.py +313 -0
  20. iac_code/cli/__init__.py +3 -0
  21. iac_code/cli/headless.py +114 -0
  22. iac_code/cli/main.py +246 -0
  23. iac_code/cli/output_formats.py +125 -0
  24. iac_code/commands/__init__.py +93 -0
  25. iac_code/commands/auth.py +1055 -0
  26. iac_code/commands/clear.py +34 -0
  27. iac_code/commands/compact.py +43 -0
  28. iac_code/commands/debug.py +45 -0
  29. iac_code/commands/effort.py +116 -0
  30. iac_code/commands/exit.py +10 -0
  31. iac_code/commands/help.py +49 -0
  32. iac_code/commands/model.py +130 -0
  33. iac_code/commands/registry.py +245 -0
  34. iac_code/commands/resume.py +49 -0
  35. iac_code/commands/tasks.py +41 -0
  36. iac_code/config.py +304 -0
  37. iac_code/i18n/__init__.py +141 -0
  38. iac_code/i18n/locales/zh/LC_MESSAGES/messages.po +1355 -0
  39. iac_code/memory/__init__.py +1 -0
  40. iac_code/memory/memory_manager.py +92 -0
  41. iac_code/memory/memory_tools.py +88 -0
  42. iac_code/providers/__init__.py +1 -0
  43. iac_code/providers/anthropic_provider.py +284 -0
  44. iac_code/providers/base.py +128 -0
  45. iac_code/providers/dashscope_provider.py +47 -0
  46. iac_code/providers/deepseek_provider.py +36 -0
  47. iac_code/providers/manager.py +399 -0
  48. iac_code/providers/openai_provider.py +344 -0
  49. iac_code/providers/retry.py +58 -0
  50. iac_code/providers/stream_watchdog.py +47 -0
  51. iac_code/providers/thinking.py +164 -0
  52. iac_code/services/__init__.py +1 -0
  53. iac_code/services/agent_factory.py +127 -0
  54. iac_code/services/cloud_credentials.py +22 -0
  55. iac_code/services/context_manager.py +221 -0
  56. iac_code/services/providers/__init__.py +1 -0
  57. iac_code/services/providers/aliyun.py +232 -0
  58. iac_code/services/session_index.py +281 -0
  59. iac_code/services/session_storage.py +245 -0
  60. iac_code/services/telemetry/__init__.py +66 -0
  61. iac_code/services/telemetry/attributes.py +84 -0
  62. iac_code/services/telemetry/client.py +330 -0
  63. iac_code/services/telemetry/config.py +76 -0
  64. iac_code/services/telemetry/constants.py +75 -0
  65. iac_code/services/telemetry/content_serializer.py +124 -0
  66. iac_code/services/telemetry/events.py +42 -0
  67. iac_code/services/telemetry/fallback.py +59 -0
  68. iac_code/services/telemetry/identity.py +73 -0
  69. iac_code/services/telemetry/metrics.py +62 -0
  70. iac_code/services/telemetry/names.py +199 -0
  71. iac_code/services/telemetry/sanitize.py +88 -0
  72. iac_code/services/telemetry/sink.py +67 -0
  73. iac_code/services/telemetry/tracing.py +38 -0
  74. iac_code/services/telemetry/types.py +13 -0
  75. iac_code/services/token_budget.py +54 -0
  76. iac_code/services/token_counter.py +76 -0
  77. iac_code/skills/__init__.py +1 -0
  78. iac_code/skills/bundled/__init__.py +94 -0
  79. iac_code/skills/bundled/iac_aliyun/SKILL.md +192 -0
  80. iac_code/skills/bundled/iac_aliyun/__init__.py +16 -0
  81. iac_code/skills/bundled/iac_aliyun/references/cloud-products/ecs.md +167 -0
  82. iac_code/skills/bundled/iac_aliyun/references/cloud-products/oss.md +69 -0
  83. iac_code/skills/bundled/iac_aliyun/references/cloud-products/rds.md +95 -0
  84. iac_code/skills/bundled/iac_aliyun/references/cloud-products/redis.md +100 -0
  85. iac_code/skills/bundled/iac_aliyun/references/cloud-products/slb.md +60 -0
  86. iac_code/skills/bundled/iac_aliyun/references/cloud-products/vpc.md +54 -0
  87. iac_code/skills/bundled/iac_aliyun/references/ros-template.md +155 -0
  88. iac_code/skills/bundled/iac_aliyun/references/template-parameters.md +206 -0
  89. iac_code/skills/bundled/iac_aliyun/references/terraform-template.md +101 -0
  90. iac_code/skills/bundled/iac_aliyun/scripts/tf2ros.py +77 -0
  91. iac_code/skills/bundled/simplify.py +28 -0
  92. iac_code/skills/discovery.py +136 -0
  93. iac_code/skills/frontmatter.py +119 -0
  94. iac_code/skills/listing.py +92 -0
  95. iac_code/skills/loader.py +42 -0
  96. iac_code/skills/processor.py +81 -0
  97. iac_code/skills/renderer.py +157 -0
  98. iac_code/skills/skill_definition.py +82 -0
  99. iac_code/skills/skill_tool.py +261 -0
  100. iac_code/state/__init__.py +5 -0
  101. iac_code/state/app_state.py +122 -0
  102. iac_code/tasks/__init__.py +1 -0
  103. iac_code/tasks/notification_queue.py +28 -0
  104. iac_code/tasks/task_state.py +66 -0
  105. iac_code/tasks/task_tools.py +114 -0
  106. iac_code/tools/__init__.py +8 -0
  107. iac_code/tools/base.py +226 -0
  108. iac_code/tools/bash.py +133 -0
  109. iac_code/tools/cloud/__init__.py +0 -0
  110. iac_code/tools/cloud/aliyun/__init__.py +0 -0
  111. iac_code/tools/cloud/aliyun/aliyun_api.py +510 -0
  112. iac_code/tools/cloud/aliyun/aliyun_doc_search.py +145 -0
  113. iac_code/tools/cloud/aliyun/endpoints.yml +343 -0
  114. iac_code/tools/cloud/aliyun/ros_client.py +56 -0
  115. iac_code/tools/cloud/aliyun/ros_stack.py +633 -0
  116. iac_code/tools/cloud/aliyun/ros_stack_instances.py +247 -0
  117. iac_code/tools/cloud/base_api.py +162 -0
  118. iac_code/tools/cloud/base_stack.py +242 -0
  119. iac_code/tools/cloud/registry.py +20 -0
  120. iac_code/tools/cloud/types.py +105 -0
  121. iac_code/tools/edit_file.py +121 -0
  122. iac_code/tools/glob.py +103 -0
  123. iac_code/tools/grep.py +254 -0
  124. iac_code/tools/list_files.py +104 -0
  125. iac_code/tools/read_file.py +127 -0
  126. iac_code/tools/result_storage.py +39 -0
  127. iac_code/tools/tool_executor.py +165 -0
  128. iac_code/tools/web_fetch.py +177 -0
  129. iac_code/tools/write_file.py +88 -0
  130. iac_code/types/__init__.py +40 -0
  131. iac_code/types/permissions.py +26 -0
  132. iac_code/types/skill_source.py +11 -0
  133. iac_code/types/stream_events.py +227 -0
  134. iac_code/ui/__init__.py +5 -0
  135. iac_code/ui/banner.py +110 -0
  136. iac_code/ui/components/__init__.py +0 -0
  137. iac_code/ui/components/dialog.py +142 -0
  138. iac_code/ui/components/divider.py +20 -0
  139. iac_code/ui/components/fuzzy_picker.py +308 -0
  140. iac_code/ui/components/progress_bar.py +54 -0
  141. iac_code/ui/components/search_box.py +165 -0
  142. iac_code/ui/components/select.py +319 -0
  143. iac_code/ui/components/status_icon.py +42 -0
  144. iac_code/ui/components/tabs.py +128 -0
  145. iac_code/ui/core/__init__.py +0 -0
  146. iac_code/ui/core/in_place_render.py +129 -0
  147. iac_code/ui/core/input_history.py +118 -0
  148. iac_code/ui/core/key_event.py +41 -0
  149. iac_code/ui/core/prompt_input.py +507 -0
  150. iac_code/ui/core/raw_input.py +302 -0
  151. iac_code/ui/core/screen.py +80 -0
  152. iac_code/ui/dialogs/__init__.py +0 -0
  153. iac_code/ui/dialogs/global_search.py +178 -0
  154. iac_code/ui/dialogs/history_search.py +100 -0
  155. iac_code/ui/dialogs/model_picker.py +280 -0
  156. iac_code/ui/dialogs/quick_open.py +108 -0
  157. iac_code/ui/dialogs/resume_picker.py +749 -0
  158. iac_code/ui/keybindings/__init__.py +0 -0
  159. iac_code/ui/keybindings/manager.py +124 -0
  160. iac_code/ui/renderer.py +1535 -0
  161. iac_code/ui/repl.py +772 -0
  162. iac_code/ui/spinner.py +112 -0
  163. iac_code/ui/suggestions/__init__.py +0 -0
  164. iac_code/ui/suggestions/aggregator.py +171 -0
  165. iac_code/ui/suggestions/command_provider.py +43 -0
  166. iac_code/ui/suggestions/directory_provider.py +95 -0
  167. iac_code/ui/suggestions/file_provider.py +121 -0
  168. iac_code/ui/suggestions/shell_history_provider.py +108 -0
  169. iac_code/ui/suggestions/token_extractor.py +77 -0
  170. iac_code/ui/suggestions/types.py +45 -0
  171. iac_code/ui/transcript_view.py +199 -0
  172. iac_code/utils/__init__.py +0 -0
  173. iac_code/utils/background_housekeeping.py +53 -0
  174. iac_code/utils/cleanup.py +68 -0
  175. iac_code/utils/json_utils.py +60 -0
  176. iac_code/utils/log.py +150 -0
  177. iac_code/utils/project_paths.py +74 -0
  178. iac_code/utils/tool_input_parser.py +62 -0
  179. iac_code-0.1.0.dist-info/LICENSE +201 -0
  180. iac_code-0.1.0.dist-info/METADATA +64 -0
  181. iac_code-0.1.0.dist-info/RECORD +184 -0
  182. iac_code-0.1.0.dist-info/WHEEL +5 -0
  183. iac_code-0.1.0.dist-info/entry_points.txt +2 -0
  184. iac_code-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,343 @@
1
+ # Alibaba Cloud API Endpoints
2
+ # Source: https://help.aliyun.com/zh/[product]/developer-reference/api-xxx-endpoint
3
+ #
4
+ # Format:
5
+ # endpoint: xxx — Global central (all regions)
6
+ # regional: {pattern, regions, mapping} — Regionalized (mapping overrides pattern)
7
+ # central: {endpoint, regions} — Central override for specific regions
8
+ #
9
+ # Resolution: YAML lookup → Location API → fallback ({product}.{region_id}.aliyuncs.com)
10
+
11
+ ros:
12
+ endpoint: ros.aliyuncs.com
13
+
14
+ IaCService:
15
+ endpoint: iac.aliyuncs.com
16
+
17
+ ecs:
18
+ regional:
19
+ pattern: "ecs.{region_id}.aliyuncs.com"
20
+ regions:
21
+ - cn-qingdao
22
+ - cn-beijing
23
+ - cn-zhangjiakou
24
+ - cn-huhehaote
25
+ - cn-wulanchabu
26
+ - cn-hangzhou
27
+ - cn-shanghai
28
+ - cn-nanjing
29
+ - cn-fuzhou
30
+ - cn-shenzhen
31
+ - cn-heyuan
32
+ - cn-guangzhou
33
+ - cn-wuhan-lr
34
+ - cn-zhongwei
35
+ - cn-chengdu
36
+ - cn-zhengzhou-jva
37
+ - cn-hongkong
38
+ - ap-southeast-1
39
+ - ap-southeast-2
40
+ - ap-southeast-3
41
+ - ap-southeast-5
42
+ - ap-southeast-6
43
+ - ap-southeast-7
44
+ - ap-southeast-8
45
+ - ap-northeast-1
46
+ - ap-northeast-2
47
+ - eu-central-1
48
+ - eu-west-1
49
+ - us-east-1
50
+ - us-west-1
51
+ - us-southeast-1
52
+ - na-south-1
53
+ - me-east-1
54
+ - me-central-1
55
+ - ap-south-1
56
+ - cn-beijing-finance-1
57
+ - cn-shanghai-finance-1
58
+ - cn-shenzhen-finance-1
59
+ - cn-heyuan-acdr-1
60
+ central:
61
+ endpoint: ecs.aliyuncs.com
62
+ regions:
63
+ - cn-hangzhou-finance
64
+ - cn-north-2-gov-1
65
+
66
+ rds:
67
+ regional:
68
+ pattern: "rds.{region_id}.aliyuncs.com"
69
+ regions:
70
+ - cn-zhangjiakou
71
+ - cn-huhehaote
72
+ - cn-wulanchabu
73
+ - cn-guangzhou
74
+ - cn-chengdu
75
+ - ap-southeast-1
76
+ - ap-southeast-3
77
+ - ap-southeast-5
78
+ - ap-southeast-6
79
+ - ap-northeast-1
80
+ - eu-central-1
81
+ - eu-west-1
82
+ - us-east-1
83
+ - us-west-1
84
+ - na-south-1
85
+ - me-east-1
86
+ - cn-shenzhen-finance-1
87
+ central:
88
+ endpoint: rds.aliyuncs.com
89
+ regions:
90
+ - cn-qingdao
91
+ - cn-beijing
92
+ - cn-hangzhou
93
+ - cn-shanghai
94
+ - cn-shenzhen
95
+ - cn-heyuan
96
+ - cn-hongkong
97
+ - cn-beijing-finance-1
98
+ - cn-hangzhou-finance
99
+ - cn-shanghai-finance-1
100
+
101
+ r-kvstore:
102
+ regional:
103
+ pattern: "r-kvstore.{region_id}.aliyuncs.com"
104
+ regions:
105
+ - cn-qingdao
106
+ - cn-beijing
107
+ - cn-zhangjiakou
108
+ - cn-huhehaote
109
+ - cn-nanjing
110
+ - cn-fuzhou
111
+ - cn-shenzhen
112
+ - cn-guangzhou
113
+ - cn-wuhan-lr
114
+ - cn-chengdu
115
+ - cn-zhengzhou-jva
116
+ - cn-hongkong
117
+ - ap-southeast-1
118
+ - ap-southeast-2
119
+ - ap-southeast-3
120
+ - ap-southeast-5
121
+ - ap-southeast-6
122
+ - ap-southeast-7
123
+ - ap-northeast-1
124
+ - ap-northeast-2
125
+ - ap-south-1
126
+ - eu-central-1
127
+ - eu-west-1
128
+ - us-east-1
129
+ - us-west-1
130
+ - us-southeast-1
131
+ - na-south-1
132
+ - me-east-1
133
+ - me-central-1
134
+ - cn-beijing-finance-1
135
+ - cn-shanghai-finance-1
136
+ - cn-shenzhen-finance-1
137
+ central:
138
+ endpoint: r-kvstore.aliyuncs.com
139
+ regions:
140
+ - cn-wulanchabu
141
+ - cn-hangzhou
142
+ - cn-shanghai
143
+ - cn-heyuan
144
+ - cn-hangzhou-finance
145
+
146
+ slb:
147
+ regional:
148
+ pattern: "slb.{region_id}.aliyuncs.com"
149
+ regions:
150
+ - cn-qingdao
151
+ - cn-beijing
152
+ - cn-zhangjiakou
153
+ - cn-huhehaote
154
+ - cn-wulanchabu
155
+ - cn-shanghai
156
+ - cn-nanjing
157
+ - cn-fuzhou
158
+ - cn-shenzhen
159
+ - cn-heyuan
160
+ - cn-guangzhou
161
+ - cn-wuhan-lr
162
+ - cn-chengdu
163
+ - cn-zhengzhou-jva
164
+ - cn-hongkong
165
+ - ap-southeast-1
166
+ - ap-southeast-2
167
+ - ap-southeast-3
168
+ - ap-southeast-5
169
+ - ap-southeast-6
170
+ - ap-southeast-7
171
+ - ap-northeast-1
172
+ - ap-northeast-2
173
+ - ap-south-1
174
+ - eu-central-1
175
+ - eu-west-1
176
+ - us-east-1
177
+ - us-west-1
178
+ - na-south-1
179
+ - me-east-1
180
+ - me-central-1
181
+ - cn-beijing-finance-1
182
+ - cn-heyuan-acdr-1
183
+ central:
184
+ endpoint: slb.aliyuncs.com
185
+ regions:
186
+ - cn-hangzhou
187
+ - cn-hangzhou-finance
188
+ - cn-shanghai-finance-1
189
+ - cn-shenzhen-finance-1
190
+
191
+ alb:
192
+ regional:
193
+ pattern: "alb.{region_id}.aliyuncs.com"
194
+ regions:
195
+ - cn-qingdao
196
+ - cn-beijing
197
+ - cn-zhangjiakou
198
+ - cn-wulanchabu
199
+ - cn-hangzhou
200
+ - cn-shanghai
201
+ - cn-nanjing
202
+ - cn-fuzhou
203
+ - cn-shenzhen
204
+ - cn-heyuan
205
+ - cn-guangzhou
206
+ - cn-chengdu
207
+ - cn-wuhan-lr
208
+ - cn-zhengzhou-jva
209
+ - cn-hongkong
210
+ - ap-southeast-1
211
+ - ap-southeast-2
212
+ - ap-southeast-3
213
+ - ap-southeast-5
214
+ - ap-southeast-6
215
+ - ap-southeast-7
216
+ - ap-northeast-1
217
+ - ap-northeast-2
218
+ - ap-south-1
219
+ - eu-central-1
220
+ - eu-west-1
221
+ - us-east-1
222
+ - us-west-1
223
+ - na-south-1
224
+ - me-central-1
225
+ - cn-beijing-finance-1
226
+ - cn-shanghai-finance-1
227
+ - cn-shenzhen-finance-1
228
+ mapping:
229
+ cn-hangzhou-finance: alb.cn-hangzhou.aliyuncs.com
230
+
231
+ nlb:
232
+ regional:
233
+ pattern: "nlb.{region_id}.aliyuncs.com"
234
+ regions:
235
+ - cn-qingdao
236
+ - cn-beijing
237
+ - cn-zhangjiakou
238
+ - cn-wulanchabu
239
+ - cn-hangzhou
240
+ - cn-shanghai
241
+ - cn-nanjing
242
+ - cn-fuzhou
243
+ - cn-shenzhen
244
+ - cn-heyuan
245
+ - cn-guangzhou
246
+ - cn-wuhan-lr
247
+ - cn-chengdu
248
+ - cn-zhengzhou-jva
249
+ - cn-hongkong
250
+ - ap-southeast-1
251
+ - ap-southeast-3
252
+ - ap-southeast-5
253
+ - ap-southeast-6
254
+ - ap-southeast-7
255
+ - ap-northeast-1
256
+ - ap-northeast-2
257
+ - ap-south-1
258
+ - eu-central-1
259
+ - eu-west-1
260
+ - us-east-1
261
+ - us-west-1
262
+ - na-south-1
263
+ - me-east-1
264
+ - me-central-1
265
+ - cn-beijing-finance-1
266
+ - cn-shanghai-finance-1
267
+ - cn-shenzhen-finance-1
268
+
269
+ vpc:
270
+ regional:
271
+ pattern: "vpc.{region_id}.aliyuncs.com"
272
+ regions:
273
+ - cn-qingdao
274
+ - cn-beijing
275
+ - cn-zhangjiakou
276
+ - cn-huhehaote
277
+ - cn-wulanchabu
278
+ - cn-hangzhou
279
+ - cn-shanghai
280
+ - cn-nanjing
281
+ - cn-fuzhou
282
+ - cn-shenzhen
283
+ - cn-heyuan
284
+ - cn-guangzhou
285
+ - cn-wuhan-lr
286
+ - cn-chengdu
287
+ - cn-zhengzhou-jva
288
+ - cn-hongkong
289
+ - ap-southeast-1
290
+ - ap-southeast-2
291
+ - ap-southeast-3
292
+ - ap-southeast-5
293
+ - ap-southeast-6
294
+ - ap-southeast-7
295
+ - ap-northeast-1
296
+ - ap-northeast-2
297
+ - ap-south-1
298
+ - eu-central-1
299
+ - eu-west-1
300
+ - us-east-1
301
+ - us-west-1
302
+ - na-south-1
303
+ - me-east-1
304
+ - me-central-1
305
+ - cn-beijing-finance-1
306
+ - cn-shanghai-finance-1
307
+ - cn-shenzhen-finance-1
308
+ - cn-heyuan-acdr-1
309
+
310
+ oss:
311
+ regional:
312
+ pattern: "oss-{region_id}.aliyuncs.com"
313
+ regions:
314
+ - cn-hangzhou
315
+ - cn-shanghai
316
+ - cn-nanjing
317
+ - cn-fuzhou
318
+ - cn-wuhan-lr
319
+ - cn-qingdao
320
+ - cn-beijing
321
+ - cn-zhangjiakou
322
+ - cn-huhehaote
323
+ - cn-wulanchabu
324
+ - cn-shenzhen
325
+ - cn-heyuan
326
+ - cn-guangzhou
327
+ - cn-chengdu
328
+ - cn-zhongwei
329
+ - cn-hongkong
330
+ - rg-china-mainland
331
+ - ap-northeast-1
332
+ - ap-northeast-2
333
+ - ap-southeast-1
334
+ - ap-southeast-3
335
+ - ap-southeast-5
336
+ - ap-southeast-6
337
+ - ap-southeast-7
338
+ - eu-central-1
339
+ - eu-west-1
340
+ - us-west-1
341
+ - us-east-1
342
+ - na-south-1
343
+ - me-east-1
@@ -0,0 +1,56 @@
1
+ from alibabacloud_ros20190910.client import Client as RosClient
2
+ from alibabacloud_tea_openapi import models as open_api_models
3
+
4
+ from iac_code.services.providers.aliyun import AliyunCredential
5
+
6
+
7
+ class RosClientFactory:
8
+ @staticmethod
9
+ def create(credential: AliyunCredential | None, region_id: str = "") -> RosClient:
10
+ if credential is None:
11
+ raise ValueError(
12
+ "Alibaba Cloud credentials not configured. "
13
+ "Run 'iac-code auth' and select 'Cloud Provider' to configure."
14
+ )
15
+
16
+ effective_region = region_id or credential.region_id
17
+ if not effective_region:
18
+ raise ValueError("Region not configured. Run 'iac-code auth' and configure the region for Alibaba Cloud.")
19
+ config = RosClientFactory._build_config(credential, effective_region)
20
+ return RosClient(config)
21
+
22
+ @staticmethod
23
+ def _build_config(credential: AliyunCredential, region_id: str) -> open_api_models.Config:
24
+ mode = credential.mode
25
+
26
+ if mode == "StsToken":
27
+ return open_api_models.Config(
28
+ access_key_id=credential.access_key_id,
29
+ access_key_secret=credential.access_key_secret,
30
+ security_token=credential.sts_token,
31
+ region_id=region_id,
32
+ )
33
+
34
+ if mode == "RamRoleArn":
35
+ from alibabacloud_credentials import models as credential_models
36
+ from alibabacloud_credentials.client import Client as CredentialClient
37
+
38
+ cred_config = credential_models.Config(
39
+ type="ram_role_arn",
40
+ access_key_id=credential.access_key_id,
41
+ access_key_secret=credential.access_key_secret,
42
+ role_arn=credential.ram_role_arn,
43
+ role_session_name=credential.ram_session_name or "iac-code-session",
44
+ )
45
+ cred_client = CredentialClient(cred_config)
46
+ return open_api_models.Config(
47
+ credential=cred_client,
48
+ region_id=region_id,
49
+ )
50
+
51
+ # Default: AK mode
52
+ return open_api_models.Config(
53
+ access_key_id=credential.access_key_id,
54
+ access_key_secret=credential.access_key_secret,
55
+ region_id=region_id,
56
+ )