刪除 IoT Central 應用程式。
DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/iotApps/{resourceName}?api-version=2021-06-01
URI 參數
名稱 |
位於 |
必要 |
類型 |
Description |
resourceGroupName
|
path |
True
|
string
|
包含IoT Central應用程式的資源群組名稱。
|
resourceName
|
path |
True
|
string
|
IoT Central 應用程式的 ARM 資源名稱。
|
subscriptionId
|
path |
True
|
string
|
訂用帳戶識別碼。
|
api-version
|
query |
True
|
string
|
API 的版本。
|
回應
名稱 |
類型 |
Description |
200 OK
|
|
這會以回應刪除作業的狀態輪詢要求傳回。 本文包含表示過渡布建狀態的資源表示法。
|
202 Accepted
|
|
已接受 - 已刪除已接受的要求;作業會以異步方式完成。
|
204 No Content
|
|
一旦長時間執行的刪除作業順利完成,當狀態輪詢要求在服務中尋找IoT Central應用程式元數據,且刪除作業的狀態設定為已完成狀態時,就會傳回 204 沒有內容狀態代碼。
|
Other Status Codes
|
CloudError
|
DefaultErrorResponse
|
安全性
azure_auth
Azure Active Directory OAuth2 Flow
類型:
oauth2
Flow:
implicit
授權 URL:
https://login.microsoftonline.com/common/oauth2/authorize
範圍
名稱 |
Description |
user_impersonation
|
模擬您的用戶帳戶
|
範例
Apps_Delete
範例要求
DELETE https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.IoTCentral/iotApps/myIoTCentralApp?api-version=2021-06-01
import com.azure.core.util.Context;
/** Samples for Apps Delete. */
public final class Main {
/*
* x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_Delete.json
*/
/**
* Sample code: Apps_Delete.
*
* @param manager Entry point to IotCentralManager.
*/
public static void appsDelete(com.azure.resourcemanager.iotcentral.IotCentralManager manager) {
manager.apps().delete("resRg", "myIoTCentralApp", Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.iotcentral import IotCentralClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-iotcentral
# USAGE
python apps_delete.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = IotCentralClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.apps.begin_delete(
resource_group_name="resRg",
resource_name="myIoTCentralApp",
).result()
print(response)
# x-ms-original-file: specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_Delete.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armiotcentral_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotcentral/armiotcentral"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_Delete.json
func ExampleAppsClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armiotcentral.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAppsClient().BeginDelete(ctx, "resRg", "myIoTCentralApp", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
範例回覆
message: Created
code: 200
{
"error": {
"code": "Error code",
"message": "Error message",
"target": "Error target"
}
}
定義
CloudError
錯誤詳細數據。
名稱 |
類型 |
Description |
error.code
|
string
|
錯誤碼。
|
error.details
|
CloudErrorBody[]
|
錯誤的其他詳細數據清單。
|
error.message
|
string
|
錯誤訊息。
|
error.target
|
string
|
特定錯誤的目標。
|
CloudErrorBody
錯誤回應的詳細數據。
名稱 |
類型 |
Description |
code
|
string
|
錯誤碼。
|
details
|
CloudErrorBody[]
|
錯誤的其他詳細數據清單。
|
message
|
string
|
錯誤訊息。
|
target
|
string
|
特定錯誤的目標。
|