名前空間: microsoft.graph
重要
Microsoft Graph の /beta バージョンの API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 v1.0 で API を使用できるかどうかを確認するには、Version セレクターを使用します。
longRunningOperation オブジェクトのプロパティとリレーションシップを読み取ります。 この API を使用すると、次の実行時間の長い Microsoft Graph API操作の詳細と状態を取得できます。
実行時間の長い操作の可能な状態は、notStarted、running、succeeded、failed、succeededとfailedがターミナル状態であるunknownFutureValueです。
この API は、次の国内クラウド展開で使用できます。
| グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
| ✅ |
✅ |
✅ |
✅ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
ロール管理アラートの場合
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
RoleManagementAlert.Read.Directory |
RoleManagementAlert.ReadWrite.Directory |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
RoleManagementAlert.Read.Directory |
RoleManagementAlert.ReadWrite.Directory |
重要
職場または学校アカウントを使用した委任されたシナリオでは、サインインしているユーザーに、サポートされているMicrosoft Entraロールまたはサポートされているロールのアクセス許可を持つカスタム ロールを割り当てる必要があります。 この操作では、次の最小特権ロールがサポートされています。
- 特権ロール管理者
- グローバル閲覧者
- セキュリティ管理者
- セキュリティ閲覧者
認証方法の場合 (パスワードリセット)
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
UserAuthenticationMethod.Read.All |
UserAuthenticationMethod.Read、UserAuthenticationMethod.ReadWrite、UserAuthenticationMethod.ReadWrite.All |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
サポートされていません。 |
サポートされていません。 |
重要
サインインしているユーザーが別のユーザーを操作している職場または学校アカウントで委任されたシナリオでは、サポートされているMicrosoft Entraロールまたはサポートされているロールのアクセス許可を持つカスタム ロールを割り当てる必要があります。 この操作では、次の最小特権ロールがサポートされています。
HTTP 要求
ロール管理アラート更新の実行時間の長い操作の詳細を取得するには:
GET /identityGovernance/roleManagementAlerts/operations/{longRunningOperationId}
認証方法のリセットの実行時間の長い操作の状態を取得するには:
GET /users/{id | userPrincipalName}/authentication/operations/{id}
オプションのクエリ パラメーター
このメソッドは、応答のカスタマイズに役立つ $select OData クエリ パラメーターをサポートします。 一般的な情報については、「OData クエリ パラメーター」を参照してください。
| 名前 |
説明 |
| Authorization |
ベアラー {token}。 必須です。
認証と認可についての詳細をご覧ください。 |
要求本文
このメソッドには、要求本文を指定しません。
応答
成功した場合、このメソッドは応答コード 200 OK と、応答本文に longRunningOperation オブジェクトを返します。
ロール管理アラートの場合、 resourceLocation には、操作の状態が succeeded場合はロール管理アラートの URL が含まれます。それ以外の場合は resourceLocation が空です。
例
例 1: 操作の状態がである場合のロール管理アラート更新の実行時間の長い操作の詳細を取得する running
要求
次の例は要求を示しています。
GET https://graph.microsoft.com/beta/identityGovernance/roleManagementAlerts/operations/refresh:DirectoryRole_19356be4-7e93-4ed6-a7c6-0ae28454d125_StaleSignInAlert
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.RoleManagementAlerts.Operations["{longRunningOperation-id}"].GetAsync();
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
operations, err := graphClient.IdentityGovernance().RoleManagementAlerts().Operations().ByLongRunningOperationId("longRunningOperation-id").Get(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
LongRunningOperation result = graphClient.identityGovernance().roleManagementAlerts().operations().byLongRunningOperationId("{longRunningOperation-id}").get();
const options = {
authProvider,
};
const client = Client.init(options);
let longRunningOperation = await client.api('/identityGovernance/roleManagementAlerts/operations/refresh:DirectoryRole_19356be4-7e93-4ed6-a7c6-0ae28454d125_StaleSignInAlert')
.version('beta')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->identityGovernance()->roleManagementAlerts()->operations()->byLongRunningOperationId('longRunningOperation-id')->get()->wait();
Import-Module Microsoft.Graph.Beta.Identity.Governance
Get-MgBetaIdentityGovernanceRoleManagementAlertOperation -LongRunningOperationId $longRunningOperationId
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.identity_governance.role_management_alerts.operations.by_long_running_operation_id('longRunningOperation-id').get()
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#identityGovernance/roleManagementAlerts/operations/$entity",
"id": "refresh:DirectoryRole_19356be4-7e93-4ed6-a7c6-0ae28454d125_StaleSignInAlert",
"createdDateTime": "2023-06-09T22:50:41.5414467Z",
"lastActionDateTime": "2023-06-09T22:52:09.0296021Z",
"resourceLocation": "",
"status": "running",
"statusDetail": ""
}
例 2: 操作の状態が次の場合にロール管理アラートの更新のために実行時間の長い操作の詳細を取得する succeeded
要求
次の例は要求を示しています。
GET https://graph.microsoft.com/beta/identityGovernance/roleManagementAlerts/operations/refresh:DirectoryRole_19356be4-7e93-4ed6-a7c6-0ae28454d125_StaleSignInAlert
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.IdentityGovernance.RoleManagementAlerts.Operations["{longRunningOperation-id}"].GetAsync();
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
operations, err := graphClient.IdentityGovernance().RoleManagementAlerts().Operations().ByLongRunningOperationId("longRunningOperation-id").Get(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
LongRunningOperation result = graphClient.identityGovernance().roleManagementAlerts().operations().byLongRunningOperationId("{longRunningOperation-id}").get();
const options = {
authProvider,
};
const client = Client.init(options);
let longRunningOperation = await client.api('/identityGovernance/roleManagementAlerts/operations/refresh:DirectoryRole_19356be4-7e93-4ed6-a7c6-0ae28454d125_StaleSignInAlert')
.version('beta')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->identityGovernance()->roleManagementAlerts()->operations()->byLongRunningOperationId('longRunningOperation-id')->get()->wait();
Import-Module Microsoft.Graph.Beta.Identity.Governance
Get-MgBetaIdentityGovernanceRoleManagementAlertOperation -LongRunningOperationId $longRunningOperationId
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.identity_governance.role_management_alerts.operations.by_long_running_operation_id('longRunningOperation-id').get()
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#identityGovernance/roleManagementAlerts/operations/$entity",
"id": "refresh:DirectoryRole_19356be4-7e93-4ed6-a7c6-0ae28454d125_StaleSignInAlert",
"createdDateTime": "2023-06-09T22:50:41.5414467Z",
"lastActionDateTime": "2023-06-09T22:56:09.0296021Z",
"resourceLocation": "https://graph.microsoft.com/beta/identityGovernance/roleManagementAlerts/alerts/DirectoryRole_19356be4-7e93-4ed6-a7c6-0ae28454d125_StaleSignInAlert",
"status": "succeeded",
"statusDetail": ""
}
例 3: パスワード認証方法のリセット操作の状態を取得します。
この要求で使用する操作の ID は、 passwword リセット操作から取得した応答から取得されます。
要求
次の例は要求を示しています。
GET https://graph.microsoft.com/beta/users/{id | userPrincipalName}/authentication/operations/{id}
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Users["{user-id}"].Authentication.Operations["{longRunningOperation-id}"].GetAsync();
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
operations, err := graphClient.Users().ByUserId("user-id").Authentication().Operations().ByLongRunningOperationId("longRunningOperation-id").Get(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
LongRunningOperation result = graphClient.users().byUserId("{user-id}").authentication().operations().byLongRunningOperationId("{longRunningOperation-id}").get();
const options = {
authProvider,
};
const client = Client.init(options);
let longRunningOperation = await client.api('/users/{id | userPrincipalName}/authentication/operations/{id}')
.version('beta')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->users()->byUserId('user-id')->authentication()->operations()->byLongRunningOperationId('longRunningOperation-id')->get()->wait();
Import-Module Microsoft.Graph.Beta.Identity.SignIns
Get-MgBetaUserAuthenticationOperation -UserId $userId -LongRunningOperationId $longRunningOperationId
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.users.by_user_id('user-id').authentication.operations.by_long_running_operation_id('longRunningOperation-id').get()
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-type: application/json
{
"status": "running",
"createdDateTime": "2020-03-19T12-01-03.45Z",
"lastActionDateTime": "2020-03-19T12-01-04.23Z",
"id": "2d497bb-57bd-47a6-8749-5ccd0869f2bd"
}
例 4: 業界データ サービスから実行時間の長い操作を取得する
次の例は、業界データ サービスの実行時間の長い操作を取得する方法を示しています。
要求
次の例は要求を示しています。
GET https://graph.microsoft.com/beta/external/industryData/operations/d194fa3e-18c9-47a1-0fb1-08dad8e7a876
// Code snippets are only available for the latest version. Current version is 5.x
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.External.IndustryData.Operations["{longRunningOperation-id}"].GetAsync();
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
//other-imports
)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
operations, err := graphClient.External().IndustryData().Operations().ByLongRunningOperationId("longRunningOperation-id").Get(context.Background(), nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
LongRunningOperation result = graphClient.external().industryData().operations().byLongRunningOperationId("{longRunningOperation-id}").get();
const options = {
authProvider,
};
const client = Client.init(options);
let longRunningOperation = await client.api('/external/industryData/operations/d194fa3e-18c9-47a1-0fb1-08dad8e7a876')
.version('beta')
.get();
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$result = $graphServiceClient->external()->industryData()->operations()->byLongRunningOperationId('longRunningOperation-id')->get()->wait();
Import-Module Microsoft.Graph.Beta.Search
Get-MgBetaExternalIndustryDataOperation -LongRunningOperationId $longRunningOperationId
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
result = await graph_client.external.industry_data.operations.by_long_running_operation_id('longRunningOperation-id').get()
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.longRunningOperation",
"createdDateTime": "2022-12-14T05:54:35.400029Z",
"id": "d194fa3e-18c9-47a1-0fb1-08dad8e7a876",
"lastActionDateTime": "2022-12-14T05:54:43.8410226Z",
"resourceLocation": "https://graph.microsoft.com/beta/industryData/dataConnectors/022da4a0-c239-4b07-abed-08dad8e7a07a",
"status": "succeeded",
"statusDetail": null
}