DeviceManagementAsyncClient.java
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.iot.deviceupdate;
import com.azure.core.annotation.Generated;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceClient;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.exception.HttpResponseException;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.RequestOptions;
import com.azure.core.http.rest.Response;
import com.azure.core.util.BinaryData;
import com.azure.core.util.polling.PollerFlux;
import com.azure.iot.deviceupdate.implementation.DeviceManagementsImpl;
import reactor.core.publisher.Mono;
/** Initializes a new instance of the asynchronous DeviceUpdateClient type. */
@ServiceClient(builder = DeviceUpdateClientBuilder.class, isAsync = true)
public final class DeviceManagementAsyncClient {
@Generated private final DeviceManagementsImpl serviceClient;
/**
* Initializes an instance of DeviceManagements client.
*
* @param serviceClient the service client implementation.
*/
@Generated
DeviceManagementAsyncClient(DeviceManagementsImpl serviceClient) {
this.serviceClient = serviceClient;
}
/**
* Gets a list of all device classes (unique combinations of device manufacturer and model) for all devices
* connected to Device Update for IoT Hub.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* value: [
* {
* deviceClassId: String
* compatProperties: {
* String: String
* }
* bestCompatibleUpdateId: {
* provider: String
* name: String
* version: String
* }
* }
* ]
* nextLink: String
* }
* }</pre>
*
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return a list of all device classes (unique combinations of device manufacturer and model) for all devices
* connected to Device Update for IoT Hub.
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux<BinaryData> listDeviceClasses(RequestOptions requestOptions) {
return this.serviceClient.listDeviceClassesAsync(requestOptions);
}
/**
* Gets the properties of a device class.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* deviceClassId: String
* compatProperties: {
* String: String
* }
* bestCompatibleUpdateId: {
* provider: String
* name: String
* version: String
* }
* }
* }</pre>
*
* @param deviceClassId Device class identifier.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return the properties of a device class along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> getDeviceClassWithResponse(String deviceClassId, RequestOptions requestOptions) {
return this.serviceClient.getDeviceClassWithResponseAsync(deviceClassId, requestOptions);
}
/**
* Gets a list of installable updates for a device class.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* value: [
* {
* provider: String
* name: String
* version: String
* }
* ]
* nextLink: String
* }
* }</pre>
*
* @param deviceClassId Device class identifier.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return a list of installable updates for a device class.
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux<BinaryData> listInstallableUpdatesForDeviceClass(
String deviceClassId, RequestOptions requestOptions) {
return this.serviceClient.listInstallableUpdatesForDeviceClassAsync(deviceClassId, requestOptions);
}
/**
* Gets a list of devices connected to Device Update for IoT Hub.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>filter</td><td>String</td><td>No</td><td>Restricts the set of devices returned. You can filter on device GroupId or DeviceClassId.</td></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* value: [
* {
* deviceId: String
* moduleId: String
* deviceClassId: String
* manufacturer: String
* model: String
* groupId: String
* lastAttemptedUpdateId: {
* provider: String
* name: String
* version: String
* }
* deploymentStatus: String(Succeeded/InProgress/Failed/Canceled/Incompatible)
* installedUpdateId: (recursive schema, see installedUpdateId above)
* onLatestUpdate: boolean
* lastDeploymentId: String
* lastInstallResult: {
* resultCode: int
* extendedResultCode: int
* resultDetails: String
* stepResults: [
* {
* updateId: (recursive schema, see updateId above)
* description: String
* resultCode: int
* extendedResultCode: int
* resultDetails: String
* }
* ]
* }
* }
* ]
* nextLink: String
* }
* }</pre>
*
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return a list of devices connected to Device Update for IoT Hub.
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux<BinaryData> listDevices(RequestOptions requestOptions) {
return this.serviceClient.listDevicesAsync(requestOptions);
}
/**
* Import existing devices from IoT Hub.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* <tr><td>action</td><td>String</td><td>Yes</td><td>Devices action.</td></tr>
* </table>
*
* <p><strong>Request Body Schema</strong>
*
* <pre>{@code
* String(Devices/Modules/All)
* }</pre>
*
* @param importType The types of devices to import.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<Void>> importDevicesWithResponse(BinaryData importType, RequestOptions requestOptions) {
return this.serviceClient.importDevicesWithResponseAsync(importType, requestOptions);
}
/**
* Import existing devices from IoT Hub.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* <tr><td>action</td><td>String</td><td>Yes</td><td>Devices action.</td></tr>
* </table>
*
* <p><strong>Request Body Schema</strong>
*
* <pre>{@code
* String(Devices/Modules/All)
* }</pre>
*
* @param importType The types of devices to import.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return the response body along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux<BinaryData, BinaryData> beginImportDevices(BinaryData importType, RequestOptions requestOptions) {
return this.serviceClient.beginImportDevicesAsync(importType, requestOptions);
}
/**
* Gets the device properties and latest deployment status for a device connected to Device Update for IoT Hub.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* deviceId: String
* moduleId: String
* deviceClassId: String
* manufacturer: String
* model: String
* groupId: String
* lastAttemptedUpdateId: {
* provider: String
* name: String
* version: String
* }
* deploymentStatus: String(Succeeded/InProgress/Failed/Canceled/Incompatible)
* installedUpdateId: (recursive schema, see installedUpdateId above)
* onLatestUpdate: boolean
* lastDeploymentId: String
* lastInstallResult: {
* resultCode: int
* extendedResultCode: int
* resultDetails: String
* stepResults: [
* {
* updateId: (recursive schema, see updateId above)
* description: String
* resultCode: int
* extendedResultCode: int
* resultDetails: String
* }
* ]
* }
* }
* }</pre>
*
* @param deviceId Device identifier in Azure IoT Hub.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return the device properties and latest deployment status for a device connected to Device Update for IoT Hub
* along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> getDeviceWithResponse(String deviceId, RequestOptions requestOptions) {
return this.serviceClient.getDeviceWithResponseAsync(deviceId, requestOptions);
}
/**
* Gets the device module properties and latest deployment status for a device module connected to Device Update for
* IoT Hub.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* deviceId: String
* moduleId: String
* deviceClassId: String
* manufacturer: String
* model: String
* groupId: String
* lastAttemptedUpdateId: {
* provider: String
* name: String
* version: String
* }
* deploymentStatus: String(Succeeded/InProgress/Failed/Canceled/Incompatible)
* installedUpdateId: (recursive schema, see installedUpdateId above)
* onLatestUpdate: boolean
* lastDeploymentId: String
* lastInstallResult: {
* resultCode: int
* extendedResultCode: int
* resultDetails: String
* stepResults: [
* {
* updateId: (recursive schema, see updateId above)
* description: String
* resultCode: int
* extendedResultCode: int
* resultDetails: String
* }
* ]
* }
* }
* }</pre>
*
* @param deviceId Device identifier in Azure IoT Hub.
* @param moduleId Device module identifier in Azure IoT Hub.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return the device module properties and latest deployment status for a device module connected to Device Update
* for IoT Hub along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> getDeviceModuleWithResponse(
String deviceId, String moduleId, RequestOptions requestOptions) {
return this.serviceClient.getDeviceModuleWithResponseAsync(deviceId, moduleId, requestOptions);
}
/**
* Gets the breakdown of how many devices are on their latest update, have new updates available, or are in progress
* receiving new updates.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* totalDeviceCount: int
* onLatestUpdateDeviceCount: int
* newUpdatesAvailableDeviceCount: int
* updatesInProgressDeviceCount: int
* }
* }</pre>
*
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return the breakdown of how many devices are on their latest update, have new updates available, or are in
* progress receiving new updates along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> getUpdateComplianceWithResponse(RequestOptions requestOptions) {
return this.serviceClient.getUpdateComplianceWithResponseAsync(requestOptions);
}
/**
* Gets a list of available group device tags for all devices connected to Device Update for IoT Hub.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* value: [
* {
* tagName: String
* deviceCount: int
* }
* ]
* nextLink: String
* }
* }</pre>
*
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return a list of available group device tags for all devices connected to Device Update for IoT Hub.
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux<BinaryData> listDeviceTags(RequestOptions requestOptions) {
return this.serviceClient.listDeviceTagsAsync(requestOptions);
}
/**
* Gets a count of how many devices have a device tag.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* tagName: String
* deviceCount: int
* }
* }</pre>
*
* @param tagName Tag name.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return a count of how many devices have a device tag along with {@link Response} on successful completion of
* {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> getDeviceTagWithResponse(String tagName, RequestOptions requestOptions) {
return this.serviceClient.getDeviceTagWithResponseAsync(tagName, requestOptions);
}
/**
* Gets a list of all device groups.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* value: [
* {
* groupId: String
* groupType: String(DeviceClassIdAndIoTHubTag/InvalidDeviceClassIdAndIoTHubTag/DefaultDeviceClassId)
* tags: [
* String
* ]
* createdDateTime: String
* deviceCount: Integer
* deploymentId: String
* deviceClassId: String
* }
* ]
* nextLink: String
* }
* }</pre>
*
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return a list of all device groups.
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux<BinaryData> listGroups(RequestOptions requestOptions) {
return this.serviceClient.listGroupsAsync(requestOptions);
}
/**
* Gets the properties of a group.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* groupId: String
* groupType: String(DeviceClassIdAndIoTHubTag/InvalidDeviceClassIdAndIoTHubTag/DefaultDeviceClassId)
* tags: [
* String
* ]
* createdDateTime: String
* deviceCount: Integer
* deploymentId: String
* deviceClassId: String
* }
* }</pre>
*
* @param groupId Group identity.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return the properties of a group along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> getGroupWithResponse(String groupId, RequestOptions requestOptions) {
return this.serviceClient.getGroupWithResponseAsync(groupId, requestOptions);
}
/**
* Create or update a device group.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Request Body Schema</strong>
*
* <pre>{@code
* {
* groupId: String
* groupType: String(DeviceClassIdAndIoTHubTag/InvalidDeviceClassIdAndIoTHubTag/DefaultDeviceClassId)
* tags: [
* String
* ]
* createdDateTime: String
* deviceCount: Integer
* deploymentId: String
* deviceClassId: String
* }
* }</pre>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* groupId: String
* groupType: String(DeviceClassIdAndIoTHubTag/InvalidDeviceClassIdAndIoTHubTag/DefaultDeviceClassId)
* tags: [
* String
* ]
* createdDateTime: String
* deviceCount: Integer
* deploymentId: String
* deviceClassId: String
* }
* }</pre>
*
* @param groupId Group identity.
* @param group The group properties.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return group details along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> createOrUpdateGroupWithResponse(
String groupId, BinaryData group, RequestOptions requestOptions) {
return this.serviceClient.createOrUpdateGroupWithResponseAsync(groupId, group, requestOptions);
}
/**
* Deletes a device group.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* @param groupId Group identity.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<Void>> deleteGroupWithResponse(String groupId, RequestOptions requestOptions) {
return this.serviceClient.deleteGroupWithResponseAsync(groupId, requestOptions);
}
/**
* Get group update compliance information such as how many devices are on their latest update, how many need new
* updates, and how many are in progress on receiving a new update.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* totalDeviceCount: int
* onLatestUpdateDeviceCount: int
* newUpdatesAvailableDeviceCount: int
* updatesInProgressDeviceCount: int
* }
* }</pre>
*
* @param groupId Group identity.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return group update compliance information such as how many devices are on their latest update, how many need
* new updates, and how many are in progress on receiving a new update along with {@link Response} on successful
* completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> getGroupUpdateComplianceWithResponse(
String groupId, RequestOptions requestOptions) {
return this.serviceClient.getGroupUpdateComplianceWithResponseAsync(groupId, requestOptions);
}
/**
* Get the best available updates for a group and a count of how many devices need each update.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>filter</td><td>String</td><td>No</td><td>Restricts the set of bestUpdates returned. You can filter on update Provider, Name and Version property.</td></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* value: [
* {
* updateId: {
* provider: String
* name: String
* version: String
* }
* deviceCount: int
* }
* ]
* nextLink: String
* }
* }</pre>
*
* @param groupId Group identity.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return the best available updates for a group and a count of how many devices need each update.
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux<BinaryData> listBestUpdatesForGroup(String groupId, RequestOptions requestOptions) {
return this.serviceClient.listBestUpdatesForGroupAsync(groupId, requestOptions);
}
/**
* Gets a list of deployments for a group.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>filter</td><td>String</td><td>No</td><td>Restricts the set of deployments returned. You can filter on update Provider, Name and Version property.</td></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* value: [
* {
* deploymentId: String
* startDateTime: String
* updateId: {
* provider: String
* name: String
* version: String
* }
* groupId: String
* isCanceled: Boolean
* isRetried: Boolean
* }
* ]
* nextLink: String
* }
* }</pre>
*
* @param groupId Group identity.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return a list of deployments for a group.
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux<BinaryData> listDeploymentsForGroup(String groupId, RequestOptions requestOptions) {
return this.serviceClient.listDeploymentsForGroupAsync(groupId, requestOptions);
}
/**
* Gets the properties of a deployment.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* deploymentId: String
* startDateTime: String
* updateId: {
* provider: String
* name: String
* version: String
* }
* groupId: String
* isCanceled: Boolean
* isRetried: Boolean
* }
* }</pre>
*
* @param groupId Group identity.
* @param deploymentId Deployment identifier.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return the properties of a deployment along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> getDeploymentWithResponse(
String groupId, String deploymentId, RequestOptions requestOptions) {
return this.serviceClient.getDeploymentWithResponseAsync(groupId, deploymentId, requestOptions);
}
/**
* Creates or updates a deployment.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Request Body Schema</strong>
*
* <pre>{@code
* {
* deploymentId: String
* startDateTime: String
* updateId: {
* provider: String
* name: String
* version: String
* }
* groupId: String
* isCanceled: Boolean
* isRetried: Boolean
* }
* }</pre>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* deploymentId: String
* startDateTime: String
* updateId: {
* provider: String
* name: String
* version: String
* }
* groupId: String
* isCanceled: Boolean
* isRetried: Boolean
* }
* }</pre>
*
* @param deploymentId Deployment identifier.
* @param groupId Group identity.
* @param deployment The deployment properties.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return deployment metadata along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> createOrUpdateDeploymentWithResponse(
String deploymentId, String groupId, BinaryData deployment, RequestOptions requestOptions) {
return this.serviceClient.createOrUpdateDeploymentWithResponseAsync(
deploymentId, groupId, deployment, requestOptions);
}
/**
* Deletes a deployment.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* @param groupId Group identity.
* @param deploymentId Deployment identifier.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<Void>> deleteDeploymentWithResponse(
String groupId, String deploymentId, RequestOptions requestOptions) {
return this.serviceClient.deleteDeploymentWithResponseAsync(groupId, deploymentId, requestOptions);
}
/**
* Gets the status of a deployment including a breakdown of how many devices in the deployment are in progress,
* completed, or failed.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* deploymentState: String(Active/Inactive/Canceled)
* totalDevices: Integer
* devicesInProgressCount: Integer
* devicesCompletedFailedCount: Integer
* devicesCompletedSucceededCount: Integer
* devicesCanceledCount: Integer
* }
* }</pre>
*
* @param groupId Group identity.
* @param deploymentId Deployment identifier.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return the status of a deployment including a breakdown of how many devices in the deployment are in progress,
* completed, or failed along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> getDeploymentStatusWithResponse(
String groupId, String deploymentId, RequestOptions requestOptions) {
return this.serviceClient.getDeploymentStatusWithResponseAsync(groupId, deploymentId, requestOptions);
}
/**
* Gets a list of devices in a deployment along with their state. Useful for getting a list of failed devices.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>filter</td><td>String</td><td>No</td><td>Restricts the set of deployment device states returned. You can filter on deviceId and moduleId and/or deviceState.</td></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* value: [
* {
* deviceId: String
* moduleId: String
* retryCount: int
* movedOnToNewDeployment: boolean
* deviceState: String(Succeeded/InProgress/Failed/Canceled/Incompatible)
* }
* ]
* nextLink: String
* }
* }</pre>
*
* @param groupId Group identity.
* @param deploymentId Deployment identifier.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return a list of devices in a deployment along with their state.
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux<BinaryData> listDeploymentDevices(
String groupId, String deploymentId, RequestOptions requestOptions) {
return this.serviceClient.listDeploymentDevicesAsync(groupId, deploymentId, requestOptions);
}
/**
* Retrieve operation status.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Header Parameters</strong>
*
* <table border="1">
* <caption>Header Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>ifNoneMatch</td><td>String</td><td>No</td><td>Defines the If-None-Match condition. The operation will be performed only if the ETag on the server does not match this value.</td></tr>
* </table>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* operationId: String
* status: String(Undefined/NotStarted/Running/Succeeded/Failed)
* error: {
* code: String
* message: String
* target: String
* details: [
* (recursive schema, see above)
* ]
* innererror: {
* code: String
* message: String
* errorDetail: String
* innerError: (recursive schema, see innerError above)
* }
* occurredDateTime: String
* }
* traceId: String
* lastActionDateTime: String
* createdDateTime: String
* etag: String
* }
* }</pre>
*
* @param operationId Operation identifier.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return operation metadata along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> getOperationWithResponse(String operationId, RequestOptions requestOptions) {
return this.serviceClient.getOperationWithResponseAsync(operationId, requestOptions);
}
/**
* Get a list of all device import operations. Completed operations are kept for 7 days before auto-deleted.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>filter</td><td>String</td><td>No</td><td>Restricts the set of operations returned. Only one specific filter is supported: "status eq 'NotStarted' or status eq 'Running'"</td></tr>
* <tr><td>top</td><td>String</td><td>No</td><td>Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n.</td></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* value: [
* {
* operationId: String
* status: String(Undefined/NotStarted/Running/Succeeded/Failed)
* error: {
* code: String
* message: String
* target: String
* details: [
* (recursive schema, see above)
* ]
* innererror: {
* code: String
* message: String
* errorDetail: String
* innerError: (recursive schema, see innerError above)
* }
* occurredDateTime: String
* }
* traceId: String
* lastActionDateTime: String
* createdDateTime: String
* etag: String
* }
* ]
* nextLink: String
* }
* }</pre>
*
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return a list of all device import operations.
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux<BinaryData> listOperations(RequestOptions requestOptions) {
return this.serviceClient.listOperationsAsync(requestOptions);
}
/**
* Start the device diagnostics log collection operation on specified devices.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Request Body Schema</strong>
*
* <pre>{@code
* {
* operationId: String
* deviceList: [
* {
* deviceId: String
* moduleId: String
* }
* ]
* description: String
* createdDateTime: String
* lastActionDateTime: String
* status: String(Undefined/NotStarted/Running/Succeeded/Failed)
* }
* }</pre>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* operationId: String
* deviceList: [
* {
* deviceId: String
* moduleId: String
* }
* ]
* description: String
* createdDateTime: String
* lastActionDateTime: String
* status: String(Undefined/NotStarted/Running/Succeeded/Failed)
* }
* }</pre>
*
* @param operationId Operation identifier.
* @param logCollectionRequest The deployment properties.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return diagnostics request body along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> collectLogsWithResponse(
String operationId, BinaryData logCollectionRequest, RequestOptions requestOptions) {
return this.serviceClient.collectLogsWithResponseAsync(operationId, logCollectionRequest, requestOptions);
}
/**
* Get the device diagnostics log collection operation.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* operationId: String
* deviceList: [
* {
* deviceId: String
* moduleId: String
* }
* ]
* description: String
* createdDateTime: String
* lastActionDateTime: String
* status: String(Undefined/NotStarted/Running/Succeeded/Failed)
* }
* }</pre>
*
* @param operationId Operation identifier.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return the device diagnostics log collection operation along with {@link Response} on successful completion of
* {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> getLogCollectionOperationWithResponse(
String operationId, RequestOptions requestOptions) {
return this.serviceClient.getLogCollectionOperationWithResponseAsync(operationId, requestOptions);
}
/**
* Get all device diagnostics log collection operations.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* value: [
* {
* operationId: String
* deviceList: [
* {
* deviceId: String
* moduleId: String
* }
* ]
* description: String
* createdDateTime: String
* lastActionDateTime: String
* status: String(Undefined/NotStarted/Running/Succeeded/Failed)
* }
* ]
* nextLink: String
* }
* }</pre>
*
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return all device diagnostics log collection operations.
*/
@Generated
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux<BinaryData> listLogCollectionOperations(RequestOptions requestOptions) {
return this.serviceClient.listLogCollectionOperationsAsync(requestOptions);
}
/**
* Get device diagnostics log collection operation with detailed status.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* operationId: String
* createdDateTime: String
* lastActionDateTime: String
* status: String(Undefined/NotStarted/Running/Succeeded/Failed)
* deviceStatus: [
* {
* deviceId: String
* moduleId: String
* status: String(Undefined/NotStarted/Running/Succeeded/Failed)
* resultCode: String
* extendedResultCode: String
* logLocation: String
* }
* ]
* description: String
* }
* }</pre>
*
* @param operationId Operation identifier.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return device diagnostics log collection operation with detailed status along with {@link Response} on
* successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> getLogCollectionOperationDetailedStatusWithResponse(
String operationId, RequestOptions requestOptions) {
return this.serviceClient.getLogCollectionOperationDetailedStatusWithResponseAsync(operationId, requestOptions);
}
/**
* Stops a deployment.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>action</td><td>String</td><td>Yes</td><td>Cancel deployment action.</td></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* deploymentId: String
* startDateTime: String
* updateId: {
* provider: String
* name: String
* version: String
* }
* groupId: String
* isCanceled: Boolean
* isRetried: Boolean
* }
* }</pre>
*
* @param groupId Group identity.
* @param deploymentId Deployment identifier.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return deployment metadata along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> stopDeploymentWithResponse(
String groupId, String deploymentId, RequestOptions requestOptions) {
return this.serviceClient.stopDeploymentWithResponseAsync(groupId, deploymentId, requestOptions);
}
/**
* Retries a deployment with failed devices.
*
* <p><strong>Query Parameters</strong>
*
* <table border="1">
* <caption>Query Parameters</caption>
* <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
* <tr><td>action</td><td>String</td><td>Yes</td><td>Retry deployment action.</td></tr>
* <tr><td>apiVersion</td><td>String</td><td>Yes</td><td>Api Version</td></tr>
* </table>
*
* <p><strong>Response Body Schema</strong>
*
* <pre>{@code
* {
* deploymentId: String
* startDateTime: String
* updateId: {
* provider: String
* name: String
* version: String
* }
* groupId: String
* isCanceled: Boolean
* isRetried: Boolean
* }
* }</pre>
*
* @param groupId Group identity.
* @param deploymentId Deployment identifier.
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
* @throws HttpResponseException thrown if the request is rejected by server.
* @return deployment metadata along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> retryDeploymentWithResponse(
String groupId, String deploymentId, RequestOptions requestOptions) {
return this.serviceClient.retryDeploymentWithResponseAsync(groupId, deploymentId, requestOptions);
}
}