Exemplo n.º 1
0
        public void Refresh(string url)
        {
            var pushObjectCacheRequest = new AlibabaCloud.SDK.Cdn20180510.Models.PushObjectCacheRequest()
            {
                ObjectPath = url
            };

            try
            {
                _client.PushObjectCache(pushObjectCacheRequest);
            }
            catch (TeaException ex)
            {
                _logger.LogError($"Cannot refresh AliCDN, please check your AccessKey and url configuration:\n{ex.Message}");
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 刷新
        /// </summary>
        /// <param name="paths"></param>
        public void Refresh(string paths)
        {
            var client = CreateClient(SecretModel.AccessKey, SecretModel.Secret);
            var pushObjectCacheRequest = new AlibabaCloud.SDK.Cdn20180510.Models.PushObjectCacheRequest()
            {
                ObjectPath = paths
            };

            var result = client.PushObjectCache(pushObjectCacheRequest);

            Console.WriteLine(
                JsonSerializer.Serialize(
                    result, new JsonSerializerOptions()
            {
                WriteIndented = true
            }
                    )
                );
        }