3131 type = click .Choice (['1' , '0' ]),
3232 help = "Respect headers. The value 1 is On and 0 is Off."
3333 )
34- @click .option ('--cache' , '-c' , multiple = True , type = str ,
34+ @click .option ('--cache' , '-c' , type = str ,
3535 help = "Cache key optimization. These are the valid options to choose: 'include-all', 'ignore-all', "
3636 "'include-specified', 'ignore-specified'. If you select 'include-specified' or 'ignore-specified' "
37- "please add a description too using again --cache, "
38- "e.g --cache=include-specified --cache=description."
37+ "please add to option --cache-description.\n "
38+ " e.g --cache=include-specified --cache-description=description."
39+ )
40+ @click .option ('--cache-description' , '-C' , type = str ,
41+ help = "In cache option, if you select 'include-specified' or 'ignore-specified', "
42+ "please add a description too using this option.\n "
43+ "e.g --cache include-specified --cache-description description."
3944 )
4045@click .option ('--performance-configuration' , '-p' ,
4146 type = click .Choice (['General web delivery' , 'Large file optimization' , 'Video on demand optimization' ]),
4247 help = "Optimize for, General web delivery', 'Large file optimization', 'Video on demand optimization', "
4348 "the Dynamic content acceleration option is not added because this has a special configuration."
4449 )
4550@environment .pass_env
46- def cli (env , identifier , header , http_port , https_port , origin , respect_headers , cache , performance_configuration ):
51+ def cli (env , identifier , header , http_port , https_port , origin , respect_headers , cache ,
52+ cache_description , performance_configuration ):
4753 """Edit a CDN Account.
4854
4955 Note: You can use the hostname or uniqueId as IDENTIFIER.
@@ -53,15 +59,14 @@ def cli(env, identifier, header, http_port, https_port, origin, respect_headers,
5359 cdn_id = helpers .resolve_id (manager .resolve_ids , identifier , 'CDN' )
5460
5561 cache_result = {}
56- if cache :
62+ if cache or cache_description :
5763 if len (cache ) > 1 :
58- cache_result ['cacheKeyQueryRule' ] = cache [0 ]
59- cache_result ['description' ] = cache [1 ]
64+ cache_result ['cacheKeyQueryRule' ] = cache
6065 else :
6166 cache_result ['cacheKeyQueryRule' ] = cache [0 ]
6267
6368 cdn_result = manager .edit (cdn_id , header = header , http_port = http_port , https_port = https_port , origin = origin ,
64- respect_headers = respect_headers , cache = cache_result ,
69+ respect_headers = respect_headers , cache = cache_result , cache_description = cache_description ,
6570 performance_configuration = performance_configuration )
6671
6772 table = formatting .KeyValueTable (['name' , 'value' ])
0 commit comments