OCISDK/OCISDK/ObjectStorage/ObjectStorageClientAsync.cs
/// <summary>
/// Lists the logs of the work request with the given ID.
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Lists the logs of the work request with the given ID.
Lists the logs of the work request with the given ID .
public async Task<ListWorkRequestLogsResponse> ListWorkRequestLogs(ListWorkRequestLogsRequest request)
        {
            var uriStr = $"{GetEndPointNoneVersion("workRequests", this.Region)}/{request.WorkRequestId}/logs";
            var optional = request.GetOptionQuery();
            if (!string.IsNullOrEmpty(optional))
            {
                uriStr = $"{uriStr}?{optional}";
            }
            var uri = new Uri(uriStr);
            using (var webResponse = await this.RestClientAsync.Get(uri, new HttpRequestHeaderParam { OpcClientRequestId = request.OpcClientRequestId }))
            using (var stream = webResponse.GetResponseStream())
            using (var reader = new StreamReader(stream))
            {
                var response = reader.ReadToEnd();
                return new ListWorkRequestLogsResponse()
                {
                    Items = JsonSerializer.Deserialize<List<WorkRequestLogEntry>>(response),
                    OpcRequestId = webResponse.Headers.Get("opc-request-id"),
                    OpcClientRequestId = webResponse.Headers.Get("opc-client-request-id"),
                    OpcNextPage = webResponse.Headers.Get("opc-next-page")
                };
            }
        }
public async Task < ListWorkRequestLogsResponse > ListWorkRequestLogs ( ListWorkRequestLogsRequest request ) { var uriStr = $" { GetEndPointNoneVersion ( " " , this . Region ) } / { request . WorkRequestId } /logs " ; var optional = request . GetOptionQuery ( ) ; if ( ! string . IsNullOrEmpty ( optional ) ) { uriStr = $" { uriStr } ? { optional } " ; } var uri = new Uri ( uriStr ) ; using ( var webResponse = await this . RestClientAsync . Get ( uri , new HttpRequestHeaderParam { OpcClientRequestId = request . OpcClientRequestId } ) ) using ( var stream = webResponse . GetResponseStream ( ) ) using ( var reader = new StreamReader ( stream ) ) { var response = reader . ReadToEnd ( ) ; return new ListWorkRequestLogsResponse ( ) { Items = JsonSerializer . Deserialize < List < WorkRequestLogEntry > > ( response ) , OpcRequestId = webResponse . Headers . Get ( " " ) , OpcClientRequestId = webResponse . Headers . Get ( " " ) , OpcNextPage = webResponse . Headers . Get ( " " ) } ; } }
Lists the logs of the work request with the given ID.
Lists the logs of the work request with the given ID .
None
request
ListWorkRequestLogsRequest
None