Klasik ölçüm uyarı kuralını siler
DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}?api-version=2016-03-01
URI Parametreleri
Name |
İçinde |
Gerekli |
Tür |
Description |
resourceGroupName
|
path |
True
|
string
|
Kaynak grubunun adı. Ad büyük/küçük harfe duyarlı değildir.
|
ruleName
|
path |
True
|
string
|
Kuralın adı.
|
subscriptionId
|
path |
True
|
string
|
Hedef aboneliğin kimliği.
|
api-version
|
query |
True
|
string
|
Bu işlem için kullanılacak API sürümü.
|
Yanıtlar
Name |
Tür |
Description |
200 OK
|
|
Uyarı kuralını silme isteği başarılı
|
204 No Content
|
|
İçerik yok: İstek başarılı oldu, ancak yanıt boş
|
Other Status Codes
|
ErrorResponse
|
İşlemin neden başarısız olduğunu açıklayan hata yanıtı.
|
Güvenlik
azure_auth
Azure Active Directory OAuth2 Flow
Tür:
oauth2
Akış:
implicit
Yetkilendirme URL’si:
https://login.microsoftonline.com/common/oauth2/authorize
Kapsamlar
Name |
Description |
user_impersonation
|
kullanıcı hesabınızın kimliğine bürünme
|
Örnekler
Delete an alert rule
Örnek isteği
DELETE https://management.azure.com/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourcegroups/Rac46PostSwapRG/providers/Microsoft.Insights/alertrules/chiricutin?api-version=2016-03-01
/**
* Samples for AlertRules Delete.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteAlertRule.json
*/
/**
* Sample code: Delete an alert rule.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void deleteAnAlertRule(com.azure.resourcemanager.AzureResourceManager azure) {
azure.diagnosticSettings().manager().serviceClient().getAlertRules().deleteWithResponse("Rac46PostSwapRG",
"chiricutin", com.azure.core.util.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
package armmonitor_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/monitor/armmonitor"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteAlertRule.json
func ExampleAlertRulesClient_Delete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armmonitor.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewAlertRulesClient().Delete(ctx, "Rac46PostSwapRG", "chiricutin", nil)
if err != nil {
log.Fatalf("failed to finish the request: %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
const { MonitorClient } = require("@azure/arm-monitor");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Deletes a classic metric alert rule
*
* @summary Deletes a classic metric alert rule
* x-ms-original-file: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteAlertRule.json
*/
async function deleteAnAlertRule() {
const subscriptionId =
process.env["MONITOR_SUBSCRIPTION_ID"] || "b67f7fec-69fc-4974-9099-a26bd6ffeda3";
const resourceGroupName = process.env["MONITOR_RESOURCE_GROUP"] || "Rac46PostSwapRG";
const ruleName = "chiricutin";
const credential = new DefaultAzureCredential();
const client = new MonitorClient(credential, subscriptionId);
const result = await client.alertRules.delete(resourceGroupName, ruleName);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using System.Xml;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Monitor.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.Monitor;
// Generated from example definition: specification/monitor/resource-manager/Microsoft.Insights/stable/2016-03-01/examples/deleteAlertRule.json
// this example is just showing the usage of "AlertRules_Delete" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://video2.skills-academy.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this AlertRuleResource created on azure
// for more information of creating AlertRuleResource, please refer to the document of AlertRuleResource
string subscriptionId = "b67f7fec-69fc-4974-9099-a26bd6ffeda3";
string resourceGroupName = "Rac46PostSwapRG";
string ruleName = "chiricutin";
ResourceIdentifier alertRuleResourceId = AlertRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, ruleName);
AlertRuleResource alertRule = client.GetAlertRuleResource(alertRuleResourceId);
// invoke the operation
await alertRule.DeleteAsync(WaitUntil.Completed);
Console.WriteLine($"Succeeded");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Tanımlar
ErrorResponse
Hata yanıtının biçimini açıklar.
Name |
Tür |
Description |
code
|
string
|
Hata kodu
|
message
|
string
|
İşlemin neden başarısız olduğunu belirten hata iletisi.
|