ruleId と operationId を使用して、要求されたスコープのガバナンス ルールの実行時間の長い操作結果を取得する
GET https://management.azure.com/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}?api-version=2022-01-01-preview
URI パラメーター
名前 |
/ |
必須 |
型 |
説明 |
operationId
|
path |
True
|
string
|
ガバナンス ルールの実行時間の長い操作の一意キー
|
ruleId
|
path |
True
|
string
|
ガバナンス ルール キー - 標準ガバナンス 規則 (GUID) の一意のキー
|
scope
|
path |
True
|
string
|
ガバナンス ルールのスコープ。 有効なスコープは、管理グループ (形式: 'providers/Microsoft.Management/managementGroups/{managementGroup}')、サブスクリプション (形式: 'subscriptions/{subscriptionId}'))、またはセキュリティ コネクタ (形式: 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' です。
|
api-version
|
query |
True
|
string
|
操作の API バージョン
|
応答
名前 |
型 |
説明 |
200 OK
|
OperationResult
|
OK - 操作が完了しました
|
202 Accepted
|
|
受け入れ済み - 操作はまだ進行中です
ヘッダー
location: string
|
Other Status Codes
|
CloudError
|
操作が失敗した理由を説明するエラー応答
|
セキュリティ
azure_auth
Azure Active Directory OAuth2 フロー
型:
oauth2
フロー:
implicit
Authorization URL (承認 URL):
https://login.microsoftonline.com/common/oauth2/authorize
スコープ
名前 |
説明 |
user_impersonation
|
ユーザー アカウントを偽装する
|
例
Get governance rules long run operation result over management group
要求のサンプル
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
応答のサンプル
{
"status": "Succeeded"
}
Get governance rules long run operation result over security connector
要求のサンプル
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
応答のサンプル
{
"status": "Succeeded"
}
Get governance rules long run operation result over subscription
要求のサンプル
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
応答のサンプル
{
"status": "Succeeded"
}
定義
CloudError
失敗した操作のエラーの詳細を返す、すべての Azure Resource Manager API の一般的なエラー応答。 (これは、OData エラー応答形式にも従います)。
名前 |
型 |
説明 |
error.additionalInfo
|
ErrorAdditionalInfo[]
|
エラーの追加情報。
|
error.code
|
string
|
エラー コード。
|
error.details
|
CloudErrorBody[]
|
エラーの詳細。
|
error.message
|
string
|
エラー メッセージ。
|
error.target
|
string
|
エラーターゲット。
|
CloudErrorBody
エラーの詳細。
ErrorAdditionalInfo
リソース管理エラーの追加情報。
名前 |
型 |
説明 |
info
|
object
|
追加情報。
|
type
|
string
|
追加情報の種類。
|
OperationResult
特定のスコープに対するガバナンス ルールの実行時間の長い操作状態