/// <summary> /// Create or update a blueprint assignment. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='scope'> /// The scope of the resource. Valid scopes are: management group (format: /// '/providers/Microsoft.Management/managementGroups/{managementGroup}'), /// subscription (format: '/subscriptions/{subscriptionId}'). /// </param> /// <param name='assignmentName'> /// Name of the blueprint assignment. /// </param> /// <param name='assignment'> /// Blueprint assignment object to save. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Assignment> CreateOrUpdateAsync(this IAssignmentsOperations operations, string scope, string assignmentName, Assignment assignment, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(scope, assignmentName, assignment, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Get Blueprints service SPN objectId /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceScope'> /// The scope of the resource. Valid scopes are: management group (format: /// '/providers/Microsoft.Management/managementGroups/{managementGroup}'), /// subscription (format: '/subscriptions/{subscriptionId}'). /// </param> /// <param name='assignmentName'> /// Name of the blueprint assignment. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <WhoIsBlueprintContract> WhoIsBlueprintAsync(this IAssignmentsOperations operations, string resourceScope, string assignmentName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.WhoIsBlueprintWithHttpMessagesAsync(resourceScope, assignmentName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Delete a blueprint assignment. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceScope'> /// The scope of the resource. Valid scopes are: management group (format: /// '/providers/Microsoft.Management/managementGroups/{managementGroup}'), /// subscription (format: '/subscriptions/{subscriptionId}'). /// </param> /// <param name='assignmentName'> /// Name of the blueprint assignment. /// </param> /// <param name='deleteBehavior'> /// When deleteBehavior=all, the resources that were created by the blueprint /// assignment will be deleted. Possible values include: 'none', 'all' /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Assignment> DeleteAsync(this IAssignmentsOperations operations, string resourceScope, string assignmentName, string deleteBehavior = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceScope, assignmentName, deleteBehavior, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// List blueprint assignments within a subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <Assignment> > ListNextAsync(this IAssignmentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets a Blueprint assignment in a management group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='managementGroupName'> /// The name of the management group where the assignment is saved. /// </param> /// <param name='assignmentName'> /// The name of the assignment. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Assignment> GetInManagementGroupAsync(this IAssignmentsOperations operations, string managementGroupName, string assignmentName, CancellationToken cancellationToken = default(CancellationToken)) { var resourceScope = string.Format(Constants.ResourceScopes.ManagementGroupScope, managementGroupName); using (var _result = await operations.GetWithHttpMessagesAsync(resourceScope, assignmentName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Get a Blueprint assignment. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='subscriptionId'> /// azure subscriptionId, which we assign the blueprint to. /// </param> /// <param name='assignmentName'> /// name of the assignment. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Assignment> GetInSubscriptionAsync(this IAssignmentsOperations operations, string subscriptionId, string assignmentName, CancellationToken cancellationToken = default(CancellationToken)) { var scope = string.Format(Constants.ResourceScopes.SubscriptionScope, subscriptionId); using (var _result = await operations.GetWithHttpMessagesAsync(scope, assignmentName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// List blueprint assignments within a subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> public static IPage <Assignment> ListNext(this IAssignmentsOperations operations, string nextPageLink) { return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// List blueprint assignments within a subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='scope'> /// The scope of the resource. Valid scopes are: management group (format: /// '/providers/Microsoft.Management/managementGroups/{managementGroup}'), /// subscription (format: '/subscriptions/{subscriptionId}'). /// </param> public static IPage <Assignment> List(this IAssignmentsOperations operations, string scope) { return(operations.ListAsync(scope).GetAwaiter().GetResult()); }
/// <summary> /// Gets a Blueprint assignment in a management group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='managementGroupName'> /// The name of the management group where the assignment is saved. /// </param> /// <param name='assignmentName'> /// The name of the assignment. /// </param> public static Assignment GetInSubscription(this IAssignmentsOperations operations, string managementGroupName, string assignmentName) { var resourceScope = string.Format(Constants.ResourceScopes.ManagementGroupScope, managementGroupName); return(operations.GetInSubscriptionAsync(resourceScope, assignmentName).GetAwaiter().GetResult()); }
/// <summary> /// Creates or updates a Blueprint assignment in a management group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='managementGroupName'> /// The name of the management group where the assignment will be saved. /// </param> /// <param name='assignmentName'> /// The name of the assignment. /// </param> /// <param name='assignment'> /// The assignment object to save. /// </param> public static Assignment CreateOrUpdateInManagementGroup(this IAssignmentsOperations operations, string managementGroupName, string assignmentName, Assignment assignment) { var resourceScope = string.Format(Constants.ResourceScopes.ManagementGroupScope, managementGroupName); return(operations.CreateOrUpdateAsync(resourceScope, assignmentName, assignment).GetAwaiter().GetResult()); }
/// <summary> /// Delete a blueprint assignment. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceScope'> /// The scope of the resource. Valid scopes are: management group (format: /// '/providers/Microsoft.Management/managementGroups/{managementGroup}'), /// subscription (format: '/subscriptions/{subscriptionId}'). /// </param> /// <param name='assignmentName'> /// Name of the blueprint assignment. /// </param> /// <param name='deleteBehavior'> /// When deleteBehavior=all, the resources that were created by the blueprint /// assignment will be deleted. Possible values include: 'none', 'all' /// </param> public static Assignment Delete(this IAssignmentsOperations operations, string resourceScope, string assignmentName, string deleteBehavior = default(string)) { return(operations.DeleteAsync(resourceScope, assignmentName, deleteBehavior).GetAwaiter().GetResult()); }
/// <summary> /// Get a Blueprint assignment. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='subscriptionId'> /// azure subscriptionId, which we assign the blueprint to. /// </param> /// <param name='assignmentName'> /// name of the assignment. /// </param> public static Assignment GetInSubscription(this IAssignmentsOperations operations, string subscriptionId, string assignmentName) { var scope = string.Format(Constants.ResourceScopes.SubscriptionScope, subscriptionId); return(operations.GetInSubscriptionAsync(scope, assignmentName).GetAwaiter().GetResult()); }
/// <summary> /// List Blueprint assignments within a subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='subscriptionId'> /// azure subscriptionId, which we assign the blueprint to. /// </param> public static IPage <Assignment> ListInSubscription(this IAssignmentsOperations operations, string subscriptionId) { var scope = string.Format(Constants.ResourceScopes.SubscriptionScope, subscriptionId); return(operations.ListAsync(scope).GetAwaiter().GetResult()); }
/// <summary> /// Delete a Blueprint assignment. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='subscriptionId'> /// azure subscriptionId, which we assign the blueprint to. /// </param> /// <param name='assignmentName'> /// name of the assignment. /// </param> /// <param name='assignmentDeleteBehavior'> /// If set to <see cref='AssignmentDeleteBehavior.All' />, this will delete all of the resources created by the assignment. /// This functionality is disabled by default. /// </param> public static Assignment DeleteInSubscription(this IAssignmentsOperations operations, string subscriptionId, string assignmentName, string assignmentDeleteBehavior = default(string)) { var scope = string.Format(Constants.ResourceScopes.SubscriptionScope, subscriptionId); return(operations.DeleteAsync(scope, assignmentName, assignmentDeleteBehavior).GetAwaiter().GetResult()); }
/// <summary> /// Get Blueprints service SPN objectId /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceScope'> /// The scope of the resource. Valid scopes are: management group (format: /// '/providers/Microsoft.Management/managementGroups/{managementGroup}'), /// subscription (format: '/subscriptions/{subscriptionId}'). /// </param> /// <param name='assignmentName'> /// Name of the blueprint assignment. /// </param> public static WhoIsBlueprintContract WhoIsBlueprint(this IAssignmentsOperations operations, string resourceScope, string assignmentName) { return(operations.WhoIsBlueprintAsync(resourceScope, assignmentName).GetAwaiter().GetResult()); }
/// <summary> /// Delete a blueprint assignment. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceScope'> /// The scope of the resource. Valid scopes are: management group (format: /// '/providers/Microsoft.Management/managementGroups/{managementGroup}'), /// subscription (format: '/subscriptions/{subscriptionId}'). /// </param> /// <param name='assignmentName'> /// Name of the blueprint assignment. /// </param> public static Assignment Delete(this IAssignmentsOperations operations, string resourceScope, string assignmentName) { return(operations.DeleteAsync(resourceScope, assignmentName).GetAwaiter().GetResult()); }
/// <summary> /// Create or update a blueprint assignment. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='scope'> /// The scope of the resource. Valid scopes are: management group (format: /// '/providers/Microsoft.Management/managementGroups/{managementGroup}'), /// subscription (format: '/subscriptions/{subscriptionId}'). /// </param> /// <param name='assignmentName'> /// Name of the blueprint assignment. /// </param> /// <param name='assignment'> /// Blueprint assignment object to save. /// </param> public static Assignment CreateOrUpdate(this IAssignmentsOperations operations, string scope, string assignmentName, Assignment assignment) { return(operations.CreateOrUpdateAsync(scope, assignmentName, assignment).GetAwaiter().GetResult()); }
/// <summary> /// Lists Blueprint assignments within a management group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='managementGroupName'> /// The name of the management group where the assignments are saved. /// </param> public static IPage <Assignment> ListInManagementGroup(this IAssignmentsOperations operations, string managementGroupName) { var resourceScope = string.Format(Constants.ResourceScopes.ManagementGroupScope, managementGroupName); return(operations.ListAsync(resourceScope).GetAwaiter().GetResult()); }
/// <summary> /// Get a blueprint assignment. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='scope'> /// The scope of the resource. Valid scopes are: management group (format: /// '/providers/Microsoft.Management/managementGroups/{managementGroup}'), /// subscription (format: '/subscriptions/{subscriptionId}'). /// </param> /// <param name='assignmentName'> /// Name of the blueprint assignment. /// </param> public static Assignment Get(this IAssignmentsOperations operations, string scope, string assignmentName) { return(operations.GetAsync(scope, assignmentName).GetAwaiter().GetResult()); }
/// <summary> /// Deletes a Blueprint assignment in a management group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='managementGroupName'> /// The name of the management group where the assignment is saved. /// </param> /// <param name='assignmentName'> /// The name of the assignment. /// </param> /// <param name='assignmentDeleteBehavior'> /// If set to <see cref='AssignmentDeleteBehavior.All' />, this will delete all of the resources created by the assignment. /// The default is to preserve resources with <see cref="AssignmentDeleteBehavior.None" />. /// </param> public static Assignment DeleteInManagementGroup(this IAssignmentsOperations operations, string managementGroupName, string assignmentName, string assignmentDeleteBehavior = default(string)) { var resourceScope = string.Format(Constants.ResourceScopes.ManagementGroupScope, managementGroupName); return(operations.DeleteAsync(resourceScope, assignmentName, assignmentDeleteBehavior).GetAwaiter().GetResult()); }