FeatureRolloutPolicy erstellen
Artikel
07/18/2022
2 Minuten Lesedauer
3 Mitwirkende
In diesem Artikel
Namespace: microsoft.graph
Erstellen sie ein neues featureRolloutPolicy-Objekt.
Berechtigungen
Eine der nachfolgenden Berechtigungen ist erforderlich, um diese API aufrufen zu können. Weitere Informationen, unter anderem zur Auswahl von Berechtigungen, finden Sie im Artikel zum Thema Berechtigungen .
Berechtigungstyp
Berechtigungen (von der Berechtigung mit den wenigsten Rechten zu der mit den meisten Rechten)
Delegiert (Geschäfts-, Schul- oder Unikonto)
Directory.ReadWrite.All
Delegiert (persönliches Microsoft-Konto)
Nicht unterstützt
Anwendung
Nicht unterstützt
HTTP-Anforderung
POST /policies/featureRolloutPolicies
Name
Beschreibung
Authorization
Bearer {token}. Erforderlich
Anforderungstext
Geben Sie im Anforderungstext eine JSON-Darstellung des featureRolloutPolicy-Objekts an.
In der folgenden Tabelle sind die Eigenschaften aufgeführt, die angegeben werden müssen, wenn Sie ein FeaturerolloutPolicy -Objekt erstellen.
Parameter
Typ
Beschreibung
displayName
string
Der Anzeigename für diese Featurerolloutrichtlinie.
Feature
stagedFeatureName
Das Feature, das mit dieser Richtlinie eingeführt würde.
isEnabled
string
Gibt an, ob das Featurerollout aktiviert ist.
Antwort
Bei erfolgreicher Ausführung gibt die Methode den 201 Created Antwortcode und ein neues FeatureRolloutPolicy-Objekt im Antworttext zurück.
Beispiele
Anforderung
Nachfolgend sehen Sie ein Beispiel der Anforderung.
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
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var featureRolloutPolicy = new FeatureRolloutPolicy
{
DisplayName = "PassthroughAuthentication rollout policy",
Description = "PassthroughAuthentication rollout policy",
Feature = StagedFeatureName.PassthroughAuthentication,
IsEnabled = true,
IsAppliedToOrganization = false
};
await graphClient.Policies.FeatureRolloutPolicies
.Request()
.AddAsync(featureRolloutPolicy);
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
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);
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/policies/featureRolloutPolicies"]]];
[urlRequest setHTTPMethod:@"POST"];
[urlRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
MSGraphFeatureRolloutPolicy *featureRolloutPolicy = [[MSGraphFeatureRolloutPolicy alloc] init];
[featureRolloutPolicy setDisplayName:@"PassthroughAuthentication rollout policy"];
[featureRolloutPolicy setDescription:@"PassthroughAuthentication rollout policy"];
[featureRolloutPolicy setFeature: [MSGraphStagedFeatureName passthroughAuthentication]];
[featureRolloutPolicy setIsEnabled: true];
[featureRolloutPolicy setIsAppliedToOrganization: false];
NSError *error;
NSData *featureRolloutPolicyData = [featureRolloutPolicy getSerializedDataWithError:&error];
[urlRequest setHTTPBody:featureRolloutPolicyData];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
//Request Completed
}];
[meDataTask execute];
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
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);
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewFeatureRolloutPolicy()
displayName := "PassthroughAuthentication rollout policy"
requestBody.SetDisplayName(&displayName)
description := "PassthroughAuthentication rollout policy"
requestBody.SetDescription(&description)
feature := "passthroughAuthentication"
requestBody.SetFeature(&feature)
isEnabled := true
requestBody.SetIsEnabled(&isEnabled)
isAppliedToOrganization := false
requestBody.SetIsAppliedToOrganization(&isAppliedToOrganization)
result, err := graphClient.Policies().FeatureRolloutPolicies().Post(requestBody)
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
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
Ausführliche Informationen zum Hinzufügen des SDK zu Ihrem Projekt und zum Erstellen einer authProvider-Instanz finden Sie in der SDK-Dokumentation .
Antwort
Nachfolgend sehen Sie ein Beispiel der Antwort.
Hinweis: Das hier gezeigte Antwortobjekt kann zur besseren Lesbarkeit gekürzt werden.
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
}