DeviceManagementClient.GetDeploymentForDeviceClassSubgroupAsync 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 las propiedades de implementación.
public virtual System.Threading.Tasks.Task<Azure.Response> GetDeploymentForDeviceClassSubgroupAsync(string groupId, string deviceClassId, string deploymentId, Azure.RequestContext context = default);
abstract member GetDeploymentForDeviceClassSubgroupAsync : string * string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetDeploymentForDeviceClassSubgroupAsync : string * string * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetDeploymentForDeviceClassSubgroupAsync (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 desde el servicio. Los detalles del esquema del cuerpo de la respuesta se encuentran en la sección Comentarios a continuación.
Excepciones
groupId
, deviceClassId
o deploymentId
es un valor null.
groupId
o deviceClassId
deploymentId
es una cadena vacía y se espera que no esté vacía.
El servicio devolvió un código de estado no correcto.
Ejemplos
En este ejemplo se muestra cómo llamar a GetDeploymentForDeviceClassSubgroupAsync 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.GetDeploymentForDeviceClassSubgroupAsync("<groupId>", "<deviceClassId>", "<deploymentId>");
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("deploymentId").ToString());
Console.WriteLine(result.GetProperty("startDateTime").ToString());
Console.WriteLine(result.GetProperty("update").GetProperty("updateId").GetProperty("provider").ToString());
Console.WriteLine(result.GetProperty("update").GetProperty("updateId").GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("update").GetProperty("updateId").GetProperty("version").ToString());
Console.WriteLine(result.GetProperty("update").GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("update").GetProperty("friendlyName").ToString());
Console.WriteLine(result.GetProperty("groupId").ToString());
Console.WriteLine(result.GetProperty("deviceClassSubgroups")[0].ToString());
Console.WriteLine(result.GetProperty("isCanceled").ToString());
Console.WriteLine(result.GetProperty("isRetried").ToString());
Console.WriteLine(result.GetProperty("rollbackPolicy").GetProperty("update").GetProperty("updateId").GetProperty("provider").ToString());
Console.WriteLine(result.GetProperty("rollbackPolicy").GetProperty("update").GetProperty("updateId").GetProperty("name").ToString());
Console.WriteLine(result.GetProperty("rollbackPolicy").GetProperty("update").GetProperty("updateId").GetProperty("version").ToString());
Console.WriteLine(result.GetProperty("rollbackPolicy").GetProperty("update").GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("rollbackPolicy").GetProperty("update").GetProperty("friendlyName").ToString());
Console.WriteLine(result.GetProperty("rollbackPolicy").GetProperty("failure").GetProperty("devicesFailedPercentage").ToString());
Console.WriteLine(result.GetProperty("rollbackPolicy").GetProperty("failure").GetProperty("devicesFailedCount").ToString());
Console.WriteLine(result.GetProperty("isCloudInitiatedRollback").ToString());
Comentarios
A continuación se muestra el esquema JSON para la carga de respuesta.
Cuerpo de la respuesta:
Esquema para Deployment
:
{
deploymentId: string, # Required. The caller-provided deployment identifier. This cannot be longer than 73 characters, must be all lower-case, and cannot contain '&', '^', '[', ']', '{', '}', '|', '<', '>', forward slash, backslash, or double quote. The Updates view in the Azure Portal IoT Hub resource generates a GUID for deploymentId when you create a deployment.
startDateTime: string (ISO 8601 Format), # Required. The deployment start datetime.
update: {
updateId: {
provider: string, # Required. Update provider.
name: string, # Required. Update name.
version: string, # Required. Update version.
}, # Required. Update identifier.
description: string, # Optional. Update description.
friendlyName: string, # Optional. Friendly update name.
}, # Required. Update information for the update in the deployment.
groupId: string, # Required. The group identity for the devices the deployment is intended to update.
deviceClassSubgroups: [string], # Optional. The device class subgroups the deployment is compatible with and subgroup deployments have been created for. This is not provided by the caller during CreateOrUpdateDeployment but is automatically determined by Device Update
isCanceled: boolean, # Optional. Boolean flag indicating whether the deployment was canceled.
isRetried: boolean, # Optional. Boolean flag indicating whether the deployment has been retried.
rollbackPolicy: {
update: UpdateInfo, # Required. Update to rollback to.
failure: {
devicesFailedPercentage: number, # Required. Percentage of devices that failed.
devicesFailedCount: number, # Required. Number of devices that failed.
}, # Required. Failure conditions to initiate rollback policy.
}, # Optional. The rollback policy for the deployment.
isCloudInitiatedRollback: boolean, # Optional. Boolean flag indicating whether the deployment is a rollback deployment.
}
Se aplica a
Azure SDK for .NET