Skip to content

Commit b819ada

Browse files
JoyerJinmsJinLei
andauthored
[Blueprint] Remove Blueprint 0.20.7-preview dependencies on released track 1 SDK and add Microsoft.Azure.PowerShell.Blueprint.Management.Sdk (#26036)
* blueprint management sdk generated by autorest.csharp * blueprint management sdk generated by autorest.powershell * Update Assembly * Blueprint changelog * Update ChangeLog.md --------- Co-authored-by: Jin Lei <[email protected]>
1 parent 92c2fb0 commit b819ada

File tree

90 files changed

+14713
-25
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+14713
-25
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<PsModuleName>Blueprint</PsModuleName>
4+
</PropertyGroup>
5+
<Import Project="$(MSBuildThisFileDirectory)..\..\Az.props" />
6+
<PropertyGroup>
7+
<TargetFramework>netstandard2.0</TargetFramework>
8+
<AssemblyName>Microsoft.Azure.PowerShell.Blueprint.Management.Sdk</AssemblyName>
9+
<RootNamespace>Microsoft.Azure.Management.Blueprint</RootNamespace>
10+
<NoWarn>$(NoWarn);CS0108;CS1573</NoWarn>
11+
</PropertyGroup>
12+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., build.proj))\src\Az.Post.props" />
13+
</Project>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for license information.
3+
4+
namespace Microsoft.Azure.Management.Blueprint
5+
{
6+
public static class Constants
7+
{
8+
public static class ResourceScopes
9+
{
10+
public const string SubscriptionScope = "/subscriptions/{0}";
11+
public const string ManagementGroupScope = "/providers/Microsoft.Management/managementGroups/{0}";
12+
13+
}
14+
15+
/// <summary>
16+
/// Allowed target scope of blueprint.
17+
/// </summary>
18+
public static class BlueprintTargetScopes
19+
{
20+
public const string Subscription = "subscription";
21+
}
22+
23+
/// <summary>
24+
/// allowed parameter types, align with Azure Resource Template
25+
/// </summary>
26+
public static class ParameterDefinitionTypes
27+
{
28+
public const string String = "string";
29+
public const string Int = "int";
30+
public const string Array = "array";
31+
public const string Bool = "bool";
32+
public const string Object = "object";
33+
public const string SecureString = "secureString";
34+
public const string SecureObject = "secureObject";
35+
}
36+
37+
public static class ManagedServiceIdentityType
38+
{
39+
public const string SystemAssigned = "SystemAssigned";
40+
}
41+
42+
public static class AssignmentProvisioningState
43+
{
44+
public const string Creating = "Creating";
45+
public const string Validating = "Validating";
46+
public const string Waiting = "Waiting";
47+
public const string Deploying = "Deploying";
48+
public const string Succeeded = "Succeeded";
49+
public const string Failed = "Failed";
50+
public const string Canceled = "Canceled";
51+
public const string Locking = "Locking";
52+
public const string Deleting = "Deleting";
53+
54+
}
55+
}
56+
}
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
namespace Microsoft.Azure.Management.Blueprint
2+
{
3+
using Microsoft.Rest;
4+
using Microsoft.Rest.Azure;
5+
using Models;
6+
using System.Threading;
7+
using System.Threading.Tasks;
8+
9+
/// <summary>
10+
/// Extension methods for ArtifactsOperations.
11+
/// </summary>
12+
public static partial class ManagementGroupArtifactsExtensions
13+
{
14+
/// <summary>
15+
/// Create or update Blueprint artifact.
16+
/// </summary>
17+
/// <param name='operations'>
18+
/// The operations group for this extension method.
19+
/// </param>
20+
/// <param name='managementGroupName'>
21+
/// azure managementGroup name, which we save the blueprint to.
22+
/// </param>
23+
/// <param name='blueprintName'>
24+
/// name of the blueprint.
25+
/// </param>
26+
/// <param name='artifactName'>
27+
/// name of the artifact.
28+
/// </param>
29+
/// <param name='artifact'>
30+
/// Blueprint artifact to save.
31+
/// </param>
32+
public static Artifact CreateOrUpdateInManagementGroup(this IArtifactsOperations operations, string managementGroupName, string blueprintName, string artifactName, Artifact artifact)
33+
{
34+
var scope = string.Format(Constants.ResourceScopes.ManagementGroupScope, managementGroupName);
35+
return operations.CreateOrUpdateAsync(scope, blueprintName, artifactName, artifact).GetAwaiter().GetResult();
36+
}
37+
38+
/// <summary>
39+
/// Create or update Blueprint artifact.
40+
/// </summary>
41+
/// <param name='operations'>
42+
/// The operations group for this extension method.
43+
/// </param>
44+
/// <param name='managementGroupName'>
45+
/// azure managementGroup name, which we save the blueprint to.
46+
/// </param>
47+
/// <param name='blueprintName'>
48+
/// name of the blueprint.
49+
/// </param>
50+
/// <param name='artifactName'>
51+
/// name of the artifact.
52+
/// </param>
53+
/// <param name='artifact'>
54+
/// Blueprint artifact to save.
55+
/// </param>
56+
/// <param name='cancellationToken'>
57+
/// The cancellation token.
58+
/// </param>
59+
public static async Task<Artifact> CreateOrUpdateInManagementGroupAsync(this IArtifactsOperations operations, string managementGroupName, string blueprintName, string artifactName, Artifact artifact, CancellationToken cancellationToken = default(CancellationToken))
60+
{
61+
var scope = string.Format(Constants.ResourceScopes.ManagementGroupScope, managementGroupName);
62+
using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(scope, blueprintName, artifactName, artifact, null, cancellationToken).ConfigureAwait(false))
63+
{
64+
return _result.Body;
65+
}
66+
}
67+
68+
/// <summary>
69+
/// Get a Blueprint artifact.
70+
/// </summary>
71+
/// <param name='operations'>
72+
/// The operations group for this extension method.
73+
/// </param>
74+
/// <param name='managementGroupName'>
75+
/// azure managementGroup name, which we save the blueprint to.
76+
/// </param>
77+
/// <param name='blueprintName'>
78+
/// name of the blueprint.
79+
/// </param>
80+
/// <param name='artifactName'>
81+
/// name of the artifact.
82+
/// </param>
83+
public static Artifact GetInManagementGroup(this IArtifactsOperations operations, string managementGroupName, string blueprintName, string artifactName)
84+
{
85+
var scope = string.Format(Constants.ResourceScopes.ManagementGroupScope, managementGroupName);
86+
return operations.GetAsync(scope, blueprintName, artifactName).GetAwaiter().GetResult();
87+
}
88+
89+
/// <summary>
90+
/// Get a Blueprint artifact.
91+
/// </summary>
92+
/// <param name='operations'>
93+
/// The operations group for this extension method.
94+
/// </param>
95+
/// <param name='managementGroupName'>
96+
/// azure managementGroup name, which we save the blueprint to.
97+
/// </param>
98+
/// <param name='blueprintName'>
99+
/// name of the blueprint.
100+
/// </param>
101+
/// <param name='artifactName'>
102+
/// name of the artifact.
103+
/// </param>
104+
/// <param name='cancellationToken'>
105+
/// The cancellation token.
106+
/// </param>
107+
public static async Task<Artifact> GetInManagementGroupAsync(this IArtifactsOperations operations, string managementGroupName, string blueprintName, string artifactName, CancellationToken cancellationToken = default(CancellationToken))
108+
{
109+
var scope = string.Format(Constants.ResourceScopes.ManagementGroupScope, managementGroupName);
110+
using (var _result = await operations.GetWithHttpMessagesAsync(scope, blueprintName, artifactName, null, cancellationToken).ConfigureAwait(false))
111+
{
112+
return _result.Body;
113+
}
114+
}
115+
116+
/// <summary>
117+
/// Delete a Blueprint artifact.
118+
/// </summary>
119+
/// <param name='operations'>
120+
/// The operations group for this extension method.
121+
/// </param>
122+
/// <param name='managementGroupName'>
123+
/// azure managementGroup name, which we save the blueprint to.
124+
/// </param>
125+
/// <param name='blueprintName'>
126+
/// name of the blueprint.
127+
/// </param>
128+
/// <param name='artifactName'>
129+
/// name of the artifact.
130+
/// </param>
131+
public static Artifact DeleteInManagementGroup(this IArtifactsOperations operations, string managementGroupName, string blueprintName, string artifactName)
132+
{
133+
var scope = string.Format(Constants.ResourceScopes.ManagementGroupScope, managementGroupName);
134+
return operations.DeleteAsync(scope, blueprintName, artifactName).GetAwaiter().GetResult();
135+
}
136+
137+
/// <summary>
138+
/// Delete a Blueprint artifact.
139+
/// </summary>
140+
/// <param name='operations'>
141+
/// The operations group for this extension method.
142+
/// </param>
143+
/// <param name='managementGroupName'>
144+
/// azure managementGroup name, which we save the blueprint to.
145+
/// </param>
146+
/// <param name='blueprintName'>
147+
/// name of the blueprint.
148+
/// </param>
149+
/// <param name='artifactName'>
150+
/// name of the artifact.
151+
/// </param>
152+
/// <param name='cancellationToken'>
153+
/// The cancellation token.
154+
/// </param>
155+
public static async Task<Artifact> DeleteInManagementGroupAsync(this IArtifactsOperations operations, string managementGroupName, string blueprintName, string artifactName, CancellationToken cancellationToken = default(CancellationToken))
156+
{
157+
var scope = string.Format(Constants.ResourceScopes.ManagementGroupScope, managementGroupName);
158+
using (var _result = await operations.DeleteWithHttpMessagesAsync(scope, blueprintName, artifactName, null, cancellationToken).ConfigureAwait(false))
159+
{
160+
return _result.Body;
161+
}
162+
}
163+
164+
/// <summary>
165+
/// List artifacts for a given Blueprint.
166+
/// </summary>
167+
/// <param name='operations'>
168+
/// The operations group for this extension method.
169+
/// </param>
170+
/// <param name='managementGroupName'>
171+
/// azure managementGroup name, which we save the blueprint to.
172+
/// </param>
173+
/// <param name='blueprintName'>
174+
/// name of the blueprint.
175+
/// </param>
176+
public static IPage<Artifact> ListInManagementGroup(this IArtifactsOperations operations, string managementGroupName, string blueprintName)
177+
{
178+
var scope = string.Format(Constants.ResourceScopes.ManagementGroupScope, managementGroupName);
179+
return operations.ListAsync(scope, blueprintName).GetAwaiter().GetResult();
180+
}
181+
182+
/// <summary>
183+
/// List artifacts for a given Blueprint.
184+
/// </summary>
185+
/// <param name='operations'>
186+
/// The operations group for this extension method.
187+
/// </param>
188+
/// <param name='managementGroupName'>
189+
/// azure managementGroup name, which we save the blueprint to.
190+
/// </param>
191+
/// <param name='blueprintName'>
192+
/// name of the blueprint.
193+
/// </param>
194+
/// <param name='cancellationToken'>
195+
/// The cancellation token.
196+
/// </param>
197+
public static async Task<IPage<Artifact>> ListInManagementGroupAsync(this IArtifactsOperations operations, string managementGroupName, string blueprintName, CancellationToken cancellationToken = default(CancellationToken))
198+
{
199+
var scope = string.Format(Constants.ResourceScopes.ManagementGroupScope, managementGroupName);
200+
using (var _result = await operations.ListWithHttpMessagesAsync(scope, blueprintName, null, cancellationToken).ConfigureAwait(false))
201+
{
202+
return _result.Body;
203+
}
204+
}
205+
}
206+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
namespace Microsoft.Azure.Management.Blueprint
2+
{
3+
using Microsoft.Rest.Azure;
4+
using Models;
5+
using System.Threading;
6+
using System.Threading.Tasks;
7+
8+
/// <summary>
9+
/// Extension methods for AssignmentOperations.
10+
/// </summary>
11+
public static partial class ManagementGroupAssignmentOperationsExtensions
12+
{
13+
/// <summary>
14+
/// Lists Operations for given blueprint assignment within a management group.
15+
/// </summary>
16+
/// <param name='operations'>
17+
/// The operations group for this extension method.
18+
/// </param>
19+
/// <param name='managementGroupName'>
20+
/// The name of the management group where the assignment is saved.
21+
/// </param>
22+
/// <param name='assignmentName'>
23+
/// The name of the assignment.
24+
/// </param>
25+
public static IPage<AssignmentOperation> ListInManagementGroup(this IAssignmentOperations operations, string managementGroupName, string assignmentName)
26+
{
27+
var resourceScope = string.Format(Constants.ResourceScopes.ManagementGroupScope, managementGroupName);
28+
return operations.ListAsync(resourceScope, assignmentName).GetAwaiter().GetResult();
29+
}
30+
31+
/// <summary>
32+
/// Lists Operations for given blueprint assignment within a management group.
33+
/// </summary>
34+
/// <param name='operations'>
35+
/// The operations group for this extension method.
36+
/// </param>
37+
/// <param name='managementGroupName'>
38+
/// The name of the management group where the assignment is saved.
39+
/// </param>
40+
/// <param name='assignmentName'>
41+
/// The name of the assignment.
42+
/// </param>
43+
/// <param name='cancellationToken'>
44+
/// The cancellation token.
45+
/// </param>
46+
public static async Task<IPage<AssignmentOperation>> ListInManagementGroupAsync(this IAssignmentOperations operations, string managementGroupName, string assignmentName, CancellationToken cancellationToken = default(CancellationToken))
47+
{
48+
var resourceScope = string.Format(Constants.ResourceScopes.ManagementGroupScope, managementGroupName);
49+
using (var _result = await operations.ListWithHttpMessagesAsync(resourceScope, assignmentName, null, cancellationToken).ConfigureAwait(false))
50+
{
51+
return _result.Body;
52+
}
53+
}
54+
55+
/// <summary>
56+
/// Gets a Blueprint assignment operation.
57+
/// </summary>
58+
/// <param name='operations'>
59+
/// The operations group for this extension method.
60+
/// </param>
61+
/// <param name='managementGroupName'>
62+
/// The name of the management group where the assignment is saved.
63+
/// </param>
64+
/// <param name='assignmentName'>
65+
/// The name of the assignment.
66+
/// </param>
67+
/// <param name='assignmentOperationName'>
68+
/// The name of the assignment operation.
69+
/// </param>
70+
public static AssignmentOperation GetInManagementGroup(this IAssignmentOperations operations, string managementGroupName, string assignmentName, string assignmentOperationName)
71+
{
72+
var resourceScope = string.Format(Constants.ResourceScopes.ManagementGroupScope, managementGroupName);
73+
return operations.GetAsync(resourceScope, assignmentName, assignmentOperationName).GetAwaiter().GetResult();
74+
}
75+
76+
/// <summary>
77+
/// Gets a Blueprint assignment operation.
78+
/// </summary>
79+
/// <param name='operations'>
80+
/// The operations group for this extension method.
81+
/// </param>
82+
/// <param name='managementGroupName'>
83+
/// The name of the management group where the assignment is saved.
84+
/// </param>
85+
/// <param name='assignmentName'>
86+
/// The name of the assignment.
87+
/// </param>
88+
/// <param name='assignmentOperationName'>
89+
/// The name of the assignment operation.
90+
/// </param>
91+
/// <param name='cancellationToken'>
92+
/// The cancellation token.
93+
/// </param>
94+
public static async Task<AssignmentOperation> GetInManagementGroupAsync(this IAssignmentOperations operations, string managementGroupName, string assignmentName, string assignmentOperationName, CancellationToken cancellationToken = default(CancellationToken))
95+
{
96+
var resourceScope = string.Format(Constants.ResourceScopes.ManagementGroupScope, managementGroupName);
97+
using (var _result = await operations.GetWithHttpMessagesAsync(resourceScope, assignmentName, assignmentOperationName, null, cancellationToken).ConfigureAwait(false))
98+
{
99+
return _result.Body;
100+
}
101+
}
102+
}
103+
}
104+

0 commit comments

Comments
 (0)