Obter o resultado da operação de longo prazo das regras de governança para o escopo solicitado por ruleId e operationId
GET https://management.azure.com/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}?api-version=2022-01-01-preview
Parâmetros de URI
Nome |
Em |
Obrigatório |
Tipo |
Description |
operationId
|
path |
True
|
string
|
A chave exclusiva da operação de execução prolongada da regra de governança
|
ruleId
|
path |
True
|
string
|
A chave de regra de governança - chave exclusiva para a regra de governança padrão (GUID)
|
scope
|
path |
True
|
string
|
O escopo das regras de governança. Escopos válidos são: grupo de gerenciamento (formato: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), assinatura (formato: 'subscriptions/{subscriptionId}') ou conector de segurança (formato: 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'
|
api-version
|
query |
True
|
string
|
Versão da API para a operação
|
Respostas
Nome |
Tipo |
Description |
200 OK
|
OperationResult
|
OK - A operação concluída
|
202 Accepted
|
|
Aceito – A operação ainda está em andamento
Cabeçalhos
location: string
|
Other Status Codes
|
CloudError
|
Resposta de erro descrevendo por que a operação falhou
|
Segurança
azure_auth
Fluxo OAuth2 do Azure Active Directory
Tipo:
oauth2
Flow:
implicit
URL de Autorização:
https://login.microsoftonline.com/common/oauth2/authorize
Escopos
Nome |
Description |
user_impersonation
|
representar sua conta de usuário
|
Exemplos
Get governance rules long run operation result over management group
Solicitação de exemplo
GET https://management.azure.com/providers/Microsoft.Management/managementGroups/contoso/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8/operationResults/58b33f4f-c8c7-4b01-99cc-d437db4d40dd?api-version=2022-01-01-preview
/**
* Samples for GovernanceRules OperationResults.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/
* GetManagementGroupGovernanceRuleExecuteStatus_example.json
*/
/**
* Sample code: Get governance rules long run operation result over management group.
*
* @param manager Entry point to SecurityManager.
*/
public static void getGovernanceRulesLongRunOperationResultOverManagementGroup(
com.azure.resourcemanager.security.SecurityManager manager) {
manager.governanceRules().operationResultsWithResponse(
"providers/Microsoft.Management/managementGroups/contoso", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8",
"58b33f4f-c8c7-4b01-99cc-d437db4d40dd", 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 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: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRuleExecuteStatus_example.json
func ExampleGovernanceRulesClient_OperationResults_getGovernanceRulesLongRunOperationResultOverManagementGroup() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsecurity.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewGovernanceRulesClient().OperationResults(ctx, "providers/Microsoft.Management/managementGroups/contoso", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", 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.OperationResultAutoGenerated = armsecurity.OperationResultAutoGenerated{
// Status: to.Ptr(armsecurity.OperationResultSucceeded),
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SecurityCenter } = require("@azure/arm-security");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get governance rules long run operation result for the requested scope by ruleId and operationId
*
* @summary Get governance rules long run operation result for the requested scope by ruleId and operationId
* x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRuleExecuteStatus_example.json
*/
async function getGovernanceRulesLongRunOperationResultOverManagementGroup() {
const scope = "providers/Microsoft.Management/managementGroups/contoso";
const ruleId = "ad9a8e26-29d9-4829-bb30-e597a58cdbb8";
const operationId = "58b33f4f-c8c7-4b01-99cc-d437db4d40dd";
const credential = new DefaultAzureCredential();
const client = new SecurityCenter(credential);
const result = await client.governanceRules.operationResults(scope, ruleId, operationId);
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
Resposta de exemplo
{
"status": "Succeeded"
}
Get governance rules long run operation result over security connector
Solicitação de exemplo
GET https://management.azure.com/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8/operationResults/58b33f4f-c8c7-4b01-99cc-d437db4d40dd?api-version=2022-01-01-preview
/**
* Samples for GovernanceRules OperationResults.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/
* GetSecurityConnectorGovernanceRuleExecuteStatus_example.json
*/
/**
* Sample code: Get governance rules long run operation result over security connector.
*
* @param manager Entry point to SecurityManager.
*/
public static void getGovernanceRulesLongRunOperationResultOverSecurityConnector(
com.azure.resourcemanager.security.SecurityManager manager) {
manager.governanceRules().operationResultsWithResponse(
"subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector",
"ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd",
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 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: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetSecurityConnectorGovernanceRuleExecuteStatus_example.json
func ExampleGovernanceRulesClient_OperationResults_getGovernanceRulesLongRunOperationResultOverSecurityConnector() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsecurity.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewGovernanceRulesClient().OperationResults(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", 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.OperationResultAutoGenerated = armsecurity.OperationResultAutoGenerated{
// Status: to.Ptr(armsecurity.OperationResultSucceeded),
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SecurityCenter } = require("@azure/arm-security");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get governance rules long run operation result for the requested scope by ruleId and operationId
*
* @summary Get governance rules long run operation result for the requested scope by ruleId and operationId
* x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetSecurityConnectorGovernanceRuleExecuteStatus_example.json
*/
async function getGovernanceRulesLongRunOperationResultOverSecurityConnector() {
const scope =
"subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector";
const ruleId = "ad9a8e26-29d9-4829-bb30-e597a58cdbb8";
const operationId = "58b33f4f-c8c7-4b01-99cc-d437db4d40dd";
const credential = new DefaultAzureCredential();
const client = new SecurityCenter(credential);
const result = await client.governanceRules.operationResults(scope, ruleId, operationId);
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 System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.SecurityCenter;
using Azure.ResourceManager.SecurityCenter.Models;
// Generated from example definition: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetSecurityConnectorGovernanceRuleExecuteStatus_example.json
// this example is just showing the usage of "SecurityConnectorGovernanceRulesExecuteStatus_Get" 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://learn.microsoft.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 SecurityConnectorGovernanceRuleResource created on azure
// for more information of creating SecurityConnectorGovernanceRuleResource, please refer to the document of SecurityConnectorGovernanceRuleResource
string subscriptionId = "20ff7fc3-e762-44dd-bd96-b71116dcdc23";
string resourceGroupName = "gcpResourceGroup";
string securityConnectorName = "gcpconnector";
string ruleId = "ad9a8e26-29d9-4829-bb30-e597a58cdbb8";
ResourceIdentifier securityConnectorGovernanceRuleResourceId = SecurityConnectorGovernanceRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, securityConnectorName, ruleId);
SecurityConnectorGovernanceRuleResource securityConnectorGovernanceRule = client.GetSecurityConnectorGovernanceRuleResource(securityConnectorGovernanceRuleResourceId);
// invoke the operation
string operationId = "58b33f4f-c8c7-4b01-99cc-d437db4d40dd";
ArmOperation<ExecuteRuleStatus> lro = await securityConnectorGovernanceRule.GetRuleExecutionStatusAsync(WaitUntil.Completed, operationId);
ExecuteRuleStatus result = lro.Value;
Console.WriteLine($"Succeeded: {result}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta de exemplo
{
"status": "Succeeded"
}
Get governance rules long run operation result over subscription
Solicitação de exemplo
GET https://management.azure.com/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8/operationResults/58b33f4f-c8c7-4b01-99cc-d437db4d40dd?api-version=2022-01-01-preview
/**
* Samples for GovernanceRules OperationResults.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/
* GetGovernanceRuleExecuteStatus_example.json
*/
/**
* Sample code: Get governance rules long run operation result over subscription.
*
* @param manager Entry point to SecurityManager.
*/
public static void getGovernanceRulesLongRunOperationResultOverSubscription(
com.azure.resourcemanager.security.SecurityManager manager) {
manager.governanceRules().operationResultsWithResponse("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23",
"ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd",
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 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: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetGovernanceRuleExecuteStatus_example.json
func ExampleGovernanceRulesClient_OperationResults_getGovernanceRulesLongRunOperationResultOverSubscription() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsecurity.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewGovernanceRulesClient().OperationResults(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", 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.OperationResultAutoGenerated = armsecurity.OperationResultAutoGenerated{
// Status: to.Ptr(armsecurity.OperationResultSucceeded),
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SecurityCenter } = require("@azure/arm-security");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Get governance rules long run operation result for the requested scope by ruleId and operationId
*
* @summary Get governance rules long run operation result for the requested scope by ruleId and operationId
* x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetGovernanceRuleExecuteStatus_example.json
*/
async function getGovernanceRulesLongRunOperationResultOverSubscription() {
const scope = "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23";
const ruleId = "ad9a8e26-29d9-4829-bb30-e597a58cdbb8";
const operationId = "58b33f4f-c8c7-4b01-99cc-d437db4d40dd";
const credential = new DefaultAzureCredential();
const client = new SecurityCenter(credential);
const result = await client.governanceRules.operationResults(scope, ruleId, operationId);
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 System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.SecurityCenter;
using Azure.ResourceManager.SecurityCenter.Models;
// Generated from example definition: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetGovernanceRuleExecuteStatus_example.json
// this example is just showing the usage of "SubscriptionGovernanceRulesExecuteStatus_Get" 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://learn.microsoft.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 SubscriptionGovernanceRuleResource created on azure
// for more information of creating SubscriptionGovernanceRuleResource, please refer to the document of SubscriptionGovernanceRuleResource
string subscriptionId = "20ff7fc3-e762-44dd-bd96-b71116dcdc23";
string ruleId = "ad9a8e26-29d9-4829-bb30-e597a58cdbb8";
ResourceIdentifier subscriptionGovernanceRuleResourceId = SubscriptionGovernanceRuleResource.CreateResourceIdentifier(subscriptionId, ruleId);
SubscriptionGovernanceRuleResource subscriptionGovernanceRule = client.GetSubscriptionGovernanceRuleResource(subscriptionGovernanceRuleResourceId);
// invoke the operation
string operationId = "58b33f4f-c8c7-4b01-99cc-d437db4d40dd";
ArmOperation<ExecuteRuleStatus> lro = await subscriptionGovernanceRule.GetRuleExecutionStatusAsync(WaitUntil.Completed, operationId);
ExecuteRuleStatus result = lro.Value;
Console.WriteLine($"Succeeded: {result}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta de exemplo
{
"status": "Succeeded"
}
Definições
Nome |
Description |
CloudError
|
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.).
|
CloudErrorBody
|
O detalhe do erro.
|
ErrorAdditionalInfo
|
As informações adicionais do erro de gerenciamento de recursos.
|
OperationResult
|
Status de operação de longo prazo da regra de governança em um determinado escopo
|
CloudError
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.).
Nome |
Tipo |
Description |
error.additionalInfo
|
ErrorAdditionalInfo[]
|
As informações adicionais do erro.
|
error.code
|
string
|
O código de erro.
|
error.details
|
CloudErrorBody[]
|
Os detalhes do erro.
|
error.message
|
string
|
A mensagem de erro.
|
error.target
|
string
|
O destino do erro.
|
CloudErrorBody
O detalhe do erro.
Nome |
Tipo |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
As informações adicionais do erro.
|
code
|
string
|
O código de erro.
|
details
|
CloudErrorBody[]
|
Os detalhes do erro.
|
message
|
string
|
A mensagem de erro.
|
target
|
string
|
O destino do erro.
|
ErrorAdditionalInfo
As informações adicionais do erro de gerenciamento de recursos.
Nome |
Tipo |
Description |
info
|
object
|
As informações adicionais.
|
type
|
string
|
O tipo de informação adicional.
|
OperationResult
Status de operação de longo prazo da regra de governança em um determinado escopo
Nome |
Tipo |
Description |
status
|
OperationResult
|
O status do resultado da operação de longo prazo da regra de governança
|