创建 siteSource
本文内容
命名空间:microsoft.graph.security
创建与电子数据展示保管人 关联的新 siteSource 对象。
权限
调用此 API 需要以下权限之一。 若要了解详细信息,包括如何选择权限的信息,请参阅权限 。
权限类型
权限(从最低特权到最高特权)
委派(工作或学校帐户)
eDiscovery.Read.All、eDiscovery.ReadWrite.All
委派(个人 Microsoft 帐户)
不支持。
应用程序
不支持。
HTTP 请求
POST /security/cases/ediscoveryCases/{ediscoveryCaseId}/custodians/{custodianId}/siteSources
名称
说明
Authorization
持有者 {token}。 必填。
Content-Type
application/json. 必需。
请求正文
在请求正文中,提供 siteSource 对象的 JSON 表示形式。
创建 siteSource 时,可以指定以下属性。
属性
类型
说明
网站
String
网站的 URL;例如 。 https://contoso.sharepoint.com/sites/HumanResources
响应
如果成功,此方法在 201 Created
响应正文中返回响应代码和 microsoft.graph.security.siteSource 对象。
示例
请求
请求示例如下所示。
POST https://graph.microsoft.com/v1.0/security/cases/ediscoveryCases/b0073e4e-4184-41c6-9eb7-8c8cc3e2288b/custodians/0053a61a3b6c42738f7606791716a22a/siteSources
Content-Type: application/json
{
"site": {
"webUrl": "https://m365x809305.sharepoint.com/sites/Retail"
}
}
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.Models.Security.SiteSource
{
Site = new Site
{
WebUrl = "https://m365x809305.sharepoint.com/sites/Retail",
},
};
var result = await graphClient.Security.Cases.EdiscoveryCases["{ediscoveryCase-id}"].Custodians["{ediscoveryCustodian-id}"].SiteSources.PostAsync(requestBody);
有关如何 将 SDK 添加到 项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档 。
const options = {
authProvider,
};
const client = Client.init(options);
const siteSource = {
site: {
webUrl: 'https://m365x809305.sharepoint.com/sites/Retail'
}
};
await client.api('/security/cases/ediscoveryCases/b0073e4e-4184-41c6-9eb7-8c8cc3e2288b/custodians/0053a61a3b6c42738f7606791716a22a/siteSources')
.post(siteSource);
有关如何 将 SDK 添加到 项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档 。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
SiteSource siteSource = new SiteSource();
Site site = new Site();
site.webUrl = "https://m365x809305.sharepoint.com/sites/Retail";
siteSource.site = site;
graphClient.security().cases().ediscoveryCases("b0073e4e-4184-41c6-9eb7-8c8cc3e2288b").custodians("0053a61a3b6c42738f7606791716a22a").siteSources()
.buildRequest()
.post(siteSource);
有关如何 将 SDK 添加到 项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档 。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models//security"
//other-imports
)
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewSiteSource()
site := graphmodels.NewSite()
webUrl := "https://m365x809305.sharepoint.com/sites/Retail"
site.SetWebUrl(&webUrl)
requestBody.SetSite(site)
result, err := graphClient.Security().Cases().EdiscoveryCasesById("ediscoveryCase-id").CustodiansById("ediscoveryCustodian-id").SiteSources().Post(context.Background(), requestBody, nil)
有关如何 将 SDK 添加到 项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档 。
Import-Module Microsoft.Graph.Security
$params = @{
Site = @{
WebUrl = "https://m365x809305.sharepoint.com/sites/Retail"
}
}
New-MgSecurityCaseEdiscoveryCaseCustodianSiteSource -EdiscoveryCaseId $ediscoveryCaseId -EdiscoveryCustodianId $ediscoveryCustodianId -BodyParameter $params
有关如何 将 SDK 添加到 项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档 。
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new SiteSource();
$site = new Site();
$site->setWebUrl('https://m365x809305.sharepoint.com/sites/Retail');
$requestBody->setSite($site);
$requestResult = $graphServiceClient->security()->cases()->ediscoveryCasesById('ediscoveryCase-id')->custodiansById('ediscoveryCustodian-id')->siteSources()->post($requestBody);
有关如何 将 SDK 添加到 项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档 。
响应
下面展示了示例响应。
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 201 Created
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#security/cases/ediscoveryCases('b0073e4e-4184-41c6-9eb7-8c8cc3e2288b')/custodians('0053a61a3b6c42738f7606791716a22a')/siteSources/$entity",
"@odata.id": "https://graph.microsoft.com/v1.0/sites/dbe4b18e-2765-4989-8647-48139180c45f",
"displayName": "Retail",
"createdDateTime": "0001-01-01T00:00:00Z",
"holdStatus": "applied",
"id": "dbe4b18e-2765-4989-8647-48139180c45f",
"createdBy": {
"user": {
"id": "c25c3914-f9f7-43ee-9cba-a25377e0cec6",
"displayName": "MOD Administrator",
"userPrincipalName": "admin@M365x809305.onmicrosoft.com"
},
"application": {
"id": "de8bc8b5-d9f9-48b1-a8ad-b748da725064",
"displayName": "Graph Explorer"
}
}
}