Exclui uma configuração de preços fornecida do Microsoft Defender para Nuvem em um recurso específico. Válido apenas para o escopo do recurso (os recursos com suporte são: 'VirtualMachines, VMSS, ARC Machines e Containers').
package armsecurity_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity"
)
// Generated from example definition: 2024-01-01/Pricings/DeleteResourcePricing_example.json
func ExamplePricingsClient_Delete_deleteAPricingOnResource() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsecurity.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPricingsClient().Delete(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1", "VirtualMachines", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armsecurity.PricingsClientDeleteResponse{
// }
}
const { SecurityCenter } = require("@azure/arm-security");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to deletes a provided Microsoft Defender for Cloud pricing configuration in a specific resource. Valid only for resource scope (Supported resources are: 'VirtualMachines, VMSS, ARC Machines, and Containers').
*
* @summary deletes a provided Microsoft Defender for Cloud pricing configuration in a specific resource. Valid only for resource scope (Supported resources are: 'VirtualMachines, VMSS, ARC Machines, and Containers').
* x-ms-original-file: 2024-01-01/Pricings/DeleteResourcePricing_example.json
*/
async function deleteAPricingOnResource() {
const credential = new DefaultAzureCredential();
const client = new SecurityCenter(credential);
await client.pricings.delete(
"subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1",
"VirtualMachines",
);
}
package armsecurity_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity"
)
// Generated from example definition: 2024-01-01/Pricings/DeleteResourcePricingByNameContainers_example.json
func ExamplePricingsClient_Delete_deleteAPricingOnResourceExampleForContainersPlan() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsecurity.NewClientFactory("<subscriptionID>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPricingsClient().Delete(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/demo-containers-rg/providers/Microsoft.ContainerService/managedClusters/demo-aks-cluster", "Containers", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res = armsecurity.PricingsClientDeleteResponse{
// }
}
const { SecurityCenter } = require("@azure/arm-security");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to deletes a provided Microsoft Defender for Cloud pricing configuration in a specific resource. Valid only for resource scope (Supported resources are: 'VirtualMachines, VMSS, ARC Machines, and Containers').
*
* @summary deletes a provided Microsoft Defender for Cloud pricing configuration in a specific resource. Valid only for resource scope (Supported resources are: 'VirtualMachines, VMSS, ARC Machines, and Containers').
* x-ms-original-file: 2024-01-01/Pricings/DeleteResourcePricingByNameContainers_example.json
*/
async function deleteAPricingOnResourceExampleForContainersPlan() {
const credential = new DefaultAzureCredential();
const client = new SecurityCenter(credential);
await client.pricings.delete(
"subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/demo-containers-rg/providers/Microsoft.ContainerService/managedClusters/demo-aks-cluster",
"Containers",
);
}
Resposta de erro comum para todas as APIs do Azure Resource Manager retornarem detalhes de erro para operações com falha. (Isso também segue o formato de resposta de erro OData.).
As informações adicionais do erro de gerenciamento de recursos.
Common.CloudError
Objeto
Resposta de erro comum para todas as APIs do Azure Resource Manager retornarem detalhes de erro para operações com falha. (Isso também segue o formato de resposta de erro OData.).