コード例 #1
0
 public void DeletePrivateDnsLink(
     PSPrivateDnsVirtualNetworkLink link,
     bool overwrite)
 {
     this.PrivateDnsManagementClient.VirtualNetworkLinks.Delete(
         link.ResourceGroupName,
         link.ZoneName,
         link.Name,
         ifMatch: overwrite ? "*" : link.Etag);
 }
コード例 #2
0
        public PSPrivateDnsVirtualNetworkLink GetLinkHandleNonExistentLink(string zoneName, string resourceGroupName, string linkName)
        {
            PSPrivateDnsVirtualNetworkLink retrievedLink = null;

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

            return(retrievedLink);
        }
コード例 #3
0
        public PSPrivateDnsVirtualNetworkLink UpdatePrivateDnsLink(PSPrivateDnsVirtualNetworkLink link, bool overwrite)
        {
            var response = this.PrivateDnsManagementClient.VirtualNetworkLinks.CreateOrUpdate(
                link.ResourceGroupName,
                link.ZoneName,
                link.Name,
                new VirtualNetworkLink
            {
                Location       = DnsResourceLocation,
                Tags           = TagsConversionHelper.CreateTagDictionary(link.Tags, validate: true),
                VirtualNetwork = new SubResource()
                {
                    Id = link.VirtualNetworkId,
                },
                RegistrationEnabled = link.RegistrationEnabled,
            },
                ifMatch: overwrite?null: link.Etag);

            return(ToPrivateDnsLink(response));
        }