Hämta resultat för styrningsregler för långsiktig åtgärd för det begärda omfånget av ruleId och operationId
GET https://management.azure.com/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}?api-version=2022-01-01-preview
URI-parametrar
Name |
I |
Obligatorisk |
Typ |
Description |
operationId
|
path |
True
|
string
|
Den långvariga åtgärdens unika nyckel för styrningsregeln
|
ruleId
|
path |
True
|
string
|
Styrningsregelnyckeln – unik nyckel för standardstyrningsregeln (GUID)
|
scope
|
path |
True
|
string
|
Omfånget för styrningsreglerna. Giltiga omfång är: hanteringsgrupp (format: "providers/Microsoft.Management/managementGroups/{managementGroup}", prenumeration (format: "subscriptions/{subscriptionId}") eller säkerhetsanslutningsprogram (format: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})"
|
api-version
|
query |
True
|
string
|
API-version för åtgärden
|
Svar
Name |
Typ |
Description |
200 OK
|
OperationResult
|
OK – Åtgärden har slutförts
|
202 Accepted
|
|
Godkänd – åtgärden pågår fortfarande
Sidhuvuden
location: string
|
Other Status Codes
|
CloudError
|
Felsvar som beskriver varför åtgärden misslyckades
|
Säkerhet
azure_auth
Azure Active Directory OAuth2 Flow
Typ:
oauth2
Flow:
implicit
Auktoriseringswebbadress:
https://login.microsoftonline.com/common/oauth2/authorize
Omfattningar
Name |
Description |
user_impersonation
|
personifiera ditt användarkonto
|
Exempel
Get governance rules long run operation result over management group
Exempelbegäran
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
Exempelsvar
{
"status": "Succeeded"
}
Get governance rules long run operation result over security connector
Exempelbegäran
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
Exempelsvar
{
"status": "Succeeded"
}
Get governance rules long run operation result over subscription
Exempelbegäran
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
Exempelsvar
{
"status": "Succeeded"
}
Definitioner
Name |
Description |
CloudError
|
Vanligt felsvar för alla Azure Resource Manager-API:er för att returnera felinformation för misslyckade åtgärder. (Detta följer även formatet för OData-felsvar.).
|
CloudErrorBody
|
Felinformationen.
|
ErrorAdditionalInfo
|
Ytterligare information om resurshanteringsfelet.
|
OperationResult
|
Status för långkörningsåtgärd för styrningsregeln över ett visst omfång
|
CloudError
Vanligt felsvar för alla Azure Resource Manager-API:er för att returnera felinformation för misslyckade åtgärder. (Detta följer även formatet för OData-felsvar.).
Name |
Typ |
Description |
error.additionalInfo
|
ErrorAdditionalInfo[]
|
Ytterligare information om felet.
|
error.code
|
string
|
Felkoden.
|
error.details
|
CloudErrorBody[]
|
Felinformationen.
|
error.message
|
string
|
Felmeddelandet.
|
error.target
|
string
|
Felmålet.
|
CloudErrorBody
Felinformationen.
Name |
Typ |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
Ytterligare information om felet.
|
code
|
string
|
Felkoden.
|
details
|
CloudErrorBody[]
|
Felinformationen.
|
message
|
string
|
Felmeddelandet.
|
target
|
string
|
Felmålet.
|
ErrorAdditionalInfo
Ytterligare information om resurshanteringsfelet.
Name |
Typ |
Description |
info
|
object
|
Ytterligare information.
|
type
|
string
|
Ytterligare informationstyp.
|
OperationResult
Status för långkörningsåtgärd för styrningsregeln över ett visst omfång
Name |
Typ |
Description |
status
|
OperationResult
|
Status för den långsiktiga åtgärdens resultat av styrningsregeln
|