-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add management object group to core (#22592)
* wip * Add mgmt group to core * remove temp files * update to not have nullable but share the same operations between ManagementGroup and ManagementGroupInfo * address PR comments
- Loading branch information
Showing
84 changed files
with
22,239 additions
and
19 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
common/ManagementTestShared/Redesign/ManagementGroupCleanupPolicy.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using Azure.Core; | ||
using Azure.Core.Pipeline; | ||
using System.Collections.Generic; | ||
using System.Text.RegularExpressions; | ||
|
||
namespace Azure.ResourceManager.TestFramework | ||
{ | ||
public class ManagementGroupCleanupPolicy : HttpPipelineSynchronousPolicy | ||
{ | ||
private readonly object _listLock = new object(); | ||
private Regex _mgmtGroupPattern = new Regex(@"(/providers/Microsoft\.Management/managementGroups/[^?/]+)\?api-version"); | ||
private readonly IList<string> _mgmtGroupCreated = new List<string>(); | ||
|
||
public IList<string> ManagementGroupsCreated | ||
{ | ||
get { return _mgmtGroupCreated; } | ||
} | ||
|
||
public override void OnSendingRequest(HttpMessage message) | ||
{ | ||
if (message.Request.Method == RequestMethod.Put) | ||
{ | ||
var match = _mgmtGroupPattern.Match(message.Request.Uri.ToString()); | ||
if (match.Success) | ||
{ | ||
lock (_listLock) | ||
{ | ||
_mgmtGroupCreated.Add(match.Groups[1].Value); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...sourcemanager/Azure.ResourceManager.Core/src/Generated/ManagementGroup/ManagementGroup.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.