Elimina um atestado existente no âmbito do grupo de recursos.
DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/attestations/{attestationName}?api-version=2022-09-01
Parâmetros do URI
Name |
Em |
Necessário |
Tipo |
Description |
attestationName
|
path |
True
|
string
|
O nome do atestado.
|
resourceGroupName
|
path |
True
|
string
|
O nome do grupo de recursos. O nome não é sensível a maiúsculas e minúsculas.
|
subscriptionId
|
path |
True
|
string
|
O ID da subscrição de destino.
|
api-version
|
query |
True
|
string
|
A versão da API a utilizar para esta operação.
|
Respostas
Name |
Tipo |
Description |
200 OK
|
|
O atestado foi eliminado com êxito.
|
204 No Content
|
|
O atestado não existia.
|
Other Status Codes
|
ErrorResponse
|
Resposta de erro que descreve o motivo pela qual a operação falhou.
|
Segurança
azure_auth
Fluxo OAuth2 do Azure Active Directory
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
representar a sua conta de utilizador
|
Exemplos
Delete attestation at resource group scope
Sample Request
DELETE https://management.azure.com/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myRg/providers/Microsoft.PolicyInsights/attestations/790996e6-9871-4b1f-9cd9-ec42cd6ced1e?api-version=2022-09-01
import com.azure.core.util.Context;
/** Samples for Attestations Delete. */
public final class Main {
/*
* x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteResourceGroupScope.json
*/
/**
* Sample code: Delete attestation at resource group scope.
*
* @param manager Entry point to PolicyInsightsManager.
*/
public static void deleteAttestationAtResourceGroupScope(
com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager) {
manager
.attestations()
.deleteByResourceGroupWithResponse("myRg", "790996e6-9871-4b1f-9cd9-ec42cd6ced1e", 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.policyinsights import PolicyInsightsClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-policyinsights
# USAGE
python attestations_delete_resource_group_scope.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 = PolicyInsightsClient(
credential=DefaultAzureCredential(),
subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2",
)
response = client.attestations.delete_at_resource_group(
resource_group_name="myRg",
attestation_name="790996e6-9871-4b1f-9cd9-ec42cd6ced1e",
)
print(response)
# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteResourceGroupScope.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 armpolicyinsights_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/policyinsights/armpolicyinsights"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/05a9cdab363b8ec824094ee73950c04594325172/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteResourceGroupScope.json
func ExampleAttestationsClient_DeleteAtResourceGroup() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armpolicyinsights.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewAttestationsClient().DeleteAtResourceGroup(ctx, "myRg", "790996e6-9871-4b1f-9cd9-ec42cd6ced1e", 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 { PolicyInsightsClient } = require("@azure/arm-policyinsights");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Deletes an existing attestation at resource group scope.
*
* @summary Deletes an existing attestation at resource group scope.
* x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2022-09-01/examples/Attestations_DeleteResourceGroupScope.json
*/
async function deleteAttestationAtResourceGroupScope() {
const subscriptionId =
process.env["POLICYINSIGHTS_SUBSCRIPTION_ID"] || "35ee058e-5fa0-414c-8145-3ebb8d09b6e2";
const resourceGroupName = process.env["POLICYINSIGHTS_RESOURCE_GROUP"] || "myRg";
const attestationName = "790996e6-9871-4b1f-9cd9-ec42cd6ced1e";
const credential = new DefaultAzureCredential();
const client = new PolicyInsightsClient(credential, subscriptionId);
const result = await client.attestations.deleteAtResourceGroup(
resourceGroupName,
attestationName
);
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
Definições
ErrorDefinition
Definição de erro.
Name |
Tipo |
Description |
additionalInfo
|
TypedErrorInfo[]
|
Detalhes de erros específicos de cenários adicionais.
|
code
|
string
|
Código de erro específico do serviço que serve como subestado para o código de erro HTTP.
|
details
|
ErrorDefinition[]
|
Detalhes internos do erro.
|
message
|
string
|
Descrição do erro.
|
target
|
string
|
O destino do erro.
|
ErrorResponse
Resposta de erro.
TypedErrorInfo
Detalhes de erros específicos do cenário.
Name |
Tipo |
Description |
info
|
|
Os detalhes de erro específicos do cenário.
|
type
|
string
|
O tipo de detalhes de erro incluídos.
|