/// 获取存储桶日志服务 public void GetBucketLogging() { //.cssg-snippet-body-start:[get-bucket-logging] try { string bucket = "examplebucket-1250000000"; //格式:BucketName-APPID GetBucketLoggingRequest request = new GetBucketLoggingRequest(bucket); //执行请求 GetBucketLoggingResult getResult = cosXml.getBucketLogging(request); //请求成功 BucketLoggingStatus status = getResult.bucketLoggingStatus; if (status != null && status.loggingEnabled != null) { string targetBucket = status.loggingEnabled.targetBucket; string targetPrefix = status.loggingEnabled.targetPrefix; } } catch (COSXML.CosException.CosClientException clientEx) { //请求失败 Console.WriteLine("CosClientException: " + clientEx); } catch (COSXML.CosException.CosServerException serverEx) { //请求失败 Console.WriteLine("CosServerException: " + serverEx.GetInfo()); } //.cssg-snippet-body-end }
static void GetBucketLogging() { try { GetBucketLoggingRequest request = new GetBucketLoggingRequest { BucketName = bucketName }; GetBucketLoggingResponse response = client.GetBucketLogging(request); Console.WriteLine("TargetBucketName is : " + response.Configuration.TargetBucketName); Console.WriteLine("TargetPrefix is : " + response.Configuration.TargetPrefix); Console.WriteLine("Get bucket logging response: {0}", response.StatusCode); } catch (ObsException ex) { Console.WriteLine("Exception errorcode: {0}, when get bucket logging.", ex.ErrorCode); Console.WriteLine("Exception errormessage: {0}", ex.ErrorMessage); } }
public void GetBucketLoggingAsync(GetBucketLoggingRequest request, OnSuccessCallback <CosResult> successCallback, OnFailedCallback failCallback) { Schedue(request, new Model.Bucket.GetBucketLoggingResult(), successCallback, failCallback); }
public GetBucketLoggingResult GetBucketLogging(GetBucketLoggingRequest request) { return((Model.Bucket.GetBucketLoggingResult)Excute(request, new Model.Bucket.GetBucketLoggingResult())); }
public Task <GetBucketLoggingResponse> GetBucketLoggingAsync(GetBucketLoggingRequest request, CancellationToken cancellationToken = default) { throw new NotImplementedException(); }
/// <summary> /// 获取桶访问日志配置。 /// </summary> /// <param name="request">获取桶访问日志配置的请求参数。</param> /// <returns>获取桶访问日志配置的响应结果。</returns> public GetBucketLoggingResponse GetBucketLogging(GetBucketLoggingRequest request) { return(this.DoRequest <GetBucketLoggingRequest, GetBucketLoggingResponse>(request)); }
public GetBucketLoggingResponse GetBucketLogging(GetBucketLoggingRequest request) { throw new NotImplementedException(); }
/// <summary> /// Start the asynchronous request for obtaining the bucket logging configuration. /// </summary> /// <param name="request">Parameters in a request for obtaining the bucket logging configuration</param> /// <param name="callback">Asynchronous request callback function</param> /// <param name="state">Asynchronous request status object</param> /// <returns>Response to the asynchronous request</returns> public IAsyncResult BeginGetBucketLogging(GetBucketLoggingRequest request, AsyncCallback callback, object state) { return(this.BeginDoRequest <GetBucketLoggingRequest>(request, callback, state)); }
public void GetBucketLoggingAsync(GetBucketLoggingRequest request, AmazonServiceCallback <GetBucketLoggingRequest, GetBucketLoggingResponse> callback, AsyncOptions options = null) { throw new System.NotImplementedException(); }