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.
- iac_code/__init__.py +2 -0
- iac_code/acp/__init__.py +97 -0
- iac_code/acp/convert.py +423 -0
- iac_code/acp/http_sse.py +448 -0
- iac_code/acp/mcp.py +54 -0
- iac_code/acp/metrics.py +71 -0
- iac_code/acp/server.py +662 -0
- iac_code/acp/session.py +446 -0
- iac_code/acp/slash_registry.py +125 -0
- iac_code/acp/state.py +99 -0
- iac_code/acp/tools.py +112 -0
- iac_code/acp/types.py +13 -0
- iac_code/acp/version.py +26 -0
- iac_code/agent/__init__.py +19 -0
- iac_code/agent/agent_loop.py +640 -0
- iac_code/agent/agent_tool.py +269 -0
- iac_code/agent/agent_types.py +87 -0
- iac_code/agent/message.py +153 -0
- iac_code/agent/system_prompt.py +313 -0
- iac_code/cli/__init__.py +3 -0
- iac_code/cli/headless.py +114 -0
- iac_code/cli/main.py +246 -0
- iac_code/cli/output_formats.py +125 -0
- iac_code/commands/__init__.py +93 -0
- iac_code/commands/auth.py +1055 -0
- iac_code/commands/clear.py +34 -0
- iac_code/commands/compact.py +43 -0
- iac_code/commands/debug.py +45 -0
- iac_code/commands/effort.py +116 -0
- iac_code/commands/exit.py +10 -0
- iac_code/commands/help.py +49 -0
- iac_code/commands/model.py +130 -0
- iac_code/commands/registry.py +245 -0
- iac_code/commands/resume.py +49 -0
- iac_code/commands/tasks.py +41 -0
- iac_code/config.py +304 -0
- iac_code/i18n/__init__.py +141 -0
- iac_code/i18n/locales/zh/LC_MESSAGES/messages.po +1355 -0
- iac_code/memory/__init__.py +1 -0
- iac_code/memory/memory_manager.py +92 -0
- iac_code/memory/memory_tools.py +88 -0
- iac_code/providers/__init__.py +1 -0
- iac_code/providers/anthropic_provider.py +284 -0
- iac_code/providers/base.py +128 -0
- iac_code/providers/dashscope_provider.py +47 -0
- iac_code/providers/deepseek_provider.py +36 -0
- iac_code/providers/manager.py +399 -0
- iac_code/providers/openai_provider.py +344 -0
- iac_code/providers/retry.py +58 -0
- iac_code/providers/stream_watchdog.py +47 -0
- iac_code/providers/thinking.py +164 -0
- iac_code/services/__init__.py +1 -0
- iac_code/services/agent_factory.py +127 -0
- iac_code/services/cloud_credentials.py +22 -0
- iac_code/services/context_manager.py +221 -0
- iac_code/services/providers/__init__.py +1 -0
- iac_code/services/providers/aliyun.py +232 -0
- iac_code/services/session_index.py +281 -0
- iac_code/services/session_storage.py +245 -0
- iac_code/services/telemetry/__init__.py +66 -0
- iac_code/services/telemetry/attributes.py +84 -0
- iac_code/services/telemetry/client.py +330 -0
- iac_code/services/telemetry/config.py +76 -0
- iac_code/services/telemetry/constants.py +75 -0
- iac_code/services/telemetry/content_serializer.py +124 -0
- iac_code/services/telemetry/events.py +42 -0
- iac_code/services/telemetry/fallback.py +59 -0
- iac_code/services/telemetry/identity.py +73 -0
- iac_code/services/telemetry/metrics.py +62 -0
- iac_code/services/telemetry/names.py +199 -0
- iac_code/services/telemetry/sanitize.py +88 -0
- iac_code/services/telemetry/sink.py +67 -0
- iac_code/services/telemetry/tracing.py +38 -0
- iac_code/services/telemetry/types.py +13 -0
- iac_code/services/token_budget.py +54 -0
- iac_code/services/token_counter.py +76 -0
- iac_code/skills/__init__.py +1 -0
- iac_code/skills/bundled/__init__.py +94 -0
- iac_code/skills/bundled/iac_aliyun/SKILL.md +192 -0
- iac_code/skills/bundled/iac_aliyun/__init__.py +16 -0
- iac_code/skills/bundled/iac_aliyun/references/cloud-products/ecs.md +167 -0
- iac_code/skills/bundled/iac_aliyun/references/cloud-products/oss.md +69 -0
- iac_code/skills/bundled/iac_aliyun/references/cloud-products/rds.md +95 -0
- iac_code/skills/bundled/iac_aliyun/references/cloud-products/redis.md +100 -0
- iac_code/skills/bundled/iac_aliyun/references/cloud-products/slb.md +60 -0
- iac_code/skills/bundled/iac_aliyun/references/cloud-products/vpc.md +54 -0
- iac_code/skills/bundled/iac_aliyun/references/ros-template.md +155 -0
- iac_code/skills/bundled/iac_aliyun/references/template-parameters.md +206 -0
- iac_code/skills/bundled/iac_aliyun/references/terraform-template.md +101 -0
- iac_code/skills/bundled/iac_aliyun/scripts/tf2ros.py +77 -0
- iac_code/skills/bundled/simplify.py +28 -0
- iac_code/skills/discovery.py +136 -0
- iac_code/skills/frontmatter.py +119 -0
- iac_code/skills/listing.py +92 -0
- iac_code/skills/loader.py +42 -0
- iac_code/skills/processor.py +81 -0
- iac_code/skills/renderer.py +157 -0
- iac_code/skills/skill_definition.py +82 -0
- iac_code/skills/skill_tool.py +261 -0
- iac_code/state/__init__.py +5 -0
- iac_code/state/app_state.py +122 -0
- iac_code/tasks/__init__.py +1 -0
- iac_code/tasks/notification_queue.py +28 -0
- iac_code/tasks/task_state.py +66 -0
- iac_code/tasks/task_tools.py +114 -0
- iac_code/tools/__init__.py +8 -0
- iac_code/tools/base.py +226 -0
- iac_code/tools/bash.py +133 -0
- iac_code/tools/cloud/__init__.py +0 -0
- iac_code/tools/cloud/aliyun/__init__.py +0 -0
- iac_code/tools/cloud/aliyun/aliyun_api.py +510 -0
- iac_code/tools/cloud/aliyun/aliyun_doc_search.py +145 -0
- iac_code/tools/cloud/aliyun/endpoints.yml +343 -0
- iac_code/tools/cloud/aliyun/ros_client.py +56 -0
- iac_code/tools/cloud/aliyun/ros_stack.py +633 -0
- iac_code/tools/cloud/aliyun/ros_stack_instances.py +247 -0
- iac_code/tools/cloud/base_api.py +162 -0
- iac_code/tools/cloud/base_stack.py +242 -0
- iac_code/tools/cloud/registry.py +20 -0
- iac_code/tools/cloud/types.py +105 -0
- iac_code/tools/edit_file.py +121 -0
- iac_code/tools/glob.py +103 -0
- iac_code/tools/grep.py +254 -0
- iac_code/tools/list_files.py +104 -0
- iac_code/tools/read_file.py +127 -0
- iac_code/tools/result_storage.py +39 -0
- iac_code/tools/tool_executor.py +165 -0
- iac_code/tools/web_fetch.py +177 -0
- iac_code/tools/write_file.py +88 -0
- iac_code/types/__init__.py +40 -0
- iac_code/types/permissions.py +26 -0
- iac_code/types/skill_source.py +11 -0
- iac_code/types/stream_events.py +227 -0
- iac_code/ui/__init__.py +5 -0
- iac_code/ui/banner.py +110 -0
- iac_code/ui/components/__init__.py +0 -0
- iac_code/ui/components/dialog.py +142 -0
- iac_code/ui/components/divider.py +20 -0
- iac_code/ui/components/fuzzy_picker.py +308 -0
- iac_code/ui/components/progress_bar.py +54 -0
- iac_code/ui/components/search_box.py +165 -0
- iac_code/ui/components/select.py +319 -0
- iac_code/ui/components/status_icon.py +42 -0
- iac_code/ui/components/tabs.py +128 -0
- iac_code/ui/core/__init__.py +0 -0
- iac_code/ui/core/in_place_render.py +129 -0
- iac_code/ui/core/input_history.py +118 -0
- iac_code/ui/core/key_event.py +41 -0
- iac_code/ui/core/prompt_input.py +507 -0
- iac_code/ui/core/raw_input.py +302 -0
- iac_code/ui/core/screen.py +80 -0
- iac_code/ui/dialogs/__init__.py +0 -0
- iac_code/ui/dialogs/global_search.py +178 -0
- iac_code/ui/dialogs/history_search.py +100 -0
- iac_code/ui/dialogs/model_picker.py +280 -0
- iac_code/ui/dialogs/quick_open.py +108 -0
- iac_code/ui/dialogs/resume_picker.py +749 -0
- iac_code/ui/keybindings/__init__.py +0 -0
- iac_code/ui/keybindings/manager.py +124 -0
- iac_code/ui/renderer.py +1535 -0
- iac_code/ui/repl.py +772 -0
- iac_code/ui/spinner.py +112 -0
- iac_code/ui/suggestions/__init__.py +0 -0
- iac_code/ui/suggestions/aggregator.py +171 -0
- iac_code/ui/suggestions/command_provider.py +43 -0
- iac_code/ui/suggestions/directory_provider.py +95 -0
- iac_code/ui/suggestions/file_provider.py +121 -0
- iac_code/ui/suggestions/shell_history_provider.py +108 -0
- iac_code/ui/suggestions/token_extractor.py +77 -0
- iac_code/ui/suggestions/types.py +45 -0
- iac_code/ui/transcript_view.py +199 -0
- iac_code/utils/__init__.py +0 -0
- iac_code/utils/background_housekeeping.py +53 -0
- iac_code/utils/cleanup.py +68 -0
- iac_code/utils/json_utils.py +60 -0
- iac_code/utils/log.py +150 -0
- iac_code/utils/project_paths.py +74 -0
- iac_code/utils/tool_input_parser.py +62 -0
- iac_code-0.1.0.dist-info/LICENSE +201 -0
- iac_code-0.1.0.dist-info/METADATA +64 -0
- iac_code-0.1.0.dist-info/RECORD +184 -0
- iac_code-0.1.0.dist-info/WHEEL +5 -0
- iac_code-0.1.0.dist-info/entry_points.txt +2 -0
- 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
|
+
)
|