创建功能RolloutPolicy
本文内容
命名空间:microsoft.graph
创建一个新的 功能RolloutPolicy 对象。
权限
调用此 API 需要以下权限之一。 若要了解详细信息,包括如何选择权限的信息,请参阅权限 。
权限类型
权限(从最低特权到最高特权)
委派(工作或学校帐户)
Directory.ReadWrite.All
委派(个人 Microsoft 帐户)
不支持。
应用程序
不支持。
HTTP 请求
POST /policies/featureRolloutPolicies
名称
说明
Authorization
持有者 {token}。 必需
请求正文
在请求正文中,提供 featureRolloutPolicy 对象的 JSON 表示形式。
下表显示了创建 功能RolloutPolicy 时所需的属性。
参数
类型
说明
displayName
string
此功能推出策略的显示名称。
特征
stagedFeatureName
将使用此策略推出的功能。
isEnabled
string
指示是否启用功能推出。
响应
如果成功,此方法在响应正文中返回响应 201 Created
代码和 新功能RolloutPolicy 对象。
示例
请求
下面展示了示例请求。
POST https://graph.microsoft.com/v1.0/policies/featureRolloutPolicies
Content-type: application/json
{
"displayName": "PassthroughAuthentication rollout policy",
"description": "PassthroughAuthentication rollout policy",
"feature": "passthroughAuthentication",
"isEnabled": true,
"isAppliedToOrganization": false
}
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new FeatureRolloutPolicy
{
DisplayName = "PassthroughAuthentication rollout policy",
Description = "PassthroughAuthentication rollout policy",
Feature = StagedFeatureName.PassthroughAuthentication,
IsEnabled = true,
IsAppliedToOrganization = false,
};
var result = await graphClient.Policies.FeatureRolloutPolicies.PostAsync(requestBody);
有关如何 将 SDK 添加到 项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档 。
const options = {
authProvider,
};
const client = Client.init(options);
const featureRolloutPolicy = {
displayName: 'PassthroughAuthentication rollout policy',
description: 'PassthroughAuthentication rollout policy',
feature: 'passthroughAuthentication',
isEnabled: true,
isAppliedToOrganization: false
};
await client.api('/policies/featureRolloutPolicies')
.post(featureRolloutPolicy);
有关如何 将 SDK 添加到 项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档 。
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
FeatureRolloutPolicy featureRolloutPolicy = new FeatureRolloutPolicy();
featureRolloutPolicy.displayName = "PassthroughAuthentication rollout policy";
featureRolloutPolicy.description = "PassthroughAuthentication rollout policy";
featureRolloutPolicy.feature = StagedFeatureName.PASSTHROUGH_AUTHENTICATION;
featureRolloutPolicy.isEnabled = true;
featureRolloutPolicy.isAppliedToOrganization = false;
graphClient.policies().featureRolloutPolicies()
.buildRequest()
.post(featureRolloutPolicy);
有关如何 将 SDK 添加到 项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档 。
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClientWithCredentials(cred, scopes)
requestBody := graphmodels.NewFeatureRolloutPolicy()
displayName := "PassthroughAuthentication rollout policy"
requestBody.SetDisplayName(&displayName)
description := "PassthroughAuthentication rollout policy"
requestBody.SetDescription(&description)
feature := graphmodels.PASSTHROUGHAUTHENTICATION_STAGEDFEATURENAME
requestBody.SetFeature(&feature)
isEnabled := true
requestBody.SetIsEnabled(&isEnabled)
isAppliedToOrganization := false
requestBody.SetIsAppliedToOrganization(&isAppliedToOrganization)
result, err := graphClient.Policies().FeatureRolloutPolicies().Post(context.Background(), requestBody, nil)
有关如何 将 SDK 添加到 项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档 。
Import-Module Microsoft.Graph.Identity.SignIns
$params = @{
DisplayName = "PassthroughAuthentication rollout policy"
Description = "PassthroughAuthentication rollout policy"
Feature = "passthroughAuthentication"
IsEnabled = $true
IsAppliedToOrganization = $false
}
New-MgPolicyFeatureRolloutPolicy -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 FeatureRolloutPolicy();
$requestBody->setDisplayName('PassthroughAuthentication rollout policy');
$requestBody->setDescription('PassthroughAuthentication rollout policy');
$requestBody->setFeature(new StagedFeatureName('passthroughauthentication'));
$requestBody->setIsEnabled(true);
$requestBody->setIsAppliedToOrganization(false);
$requestResult = $graphServiceClient->policies()->featureRolloutPolicies()->post($requestBody);
有关如何 将 SDK 添加到 项目并 创建 authProvider 实例的详细信息,请参阅 SDK 文档 。
响应
下面展示了示例响应。
注意: 为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 201 Created
Content-type: application/json
{
"id": "e3c2f23a-edd2-43a8-849f-154e70794ac5",
"displayName": "PassthroughAuthentication rollout policy",
"description": "PassthroughAuthentication rollout policy",
"feature": "passthroughAuthentication",
"isEnabled": true,
"isAppliedToOrganization": false
}