次の方法で共有


DeviceManagementClient.DeleteGroupAsync(String, RequestContext) メソッド

定義

デバイス グループを削除します。 このグループは、デバイス更新が有効なデバイスがハブに接続され、そのプロパティが報告されると自動的に作成されます。 グループ、サブグループ、デプロイは自動的にクリーンアップされませんが、履歴のために保持されます。 ユーザーはこのメソッドを呼び出して、グループの履歴を保持する必要がなく、不要になったグループを削除できます。 グループが削除された後にデバイスがこのグループに対して再度接続された場合、デバイスは自動的に再作成されますが、履歴はありません。

public virtual System.Threading.Tasks.Task<Azure.Response> DeleteGroupAsync(string groupId, Azure.RequestContext context = default);
abstract member DeleteGroupAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.DeleteGroupAsync : string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function DeleteGroupAsync (groupId As String, Optional context As RequestContext = Nothing) As Task(Of Response)

パラメーター

groupId
String

グループ識別子。

context
RequestContext

要求コンテキスト。これは、呼び出しごとにクライアント パイプラインの既定の動作をオーバーライドできます。

戻り値

サービスから返された応答。

例外

groupId が null です。

groupId は空の文字列であり、空でないと想定されていました。

サービスから成功以外の状態コードが返されました。

このサンプルでは、必要なパラメーターを使用して DeleteGroupAsync を呼び出す方法を示します。

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

Response response = await client.DeleteGroupAsync("<groupId>");
Console.WriteLine(response.Status);

注釈

Response Errorスキーマ:

{
              error: {
                code: string,
                message: string,
                target: string,
                details: [Error],
                innererror: {
                  code: string,
                  message: string,
                  errorDetail: string,
                  innerError: InnerError
                },
                occurredDateTime: string (ISO 8601 Format)
              }
            }

適用対象