DeviceManagementClient.GetDeviceClassSubgroupDeploymentStatusAsync Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Obtiene el estado de una implementación, incluido un desglose del número de dispositivos de la implementación en curso, completados o erróneos.
public virtual System.Threading.Tasks.Task<Azure.Response> GetDeviceClassSubgroupDeploymentStatusAsync(string groupId, string deviceClassId, string deploymentId, Azure.RequestContext context = default);
abstract member GetDeviceClassSubgroupDeploymentStatusAsync : string * string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetDeviceClassSubgroupDeploymentStatusAsync : string * string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetDeviceClassSubgroupDeploymentStatusAsync (groupId As String, deviceClassId As String, deploymentId As String, Optional context As RequestContext = Nothing) As Task(Of Response)
Parámetros
- groupId
- String
Identificador de grupo.
- deviceClassId
- String
Identificador de clase de dispositivo.
- deploymentId
- String
Identificador de implementación.
- context
- RequestContext
Contexto de solicitud, que puede invalidar los comportamientos predeterminados de la canalización de cliente por llamada.
Devoluciones
Respuesta devuelta por el servicio. Los detalles del esquema del cuerpo de la respuesta se encuentran en la sección Comentarios siguiente.
Excepciones
groupId
, deviceClassId
o deploymentId
es un valor null.
groupId
, deviceClassId
o deploymentId
es una cadena vacía y se esperaba que no estuviera vacía.
El servicio devolvió un código de estado no correcto.
Ejemplos
En este ejemplo se muestra cómo llamar a GetDeviceClassSubgroupDeploymentStatusAsync con los parámetros necesarios y analizar el resultado.
var credential = new DefaultAzureCredential();
var endpoint = new Uri("<https://my-service.azure.com>");
var client = new DeviceManagementClient(endpoint, "<instanceId>", credential);
Response response = await client.GetDeviceClassSubgroupDeploymentStatusAsync("<groupId>", "<deviceClassId>", "<deploymentId>");
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("groupId").ToString());
Console.WriteLine(result.GetProperty("deviceClassId").ToString());
Console.WriteLine(result.GetProperty("deploymentState").ToString());
Console.WriteLine(result.GetProperty("error").GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("error").GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("error").GetProperty("target").ToString());
Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("error").GetProperty("innererror").GetProperty("errorDetail").ToString());
Console.WriteLine(result.GetProperty("error").GetProperty("occurredDateTime").ToString());
Console.WriteLine(result.GetProperty("totalDevices").ToString());
Console.WriteLine(result.GetProperty("devicesInProgressCount").ToString());
Console.WriteLine(result.GetProperty("devicesCompletedFailedCount").ToString());
Console.WriteLine(result.GetProperty("devicesCompletedSucceededCount").ToString());
Console.WriteLine(result.GetProperty("devicesCanceledCount").ToString());
Comentarios
A continuación se muestra el esquema JSON para la carga de respuesta.
Cuerpo de la respuesta:
Esquema para DeviceClassSubgroupDeploymentStatus
:
{
groupId: string, # Required. The group identity
deviceClassId: string, # Required. The device class subgroup identity
deploymentState: "Active" | "Failed" | "Inactive" | "Canceled", # Required. The state of the subgroup deployment.
error: {
code: string, # Required. Server defined error code.
message: string, # Required. A human-readable representation of the error.
target: string, # Optional. The target of the error.
details: [Error], # Optional. An array of errors that led to the reported error.
innererror: {
code: string, # Required. A more specific error code than what was provided by the containing error.
message: string, # Optional. A human-readable representation of the error.
errorDetail: string, # Optional. The internal error or exception message.
innerError: InnerError, # Optional. An object containing more specific information than the current object about the error.
}, # Optional. An object containing more specific information than the current object about the error.
occurredDateTime: string (ISO 8601 Format), # Optional. Date and time in UTC when the error occurred.
}, # Optional. The error details of the Failed state. This is not present if the deployment state is not Failed.
totalDevices: number, # Optional. The total number of devices in the deployment.
devicesInProgressCount: number, # Optional. The number of devices that are currently in deployment.
devicesCompletedFailedCount: number, # Optional. The number of devices that have completed deployment with a failure.
devicesCompletedSucceededCount: number, # Optional. The number of devices which have successfully completed deployment.
devicesCanceledCount: number, # Optional. The number of devices which have had their deployment canceled.
}
Se aplica a
Azure SDK for .NET