Example #1
0
 /// <summary>
 /// List operations for given blueprint assignment within a subscription or a
 /// management group.
 /// </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 <AssignmentOperation> > ListNextAsync(this IAssignmentOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Example #2
0
 /// <summary>
 /// List operations for given blueprint assignment within a subscription or a
 /// management group.
 /// </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 <IPage <AssignmentOperation> > ListAsync(this IAssignmentOperations operations, string resourceScope, string assignmentName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(resourceScope, assignmentName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
        /// <summary>
        /// Get a Blueprint assignment operation.
        /// </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='assignmentOperationName'>
        /// name of the assignment operation.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        public static async Task <AssignmentOperation> GetInSubscriptionAsync(this IAssignmentOperations operations, string subscriptionId, string assignmentName, string assignmentOperationName, CancellationToken cancellationToken = default(CancellationToken))
        {
            var scope = string.Format(Constants.ResourceScopes.SubscriptionScope, subscriptionId);

            using (var _result = await operations.GetWithHttpMessagesAsync(scope, assignmentName, assignmentOperationName, null, cancellationToken).ConfigureAwait(false))
            {
                return(_result.Body);
            }
        }
Example #4
0
        /// <summary>
        /// Gets a Blueprint assignment operation.
        /// </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='assignmentOperationName'>
        /// The name of the assignment operation.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        public static async Task <AssignmentOperation> GetInManagementGroupAsync(this IAssignmentOperations operations, string managementGroupName, string assignmentName, string assignmentOperationName, CancellationToken cancellationToken = default(CancellationToken))
        {
            var resourceScope = string.Format(Constants.ResourceScopes.ManagementGroupScope, managementGroupName);

            using (var _result = await operations.GetWithHttpMessagesAsync(resourceScope, assignmentName, assignmentOperationName, null, cancellationToken).ConfigureAwait(false))
            {
                return(_result.Body);
            }
        }
Example #5
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Blueprints           = new BlueprintsOperations(this);
     Artifacts            = new ArtifactsOperations(this);
     PublishedBlueprints  = new PublishedBlueprintsOperations(this);
     PublishedArtifacts   = new PublishedArtifactsOperations(this);
     Assignments          = new AssignmentsOperations(this);
     AssignmentOperations = new AssignmentOperations(this);
     BaseUri        = new System.Uri("https://management.azure.com");
     ApiVersion     = "2018-11-01-preview";
     AcceptLanguage = "en-US";
     LongRunningOperationRetryTimeout = 30;
     GenerateClientRequestId          = true;
     SerializationSettings            = new JsonSerializerSettings
     {
         Formatting            = Newtonsoft.Json.Formatting.Indented,
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     SerializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings = new JsonSerializerSettings
     {
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <Artifact>("kind"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <Artifact>("kind"));
     CustomInitialize();
     DeserializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
Example #6
0
 /// <summary>
 /// Get a blueprint assignment operation.
 /// </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='assignmentOperationName'>
 /// Name of the blueprint assignment operation.
 /// </param>
 public static AssignmentOperation Get(this IAssignmentOperations operations, string resourceScope, string assignmentName, string assignmentOperationName)
 {
     return(operations.GetAsync(resourceScope, assignmentName, assignmentOperationName).GetAwaiter().GetResult());
 }
Example #7
0
 /// <summary>
 /// List operations for given blueprint assignment within a subscription or a
 /// management group.
 /// </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 <AssignmentOperation> ListNext(this IAssignmentOperations operations, string nextPageLink)
 {
     return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
Example #8
0
 /// <summary>
 /// List Operations for given blueprint assignment 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>
 /// <param name='assignmentName'>
 /// name of the assignment.
 /// </param>
 public static IPage <AssignmentOperation> List(this IAssignmentOperations operations, string scope, string assignmentName)
 {
     return(operations.ListAsync(scope, assignmentName).GetAwaiter().GetResult());
 }
        /// <summary>
        /// Get a Blueprint assignment operation.
        /// </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='assignmentOperationName'>
        /// name of the assignment operation.
        /// </param>
        public static AssignmentOperation GetInSubscription(this IAssignmentOperations operations, string subscriptionId, string assignmentName, string assignmentOperationName)
        {
            var scope = string.Format(Constants.ResourceScopes.SubscriptionScope, subscriptionId);

            return(operations.GetAsync(scope, assignmentName, assignmentOperationName).GetAwaiter().GetResult());
        }
Example #10
0
        /// <summary>
        /// Gets a Blueprint assignment operation.
        /// </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='assignmentOperationName'>
        /// The name of the assignment operation.
        /// </param>
        public static AssignmentOperation GetInManagementGroup(this IAssignmentOperations operations, string managementGroupName, string assignmentName, string assignmentOperationName)
        {
            var resourceScope = string.Format(Constants.ResourceScopes.ManagementGroupScope, managementGroupName);

            return(operations.GetAsync(resourceScope, assignmentName, assignmentOperationName).GetAwaiter().GetResult());
        }