Beispiel #1
0
 /// <summary>
 /// Lists the DNS zones within a resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='top'>
 /// Query parameters. If null is passed returns the default number of zones.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <Zone> > ListInResourceGroupAsync(this IZonesOperations operations, string resourceGroupName, string top = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListInResourceGroupWithHttpMessagesAsync(resourceGroupName, top, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Beispiel #2
0
 /// <summary>
 /// Lists the DNS zones in all resource groups in a subscription.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='top'>
 /// The maximum number of DNS zones to return. If not specified, returns up to
 /// 100 zones.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <Zone> > ListAsync(this IZonesOperations operations, int?top = default(int?), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(top, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Beispiel #3
0
 /// <summary>
 /// Lists the DNS zones within a resource 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 <Zone> > ListInSubscriptionNextAsync(this IZonesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListInSubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Beispiel #4
0
 /// <summary>
 /// Updates a DNS zone. Does not modify DNS records within the zone.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='zoneName'>
 /// The name of the DNS zone (without a terminating dot).
 /// </param>
 /// <param name='ifMatch'>
 /// The etag of the DNS zone. Omit this value to always overwrite the current
 /// zone. Specify the last-seen etag value to prevent accidentally overwriting
 /// any concurrent changes.
 /// </param>
 /// <param name='tags'>
 /// Resource tags.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Zone> UpdateAsync(this IZonesOperations operations, string resourceGroupName, string zoneName, string ifMatch = default(string), IDictionary <string, string> tags = default(IDictionary <string, string>), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, zoneName, ifMatch, tags, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Beispiel #5
0
 /// <summary>
 /// Creates or Updates a DNS zone within a resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='zoneName'>
 /// The name of the zone without a terminating dot.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the CreateOrUpdate operation.
 /// </param>
 /// <param name='ifMatch'>
 /// The etag of Zone.
 /// </param>
 /// <param name='ifNoneMatch'>
 /// Defines the If-None-Match condition. Set to '*' to force
 /// Create-If-Not-Exist. Other values will be ignored.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Zone> CreateOrUpdateAsync(this IZonesOperations operations, string resourceGroupName, string zoneName, Zone parameters, string ifMatch = default(string), string ifNoneMatch = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, zoneName, parameters, ifMatch, ifNoneMatch, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Beispiel #6
0
 /// <summary>
 /// Gets a DNS zone.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='zoneName'>
 /// The name of the zone without a terminating dot.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Zone> GetAsync(this IZonesOperations operations, string resourceGroupName, string zoneName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, zoneName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Deletes a DNS zone. WARNING: All DNS records in the zone will also be
 /// deleted. This operation cannot be undone.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='zoneName'>
 /// The name of the DNS zone (without a terminating dot).
 /// </param>
 /// <param name='ifMatch'>
 /// The etag of the DNS zone. Omit this value to always delete the current
 /// zone. Specify the last-seen etag value to prevent accidentally deleting any
 /// concurrent changes.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ZoneDeleteResultInner> DeleteAsync(this IZonesOperations operations, string resourceGroupName, string zoneName, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, zoneName, ifMatch, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Beispiel #8
0
        private void init(ServiceClientCredentials credentials, string SubscriptionID)
        {
            dnsManagementClient = new DnsManagementClient(credentials);
            dnsManagementClient.SubscriptionId = SubscriptionID;
            IZonesOperations zones = dnsManagementClient.Zones;

            dnsZone = zones.Get(ResourceGroupName, ZoneName);
        }
        public static async Task <IList <Zone> > ListAllAsync(this IZonesOperations operations)
        {
            var zones = new List <Zone>();

            var list = await operations.ListAsync();

            zones.AddRange(list);

            while (list.NextPageLink != null)
            {
                list = await operations.ListNextAsync(list.NextPageLink);

                zones.AddRange(list);
            }

            return(zones);
        }
