名前空間: microsoft.graph.security
retentionLabel オブジェクトのプロパティを更新します。
廃棄レビュー ステージを更新するには、要求本文に actionAfterRetentionPeriod プロパティを含め、指定できる値の 1 つを指定します。
この API は、次の国内クラウド展開で使用できます。
グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
✅ |
✅ |
✅ |
❌ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
委任 (職場または学校のアカウント) |
RecordsManagement.ReadWrite.All |
注意事項なし。 |
委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
アプリケーション |
サポートされていません。 |
サポートされていません。 |
HTTP 要求
PATCH /security/labels/retentionLabels/{retentionLabelId}
名前 |
説明 |
Authorization |
ベアラー {token}。 必須です。
認証と認可についての詳細をご覧ください。 |
Content-Type |
application/json. 必須です。 |
要求本文
要求本文で、更新するプロパティの値 のみを 指定します。 要求本文に含まれていない既存のプロパティは、以前の値を維持するか、他のプロパティ値の変更に基づいて再計算されます。
次の表に、更新できるプロパティを示します。
プロパティ |
型 |
説明 |
descriptionForAdmins |
文字列 |
これは、管理者のラベル情報を提供する省略可能なプロパティです。 |
descriptionForUsers |
文字列 |
これは、ユーザーのラベル情報を提供する省略可能なプロパティです。 |
dispositionReviewStages |
microsoft.graph.security.dispositionReviewStage コレクション |
校閲者に通知される段階を確認して、ドキュメントを削除または保持する必要があるかどうかを判断します。 |
retentionDuration |
microsoft.graph.security.retentionDuration |
コンテンツを保持する日数を指定します。 |
defaultRecordBehavior |
microsoft.graph.security.defaultRecordBehavior |
レコード ラベルの作成時にロックまたはロック解除された状態を指定します。 使用可能な値: startLocked 、startUnlocked 、unknownFutureValue 。 |
labelToBeApplied |
文字列 |
現在のラベルの保持期間が終了した後に自動的に適用される置換ラベルを指定します。 |
応答
成功した場合、このメソッドは 204 No Content
応答コードを返します。
例
要求
要求の例を次に示します。
PATCH https://graph.microsoft.com/beta/security/labels/retentionLabels/9563a605-e827-4324-a5a9-09efddff1e50
Content-Type: application/json
Content-length: 555
{
"@odata.type": "#microsoft.graph.security.retentionLabel",
"retentionDuration": {
"@odata.type": "microsoft.graph.security.retentionDurationInDays",
"days": 2555
},
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models.Security;
var requestBody = new RetentionLabel
{
OdataType = "#microsoft.graph.security.retentionLabel",
RetentionDuration = new RetentionDurationInDays
{
OdataType = "microsoft.graph.security.retentionDurationInDays",
Days = 2555,
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Security.Labels.RetentionLabels["{retentionLabel-id}"].PatchAsync(requestBody);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// 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"
graphmodelssecurity "github.com/microsoftgraph/msgraph-beta-sdk-go/models/security"
//other-imports
)
requestBody := graphmodelssecurity.NewRetentionLabel()
retentionDuration := graphmodelssecurity.NewRetentionDurationInDays()
days := int32(2555)
retentionDuration.SetDays(&days)
requestBody.SetRetentionDuration(retentionDuration)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
retentionLabels, err := graphClient.Security().Labels().RetentionLabels().ByRetentionLabelId("retentionLabel-id").Patch(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);
com.microsoft.graph.beta.models.security.RetentionLabel retentionLabel = new com.microsoft.graph.beta.models.security.RetentionLabel();
retentionLabel.setOdataType("#microsoft.graph.security.retentionLabel");
com.microsoft.graph.beta.models.security.RetentionDurationInDays retentionDuration = new com.microsoft.graph.beta.models.security.RetentionDurationInDays();
retentionDuration.setOdataType("microsoft.graph.security.retentionDurationInDays");
retentionDuration.setDays(2555);
retentionLabel.setRetentionDuration(retentionDuration);
com.microsoft.graph.models.security.RetentionLabel result = graphClient.security().labels().retentionLabels().byRetentionLabelId("{retentionLabel-id}").patch(retentionLabel);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
const options = {
authProvider,
};
const client = Client.init(options);
const retentionLabel = {
'@odata.type': '#microsoft.graph.security.retentionLabel',
retentionDuration: {
'@odata.type': 'microsoft.graph.security.retentionDurationInDays',
days: 2555
},
};
await client.api('/security/labels/retentionLabels/9563a605-e827-4324-a5a9-09efddff1e50')
.version('beta')
.update(retentionLabel);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Models\Security\RetentionLabel;
use Microsoft\Graph\Beta\Generated\Models\Security\RetentionDurationInDays;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new RetentionLabel();
$requestBody->setOdataType('#microsoft.graph.security.retentionLabel');
$retentionDuration = new RetentionDurationInDays();
$retentionDuration->setOdataType('microsoft.graph.security.retentionDurationInDays');
$retentionDuration->setDays(2555);
$requestBody->setRetentionDuration($retentionDuration);
$result = $graphServiceClient->security()->labels()->retentionLabels()->byRetentionLabelId('retentionLabel-id')->patch($requestBody)->wait();
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
Import-Module Microsoft.Graph.Beta.Security
$params = @{
"@odata.type" = "#microsoft.graph.security.retentionLabel"
retentionDuration = @{
"@odata.type" = "microsoft.graph.security.retentionDurationInDays"
days =
}
}
Update-MgBetaSecurityLabelRetentionLabel -RetentionLabelId $retentionLabelId -BodyParameter $params
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.security.retention_label import RetentionLabel
from msgraph_beta.generated.models.security.retention_duration_in_days import RetentionDurationInDays
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = RetentionLabel(
odata_type = "#microsoft.graph.security.retentionLabel",
retention_duration = RetentionDurationInDays(
odata_type = "microsoft.graph.security.retentionDurationInDays",
days = 2555,
),
)
result = await graph_client.security.labels.retention_labels.by_retention_label_id('retentionLabel-id').patch(request_body)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
応答
応答の例を下に示します。
HTTP/1.1 204 No Content