Beispiel #1
0
 public void DeletePrivateDnsZone(
     PSPrivateDnsZone zone,
     bool overwrite)
 {
     this.PrivateDnsManagementClient.PrivateZones.Delete(
         zone.ResourceGroupName,
         zone.Name,
         ifMatch: overwrite ? "*" : zone.Etag);
 }
Beispiel #2
0
        public PSPrivateDnsZone UpdatePrivateDnsZone(PSPrivateDnsZone zone, bool overwrite)
        {
            var response = this.PrivateDnsManagementClient.PrivateZones.CreateOrUpdate(
                zone.ResourceGroupName,
                zone.Name,
                new PrivateZone
            {
                Location = DnsResourceLocation,
                Tags     = TagsConversionHelper.CreateTagDictionary(zone.Tags, validate: true),
            },
                ifMatch: overwrite?null: zone.Etag);

            return(ToPrivateDnsZone(response));
        }
Beispiel #3
0
        public PSPrivateDnsZone GetDnsZoneHandleNonExistentZone(string zoneName, string resourceGroupName)
        {
            PSPrivateDnsZone retrievedZone = null;

            try
            {
                retrievedZone = this.GetPrivateDnsZone(zoneName, resourceGroupName);
            }
            catch (CloudException exception)
            {
                if (exception.Body.Code != "ResourceNotFound")
                {
                    throw;
                }
            }

            return(retrievedZone);
        }