Beispiel #10
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 protected override void Initialize()
 {
     RecordSets     = new RecordSetsOperations(this);
     Zones          = new ZonesOperations(this);
     BaseUri        = new System.Uri("https://management.azure.com");
     ApiVersion     = "2018-03-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()
         }
     };
     CustomInitialize();
     DeserializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
Beispiel #11
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     this.RecordSets     = new RecordSetsOperations(this);
     this.Zones          = new ZonesOperations(this);
     this.BaseUri        = new Uri("https://management.azure.com");
     this.ApiVersion     = "2016-04-01";
     this.AcceptLanguage = "en-US";
     this.LongRunningOperationRetryTimeout = 30;
     this.GenerateClientRequestId          = true;
     SerializationSettings = new JsonSerializerSettings
     {
         Formatting            = Formatting.Indented,
         DateFormatHandling    = DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = DateTimeZoneHandling.Utc,
         NullValueHandling     = NullValueHandling.Ignore,
         ReferenceLoopHandling = ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     SerializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings = new JsonSerializerSettings
     {
         DateFormatHandling    = DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = DateTimeZoneHandling.Utc,
         NullValueHandling     = NullValueHandling.Ignore,
         ReferenceLoopHandling = ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     DeserializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
Beispiel #12
0
 /// <summary>
 /// Removes a DNS zone from a resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='zoneName'>
 /// The name of the zone without a terminating dot.
 /// </param>
 /// <param name='ifMatch'>
 /// Defines the If-Match condition. The delete operation will be performed
 /// only if the ETag of the zone on the server matches this value.
 /// </param>
 /// <param name='ifNoneMatch'>
 /// Defines the If-None-Match condition. The delete operation will be
 /// performed only if the ETag of the zone on the server does not match this
 /// value.
 /// </param>
 public static ZoneDeleteResult Delete(this IZonesOperations operations, string resourceGroupName, string zoneName, string ifMatch = default(string), string ifNoneMatch = default(string))
 {
     return(Task.Factory.StartNew(s => ((IZonesOperations)s).DeleteAsync(resourceGroupName, zoneName, ifMatch, ifNoneMatch), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Beispiel #13
0
 /// <summary>
 /// Updates a DNS zone. Does not modify DNS records within the zone.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='zoneName'>
 /// The name of the DNS zone (without a terminating dot).
 /// </param>
 /// <param name='ifMatch'>
 /// The etag of the DNS zone. Omit this value to always overwrite the current
 /// zone. Specify the last-seen etag value to prevent accidentally overwriting
 /// any concurrent changes.
 /// </param>
 /// <param name='tags'>
 /// Resource tags.
 /// </param>
 public static Zone Update(this IZonesOperations operations, string resourceGroupName, string zoneName, string ifMatch = default(string), IDictionary <string, string> tags = default(IDictionary <string, string>))
 {
     return(operations.UpdateAsync(resourceGroupName, zoneName, ifMatch, tags).GetAwaiter().GetResult());
 }
Beispiel #14
0
 /// <summary>
 /// Lists the DNS zones within a resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='top'>
 /// The maximum number of record sets to return. If not specified, returns up
 /// to 100 record sets.
 /// </param>
 public static IPage <Zone> ListByResourceGroup(this IZonesOperations operations, string resourceGroupName, int?top = default(int?))
 {
     return(operations.ListByResourceGroupAsync(resourceGroupName, top).GetAwaiter().GetResult());
 }
Beispiel #15
0
 /// <summary>
 /// Lists the DNS zones within a resource 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 <Zone> ListInSubscriptionNext(this IZonesOperations operations, string nextPageLink)
 {
     return(Task.Factory.StartNew(s => ((IZonesOperations)s).ListInSubscriptionNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Beispiel #16
0
 /// <summary>
 /// Lists the DNS zones in all resource groups in a subscription.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='top'>
 /// The maximum number of DNS zones to return. If not specified, returns up to
 /// 100 zones.
 /// </param>
 public static IPage <Zone> List(this IZonesOperations operations, int?top = default(int?))
 {
     return(operations.ListAsync(top).GetAwaiter().GetResult());
 }
Beispiel #17
0
 /// <summary>
 /// Lists the DNS zones within a resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='top'>
 /// Query parameters. If null is passed returns the default number of zones.
 /// </param>
 public static IPage <Zone> ListInResourceGroup(this IZonesOperations operations, string resourceGroupName, string top = default(string))
 {
     return(Task.Factory.StartNew(s => ((IZonesOperations)s).ListInResourceGroupAsync(resourceGroupName, top), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Beispiel #18
0
 /// <summary>
 /// Deletes a DNS zone. WARNING: All DNS records in the zone will also be
 /// deleted. This operation cannot be undone.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='zoneName'>
 /// The name of the DNS zone (without a terminating dot).
 /// </param>
 /// <param name='ifMatch'>
 /// The etag of the DNS zone. Omit this value to always delete the current
 /// zone. Specify the last-seen etag value to prevent accidentally deleting any
 /// concurrent changes.
 /// </param>
 public static void BeginDelete(this IZonesOperations operations, string resourceGroupName, string zoneName, string ifMatch = default(string))
 {
     operations.BeginDeleteAsync(resourceGroupName, zoneName, ifMatch).GetAwaiter().GetResult();
 }
Beispiel #19
0
 /// <summary>
 /// Gets a DNS zone.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='zoneName'>
 /// The name of the zone without a terminating dot.
 /// </param>
 public static Zone Get(this IZonesOperations operations, string resourceGroupName, string zoneName)
 {
     return(Task.Factory.StartNew(s => ((IZonesOperations)s).GetAsync(resourceGroupName, zoneName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Beispiel #20
0
 /// <summary>
 /// Gets a DNS zone. Retrieves the zone properties, but not the record sets
 /// within the zone.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='zoneName'>
 /// The name of the DNS zone (without a terminating dot).
 /// </param>
 public static Zone Get(this IZonesOperations operations, string resourceGroupName, string zoneName)
 {
     return(operations.GetAsync(resourceGroupName, zoneName).GetAwaiter().GetResult());
 }
Beispiel #21
0
 /// <summary>
 /// Creates or updates a DNS zone. Does not modify DNS records within the zone.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='zoneName'>
 /// The name of the DNS zone (without a terminating dot).
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the CreateOrUpdate operation.
 /// </param>
 /// <param name='ifMatch'>
 /// The etag of the DNS zone. Omit this value to always overwrite the current
 /// zone. Specify the last-seen etag value to prevent accidentally overwriting
 /// any concurrent changes.
 /// </param>
 /// <param name='ifNoneMatch'>
 /// Set to '*' to allow a new DNS zone to be created, but to prevent updating
 /// an existing zone. Other values will be ignored.
 /// </param>
 public static Zone CreateOrUpdate(this IZonesOperations operations, string resourceGroupName, string zoneName, Zone parameters, string ifMatch = default(string), string ifNoneMatch = default(string))
 {
     return(operations.CreateOrUpdateAsync(resourceGroupName, zoneName, parameters, ifMatch, ifNoneMatch).GetAwaiter().GetResult());
 }
Beispiel #22
0
 /// <summary>
 /// Lists the DNS zones in all resource groups in 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 <Zone> ListNext(this IZonesOperations operations, string nextPageLink)
 {
     return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
Beispiel #23
0
 /// <summary>
 /// Deletes a DNS zone. WARNING: All DNS records in the zone will also be
 /// deleted. This operation cannot be undone.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='zoneName'>
 /// The name of the DNS zone (without a terminating dot).
 /// </param>
 /// <param name='ifMatch'>
 /// The etag of the DNS zone. Omit this value to always delete the current
 /// zone. Specify the last-seen etag value to prevent accidentally deleting any
 /// concurrent changes.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task BeginDeleteAsync(this IZonesOperations operations, string resourceGroupName, string zoneName, string ifMatch = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, zoneName, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }