appLogCollectionRequest を作成する
[アーティクル]
02/01/2024
6 人の共同作成者
フィードバック
この記事の内容
名前空間: microsoft.graph
注: Intune 用 Microsoft Graph API には、テナントの有効な Intune ライセンス が必要です。
新しい appLogCollectionRequest オブジェクトを 作成します。
この API は、次の国内クラウド展開 で使用できます。
グローバル サービス
米国政府機関 L4
米国政府機関 L5 (DOD)
21Vianet が運営する中国
✅
✅
✅
✅
アクセス許可
この API を呼び出すには、次のいずれかのアクセス許可が必要です。 アクセス許可の選択方法などの詳細については、「アクセス許可 」を参照してください。
アクセス許可の種類
アクセス許可 (特権の小さいものから大きいものへ)
委任 (職場または学校のアカウント)
DeviceManagementManagedDevices.ReadWrite.All
委任 (個人用 Microsoft アカウント)
サポートされていません。
アプリケーション
DeviceManagementManagedDevices.ReadWrite.All
HTTP 要求
POST /deviceManagement/mobileAppTroubleshootingEvents/{mobileAppTroubleshootingEventId}/appLogCollectionRequests
ヘッダー
値
Authorization
ベアラー {token}。 必須です。 認証と承認 の詳細については、こちらをご覧ください。
承諾
application/json
要求本文
要求本文で、appLogCollectionRequest オブジェクトの JSON 表現を指定します。
次の表は、appLogCollectionRequest を作成するときに必要なプロパティを示しています。
プロパティ
型
説明
id
String
一意の識別子。 これはuserId_DeviceId_AppId ID です。
status
appLogUploadState
アプリ ログ 収集要求が保留中、完了、または失敗した場合の状態を示します。既定値は保留中です。 使用可能な値: pending
、completed
、failed
、unknownFutureValue
。
errorMessage
String
アップロード プロセス中にエラー メッセージが存在する場合に示します。
customLogFolders
String collection
ログ フォルダーの一覧。
CompletedDateTime
DateTimeOffset
まだ完了していない場合にアップロード ログ要求が完了状態に達した時刻 NULL が返されます。
応答
成功した場合、このメソッドは 201 Created
応答コードと、応答本文で appLogCollectionRequest オブジェクトを返します。
例
要求
以下は、要求の例です。
POST https://graph.microsoft.com/v1.0/deviceManagement/mobileAppTroubleshootingEvents/{mobileAppTroubleshootingEventId}/appLogCollectionRequests
Content-type: application/json
Content-length: 257
{
"@odata.type": "#microsoft.graph.appLogCollectionRequest",
"status": "completed",
"errorMessage": "Error Message value",
"customLogFolders": [
"Custom Log Folders value"
],
"completedDateTime": "2016-12-31T23:58:52.3534526-08:00"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new AppLogCollectionRequest
{
OdataType = "#microsoft.graph.appLogCollectionRequest",
Status = AppLogUploadState.Completed,
ErrorMessage = "Error Message value",
CustomLogFolders = new List<string>
{
"Custom Log Folders value",
},
CompletedDateTime = DateTimeOffset.Parse("2016-12-31T23:58:52.3534526-08:00"),
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.DeviceManagement.MobileAppTroubleshootingEvents["{mobileAppTroubleshootingEvent-id}"].AppLogCollectionRequests.PostAsync(requestBody);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc device-management mobile-app-troubleshooting-events app-log-collection-requests create --mobile-app-troubleshooting-event-id {mobileAppTroubleshootingEvent-id} --body '{\
"@odata.type": "#microsoft.graph.appLogCollectionRequest",\
"status": "completed",\
"errorMessage": "Error Message value",\
"customLogFolders": [\
"Custom Log Folders value"\
],\
"completedDateTime": "2016-12-31T23:58:52.3534526-08:00"\
}\
'
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
import (
"context"
"time"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewAppLogCollectionRequest()
status := graphmodels.COMPLETED_APPLOGUPLOADSTATE
requestBody.SetStatus(&status)
errorMessage := "Error Message value"
requestBody.SetErrorMessage(&errorMessage)
customLogFolders := []string {
"Custom Log Folders value",
}
requestBody.SetCustomLogFolders(customLogFolders)
completedDateTime , err := time.Parse(time.RFC3339, "2016-12-31T23:58:52.3534526-08:00")
requestBody.SetCompletedDateTime(&completedDateTime)
appLogCollectionRequests, err := graphClient.DeviceManagement().MobileAppTroubleshootingEvents().ByMobileAppTroubleshootingEventId("mobileAppTroubleshootingEvent-id").AppLogCollectionRequests().Post(context.Background(), requestBody, nil)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
AppLogCollectionRequest appLogCollectionRequest = new AppLogCollectionRequest();
appLogCollectionRequest.setOdataType("#microsoft.graph.appLogCollectionRequest");
appLogCollectionRequest.setStatus(AppLogUploadState.Completed);
appLogCollectionRequest.setErrorMessage("Error Message value");
LinkedList<String> customLogFolders = new LinkedList<String>();
customLogFolders.add("Custom Log Folders value");
appLogCollectionRequest.setCustomLogFolders(customLogFolders);
OffsetDateTime completedDateTime = OffsetDateTime.parse("2016-12-31T23:58:52.3534526-08:00");
appLogCollectionRequest.setCompletedDateTime(completedDateTime);
AppLogCollectionRequest result = graphClient.deviceManagement().mobileAppTroubleshootingEvents().byMobileAppTroubleshootingEventId("{mobileAppTroubleshootingEvent-id}").appLogCollectionRequests().post(appLogCollectionRequest);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const appLogCollectionRequest = {
'@odata.type': '#microsoft.graph.appLogCollectionRequest',
status: 'completed',
errorMessage: 'Error Message value',
customLogFolders: [
'Custom Log Folders value'
],
completedDateTime: '2016-12-31T23:58:52.3534526-08:00'
};
await client.api('/deviceManagement/mobileAppTroubleshootingEvents/{mobileAppTroubleshootingEventId}/appLogCollectionRequests')
.post(appLogCollectionRequest);
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\AppLogCollectionRequest;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AppLogCollectionRequest();
$requestBody->setOdataType('#microsoft.graph.appLogCollectionRequest');
$requestBody->setStatus(new AppLogUploadState('completed'));
$requestBody->setErrorMessage('Error Message value');
$requestBody->setCustomLogFolders(['Custom Log Folders value', ]);
$requestBody->setCompletedDateTime(new \DateTime('2016-12-31T23:58:52.3534526-08:00'));
$result = $graphServiceClient->deviceManagement()->mobileAppTroubleshootingEvents()->byMobileAppTroubleshootingEventId('mobileAppTroubleshootingEvent-id')->appLogCollectionRequests()->post($requestBody)->wait();
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
Import-Module Microsoft.Graph.DeviceManagement
$params = @{
"@odata.type" = "#microsoft.graph.appLogCollectionRequest"
status = "completed"
errorMessage = "Error Message value"
customLogFolders = @(
"Custom Log Folders value"
)
completedDateTime = [System.DateTime]::Parse("2016-12-31T23:58:52.3534526-08:00")
}
New-MgDeviceManagementMobileAppTroubleshootingEventAppLogCollectionRequest -MobileAppTroubleshootingEventId $mobileAppTroubleshootingEventId -BodyParameter $params
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
from msgraph import GraphServiceClient
from msgraph.generated.models.app_log_collection_request import AppLogCollectionRequest
graph_client = GraphServiceClient(credentials, scopes)
request_body = AppLogCollectionRequest(
odata_type = "#microsoft.graph.appLogCollectionRequest",
status = AppLogUploadState.Completed,
error_message = "Error Message value",
custom_log_folders = [
"Custom Log Folders value",
],
completed_date_time = "2016-12-31T23:58:52.3534526-08:00",
)
result = await graph_client.device_management.mobile_app_troubleshooting_events.by_mobile_app_troubleshooting_event_id('mobileAppTroubleshootingEvent-id').app_log_collection_requests.post(request_body)
プロジェクトに SDK を追加 し、authProvider インスタンスを作成 する方法の詳細については、SDK のドキュメント を参照してください。
応答
以下は、応答の例です。 注: 簡潔にするために、ここに示す応答オブジェクトは切り詰められている場合があります。 実際の呼び出しではすべてのプロパティが返されます。
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 306
{
"@odata.type": "#microsoft.graph.appLogCollectionRequest",
"id": "cca685ff-85ff-cca6-ff85-a6ccff85a6cc",
"status": "completed",
"errorMessage": "Error Message value",
"customLogFolders": [
"Custom Log Folders value"
],
"completedDateTime": "2016-12-31T23:58:52.3534526-08:00"
}