Sprog

DeviceManagementClient.GetLogCollectionDetailedStatusAsync Method

Definition

[Protocol Method] Get log collection with detailed status

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual System.Threading.Tasks.Task<Azure.Response> GetLogCollectionDetailedStatusAsync(string logCollectionId, Azure.RequestContext context = default);
abstract member GetLogCollectionDetailedStatusAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetLogCollectionDetailedStatusAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetLogCollectionDetailedStatusAsync (logCollectionId As String, Optional context As RequestContext = Nothing) As Task(Of Response)

Parameters

logCollectionId
String

Log collection identifier.

context
RequestContext

The request options, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The response returned from the service.

Exceptions

logCollectionId is null.

logCollectionId is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Examples

This sample shows how to call GetLogCollectionDetailedStatusAsync with required parameters and parse the result.

var credential = new DefaultAzureCredential();
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new DeviceManagementClient(endpoint, "<instanceId>", credential);

Response response = await client.GetLogCollectionDetailedStatusAsync("<logCollectionId>");

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("operationId").ToString());
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("lastActionDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("deviceStatus")[0].GetProperty("deviceId").ToString());
Console.WriteLine(result.GetProperty("deviceStatus")[0].GetProperty("moduleId").ToString());
Console.WriteLine(result.GetProperty("deviceStatus")[0].GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("deviceStatus")[0].GetProperty("resultCode").ToString());
Console.WriteLine(result.GetProperty("deviceStatus")[0].GetProperty("extendedResultCode").ToString());
Console.WriteLine(result.GetProperty("deviceStatus")[0].GetProperty("logLocation").ToString());
Console.WriteLine(result.GetProperty("description").ToString());

Remarks

Below is the JSON schema for the response payload.

Response Body:

Schema for LogCollectionOperationDetailedStatus:

{
              operationId: string, # Optional. The device diagnostics operation id.
              createdDateTime: string, # Optional. The timestamp when the operation was created.
              lastActionDateTime: string, # Optional. A timestamp for when the current state was entered.
              status: "NotStarted" | "Running" | "Succeeded" | "Failed", # Optional. Operation status.
              deviceStatus: [
                {
                  deviceId: string, # Required. Device id
                  moduleId: string, # Optional. Module id.
                  status: "NotStarted" | "Running" | "Succeeded" | "Failed", # Required. Log upload status
                  resultCode: string, # Optional. Log upload result code
                  extendedResultCode: string, # Optional. Log upload extended result code
                  logLocation: string, # Optional. Log upload location
                }
              ], # Optional. Status of the devices in the operation
              description: string, # Optional. Device diagnostics operation description.
            }

Applies to