@@ -110,6 +110,87 @@ def main():
110110 redirect_type = 'External' ,
111111 host_name = 'example.com' ,
112112 ),
113+ ), oss .RoutingRule (
114+ rule_number = 4 ,
115+ condition = oss .RoutingRuleCondition (
116+ key_prefix_equals = 'key' ,
117+ ),
118+ redirect = oss .RoutingRuleRedirect (
119+ redirect_type = 'Mirror' ,
120+ mirror_url = 'http://example.com/' ,
121+ ),
122+ lua_config = oss .RoutingRuleLuaConfig (
123+ script = 'test.lua' ,
124+ ),
125+ ), oss .RoutingRule (
126+ rule_number = 5 ,
127+ condition = oss .RoutingRuleCondition (
128+ key_suffix_equals = 'abc/' ,
129+ http_error_code_returned_equals = 404 ,
130+ include_headers = [oss .RoutingRuleIncludeHeader (
131+ key = 'key1' ,
132+ equals = 'value1' ,
133+ ), oss .RoutingRuleIncludeHeader (
134+ key = 'key2' ,
135+ equals = 'value2' ,
136+ )],
137+ key_prefix_equals = 'key' ,
138+ ),
139+ redirect = oss .RoutingRuleRedirect (
140+ redirect_type = 'Mirror' ,
141+ mirror_url = 'http://example.com/' ,
142+ mirror_allow_video_snapshot = True ,
143+
144+ mirror_taggings = oss .MirrorTaggings (
145+ taggings = [oss .MirrorTagging (
146+ key = 'tag-key1' ,
147+ value = 'tag-value1' ,
148+ ), oss .MirrorTagging (
149+ key = 'tag-key2' ,
150+ value = 'tag-value2' ,
151+ )],
152+ ),
153+ mirror_auth = oss .MirrorAuth (
154+ access_key_id = 'test-access-key-id' ,
155+ access_key_secret = 'test-access-key-secret' ,
156+ auth_type = 'S3V4' ,
157+ region = 'cn-hangzhou' ,
158+ ),
159+ mirror_dst_region = 'oss-cn-hangzhou' ,
160+ mirror_role = 'test-role' ,
161+ mirror_using_role = True ,
162+ mirror_return_headers = oss .MirrorReturnHeaders (
163+ return_headers = [oss .ReturnHeader (
164+ key = 'header-key1' ,
165+ value = 'header-value1' ,
166+ ), oss .ReturnHeader (
167+ key = 'header-key2' ,
168+ value = 'header-value2' ,
169+ )],
170+ ),
171+ mirror_proxy_pass = False ,
172+ mirror_is_express_tunnel = True ,
173+ mirror_allow_head_object = True ,
174+ transparent_mirror_response_codes = '404,500' ,
175+ mirror_save_oss_meta = True ,
176+ mirror_allow_get_image_info = True ,
177+ mirror_url_probe = 'http://probe.example.com/' ,
178+ mirror_user_last_modified = True ,
179+ mirror_switch_all_errors = False ,
180+ mirror_multi_alternates = oss .MirrorMultiAlternates (
181+ mirror_multi_alternates = [oss .MirrorMultiAlternate (
182+ mirror_multi_alternate_number = 1 ,
183+ mirror_multi_alternate_url = 'http://alternate1.example.com/' ,
184+ mirror_multi_alternate_vpc_id = 'vpc-alternate-1' ,
185+ mirror_multi_alternate_dst_region = 'oss-cn-shanghai' ,
186+ ), oss .MirrorMultiAlternate (
187+ mirror_multi_alternate_number = 2 ,
188+ mirror_multi_alternate_url = 'http://alternate2.example.com/' ,
189+ mirror_multi_alternate_vpc_id = 'vpc-alternate-2' ,
190+ mirror_multi_alternate_dst_region = 'oss-cn-beijing' ,
191+ )],
192+ ),
193+ ),
113194 )],
114195 ),
115196 ),
0 commit comments