Skip to content

Commit 8e6200f

Browse files
committed
Compatible With V4 Region
1 parent 593cc2b commit 8e6200f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

qcloud_cos/cos_client.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,25 @@ def format_region(region):
126126
return region # 传入cos.ap-beijing-1这样显示加上cos.的region
127127
if region == 'cn-north' or region == 'cn-south' or region == 'cn-east' or region == 'cn-south-2' or region == 'cn-southwest' or region == 'sg':
128128
return region # 老域名不能加cos.
129+
# 支持v4域名映射到v5
130+
if region == 'cossh':
131+
return 'cos.ap-shanghai'
132+
if region == 'cosgz':
133+
return 'cos.ap-guangzhou'
134+
if region == 'cosbj':
135+
return 'cos.ap-beijing'
136+
if region == 'costj':
137+
return 'cos.ap-beijing-1'
138+
if region == 'coscd':
139+
return 'cos.ap-chengdu'
140+
if region == 'cossgp':
141+
return 'cos.ap-singapore'
142+
if region == 'coshk':
143+
return 'cos.ap-hongkong'
144+
if region == 'cosca':
145+
return 'cos.na-toronto'
146+
if region == 'cosger':
147+
return 'cos.eu-frankfurt'
129148

130149
return 'cos.' + region # 新域名加上cos.
131150

0 commit comments

Comments
 (0)